firmware-open icon indicating copy to clipboard operation
firmware-open copied to clipboard

Keyboard backlight color changes to white after suspend & resume

Open leviport opened this issue 1 year ago • 8 comments

On oryp7 and gaze18, I noticed that suspending and resuming changes the keyboard backlight color to white. However, hitting Fn + numpad / (color change hotkey) changes to the next color in the rotation, following the color that was set before suspending. For example, if I change the color to Pink and then suspend and resume, hitting Fn + / again changes the backlight to Green, which is the color that always comes after pink while cycling through keyboard colors. So it seems like something knows what the color should be, but it's still changing to white after a suspend and resume cycle.

Since this is happening on two different machines with multi-color keyboards, I think it might be happening on all machines with multi-color keyboards. This may exclude bonw14, since it has a complicated keyboard situation, but I can test it as well and find out.

leviport avatar Mar 16 '23 23:03 leviport

I can confirm this is also happening on the gaze15, but not the oryp4.

n3m0-22 avatar Mar 16 '23 23:03 n3m0-22

Oryp4 has proprietary firmware and EC, so that makes sense. Is oryp4's keyboard the same color after suspending and resuming?

leviport avatar Mar 16 '23 23:03 leviport

Yes the color is the same after suspend/resume.

n3m0-22 avatar Mar 16 '23 23:03 n3m0-22

This happens on my darp8 as well.

uSpike avatar Mar 17 '23 13:03 uSpike

My darp5 with open firmware also does this. As I suspected, bonw14 does not; the keyboard comes back the same color after resuming.

leviport avatar Mar 17 '23 13:03 leviport

Caused by kbled_reset being called in power_cpu_reset, which happens on S3.

https://github.com/system76/ec/blob/1046dd7aec37409d0c077ea925856bc3c2a70b81/src/board/system76/common/power.c#L347-L357

crawfxrd avatar Mar 17 '23 18:03 crawfxrd

Removing the kbled_reset() call by itself does not resolve the problem.

If I unload system76-acpi, the keyboard turns on with the same color it suspended with, before turning off again and then being white. So I don't think the DCR values are being lost, but I'd have to set up debugging and dump them to be sure.

crawfxrd avatar Mar 24 '23 19:03 crawfxrd

KB backlight is also being reset by ACPI WAK.

crawfxrd avatar Mar 27 '23 17:03 crawfxrd