Skip to content

iio: aop_sensors: publish the CT720 color channels - #2155

Open
scottjones wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
scottjones:upstream/aop-ct720-color
Open

scottjones wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
scottjones:upstream/aop-ct720-color

Conversation

@scottjones

Copy link
Copy Markdown
Contributor

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

  • Built on integration/aurora a7dd26e6d60e with the 7.3 package config, LLVM 18 and Rust 1.85:
    • make W=1 rust/ drivers/iio/common/aop_sensors/: builds
    • W=1: no warnings the base does not have
    • run-host-tests.py: every tools/asahi test is registered
    • tools/asahi host tests (control and mutation runs): aop-als-channel-tests 1/1
    • Stacked with the other 12 PRs on the same base, the full kernel, modules and DTBs build and package (linux-aurora 7.3.0-0testastip2-1-ARCH, 137 DTBs).
  • Booted as part of the full set: a kernel built from integration/aurora a7dd26e6 plus 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.
  • Checked against three captured J313 reports with an offline copy of the conversion; not run on hardware (from the commit message). The aop-als-channel host test is extended.

Merge Danger

Door: two-way

Blast Radius: ambient light

CT720 ambient-light sensors only.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant