mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
leds: pca9532 - Indent using tabs, not spaces.
Indent using tabs, not spaces. Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Acked-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
34abdf2526
commit
07172d2bfa
1 changed files with 29 additions and 29 deletions
|
@ -35,7 +35,7 @@ struct pca9532_data {
|
|||
struct pca9532_led leds[16];
|
||||
struct mutex update_lock;
|
||||
struct input_dev *idev;
|
||||
struct work_struct work;
|
||||
struct work_struct work;
|
||||
u8 pwm[2];
|
||||
u8 psc[2];
|
||||
};
|
||||
|
@ -87,14 +87,14 @@ static int pca9532_calcpwm(struct i2c_client *client, int pwm, int blink,
|
|||
if (b > 0xFF)
|
||||
return -EINVAL;
|
||||
data->pwm[pwm] = b;
|
||||
data->psc[pwm] = blink;
|
||||
return 0;
|
||||
data->psc[pwm] = blink;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pca9532_setpwm(struct i2c_client *client, int pwm)
|
||||
{
|
||||
struct pca9532_data *data = i2c_get_clientdata(client);
|
||||
mutex_lock(&data->update_lock);
|
||||
struct pca9532_data *data = i2c_get_clientdata(client);
|
||||
mutex_lock(&data->update_lock);
|
||||
i2c_smbus_write_byte_data(client, PCA9532_REG_PWM(pwm),
|
||||
data->pwm[pwm]);
|
||||
i2c_smbus_write_byte_data(client, PCA9532_REG_PSC(pwm),
|
||||
|
@ -132,11 +132,11 @@ static void pca9532_set_brightness(struct led_classdev *led_cdev,
|
|||
led->state = PCA9532_ON;
|
||||
else {
|
||||
led->state = PCA9532_PWM0; /* Thecus: hardcode one pwm */
|
||||
err = pca9532_calcpwm(led->client, 0, 0, value);
|
||||
err = pca9532_calcpwm(led->client, 0, 0, value);
|
||||
if (err)
|
||||
return; /* XXX: led api doesn't allow error code? */
|
||||
}
|
||||
schedule_work(&led->work);
|
||||
schedule_work(&led->work);
|
||||
}
|
||||
|
||||
static int pca9532_set_blink(struct led_classdev *led_cdev,
|
||||
|
@ -145,7 +145,7 @@ static int pca9532_set_blink(struct led_classdev *led_cdev,
|
|||
struct pca9532_led *led = ldev_to_led(led_cdev);
|
||||
struct i2c_client *client = led->client;
|
||||
int psc;
|
||||
int err = 0;
|
||||
int err = 0;
|
||||
|
||||
if (*delay_on == 0 && *delay_off == 0) {
|
||||
/* led subsystem ask us for a blink rate */
|
||||
|
@ -157,11 +157,11 @@ static int pca9532_set_blink(struct led_classdev *led_cdev,
|
|||
|
||||
/* Thecus specific: only use PSC/PWM 0 */
|
||||
psc = (*delay_on * 152-1)/1000;
|
||||
err = pca9532_calcpwm(client, 0, psc, led_cdev->brightness);
|
||||
if (err)
|
||||
return err;
|
||||
schedule_work(&led->work);
|
||||
return 0;
|
||||
err = pca9532_calcpwm(client, 0, psc, led_cdev->brightness);
|
||||
if (err)
|
||||
return err;
|
||||
schedule_work(&led->work);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pca9532_event(struct input_dev *dev, unsigned int type,
|
||||
|
@ -178,15 +178,15 @@ static int pca9532_event(struct input_dev *dev, unsigned int type,
|
|||
else
|
||||
data->pwm[1] = 0;
|
||||
|
||||
schedule_work(&data->work);
|
||||
schedule_work(&data->work);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pca9532_input_work(struct work_struct *work)
|
||||
{
|
||||
struct pca9532_data *data;
|
||||
data = container_of(work, struct pca9532_data, work);
|
||||
struct pca9532_data *data;
|
||||
data = container_of(work, struct pca9532_data, work);
|
||||
mutex_lock(&data->update_lock);
|
||||
i2c_smbus_write_byte_data(data->client, PCA9532_REG_PWM(1),
|
||||
data->pwm[1]);
|
||||
|
@ -195,11 +195,11 @@ static void pca9532_input_work(struct work_struct *work)
|
|||
|
||||
static void pca9532_led_work(struct work_struct *work)
|
||||
{
|
||||
struct pca9532_led *led;
|
||||
led = container_of(work, struct pca9532_led, work);
|
||||
if (led->state == PCA9532_PWM0)
|
||||
pca9532_setpwm(led->client, 0);
|
||||
pca9532_setled(led);
|
||||
struct pca9532_led *led;
|
||||
led = container_of(work, struct pca9532_led, work);
|
||||
if (led->state == PCA9532_PWM0)
|
||||
pca9532_setpwm(led->client, 0);
|
||||
pca9532_setled(led);
|
||||
}
|
||||
|
||||
static int pca9532_configure(struct i2c_client *client,
|
||||
|
@ -232,7 +232,7 @@ static int pca9532_configure(struct i2c_client *client,
|
|||
led->ldev.brightness = LED_OFF;
|
||||
led->ldev.brightness_set = pca9532_set_brightness;
|
||||
led->ldev.blink_set = pca9532_set_blink;
|
||||
INIT_WORK(&led->work, pca9532_led_work);
|
||||
INIT_WORK(&led->work, pca9532_led_work);
|
||||
err = led_classdev_register(&client->dev, &led->ldev);
|
||||
if (err < 0) {
|
||||
dev_err(&client->dev,
|
||||
|
@ -262,11 +262,11 @@ static int pca9532_configure(struct i2c_client *client,
|
|||
BIT_MASK(SND_TONE);
|
||||
data->idev->event = pca9532_event;
|
||||
input_set_drvdata(data->idev, data);
|
||||
INIT_WORK(&data->work, pca9532_input_work);
|
||||
INIT_WORK(&data->work, pca9532_input_work);
|
||||
err = input_register_device(data->idev);
|
||||
if (err) {
|
||||
input_free_device(data->idev);
|
||||
cancel_work_sync(&data->work);
|
||||
cancel_work_sync(&data->work);
|
||||
data->idev = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -283,13 +283,13 @@ exit:
|
|||
break;
|
||||
case PCA9532_TYPE_LED:
|
||||
led_classdev_unregister(&data->leds[i].ldev);
|
||||
cancel_work_sync(&data->leds[i].work);
|
||||
cancel_work_sync(&data->leds[i].work);
|
||||
break;
|
||||
case PCA9532_TYPE_N2100_BEEP:
|
||||
if (data->idev != NULL) {
|
||||
input_unregister_device(data->idev);
|
||||
input_free_device(data->idev);
|
||||
cancel_work_sync(&data->work);
|
||||
cancel_work_sync(&data->work);
|
||||
data->idev = NULL;
|
||||
}
|
||||
break;
|
||||
|
@ -340,13 +340,13 @@ static int pca9532_remove(struct i2c_client *client)
|
|||
break;
|
||||
case PCA9532_TYPE_LED:
|
||||
led_classdev_unregister(&data->leds[i].ldev);
|
||||
cancel_work_sync(&data->leds[i].work);
|
||||
cancel_work_sync(&data->leds[i].work);
|
||||
break;
|
||||
case PCA9532_TYPE_N2100_BEEP:
|
||||
if (data->idev != NULL) {
|
||||
input_unregister_device(data->idev);
|
||||
input_free_device(data->idev);
|
||||
cancel_work_sync(&data->work);
|
||||
cancel_work_sync(&data->work);
|
||||
data->idev = NULL;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue