From: Fenglin Wu <quic_fenglinw@quicinc.com>
To: Fenglin Wu <quic_fenglinw@quicinc.com>,
<linux-arm-msm@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>,
Lee Jones <lee@kernel.org>
Cc: <linux-leds@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 2/3] leds: flash: leds-qcom-flash: turn off LED before setting flash current
Date: Tue, 25 Jul 2023 17:57:20 +0800 [thread overview]
Message-ID: <20230725-leds-qcom-flash-driver-tiny-fixes-v2-2-0f5cbce5fed0@quicinc.com> (raw)
In-Reply-To: <20230725-leds-qcom-flash-driver-tiny-fixes-v2-0-0f5cbce5fed0@quicinc.com>
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>
---
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
next prev parent reply other threads:[~2023-07-25 9:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 9:57 [PATCH v2 0/3] leds-qcom-flash: several tiny fixes Fenglin Wu
2023-07-25 9:57 ` [PATCH v2 1/3] leds: flash: leds-qcom-flash: declare the driver as a module Fenglin Wu
2023-07-25 9:57 ` Fenglin Wu [this message]
2023-07-25 9:57 ` [PATCH v2 3/3] leds: flash: leds-qcom-flash: put child node if registration failed Fenglin Wu
2023-07-28 11:17 ` [PATCH v2 0/3] leds-qcom-flash: several tiny fixes Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230725-leds-qcom-flash-driver-tiny-fixes-v2-2-0f5cbce5fed0@quicinc.com \
--to=quic_fenglinw@quicinc.com \
--cc=lee@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®