[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230725-leds-qcom-flash-driver-tiny-fixes-v2-2-0f5cbce5fed0@quicinc.com>
Date: Tue, 25 Jul 2023 17:57:20 +0800
From: Fenglin Wu <quic_fenglinw@...cinc.com>
To: Fenglin Wu <quic_fenglinw@...cinc.com>,
<linux-arm-msm@...r.kernel.org>, Pavel Machek <pavel@....cz>,
Lee Jones <lee@...nel.org>
CC: <linux-leds@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v2 2/3] 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@...cinc.com>
---
drivers/leds/flash/leds-qcom-flash.c | 4 ++++
1 file changed, 4 insertions(+)
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;
--
2.25.1
Powered by blists - more mailing lists