diff options
author | Josef Schlehofer <pepe.schlehofer@gmail.com> | 2022-07-26 14:32:37 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2022-08-16 15:39:16 +0200 |
commit | e06f97eb33ca56b12dba71cb58351c025b30e5a7 (patch) | |
tree | eb9378c08f7784f50c7af8f9d9c2409ff758b151 /target/linux/mvebu/patches-5.10/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch | |
parent | 93ac163deacffd00a64007f4601bcde7210ba97f (diff) | |
download | upstream-e06f97eb33ca56b12dba71cb58351c025b30e5a7.tar.gz upstream-e06f97eb33ca56b12dba71cb58351c025b30e5a7.tar.bz2 upstream-e06f97eb33ca56b12dba71cb58351c025b30e5a7.zip |
mvebu: backport pending Turris Omnia LEDs improvements
It backports this patch series, which is currently on review:
https://lore.kernel.org/linux-leds/20220704105955.15474-1-kabel@kernel.org/T/#rb89a4ca5a836f17bdcc53d65549e0b1779bb6a18
It allows being able to configure LEDs in userspace.
This fixes issue described in Turris Build repository
https://gitlab.nic.cz/turris/os/build/-/issues/354
It happens in OpenWrt as well.
- Before
```
root@turris:/# ls /sys/class/leds/
ath10k-phy0 ath9k-phy1 mmc0::
```
-After
```
root@turris:/# ls /sys/class/leds/
ath10k-phy0 rgb:indicator-2 rgb:lan-3 rgb:wlan-1
ath9k-phy1 rgb:lan-0 rgb:lan-4 rgb:wlan-2
mmc0:: rgb:lan-1 rgb:power rgb:wlan-3
rgb:indicator-1 rgb:lan-2 rgb:wan
```
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 049368b936988ce2c7f82c07367d168600fdbaa6)
Diffstat (limited to 'target/linux/mvebu/patches-5.10/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch')
-rw-r--r-- | target/linux/mvebu/patches-5.10/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-5.10/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch b/target/linux/mvebu/patches-5.10/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch new file mode 100644 index 0000000000..da4ad49b23 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch @@ -0,0 +1,31 @@ +From 349cbe949b9622cc05b148ecfa6268cbbae35b45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org> +Date: Mon, 4 Jul 2022 12:59:55 +0200 +Subject: [PATCH] leds: turris-omnia: change max brightness from 255 to 1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Using binary brightness makes more sense for this controller, because +internally in the MCU it works that way: the LED has a color, and a +state whether it is ON or OFF. + +The resulting brightness computation with led_mc_calc_color_components() +will now always result in either (0, 0, 0) or the multi_intensity value. + +Signed-off-by: Marek Behún <kabel@kernel.org> +--- + drivers/leds/leds-turris-omnia.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -154,7 +154,7 @@ static int omnia_led_register(struct i2c + init_data.fwnode = &np->fwnode; + + cdev = &led->mc_cdev.led_cdev; +- cdev->max_brightness = 255; ++ cdev->max_brightness = 1; + cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; + cdev->trigger_type = &omnia_hw_trigger_type; + cdev->default_trigger = omnia_hw_trigger.name; |