[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230718092439.2482320-1-quic_fenglinw@quicinc.com>
Date: Tue, 18 Jul 2023 17:24:28 +0800
From: Fenglin Wu <quic_fenglinw@...cinc.com>
To: <linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<lee@...nel.org>, <pavel@....cz>, <krzysztof.kozlowski@...aro.org>,
"Fenglin Wu" <quic_fenglinw@...cinc.com>,
ChiaEn Wu <chiaen_wu@...htek.com>,
Alice Chen <alice_chen@...htek.com>,
ChiYuan Huang <cy_huang@...htek.com>,
"Dylan Van Assche" <me@...anvanassche.be>,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Tom Rix <trix@...hat.com>, <linux-leds@...r.kernel.org>
CC: <quic_collinsd@...cinc.com>, <quic_subbaram@...cinc.com>
Subject: [PATCH v1] led: flash: various minor fixes for leds-qcom-flash driver
Update the driver to address following minor issues:
- Add a sentence in Kconfig to explain the driver can be compiled
as a module
- strobe off the LED channel before setting flash current to prevent
the flash LED being lit with an incorrect brightness if it was
already active in torch mode
- put the child node if register any flash LED device failed.
Signed-off-by: Fenglin Wu <quic_fenglinw@...cinc.com>
---
drivers/leds/flash/Kconfig | 2 ++
drivers/leds/flash/leds-qcom-flash.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/drivers/leds/flash/Kconfig b/drivers/leds/flash/Kconfig
index 4ed2efc65434..4e08dbc05709 100644
--- a/drivers/leds/flash/Kconfig
+++ b/drivers/leds/flash/Kconfig
@@ -89,6 +89,8 @@ config LEDS_QCOM_FLASH
the total LED current will be split symmetrically on each channel and
they will be enabled/disabled at the same time.
+ This driver can be built as a module, it will be called "leds-qcom-flash".
+
config LEDS_RT4505
tristate "LED support for RT4505 flashlight controller"
depends on I2C && OF
diff --git a/drivers/leds/flash/leds-qcom-flash.c b/drivers/leds/flash/leds-qcom-flash.c
index b089ca1a1901..a73d3ea5c97a 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;
@@ -745,6 +749,7 @@ static int qcom_flash_led_probe(struct platform_device *pdev)
return 0;
release:
+ fwnode_handle_put(child);
while (flash_data->v4l2_flash[flash_data->leds_count] && flash_data->leds_count)
v4l2_flash_release(flash_data->v4l2_flash[flash_data->leds_count--]);
return rc;
--
2.25.1
Powered by blists - more mailing lists