On Fri, 2023-01-20 at 17:51 +0200, Bitterblue Smith wrote: > 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@xxxxxxxxx> Reviewed-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx> > --- > v2: > - Suggestion from Ping-Ke Shih: > - Check for led_classdev_brightness_set inside rtl8xxxu_init_led() > and for led_registered inside rtl8xxxu_deinit_led() instead of > checking for them in the caller functions. > [...]