Repository navigation
iio: aop_sensors: publish the CT720 color channels - #2155
Open
scottjones wants to merge 1 commit into
Open
scottjones wants to merge 1 commit into
scottjones wants to merge 1 commit into
Conversation
The CT720 (FireFish2) report already carries four channel counts and a correlated color temperature beside the lux float at +0x1d. The driver registered one channel for that part, 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 the color channels then read ENODATA rather than a stale sample. VD6286, CT817, and the lid-angle sensor keep the channels they had. 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. Checked against three captured J313 reports with an offline mirror of the integer conversion. Not run on hardware. Based on a patch by Lucas Goossen (omacom/linux-aurora#220), commits b5677f7 and 88c4f98 there, rewritten for this tree. [7.3 base: rewritten on this tree's N-channel helper, which already publishes the VD6286's color temperature, in place of the seqlock slot table the original added. The helper gains a per-channel spec (modifier and info mask) for the four intensity channels, and a channel_withdrawn() hook so a report can take a channel's last reading back; the decode, the gates and the offsets are the original's. Each channel is published on its own, so a reader can see counts from two adjacent reports. aop-als-channel-tests.py covers the CT720 layout, the gates and six mutants. Built; not run on hardware.] Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Scott Jones <scottajones@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The CT720 report already carries red, green, blue and clear counts and a color temperature next to lux, but the driver registered only lux for that part. This publishes them on aop-sensors-als when the part is the CT720, gated on matching integration times. A report that fails the gate still publishes lux, and the color channels read ENODATA. Color temperature is published only when clear is at least 12. VD6286, CT817 and the lid-angle sensor keep the channels they had.
This is Lucas Goossen's patch (omacom/linux-aurora#220) rewritten for this tree's N-channel helper; the commit message says what changed in the rewrite.
Evidence
a7dd26e6d60ewith the 7.3 package config, LLVM 18 and Rust 1.85:make W=1 rust/ drivers/iio/common/aop_sensors/: buildsa7dd26e6plus all 13 branches of this set (before the three small fix-up commits) booted on an M3 MacBook Air (J613), a Neo (J700) and an M1 Pro with no regressions against their baselines (on the M1 Pro, only the checks already known to differ: GPU name and DRAM OPP), and a 25-minute GPU soak was clean on all three. No M3 Pro, M3 Max, J504, J615 or M4 Pro ran this kernel.Merge Danger
Door: two-way
Blast Radius: ambient light
CT720 ambient-light sensors only.
🤖 Generated with Claude Code