Repository navigation
iio: aop_als: arm the CT817 again after system sleep - #2528
DjDeveloperr wants to merge 1 commit into
Conversation
On the J700 (T8140) the light sensor stops reporting at the first system sleep of a boot and never starts again. Every read of in_illuminance_input after that wake returns the last sample from before the sleep, usually taken as the panel went dark, for the rest of the boot. Measured 2026-11-19 on integration/aurora 1473d15 and on the 7.3.0-41 RPM alike: 26 boots, 72 deep sleeps, on both the DRAM-kept and the deep path. Before the first sleep, five reads over 5 s gave 20.55 20.55 20.55 19.36 20.55 lx. After the first and second wakes the same boot read 1.453372 five times each, with the room and the backlight unchanged. Each boot froze on its own value, between 0.000000 and 6.628011 lx. The firmware stops the sensor's reports for system sleep; the lid angle driver's comment notes the same. The CT817 starts reporting only on a zero to non-zero transition of its report interval, which enable_als() writes once, at probe. Register a PM notifier, as aop_las does. At PM_POST_SUSPEND it writes the interval to zero and then repeats the probe's CT817 arming: verbosity, batch and raw interval, then the interval. Only the CT817 gets the hook; the other parts are unchanged. Tested on the J700 with 1473d15 plus this patch, built as a test kit: 2 boots, 6 DRAM-kept deep sleeps. After every wake the sensor reported again and followed the light. It read 18.23-18.61 lx with the panel on, and fell to 5.17-6.37 lx, still varying from read to read, when the lock screen dimmed the backlight to 121. The sleeps, GPU, Wi-Fi, BT and the AOP mics behaved as on the tip, and the patch logged no warning. Signed-off-by: Diljit Singh <hey@djdev.me>
|
No blockers. I checked the hook's lifetime and teardown. The notifier block is the first field of a pinned
HW row: on J815 (T8142, CT817) with the same kit, 3 deep sleeps; after each wake Assisted-by: LLM (Claude:Opus 5.5) |
Problem
On the MacBook Neo (J700, T8140), the ambient light sensor stops at the first system sleep of every boot and never reports again until reboot. After that wake,
in_illuminance_inputkeeps returning the last sample taken before the sleep, usually from the moment the panel went dark. iio-sensor-proxy, and anything that follows ambient light, then sees a constant for the rest of the boot. No error is logged.Evidence (Neo J700, installed aura 1.0.0b13-g5dcf62d0, no dock)
20.55 20.55 20.55 19.36 20.55lx. After wake 1 and wake 2:1.453372×5 each, with the backlight (402) and the room unchanged.aop_las.rsalready notes this ("after the light sensor already stopped its reports for sleep").enable_als()writes that transition once, at probe, and the driver has no PM handling.Fix
A PM notifier, built the same way as aop_las's (#2223). At
PM_POST_SUSPENDit writes the interval to 0 and then repeats the probe's CT817 arming: verbosity, batch interval, raw interval, interval.offset == LUX_OFFSET_CT817); VD6286 and CT720 are unchanged.dev_warn..rustfmt.toml. Builds without warnings with LLVM 19 / Rust 1.85.Tested (Neo J700)
Test kit
7.3.0.nts1473a= 1473d15 + this patch (same diff), Ryzen build, config-neo-41 lineage. One-shot boots on the installed aura, each followed by a byte-exact undo.15.26×5. After wake 218.61 18.61 18.23 18.61 18.61, after wake 318.61×5, panel on.16.46 15.26 15.26 15.26 15.26. After wake 118.23×5 (panel on). After wake 2, with the lock screen dimming the backlight to 121,5.17 6.37 5.17 5.17 6.37. After wake 35.55×5.reports not armed againwarning, no AOP crash, no BAD lines.Not merging; for review.
🤖 Generated with Claude Code