Repository navigation
iio: aop_sensors: bind als-temp and devmotion6 wherever the AOP offers them - #2264
RyanTheTide wants to merge 1 commit into
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) |
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)