diff mbox series

[v2] leds: lm3601x: Reset led controller during init

Message ID 20240801153048.3813581-1-zenghuchen@google.com
State Superseded
Headers show
Series [v2] leds: lm3601x: Reset led controller during init | expand

Commit Message

Jack Chen Aug. 1, 2024, 3:30 p.m. UTC
LED controller should be reset during initialization to avoid abnormal
behaviors. For example, when power to SoC is recycled but power to LED
controller is not, LED controller should not presume to be in original
state.

Signed-off-by: Jack Chen <zenghuchen@google.com>
---
 drivers/leds/flash/leds-lm3601x.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Lee Jones Aug. 5, 2024, 2:15 p.m. UTC | #1
On Thu, 01 Aug 2024 11:30:48 -0400, Jack Chen wrote:
> LED controller should be reset during initialization to avoid abnormal
> behaviors. For example, when power to SoC is recycled but power to LED
> controller is not, LED controller should not presume to be in original
> state.
> 
> 

Applied, thanks!

[1/1] leds: lm3601x: Reset led controller during init
      commit: 70a4375e07fcbb771809f0af8b5f0df029ca660f

--
Lee Jones [李琼斯]
diff mbox series

Patch

diff --git a/drivers/leds/flash/leds-lm3601x.c b/drivers/leds/flash/leds-lm3601x.c
index 7e93c447fec5..148e48624cd9 100644
--- a/drivers/leds/flash/leds-lm3601x.c
+++ b/drivers/leds/flash/leds-lm3601x.c
@@ -434,6 +434,10 @@  static int lm3601x_probe(struct i2c_client *client)
 		return ret;
 	}
 
+	ret = regmap_write(led->regmap, LM3601X_DEV_ID_REG, LM3601X_SW_RESET);
+	if (ret)
+		dev_warn(&client->dev, "Failed to reset the LED controller\n");
+
 	mutex_init(&led->lock);
 
 	return lm3601x_register_leds(led, fwnode);