Repository navigation
iio: aop_sensors: bind als-temp and devmotion6 wherever the AOP offers them - #2264
Conversation
…s them The AOP core creates a platform device for every sensor service its firmware announces, named after the service. The als-temp and devmotion6 drivers only matched the device tree compatibles "apple,aop-als-temp" and "apple,aop-devmotion6", and only the T6040/T6041 and T8132 device trees describe those services. On the M1 Pro (T6000) and the M2 (T8112) the firmware announces both services, so als-temp.N.auto and devmotion6.N.auto are created, but nothing binds to them. Register each platform driver under the name of its AOP service. The platform bus then binds it by name to the device the AOP core created, so the firmware's announcement of the service decides whether the driver binds, not a list of device trees. The module aliases change to the device's modalias (platform:als-temp, platform:devmotion6) so that the module loads automatically. The OF match tables stay, so machines whose device tree describes the services bind as before. devmotion6 needs nothing from the device tree. The temperature sensor reads optional calibration from its node; without a node it now uses the sensor defaults, which is what it does today when the bootloader supplies no calibration. The drivers and the T6040/T6041 description come from linux#1054 and linux#1247. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Claude Opus 5.5 on @satchlj's behalf. Hardware result on MacBook Air M2 (J413) on the macOS 27.2 (26B123) stub, with 🤖 Generated with Claude Code |
|
Claude Opus 5.5 on @satchlj's behalf: hardware run.
Build: phellos (MacBook Air M2, J413, macOS 27.2 / 26B123 stub), default rebuilt 2026-11-20 = linux |
|
No blockers. I checked that the AOP core creates each service device named after the service ( The M2 (J413) and M1 Pro (J316s) rows plus the J413 full-kernel run in the comments cover the new path on this head (d673241). It can leave draft.
HW row (regression, not required to merge): J616s on this head. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review against pre-pr-checklist.md (§1–§6) at verified live head d673241248d63397c6289274b54ddb4a7507457b: LGTM — approving.
Checklist Summary (§1–§6)
- §1 No model gating: Clean — replaces per-SoC DT-only binding with platform-bus name matching (
"devmotion6","als-temp") against the service devicesdrivers/soc/apple/aop.rscreates whenever AOP firmware announces the service. - §2–§3 Code & safety:
- Verified
rust/kernel/driver.rs(module_driver!) andrust/kernel/of.rs(of_device_table!): replacingmodule_platform_driver!withmodule!+driver::Registration::new(SERVICE_NAME, module)preservesOF_ID_TABLEandMODULE_DEVICE_TABLE(of, ...)while updating the platform modalias toplatform:devmotion6/platform:als-temp, so both OF-described (T6040/T6041/T8132) and node-less devices autoload and bind. - Verified
aop_devmotion.rsnever touchesdev.fwnode(), checksservice.is_null()before deref, and tears down PM/polling cleanly on unbind. - Verified
aop_temp.rshandlesdev.fwnode() == Nonecleanly inControl::new(), leaving calibration packets empty and selecting sensor defaults (calibration_state = 1) — identical to existing behavior when a DT node carries no calibration. No hardcoded calibration or safety values. IIO device names (aop-sensors-devmotion6,aop-sensors-als-temp) are unchanged.
- Verified
- §4 Clean-room & attribution: Clean — commit
d673241248d6carries human author/committer (Ryan Murray) and humanSigned-off-by:with zero AI trailers; PR body ends withAssisted-by:. - §5 Evidence & CI:
host-testsgreen and branch clean againstintegration/aurora. Node-less binding and live sensor streaming are proven atd6732412on both M2 (J413: insmod/rmmod live quaternion 47.57 Hz|q|^2 = 1.000000,als-temp20.000–20.062 °C, 0 kernel errors, plus full-kernel default-boot confirmation across two healthy boots) and M1 Pro (J316s: live quaternion 47.56 Hz|q|^2 = 1.000000,als-temp20.187 °C, clean rmmod). Non-blocking note: an OF-path regression check on J616s remains a good follow-up sanity check, though the OF match table and calibration path are unchanged. - §6 Naming: Clean.
Assisted-by: LLM (Gemini 4 Neon)
|
The AOP ambient-temperature and device-motion service matches are still needed. Head |
RyanTheTide
left a comment
There was a problem hiding this comment.
Review at d673241. No blockers. The platform registration names and module aliases match the names published by the AOP service, while the existing OF match tables remain in place. A missing firmware node uses the same empty calibration path as a node with no calibration. A supplied but malformed calibration still fails as before.
The exact-head J413 and J316s node-less binding rows cover both drivers. The current integration arm64 object-build receipt and the green host check cover the registration change. Keep the OF-backed J616s calibration row in the next shared fleet cut.
Problem. On every Mac whose AOP firmware announces the
als-tempanddevmotion6services, the AOP core createsals-temp.N.autoanddevmotion6.N.auto. The two drivers bind only through the compatiblesapple,aop-als-temp/apple,aop-devmotion6, and only the T6040/T6041 and T8132 device trees have those nodes. On the M1 Pro (T6000, j316s) and the M2 (T8112, j413), both devices are created but stay unbound.Change. Each driver now registers under its AOP service name. The platform bus binds it by name to the device the AOP core created for that service. So the firmware's service announcement decides whether the driver binds, and no per-SoC device tree list is needed. The module aliases become the device modaliases (
platform:als-temp,platform:devmotion6), so the modules load on their own. The OF tables stay, so T6040/T6041/T8132 bind as before.devmotion6needs nothing from DT.als-tempreads its optional calibration from the node when one exists and falls back to sensor defaults otherwise. That is also what it does today when the bootloader supplies no calibration. The drivers come from #1054/#1247.Testing. M2 (j413, 7.3.0-aurora-fleet74, no DT node for either service): both modules bind by name. devmotion6 streams at 47.57 Hz with |q|^2 = 1.000000. als-temp reads 20.0 C at 1 Hz. Unbind is clean. W=1 + CLIPPY are clean, and so are rustfmt and checkpatch --strict.
Still to run. J616s regression row (OF path, expected unchanged).
Old gate, hardware property, evidence per generation
apple,aop-als-temp/apple,aop-devmotion6child node of the AOP. Onlyt6040.dtsi,t6041-j614c-j616c.dtsiandt8132.dtsihad one.register_service()creates the device only for an announced service, named after it. With no announcement there is no device and nothing binds.als-temp.4.autoanddevmotion6.5.autohaddriver=noneandof_node=none. After insmod they are bound to driversals-tempanddevmotion6, and the IIO devicesaop-sensors-devmotion6andaop-sensors-als-tempappear. Buffered 10 s: 476 samples, 47.57 Hz, |q|^2 min/max/mean 1.000000. Raw quaternion (W,X,Y,Z Q30) 1073701504 -605297 9283776 5233, with the machine flat and still.in_temp_inputreads 20000, 20000, 20062, 20062, 20000 m°C at 1 Hz. rmmod is clean and both devices are unbound again. The kernel log shows no errors.als-temp.4.autoanddevmotion6.5.autoare present and unbound on 7.3.0-aurora-fleet74. With the change (insmod/rmmod, no reboot): both bound by name; devmotion6 476 samples in 10 s = 47.56 Hz, |q|^2 1.000000 min/max/mean; als-temp 20.187 C; rmmod clean.How it was built and tested
The test modules were built from this commit's two files as external modules against the 7.3.0-aurora-fleet74 build tree (same source commit and config as the running kernel). They were signed with that tree's key, then loaded on the running M2 with insmod and unloaded with rmmod. There was no reboot and no suspend. The integration/aurora tip has no changes in
drivers/iio/common/aop_sensors/since fleet74.Assisted-by: LLM (Claude:Opus 5.5)