OSDN Git Service

wifi: rtl8xxxu: Register the LED and make it blink
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Fri, 20 Jan 2023 15:51:21 +0000 (17:51 +0200)
committerKalle Valo <kvalo@kernel.org>
Mon, 13 Feb 2023 17:24:35 +0000 (19:24 +0200)
commit3be01622995bb1a360718f7e5e8cee1879795fa5
tree3da6fc8bd3969cc5a2c4f26984ce506fba1d3b31
parentc6e3dc99fd321b85b9766d51844aebc9ce769059
wifi: rtl8xxxu: Register the LED and make it blink

If the chip can have an LED, register a struct led_classdev and enable
hardware-controlled blinking. When the chip is not transmitting or
receiving anything the LED is off. Otherwise the LED will blink
faster or slower according to the throughput.

The LED can be controlled from userspace by writing 0, 1, or 2 to
/sys/class/leds/rtl8xxxu-usbX-Y/brightness:
0 - solid off.
1 - solid on.
2 - hardware-controlled blinking.

In this patch none of the chips advertise having an LED. That will be
added in the next patches.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/b8235bca-60c3-d0fe-a958-53c6dd3ba3f6@gmail.com
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c