Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= <brkosebay@users.noreply.github.com>
Date: Tue, 10 Nov 2026 17:27:23 +0000
Subject: [PATCH] arm64: dts: apple: ipad5: Wake from sleep on the Smart Cover

PMIC GPIO lines 0 and 10 are the Smart Cover hall sensors. Their events,
0x30 and 0x3a, latch while the iPad sleeps; list them as wake-only so
that opening the cover wakes the iPad. The polled switches are
unchanged: lines 0 and 10 are already outside gpio-reserved-ranges.

[Orchard: from orchard PR #118, commit e8b5e4b7; moved from the J71t
board file to the shared iPad 5 file, so every iPad 5 model has it]

Assisted-by: LLM
---
diff --git a/arch/arm64/boot/dts/apple/s800x-ipad5.dtsi b/arch/arm64/boot/dts/apple/s800x-ipad5.dtsi
index 2ce40b4..fc06d53 100644
--- a/arch/arm64/boot/dts/apple/s800x-ipad5.dtsi
+++ b/arch/arm64/boot/dts/apple/s800x-ipad5.dtsi
@@ -182,6 +182,8 @@
interrupt-controller;
#interrupt-cells = <2>;
interrupts-extended = <&pinctrl_ap 76 IRQ_TYPE_LEVEL_LOW>;
+ /* Smart Cover hall sensors (lines 0 and 10): wake only. */
+ apple,wake-events = <0x30 0x3a>;
};

tristar_charger: charger@180 {
--
2.54.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Henrik Klee <henrik@goat-code.com>
Date: Fri, 13 Nov 2026 05:00:00 +0800
Subject: [PATCH] arm64: dts: apple: ipad6: Add the Smart Cover

The iPad 6 has the iPad 5's Smart Cover hall sensors on the same PMIC
lines: Apple's device tree for both boards names PMIC GPIO 0
"halleffect" and GPIO 10 "halleffect1" (/arm-io/i2c0/pmu event names,
/buttons function-button_halleffect{,1} with the same flags). Describe
them as on the iPad 5: two polled SW_MACHINE_COVER switches,
the two lines taken out of the reserved ranges, and their events 0x30
and 0x3a as wake-only, so that opening the cover wakes the iPad.

Measured on a J71b by reading the PMIC input register (0x186): both
lines read 1 with the cover open and 0 with it closed, so the assumed
active-low polarity is right.

Assisted-by: LLM
---
diff --git a/arch/arm64/boot/dts/apple/t8010-ipad6.dtsi b/arch/arm64/boot/dts/apple/t8010-ipad6.dtsi
index cd4e184..d6ec2b6 100644
--- a/arch/arm64/boot/dts/apple/t8010-ipad6.dtsi
+++ b/arch/arm64/boot/dts/apple/t8010-ipad6.dtsi
@@ -59,6 +59,42 @@
};
};

+ /*
+ * Smart Cover hall sensors: PMIC GPIO 0 ("halleffect") and 10
+ * ("halleffect1") in the ADT /buttons node. Both read low while the
+ * cover is closed (measured on a J71b). Reported as
+ * SW_MACHINE_COVER, not as a lid switch, so that closing the cover
+ * doesn't suspend the system. Each line is its own device, so that
+ * one the PMIC keeps for itself can't take the other down.
+ */
+ smart-cover {
+ compatible = "gpio-keys-polled";
+ poll-interval = <50>;
+ label = "iPad Smart Cover";
+
+ cover-switch {
+ label = "Smart Cover (PMIC GPIO 0)";
+ gpios = <&pmu_gpio 0 GPIO_ACTIVE_LOW>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_MACHINE_COVER>;
+ debounce-interval = <50>;
+ };
+ };
+
+ smart-cover-aux {
+ compatible = "gpio-keys-polled";
+ poll-interval = <50>;
+ label = "iPad Smart Cover 2";
+
+ cover-switch {
+ label = "Smart Cover (PMIC GPIO 10)";
+ gpios = <&pmu_gpio 10 GPIO_ACTIVE_LOW>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_MACHINE_COVER>;
+ debounce-interval = <50>;
+ };
+ };
+
battery_info: battery {
compatible = "simple-battery";
charge-full-design-microamp-hours = <8827000>;
@@ -136,10 +172,12 @@
compatible = "apple,d2365-pmic-gpio";
gpio-controller;
#gpio-cells = <2>;
- gpio-reserved-ranges = <0 13>, <15 9>;
+ gpio-reserved-ranges = <1 9>, <11 2>, <15 9>;
interrupt-controller;
#interrupt-cells = <2>;
interrupts-extended = <&pinctrl_ap 38 IRQ_TYPE_LEVEL_LOW>;
+ /* Smart Cover hall sensors (lines 0 and 10): wake only. */
+ apple,wake-events = <0x30 0x3a>;
};

rtc@500 {
--
2.54.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Berkay=20K=C3=B6sebay?= <brkosebay@users.noreply.github.com>
Date: Tue, 10 Nov 2026 17:27:23 +0000
Subject: [PATCH] dt-bindings: gpio: apple,d2365-pmic-gpio: Describe wake-only
events

Add apple,wake-events: GPIO events (0x30 plus the line) that end system
sleep and have no interrupt consumer, such as the iPad Smart Cover hall
sensors on lines 0 and 10. A hall sensor that is unmasked while the
system is awake drives the PMU line on every change of the magnet field,
so these events are unmasked only for the duration of a sleep and cannot
be mapped as interrupts. Only the D2365 has the event controller they
need.

[Orchard: from orchard PR #118, commit e8b5e4b7; example text names
every iPad with the cover, not only the iPad 5]

Assisted-by: LLM
---
diff --git a/Documentation/devicetree/bindings/gpio/apple,d2365-pmic-gpio.yaml b/Documentation/devicetree/bindings/gpio/apple,d2365-pmic-gpio.yaml
index c1cae13..a962bb0 100644
--- a/Documentation/devicetree/bindings/gpio/apple,d2365-pmic-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/apple,d2365-pmic-gpio.yaml
@@ -54,6 +54,21 @@ properties:
maxItems: 1
description: PMU event output of the PMIC, active low.

+ apple,wake-events:
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ minItems: 1
+ maxItems: 24
+ items:
+ minimum: 0x30
+ maximum: 0x47
+ description: |
+ GPIO events (0x30 plus the line number) that end system sleep and have
+ no interrupt consumer, such as the iPad Smart Cover hall sensors on
+ lines 0 and 10 (events 0x30 and 0x3a). They stay masked while the
+ system is awake, where the line is read through the GPIO instead, and
+ are unmasked only while it sleeps: a hall sensor drives the PMU line on
+ every change of the magnet field. They cannot be mapped as interrupts.
+
required:
- compatible
- gpio-controller
@@ -61,6 +76,7 @@ required:

dependencies:
interrupt-controller: ["#interrupt-cells"]
+ apple,wake-events: [interrupt-controller]

allOf:
- if:
@@ -74,6 +90,7 @@ allOf:
interrupt-controller: false
"#interrupt-cells": false
interrupts: false
+ apple,wake-events: false

additionalProperties: false

@@ -92,6 +109,7 @@ examples:
#interrupt-cells = <2>;
interrupt-controller;
interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
+ apple,wake-events = <0x30 0x3a>;
};
};
...
--
2.54.0
Loading
Loading