From aa4bdeffd919c08ad11a7d40629ca680932057a8 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Fri, 27 May 2022 03:10:07 +0200 Subject: [PATCH 359/464] leds: sgm3140: Add missing timer cleanup and flash gpio control strobe = 1 + brightness = 0 before the timeout may mess up the driver state. Signed-off-by: Ondrej Jirman --- drivers/leds/flash/leds-sgm3140.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/leds/flash/leds-sgm3140.c b/drivers/leds/flash/leds-sgm3140.c index d3f50dca5136..991b3db63ebe 100644 --- a/drivers/leds/flash/leds-sgm3140.c +++ b/drivers/leds/flash/leds-sgm3140.c @@ -114,8 +114,11 @@ static int sgm3140_brightness_set(struct led_classdev *led_cdev, "failed to enable regulator: %d\n", ret); return ret; } + gpiod_set_value_cansleep(priv->flash_gpio, 0); gpiod_set_value_cansleep(priv->enable_gpio, 1); } else { + del_timer_sync(&priv->powerdown_timer); + gpiod_set_value_cansleep(priv->flash_gpio, 0); gpiod_set_value_cansleep(priv->enable_gpio, 0); ret = regulator_disable(priv->vin_regulator); if (ret) { -- 2.34.1