Repository navigation
Conversation
|
Tested on a J313 (M1 Air): works, no regressions found.
That matches the description in the code comment: about 5460 K, green > red > blue, clear largest. All lab tests passed, including the device suspend phase and omarchy-m-test with no regressions. Two notes:
How this was tested
|
The CT720 (FireFish2) report already carries four channel counts and a correlated color temperature beside the lux float at +0x1d. The shared helper stored one reading and registered one IIO channel, so those fields never reached sysfs. Publish red, green, blue, and clear counts plus color temperature on aop-sensors-als when the part is the CT720. Color is accepted only when both integration-time copies match, are non-zero, and are at most 10000000. A report that fails that gate still publishes lux and clears a stale color sample. VD6286, CT817, and the lid-angle sensor stay on their single channel through the default decode path. The helper publishes the slots with a seqlock. A reader that keeps colliding with the writer returns EAGAIN instead of spinning on the same CPU. Checked against three captured J313 reports with an offline mirror of the integer conversion. Not run on hardware. Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
86ce068 to
2e02efd
Compare
|
Follow-up from a hands-on run (phone torch, sensor covered, dark room):
All channels track the light together, and a white LED reading ~5500 K is plausible. One thing to consider: at near-zero counts (clear ≤ 11) How this was tested
|
Covered J313 readings still had the firmware CCT byte set at clear counts of 11 and below, and the published temperatures were 788 K, 1288 K, 2904 K and 6781 K. Publish the temperature only when clear is at least 12. Red, green, blue, and clear stay published. A layout check that fails still replaces the valid mask with the lux bit, so a stale color sample reads back as ENODATA. Not hardware-tested. Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
The CT720 (FireFish2) report already carries four channel counts and a correlated color temperature beside the lux float. The shared helper stored one reading and registered one IIO channel, so those fields never reached sysfs.
Publish red, green, blue, and clear counts plus color temperature on aop-sensors-als when the part is the CT720. Color is accepted only when both integration-time copies match, are non-zero, and are at most 10000000. A report that fails that gate still publishes lux and clears a stale color sample. VD6286, CT817, and the lid-angle sensor stay on their single channel through the default decode path.
The helper publishes the slots with a seqlock. A reader that keeps colliding with the writer returns EAGAIN instead of spinning on the same CPU.
Checked against three captured J313 reports with an offline mirror of the integer conversion.
Session build, Monday 26 Oct 2026 05:02 PM -03: linux-aurora 7.2.11-6-2-ARCH (package 7.2.11.aurora6-2), branch local/j313-test at 7638df0. makepkg exited 0. rustc 1.85.0, LLVM/clang 18.1.8. This machine is running that kernel. The stacked commit compiled in was f368523. This pull request's earlier head was 2e02efd, which is not the commit that was built.
Channels were read on 7.2.11-6-2-ARCH: uncovered red 6, green 5, blue 1, clear 14; covered clear 11; flashlight red 482, green 784, blue 507, clear 1786.
Follow-up, not hardware-tested
9c4c6c83dd21publishes color temperature only when the clear count is at least 12. Below that it returns-ENODATAfor CCT and still publishes red, green, blue, and clear. Covered clear 11 is below the threshold; uncovered clear 14 is not. The near-darkness temperatures this is meant to drop are 788 K, 1288 K, 2904 K, and 6781 K.The
validmask is replaced by each report, not OR-ed. A CT720 report that fails the layout check contributes only the lux bit, so the previous color sample reads back asENODATA. A zero mask never reaches that store, so a report with no reading keeps the last sample. That replace was checked and left as designed.The clear-count threshold is not hardware-tested.