summaryrefslogtreecommitdiff
path: root/drivers/leds/flash
diff options
context:
space:
mode:
authorFenglin Wu <quic_fenglinw@quicinc.com>2023-07-25 17:57:20 +0800
committerLee Jones <lee@kernel.org>2023-07-28 12:17:32 +0100
commit7c47381c8664d55861036d1d858daf5e9d5d67b8 (patch)
tree918bd423ba79029260dcbfc85fdb489ca1701a58 /drivers/leds/flash
parent05a576059ac23355a86e4be058cb43997d83c7fd (diff)
leds: flash: leds-qcom-flash: Turn off LED before setting flash current
Strobe off the LED before setting flash current to avoid it's being enabled with an incorrect current if it has been working in torch mode. Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com> Link: https://lore.kernel.org/r/20230725-leds-qcom-flash-driver-tiny-fixes-v2-2-0f5cbce5fed0@quicinc.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/flash')
-rw-r--r--drivers/leds/flash/leds-qcom-flash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/leds/flash/leds-qcom-flash.c b/drivers/leds/flash/leds-qcom-flash.c
index b089ca1a1901..29cf09479422 100644
--- a/drivers/leds/flash/leds-qcom-flash.c
+++ b/drivers/leds/flash/leds-qcom-flash.c
@@ -309,6 +309,10 @@ static int qcom_flash_strobe_set(struct led_classdev_flash *fled_cdev, bool stat
struct qcom_flash_led *led = flcdev_to_qcom_fled(fled_cdev);
int rc;
+ rc = set_flash_strobe(led, SW_STROBE, false);
+ if (rc)
+ return rc;
+
rc = set_flash_current(led, led->flash_current_ma, FLASH_MODE);
if (rc)
return rc;