WSL2-Linux-Kernel/drivers/leds
Marek Behún 8869fd166f leds: trigger: tty: Do not use LED_ON/OFF constants, use led_blink_set_oneshot instead
[ Upstream commit 730094577e ]

The tty LED trigger uses the obsolete LED_ON & LED_OFF constants when
setting LED brightness. This is bad because the LED_ON constant is equal
to 1, and so when activating the tty LED trigger on a LED class device
with max_brightness greater than 1, the LED is dimmer than it can be
(when max_brightness is 255, the LED is very dimm indeed; some devices
translate 1/255 to 0, so the LED is OFF all the time).

Instead of directly setting brightness to a specific value, use the
led_blink_set_oneshot() function from LED core to configure the blink.
This function takes the current configured brightness as blink
brightness if not zero, and max brightness otherwise.

This also changes the behavior of the TTY LED trigger. Previously if
rx/tx stats kept changing, the LED was ON all the time they kept
changing. With this patch the LED will blink on TTY activity.

Fixes: fd4a641ac8 ("leds: trigger: implement a tty trigger")
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20230802090753.13611-1-kabel@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:22:49 +02:00
..
blink leds: lgm-sso: Propagate error codes from callee to caller 2021-08-07 09:12:45 +02:00
flash leds: lm3601x: Don't use mutex after it was destroyed 2022-10-26 12:34:39 +02:00
trigger leds: trigger: tty: Do not use LED_ON/OFF constants, use led_blink_set_oneshot instead 2023-09-19 12:22:49 +02:00
Kconfig leds: TI_LMU_COMMON: select REGMAP instead of depending on it 2023-05-11 23:00:37 +09:00
Makefile leds: ktd2692: Move driver to flash subdirectory 2021-07-12 10:30:06 +02:00
TODO
led-class-flash.c leds: flash: Remove redundant initialization of variable ret 2021-08-16 08:47:08 +02:00
led-class-multicolor.c leds: multicolor: Use rounded division when calculating color components 2023-09-19 12:22:48 +02:00
led-class.c leds: led-core: Fix refcount leak in of_led_get() 2023-03-10 09:39:32 +01:00
led-core.c leds: move default_state read from fwnode to core 2021-08-18 08:27:30 +02:00
led-triggers.c
leds-88pm860x.c
leds-acer-a500.c
leds-adp5520.c
leds-an30259a.c
leds-apu.c
leds-ariel.c
leds-asic3.c
leds-aw2013.c
leds-bcm6328.c
leds-bcm6358.c
leds-bd2802.c
leds-blinkm.c
leds-clevo-mail.c
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-cpcap.c
leds-cr0014114.c
leds-da903x.c
leds-da9052.c
leds-dac124s085.c
leds-el15203000.c leds: el15203000: Correct headers (of*.h -> mod_devicetable.h) 2021-08-03 23:46:09 +02:00
leds-fsg.c
leds-gpio-register.c
leds-gpio.c leds: move default_state read from fwnode to core 2021-08-18 08:27:30 +02:00
leds-hp6xx.c
leds-ip30.c
leds-ipaq-micro.c
leds-is31fl32xx.c leds: is31fl32xx: Fix missing error code in is31fl32xx_parse_dt() 2021-07-12 10:30:07 +02:00
leds-is31fl319x.c
leds-lm355x.c
leds-lm3530.c
leds-lm3532.c
leds-lm3533.c
leds-lm3642.c
leds-lm3692x.c leds: lm3692x: Correct headers (of*.h -> mod_devicetable.h) 2021-08-03 23:46:13 +02:00
leds-lm3697.c leds: lm3697: Make error handling more robust 2021-08-03 23:49:31 +02:00
leds-lm36274.c
leds-locomo.c
leds-lp50xx.c
leds-lp55xx-common.c leds: lp55xx: initialise output direction from dts 2022-01-27 11:04:21 +01:00
leds-lp55xx-common.h
leds-lp3944.c
leds-lp3952.c
leds-lp5521.c
leds-lp5523.c
leds-lp5562.c
leds-lp8501.c
leds-lp8788.c
leds-lp8860.c
leds-lt3593.c leds: lt3593: Put fwnode in any case during ->probe() 2021-08-03 23:49:31 +02:00
leds-max8997.c
leds-max77650.c
leds-mc13783.c
leds-menf21bmc.c
leds-mlxcpld.c
leds-mlxreg.c
leds-mt6323.c
leds-net48xx.c
leds-netxbig.c
leds-nic78bx.c
leds-ns2.c
leds-ot200.c
leds-pca955x.c leds: pca955x: Switch to i2c probe_new 2021-08-20 11:00:08 +02:00
leds-pca963x.c
leds-pca9532.c
leds-pm8058.c
leds-powernv.c
leds-pwm.c leds: pwm: Fix error code in led_pwm_create_fwnode() 2023-09-19 12:22:48 +02:00
leds-rb532.c
leds-regulator.c
leds-s3c24xx.c
leds-sc27xx-bltc.c
leds-spi-byte.c
leds-ss4200.c
leds-sunfire.c
leds-syscon.c
leds-tca6507.c leds: tca6507: Fix error handling of using fwnode_property_read_string 2023-05-11 23:00:37 +09:00
leds-ti-lmu-common.c
leds-tlc591xx.c
leds-tps6105x.c
leds-turris-omnia.c
leds-wm831x-status.c
leds-wm8350.c
leds-wrap.c
leds.h leds: move default_state read from fwnode to core 2021-08-18 08:27:30 +02:00
uleds.c