From a054b8bc04f61deab78d1fbc6ef17abebf172cc2 Mon Sep 17 00:00:00 2001 From: Alistair Reay Date: Fri, 4 Dec 2026 10:13:19 +0000 Subject: [PATCH 1/2] ARM: dts: apple: ipad3: Add GPIO buttons and side switch 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 --- arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi | 51 +++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi b/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi index 5ffeb40a449486..fe57216978aa99 100644 --- a/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi +++ b/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi @@ -170,6 +170,57 @@ clock-frequency = <24000000>; }; + /* + * ADT /buttons: menu (Home) 0x0404 = 36, hold (Power) 0x0405 = 37, + * volup 0x0700 = 56, voldown 0x0602 = 50, ringerab (Side Switch) + * 0x0003 = 3, all active low. Same key codes as k93 and p105. + * The Smart Cover's hall-effect switch is PMU GPIO 14 (not wired + * as a Linux GPIO IRQ yet). + */ + gpio-keys { + compatible = "gpio-keys"; + autorepeat; + + home { + label = "Home"; + gpios = <&gpio 36 1>; + linux,code = <172>; /* KEY_HOMEPAGE */ + debounce-interval = <20>; + }; + + hold { + label = "Hold"; + gpios = <&gpio 37 1>; + linux,code = <116>; /* KEY_POWER */ + debounce-interval = <20>; + }; + + volume-up { + label = "Volume Up"; + gpios = <&gpio 56 1>; + linux,code = <115>; /* KEY_VOLUMEUP */ + debounce-interval = <20>; + }; + + volume-down { + label = "Volume Down"; + gpios = <&gpio 50 1>; + linux,code = <114>; /* KEY_VOLUMEDOWN */ + debounce-interval = <20>; + }; + }; + + gpio-keys-switch { + compatible = "gpio-keys"; + + side-switch { + label = "Side Switch"; + gpios = <&gpio 3 1>; + linux,code = <113>; /* KEY_MUTE, held while on silent */ + debounce-interval = <50>; + }; + }; + soc: soc@30000000 { compatible = "simple-bus"; #address-cells = <1>; From 40c6e592c4ec598c83610e9d7b204a465cf4d688 Mon Sep 17 00:00:00 2001 From: Alistair Reay Date: Fri, 4 Dec 2026 16:15:35 +0000 Subject: [PATCH 2/2] ARM: dts: apple: ipad3: Mark Home and Hold buttons as wakeup sources 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 --- arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi b/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi index fe57216978aa99..991b48274d5d29 100644 --- a/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi +++ b/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi @@ -186,6 +186,7 @@ gpios = <&gpio 36 1>; linux,code = <172>; /* KEY_HOMEPAGE */ debounce-interval = <20>; + wakeup-source; }; hold { @@ -193,6 +194,7 @@ gpios = <&gpio 37 1>; linux,code = <116>; /* KEY_POWER */ debounce-interval = <20>; + wakeup-source; }; volume-up {