armbian_build/patch/kernel/archive/sunxi-6.0/patches.megous/leds-sgm3140-Add-missing-timer-cleanup-and-flash-gpio-control.patch
The-going bd72c996b7
Bump sunxi to 6.0.y (#4282)
* sunxi-6.0: initial state: add megous patches to series

* sunxi-6.0: Switch to v6.0.1

* wifi: Limit the version 6.0 for Realtek 88x2cs chipsets

* Adjust kernel configs

* Remove not needed patches

* Adjust broken patches

Co-authored-by: Igor <igor@armbian.com>
2022-10-25 20:39:08 +02:00

34 lines
1.1 KiB
Diff

From 2ec20258e57247b0ec6e2558b59328b0451149cd Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 27 May 2022 03:10:07 +0200
Subject: [PATCH 339/486] 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 <megi@xff.cz>
---
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 d3a30ad94..dd5d327c5 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.35.3