Skip to content

iPad 3: Add GPIO buttons and side switch - #152

Merged
henrikklee merged 2 commits into
OrchardLinux:armv7from
alistairreay:ipad3-buttons
Dec 4, 2026
Merged

henrikklee merged 2 commits into
OrchardLinux:armv7from
alistairreay:ipad3-buttons

Conversation

@alistairreay

Copy link
Copy Markdown

Summary

Wires the iPad 3 physical buttons and side mute/rotation switch from the ADT /buttons node into gpio-keys and gpio-keys-switch in the shared arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi (covering J1, J2, and J2A):

Control ADT pin SoC GPIO Flags Key code
Home (menu) 0x0404 36 active low KEY_HOMEPAGE (172)
Hold (hold) 0x0405 37 active low KEY_POWER (116)
Volume Up (volup) 0x0700 56 active low KEY_VOLUMEUP (115)
Volume Down (voldown) 0x0602 50 active low KEY_VOLUMEDOWN (114)
Side Switch (ringerab) 0x0003 3 active low KEY_MUTE (113)

Matches the key codes and debounce/autorepeat conventions of s5l8940x-k93.dts and s5l8942x-p105.dts. (The Smart Cover Hall-effect switch is PMU GPIO 14 and is left noted in a comment until the PMU exposes a GPIO IRQ chip.)

Testing

  • Built s5l8945x-{j1,j2,j2a}.dtb cleanly on orchard_applearmv7_defconfig (zero warnings).
  • Verified live on a 64 GB iPad 3 (iPad3,3 / J2A):
    • All 5 GPIO edge IRQs registered (/proc/interrupts: GPIO 36, 37, 56, 50, 3) and exposed event1 (gpio-keys) and event2 (gpio-keys-switch).
    • Pressed and released every button and toggled the side switch while recording /dev/input/event1 and /dev/input/event2: confirmed KEY_HOMEPAGE, KEY_VOLUMEUP, KEY_VOLUMEDOWN (including autorepeat), KEY_POWER, and KEY_MUTE press/release events with clean debouncing.

Wire the iPad 3 physical buttons (Home, Hold/Power, Volume Up, Volume Down)
and side mute/rotation switch from the ADT /buttons node into gpio-keys and
gpio-keys-switch in the shared s5l8945x-ipad3.dtsi (covering J1, J2, J2A):
- menu (Home): GPIO 0x0404 (36), active low, KEY_HOMEPAGE (172)
- hold (Power): GPIO 0x0405 (37), active low, KEY_POWER (116)
- volup: GPIO 0x0700 (56), active low, KEY_VOLUMEUP (115)
- voldown: GPIO 0x0602 (50), active low, KEY_VOLUMEDOWN (114)
- ringerab (Side Switch): GPIO 0x0003 (3), active low, KEY_MUTE (113)

Signed-off-by: Alistair Reay <alistair.reay@gmail.com>
Mark Home (GPIO 36) and Hold/Power (GPIO 37) as wakeup-source so either button wakes the iPad 3 from s2idle sleep (live-verified as IRQ 57 and IRQ 58).

Signed-off-by: Alistair Reay <alistair.reay@gmail.com>
@henrikklee
henrikklee merged commit 139fd14 into OrchardLinux:armv7 Dec 4, 2026
3 checks passed
@henrikklee

Copy link
Copy Markdown

Thanks a lot, @alistairreay! Merged as is.

With this, every iPad 3 gets all five controls through the standard gpio-keys interface: Home, Power, volume up, volume down and the side switch. Marking Home and Power as wake sources matters for #161 (s2idle): those two buttons are what wakes the tablet from suspend, and we're adding the same marking to the other 32-bit boards there.

Nothing left out, no open follow-ups from this one.

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