linux-stable/drivers/leds
Marek Behún 0301718d3a 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-13 09:48:36 +02:00
..
blink leds: lgm-sso: switch to using devm_fwnode_gpiod_get() 2022-11-09 13:59:28 +01:00
flash leds: flash: Set variables mvflash_{3,4}ch_regs storage-class-specifier to static 2023-03-30 13:58:24 +01:00
rgb led: qcom-lpg: Fix resource leaks in for_each_available_child_of_node() loops 2023-08-23 17:32:30 +02:00
simple leds: simatic-ipc-leds-gpio: Make sure we have the GPIO providing driver 2023-01-30 08:03:43 +00:00
trigger leds: trigger: tty: Do not use LED_ON/OFF constants, use led_blink_set_oneshot instead 2023-09-13 09:48:36 +02:00
Kconfig leds: bd2606mvv: Driver for the Rohm 6 Channel i2c LED driver 2023-04-27 17:42:33 +01:00
Makefile leds: bd2606mvv: Driver for the Rohm 6 Channel i2c LED driver 2023-04-27 17:42:33 +01:00
TODO leds: TODO: Add documentation about possible subsystem improvements 2020-09-30 19:15:33 +02:00
led-class-flash.c led-class-flash: fix -Wrestrict warning 2021-09-27 16:09:42 +02:00
led-class-multicolor.c leds: multicolor: Use rounded division when calculating color components 2023-09-13 09:48:35 +02:00
led-class.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
led-core.c leds: Fix BUG_ON check for LED_COLOR_ID_MULTI that is always false 2023-09-13 09:48:36 +02:00
led-triggers.c leds: trigger: use RCU to protect the led_cdevs list 2021-09-27 16:16:42 +02:00
leds-88pm860x.c leds: various: use only available OF children 2020-09-26 21:56:39 +02:00
leds-acer-a500.c leds: Add driver for Acer Iconia Tab A500 2020-09-26 21:56:42 +02:00
leds-adp5520.c
leds-an30259a.c leds: an30259a: Get rid of custom led_init_default_state_get() 2023-01-30 08:03:36 +00:00
leds-apu.c leds: apu: extend support for PC Engines APU1 with newer firmware 2021-02-19 22:15:10 +01:00
leds-ariel.c leds: leds-ariel: convert comma to semicolon 2021-01-31 10:38:02 +01:00
leds-aw2013.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
leds-bcm6328.c leds: bcm6328: Get rid of custom led_init_default_state_get() 2023-01-30 08:03:37 +00:00
leds-bcm6358.c leds: bcm6358: Get rid of custom led_init_default_state_get() 2023-01-30 08:03:38 +00:00
leds-bd2606mvv.c leds: bd2606mvv: Driver for the Rohm 6 Channel i2c LED driver 2023-04-27 17:42:33 +01:00
leds-bd2802.c leds: bd2802: Convert to i2c's .probe_new() 2023-01-30 08:03:18 +00:00
leds-blinkm.c leds: blinkm: Convert to i2c's .probe_new() 2023-01-30 08:03:18 +00:00
leds-clevo-mail.c
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-cpcap.c leds: various: use device_get_match_data 2020-09-26 21:56:39 +02:00
leds-cr0014114.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
leds-da903x.c leds: da903x: fix use-after-free on unbind 2020-06-22 10:37:58 +02:00
leds-da9052.c
leds-dac124s085.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
leds-el15203000.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
leds-gpio-register.c leds: leds-gpio-register: Supply description for param 'id' 2021-05-28 11:38:54 +02:00
leds-gpio.c leds: gpio: switch to using devm_fwnode_gpiod_get() 2022-11-09 13:59:21 +01:00
leds-hp6xx.c
leds-ip30.c leds: ip30: compile if COMPILE_TEST=y 2020-09-26 21:56:38 +02:00
leds-ipaq-micro.c
leds-is31fl32xx.c leds: is31fl32xx: Convert to i2c's .probe_new() 2023-01-30 08:03:19 +00:00
leds-is31fl319x.c leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest() 2023-01-30 08:03:34 +00:00
leds-lm355x.c leds: lm355x: Convert to i2c's .probe_new() 2023-01-30 08:03:21 +00:00
leds-lm3530.c leds: lm3530: Convert to i2c's .probe_new() 2023-01-30 08:03:20 +00:00
leds-lm3532.c leds: lm3532: Convert to i2c's .probe_new() 2023-01-30 08:03:21 +00:00
leds-lm3533.c leds: use sysfs_emit() to instead of scnprintf() 2022-12-07 21:05:20 +01:00
leds-lm3642.c leds: lm3642: Convert to i2c's .probe_new() 2023-01-30 08:03:22 +00:00
leds-lm3692x.c leds: lm3692x: Convert to i2c's .probe_new() 2023-01-30 08:03:23 +00:00
leds-lm3697.c leds: lm3697: Convert to i2c's .probe_new() 2023-01-30 08:03:24 +00:00
leds-lm36274.c leds: lm36274: Add missed property.h 2021-05-30 23:03:48 +02:00
leds-locomo.c ARM: pxa: split up mach/hardware.h 2022-04-19 16:27:05 +02:00
leds-lp50xx.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
leds-lp55xx-common.c leds: use sysfs_emit() to instead of scnprintf() 2022-12-07 21:05:20 +01:00
leds-lp55xx-common.h leds: lp55xx: Add multicolor framework support to lp55xx 2020-07-22 14:42:06 +02:00
leds-lp3944.c leds: lp3944: Convert to i2c's .probe_new() 2023-01-30 08:03:24 +00:00
leds-lp3952.c leds: lp3952: Convert to i2c's .probe_new() 2023-01-30 08:03:25 +00:00
leds-lp5521.c leds: lp5521: Convert to i2c's .probe_new() 2023-01-30 08:03:26 +00:00
leds-lp5523.c leds: lp5523: Convert to i2c's .probe_new() 2023-01-30 08:03:27 +00:00
leds-lp5562.c leds: lp5562: Convert to i2c's .probe_new() 2023-01-30 08:03:28 +00:00
leds-lp8501.c leds: lp8501: Convert to i2c's .probe_new() 2023-01-30 08:03:28 +00:00
leds-lp8788.c
leds-lp8860.c leds: lp8860: Remove duplicate NULL checks for gpio_desc 2023-03-16 15:08:40 +00:00
leds-lt3593.c leds: lt3593: Put fwnode in any case during ->probe() 2021-08-03 23:49:31 +02:00
leds-max8997.c leds: max8997: Don't error if there is no pdata 2022-10-22 11:55:03 +02:00
leds-max77650.c leds: parse linux,default-trigger DT property in LED core 2020-09-26 21:56:43 +02:00
leds-mc13783.c leds: various: use only available OF children 2020-09-26 21:56:39 +02:00
leds-menf21bmc.c
leds-mlxcpld.c leds: leds-mlxcpld: Fix a bunch of kernel-doc formatting issues 2021-05-28 11:39:00 +02:00
leds-mlxreg.c leds: leds-mlxreg: Fix incorrect documentation of struct member 'led_cdev' and 'led_cdev_name' 2021-05-28 11:38:59 +02:00
leds-mt6323.c leds: mt6323: Get rid of custom led_init_default_state_get() 2023-01-30 08:03:39 +00:00
leds-net48xx.c
leds-netxbig.c leds: Use DEVICE_ATTR_{RW, RO, WO} macros 2020-12-30 19:37:13 +01:00
leds-nic78bx.c
leds-ns2.c leds: ns2: do not guard OF match pointer with of_match_ptr 2020-09-30 19:22:58 +02:00
leds-ot200.c
leds-pca955x.c leds: pca955x: Get rid of custom led_init_default_state_get() 2023-01-30 08:03:40 +00:00
leds-pca963x.c leds: pca963x: Convert to i2c's .probe_new() 2023-01-30 08:03:31 +00:00
leds-pca9532.c leds: pca9532: Convert to i2c's .probe_new() 2023-01-30 08:03:30 +00:00
leds-pm8058.c leds: pm8058: Get rid of custom led_init_default_state_get() 2023-01-30 08:03:41 +00:00
leds-powernv.c leds: various: use only available OF children 2020-09-26 21:56:39 +02:00
leds-pwm.c leds: pwm: Fix error code in led_pwm_create_fwnode() 2023-09-13 09:48:35 +02:00
leds-rb532.c leds: rb532: cleanup whitespace 2020-01-02 22:41:53 +01:00
leds-regulator.c leds: regulator: Make probeable from device tree 2022-05-05 10:04:52 +02:00
leds-sc27xx-bltc.c leds: various: use only available OF children 2020-09-26 21:56:39 +02:00
leds-spi-byte.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
leds-ss4200.c leds: ss4200: simplify the return expression of register_nasgpio_led() 2020-12-30 19:37:14 +01:00
leds-sunfire.c
leds-syscon.c leds: syscon: Get rid of custom led_init_default_state_get() 2023-01-30 08:03:42 +00:00
leds-tca6507.c leds: tca6507: Fix error handling of using fwnode_property_read_string 2023-04-05 16:28:42 +01:00
leds-ti-lmu-common.c
leds-tlc591xx.c leds: tlc591xx: Mark OF related data as maybe unused 2023-03-16 15:08:43 +00:00
leds-tps6105x.c leds: tps6105x: add driver for MFD chip LED mode 2019-12-21 20:10:02 +01:00
leds-turris-omnia.c leds: turris-omnia: Convert to i2c's .probe_new() 2023-01-30 08:03:33 +00:00
leds-wm831x-status.c leds: Use DEVICE_ATTR_{RW, RO, WO} macros 2020-12-30 19:37:13 +01:00
leds-wm8350.c
leds-wrap.c
leds.h leds: Move led_init_default_state_get() to the global header 2023-01-30 08:03:35 +00:00
uleds.c