Skip to content

iPhone XS family: the touchscreen (apple_hidspi_ts XS variant) - #111

Merged
henrikklee merged 3 commits into
mainfrom
a12-xs-touch
Dec 2, 2026
Merged

henrikklee merged 3 commits into
mainfrom
a12-xs-touch

Conversation

@henrikklee

Copy link
Copy Markdown

What it gives: touch on the iPhone XS (d321), XS Max China (d331) and XS Max (d331p). Nothing has run on an XS yet.

Their touch controller is the iPhone X's (ADT hid-transport,k1, hbpp 0x105, same SPI config, Acorn PMU supply, PMGR touch clock at 24 MHz), wired like the XR's SPI1. So an ahts_xs variant of the iPhone X's in apple_hidspi_ts (requires the firmware's surface descriptor instead of the X's measured fallback), the Acorn PMU at i2c3 0x2a with its touch regulator and the touchscreen in t8020-xs.dtsi (4 MHz, IRQ AOP 19, reset AP 5, alias touchscreen0 for m1n1's calibration), per-board compatible, firmware name and size. badapple's XS Max description agrees on pins, supply and speed; none of its apple-mt-spi code is used, so all commits are Henrik's.

Checked: full apple-16k kernel build for d331p, no warnings; all A12 DTBs compile; orchard test_source_* pass. First XS test should check orientation (badapple flips y in its own touch units).

… Max

The iPhone XS (D321) and XS Max (D331, D331p) carry the iPhone X's
touch controller ("hid-transport,k1", hbpp-version 0x105, the same SPI
configuration and Acorn power_ana in their ADTs). Give each board its
compatible with the iPhone X's as the fallback.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
Their ADTs describe the iPhone X's controller: "hid-transport,k1",
hbpp-version 0x105, the same SPI configuration, the analog supply from
the Acorn display PMU and the PMGR touch clock. Drive them as the iPhone
X, in SPI mode 3 with its 200 us CS delay, and require the firmware's
surface descriptor instead of the iPhone X's measured fallback; the
device tree gives the panel's size. Their firmware is loaded as
apple/<board>-touch-<personality>.bin (C1R1FC0,2 and C1R1FC0,3 on the
XS, C1R1FC1,1 on both XS Max). kieroid's badapple drives the XS Max with
the same pins, supply and 4 MHz clock.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
Describe the XS family's touch controller from their ADTs (d321ap,
d331ap, d331pap: /arm-io/spi1/multi-touch, alike on all three): SPI1
with chip select AP GPIO 67, reset AP GPIO 5, interrupt AOP GPIO 19
(level low), the PMGR touch clock, and the analog supply from the Acorn
display PMU at I2C3 0x2a, as on the iPhone X. Each board names its
firmware and its panel's size; touchscreen0 lets m1n1 pass the unit's
calibration and personality.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
@henrikklee
henrikklee merged commit 022f193 into main Dec 2, 2026
4 checks passed
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.

1 participant