Repository navigation
iPad 3: Add GPIO buttons and side switch - #152
Merged
Merged
Conversation
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>
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires the iPad 3 physical buttons and side mute/rotation switch from the ADT
/buttonsnode intogpio-keysandgpio-keys-switchin the sharedarch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi(covering J1, J2, and J2A):menu)0x040436KEY_HOMEPAGE(172)hold)0x040537KEY_POWER(116)volup)0x070056KEY_VOLUMEUP(115)voldown)0x060250KEY_VOLUMEDOWN(114)ringerab)0x00033KEY_MUTE(113)Matches the key codes and debounce/autorepeat conventions of
s5l8940x-k93.dtsands5l8942x-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
s5l8945x-{j1,j2,j2a}.dtbcleanly onorchard_applearmv7_defconfig(zero warnings).iPad3,3/ J2A):/proc/interrupts: GPIO 36, 37, 56, 50, 3) and exposedevent1(gpio-keys) andevent2(gpio-keys-switch)./dev/input/event1and/dev/input/event2: confirmedKEY_HOMEPAGE,KEY_VOLUMEUP,KEY_VOLUMEDOWN(including autorepeat),KEY_POWER, andKEY_MUTEpress/release events with clean debouncing.