diff options
author | Jack Chen <zenghuchen@google.com> | 2024-08-01 11:30:48 -0400 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-08-05 15:15:27 +0100 |
commit | 70a4375e07fcbb771809f0af8b5f0df029ca660f (patch) | |
tree | 746c8b03f55ce604ecc98003aa23a12c80bf3b55 /drivers/leds | |
parent | a0864cf32044233e56247fa0eed3ac660f15db9e (diff) | |
download | lwn-70a4375e07fcbb771809f0af8b5f0df029ca660f.tar.gz lwn-70a4375e07fcbb771809f0af8b5f0df029ca660f.zip |
leds: lm3601x: Reset LED controller during probe
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>
Link: https://lore.kernel.org/r/20240801153048.3813581-1-zenghuchen@google.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/flash/leds-lm3601x.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/leds/flash/leds-lm3601x.c b/drivers/leds/flash/leds-lm3601x.c index 1a6b9ee9e582..abf6b96ade3d 100644 --- a/drivers/leds/flash/leds-lm3601x.c +++ b/drivers/leds/flash/leds-lm3601x.c @@ -443,6 +443,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); |