From ffca9b0a5e8703218717bcc23392c9bf79eda3e6 Mon Sep 17 00:00:00 2001 From: Wooyeon Kim Date: Thu, 24 Jan 2019 18:59:25 +0900 Subject: [PATCH] [COMMON] fimc-is2: add condition for flash S2MU106 initilize - when flash init, if flash is turned on, do off PR JIRA ID: CPR-618 Change-Id: I58aa9d8e39dc526a172b9f4f0ae658b992c4d9f6 Signed-off-by: Wooyeon Kim --- .../module_framework/flash/fimc-is-flash-s2mu106.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/flash/fimc-is-flash-s2mu106.c b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/flash/fimc-is-flash-s2mu106.c index 3e7743b6658b..7b0800255387 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/flash/fimc-is-flash-s2mu106.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/module_framework/flash/fimc-is-flash-s2mu106.c @@ -41,6 +41,11 @@ static int flash_s2mu106_init(struct v4l2_subdev *subdev, u32 val) FIMC_BUG(!flash); + for (i = 0; i < FLASH_LED_CH_MAX; i++) { + if (flash->led_ch[i] >= 0 && flash->flash_data.flash_fired) + s2mu106_fled_set_mode_ctrl(flash->led_ch[i], CAM_FLASH_MODE_OFF); + } + /* TODO: init flash driver */ flash->flash_data.mode = CAM2_FLASH_MODE_OFF; flash->flash_data.intensity = 100; /* TODO: Need to figure out min/max range */ @@ -48,11 +53,6 @@ static int flash_s2mu106_init(struct v4l2_subdev *subdev, u32 val) flash->flash_data.flash_fired = false; flash->flash_data.cal_en = false; - for (i = 0; i < FLASH_LED_CH_MAX; i++) { - if (flash->led_ch[i] >= 0) - s2mu106_fled_set_mode_ctrl(flash->led_ch[i], CAM_FLASH_MODE_OFF); - } - return ret; } -- 2.20.1