After resuming from suspend, the ALS stops working: cat /sys/bus/iio/devices/iio:device0/in_illuminance_raw
just returns 0. There also is no delay in reading this file (whereas there is a significant read delay when the ALS actually works.)
The issue almost always happens after a resume.
When the ALS is borked, suspending & resuming again will sometimes “fix” it, but this is very unreliable.
I’m not seeing anything relevant in dmesg.
Is anyone else experiencing this? I’m not sure how to go about debugging this, so any suggestion would be welcome.
Turns out that was the key difference! If I disable the light-adjusting-thingy (wluma in my case), then the ALS starts working again.
Somehow the ALS doesn’t seem to enjoy being hammered by requests from wluma just after resuming. I think it queries it at quite a high rate (10/s maybe?), I’ll look into that.
You could try reading the ALS from the EC memmap directly using sudo xxd -seek 0xE80 -l 2 /dev/port (it’s little endian and hex but 0 should be obvious), and that should narrow it down as a kernel issue or EC issue.