mvebu: leds: Turris Omnia improvements
[openwrt/openwrt.git] / target / linux / mvebu / patches-5.15 / 104-leds-turris-omnia-change-max-brightness-from-255-to-.patch
1 From 349cbe949b9622cc05b148ecfa6268cbbae35b45 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org>
3 Date: Mon, 4 Jul 2022 12:59:55 +0200
4 Subject: [PATCH] leds: turris-omnia: change max brightness from 255 to 1
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Using binary brightness makes more sense for this controller, because
10 internally in the MCU it works that way: the LED has a color, and a
11 state whether it is ON or OFF.
12
13 The resulting brightness computation with led_mc_calc_color_components()
14 will now always result in either (0, 0, 0) or the multi_intensity value.
15
16 Signed-off-by: Marek BehĂșn <kabel@kernel.org>
17 ---
18 drivers/leds/leds-turris-omnia.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 --- a/drivers/leds/leds-turris-omnia.c
22 +++ b/drivers/leds/leds-turris-omnia.c
23 @@ -146,7 +146,7 @@ static int omnia_led_register(struct i2c
24 init_data.fwnode = &np->fwnode;
25
26 cdev = &led->mc_cdev.led_cdev;
27 - cdev->max_brightness = 255;
28 + cdev->max_brightness = 1;
29 cdev->brightness_set_blocking = omnia_led_brightness_set_blocking;
30 cdev->trigger_type = &omnia_hw_trigger_type;
31 cdev->default_trigger = omnia_hw_trigger.name;