leds: cht-wcove: Add suspend/resume handling
When LED1 is showing the tablet is charging and then the device gets suspended followed by unplugging the charger, then it will incorrectly still show it is charging. To avoid this turn both LEDs off on suspend, just like the PMIC always turns them off when the tablet is powered off (even if the tablet is charging). If hw-control is supported for LED1, then restore the initial hw-control settings to let the hw control LED1 while suspended. To restore the state the LEDs had before suspending, save it before turning the LEDs off and restore it on resume. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230430195952.862527-3-hdegoede@redhat.comSigned-off-by: Lee Jones <lee@kernel.org>
Showing
Please register or sign in to comment