leds: Rename brightness_set_sync op to brightness_set_blocking

The initial purpose of brightness_set_sync op, introduced along with
the LED flash class extension, was to add a means for setting torch LED
brightness as soon as possible, which couldn't have been guaranteed by
brightness_set op. This patch renames the op to brightness_set_blocking,
which describes its purpose in a more generic way. It is beneficial
in view of the prospective changes in the LED core, aiming at removing
the need for using work queues in LED class drivers that can sleep
or use delays while setting brightness.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
This commit is contained in:
Jacek Anaszewski 2015-10-07 11:10:40 +02:00
parent f1e80c0741
commit 437a4240f2
6 changed files with 7 additions and 7 deletions

View File

@ -298,7 +298,7 @@ int led_classdev_flash_register(struct device *parent,
led_cdev = &fled_cdev->led_cdev;
if (led_cdev->flags & LED_DEV_CAP_FLASH) {
if (!led_cdev->brightness_set_sync)
if (!led_cdev->brightness_set_blocking)
return -EINVAL;
ops = fled_cdev->ops;

View File

@ -510,7 +510,7 @@ static int aat1290_led_probe(struct platform_device *pdev)
/* Initialize LED Flash class device */
led_cdev->brightness_set = aat1290_led_brightness_set;
led_cdev->brightness_set_sync = aat1290_led_brightness_set_sync;
led_cdev->brightness_set_blocking = aat1290_led_brightness_set_sync;
led_cdev->max_brightness = led_cfg.max_brightness;
led_cdev->flags |= LED_DEV_CAP_FLASH;
INIT_WORK(&led->work_brightness_set, aat1290_brightness_set_work);

View File

@ -382,7 +382,7 @@ static int ktd2692_probe(struct platform_device *pdev)
led_cdev->max_brightness = led_cfg.max_brightness;
led_cdev->brightness_set = ktd2692_led_brightness_set;
led_cdev->brightness_set_sync = ktd2692_led_brightness_set_sync;
led_cdev->brightness_set_blocking = ktd2692_led_brightness_set_sync;
led_cdev->flags |= LED_CORE_SUSPENDRESUME | LED_DEV_CAP_FLASH;
mutex_init(&led->lock);

View File

@ -932,7 +932,7 @@ static void max77693_init_fled_cdev(struct max77693_sub_led *sub_led,
led_cdev->name = led_cfg->label[fled_id];
led_cdev->brightness_set = max77693_led_brightness_set;
led_cdev->brightness_set_sync = max77693_led_brightness_set_sync;
led_cdev->brightness_set_blocking = max77693_led_brightness_set_sync;
led_cdev->max_brightness = (led->iout_joint ?
led_cfg->iout_torch_max[FLED1] +
led_cfg->iout_torch_max[FLED2] :

View File

@ -34,7 +34,7 @@ static inline int led_set_brightness_sync(struct led_classdev *led_cdev,
led_cdev->brightness = min(value, led_cdev->max_brightness);
if (!(led_cdev->flags & LED_SUSPENDED))
ret = led_cdev->brightness_set_sync(led_cdev,
ret = led_cdev->brightness_set_blocking(led_cdev,
led_cdev->brightness);
return ret;
}

View File

@ -59,8 +59,8 @@ struct led_classdev {
* Set LED brightness level immediately - it can block the caller for
* the time required for accessing a LED device register.
*/
int (*brightness_set_sync)(struct led_classdev *led_cdev,
enum led_brightness brightness);
int (*brightness_set_blocking)(struct led_classdev *led_cdev,
enum led_brightness brightness);
/* Get LED brightness level */
enum led_brightness (*brightness_get)(struct led_classdev *led_cdev);