Skip to content

iio: aop_las: stop the lid angle reports for system sleep - #2223

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/aop-las-sleep
Nov 19, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/aop-las-sleep

Conversation

@m0d16l14n1

Copy link
Copy Markdown
Contributor

The AOP firmware streams the lid angle at its own interval whether anyone reads it or not. The AOP mailbox interrupt stays enabled in suspend-to-idle, so every report ends the CPUs' idle period.

On the J815 (MacBook Air 15" M5), a 4 h lid-closed s2idle left the freeze loop 14478 times, once every 0.999 s:

  • 14413 AOP mailbox interrupts;
  • 14551 RTKit receive works.

The device-motion service already stops its reports for sleep, and the light sensor's equivalent is #1876. The lid angle is the AOP stream left running.

Change: a PM notifier, as aop_devmotion has:

  • at suspend, it reads the interval the firmware runs at, then sets it to 0;
  • at resume, it writes the interval back.

A service that refuses the read is left alone. Lid open and close reach the kernel from the SMC, not from this sensor, so a sleeping system still wakes on the lid.

Tested on J815 in the deep-sleep builds since 2026-11-15: the lid-angle reports stop at the sleep and come back at the wake, and the lid still wakes the machine.

  • checkpatch --strict and rustfmt clean.
  • Builds with W=1 on integration/aurora 0abc2f3.

Part of the J815 bring-up; board results are summarised in discussion #135.

🤖 Generated with Claude Code

The firmware streams the lid angle at its own interval whether anyone
reads it or not, and the AOP mailbox interrupt stays enabled in suspend-
to-idle, so every report ends the CPUs' idle period. On the J815
(MacBook Air 15-inch, M5), a 4 h lid-closed s2idle left the freeze loop
14478 times, once every 0.999 s, matched by 14413 AOP mailbox interrupts
and 14551 RTKit receive works. The device-motion service already stops
its reports for sleep, and the light sensor's equivalent is aurora-silicon#1876; the
lid angle is the AOP stream left running.

Read the interval the firmware runs at when the system sleeps, set it to
0, and write it back when the system wakes, from a PM notifier as
aop_devmotion does. A service that refuses the read is left alone. Lid
open and close reach the kernel from the SMC, not from this sensor, so a
sleeping system still wakes on the lid.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
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.

2 participants