Commit fa1706c4 authored by Jacek Anaszewski's avatar Jacek Anaszewski

media: flash: use led_set_brightness_sync for torch brightness

LED subsystem shifted responsibility for choosing between SYNC or ASYNC
way of setting brightness from drivers to the caller. Adapt the wrapper
to those changes.
Signed-off-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
Cc: linux-media@vger.kernel.org
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Acked-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9d79a05e
...@@ -107,10 +107,10 @@ static void v4l2_flash_set_led_brightness(struct v4l2_flash *v4l2_flash, ...@@ -107,10 +107,10 @@ static void v4l2_flash_set_led_brightness(struct v4l2_flash *v4l2_flash,
if (ctrls[LED_MODE]->val != V4L2_FLASH_LED_MODE_TORCH) if (ctrls[LED_MODE]->val != V4L2_FLASH_LED_MODE_TORCH)
return; return;
led_set_brightness(&v4l2_flash->fled_cdev->led_cdev, led_set_brightness_sync(&v4l2_flash->fled_cdev->led_cdev,
brightness); brightness);
} else { } else {
led_set_brightness(&v4l2_flash->iled_cdev->led_cdev, led_set_brightness_sync(&v4l2_flash->iled_cdev->led_cdev,
brightness); brightness);
} }
} }
...@@ -206,11 +206,11 @@ static int v4l2_flash_s_ctrl(struct v4l2_ctrl *c) ...@@ -206,11 +206,11 @@ static int v4l2_flash_s_ctrl(struct v4l2_ctrl *c)
case V4L2_CID_FLASH_LED_MODE: case V4L2_CID_FLASH_LED_MODE:
switch (c->val) { switch (c->val) {
case V4L2_FLASH_LED_MODE_NONE: case V4L2_FLASH_LED_MODE_NONE:
led_set_brightness(led_cdev, LED_OFF); led_set_brightness_sync(led_cdev, LED_OFF);
return led_set_flash_strobe(fled_cdev, false); return led_set_flash_strobe(fled_cdev, false);
case V4L2_FLASH_LED_MODE_FLASH: case V4L2_FLASH_LED_MODE_FLASH:
/* Turn the torch LED off */ /* Turn the torch LED off */
led_set_brightness(led_cdev, LED_OFF); led_set_brightness_sync(led_cdev, LED_OFF);
if (ctrls[STROBE_SOURCE]) { if (ctrls[STROBE_SOURCE]) {
external_strobe = (ctrls[STROBE_SOURCE]->val == external_strobe = (ctrls[STROBE_SOURCE]->val ==
V4L2_FLASH_STROBE_SOURCE_EXTERNAL); V4L2_FLASH_STROBE_SOURCE_EXTERNAL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment