From b0b67894dd7c3a4fabbc02fb1061d057ffdbb49c Mon Sep 17 00:00:00 2001 From: Ali Reay Date: Fri, 4 Dec 2026 06:03:10 +0000 Subject: [PATCH] ARM: dts: apple: ipad3: Add I2C1 and I2C2 sensor buses Describe i2c1 and i2c2 and their IIO sensors in the shared iPad 3 device tree (s5l8945x-ipad3.dtsi, shared by J1, J2 and J2A) from the 13G37 ADT: - i2c1 (0x3300000, IRQ 19, pins gpio101/gpio102, PMGR 0x3f101138): - AKM AK8975B compass at 0x0e (asahi-kasei,ak8975; WIA 0x48) - i2c2 (0x3400000, IRQ 20, pins gpio80/gpio81, PMGR 0x3f10113c): - ST LIS331DLH 3-axis accelerometer at 0x19 (st,lis331dlh-accel; WHO_AM_I 0x32) - TAOS TSL2581 ambient light sensor at 0x39 (amstaos,tsl2581; ID 0x93) - ST L3G4200D 3-axis gyroscope at 0x68 (st,l3g4200d-gyro; WHO_AM_I 0xd3; the ADT's alternate gyro1 at 0x6a is unpopulated on the tested unit) All four drivers are already enabled in orchard_applearmv7_defconfig (IIO_ST_ACCEL_3AXIS=y, AK8975=y, IIO_ST_GYRO_3AXIS=m, TSL2583=m). Tested on a 64 GB iPad 3 GSM (iPad3,3 / J2A) booted via kloader + kDFU from iOS 8.4.1 (12H321): all four IIO devices probed cleanly with live readings, and all three DTBs (s5l8945x-j1, -j2, -j2a) build cleanly with W=1. Signed-off-by: Ali Reay --- arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi | 74 +++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi b/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi index 4a843cf7f0ce18..5ffeb40a449486 100644 --- a/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi +++ b/arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi @@ -264,6 +264,18 @@ pins = "gpio86", "gpio87", "gpio88", "gpio89"; function = "periph"; }; + + /* ADT i2c1 function-iic_sda/scl: 0xc05 = 101, 0xc06 = 102. */ + i2c1_pins: i2c1-pins { + pins = "gpio101", "gpio102"; + function = "periph"; + }; + + /* ADT i2c2 function-iic_sda/scl: 0xa00 = 80, 0xa01 = 81. */ + i2c2_pins: i2c2-pins { + pins = "gpio80", "gpio81"; + function = "periph"; + }; }; /* SPI1's power-state switch. The pmgr node's device-clocks @@ -498,6 +510,68 @@ }; }; + /* + * ADT /arm-io/i2c1: i2c,s5l8945x, irq 19 (0x13), clock-gates 0x51 + * (PMGR 0x3f101138, measured 0x2ff from boot). Carries the AK8975B + * compass (0x0e, WIA 0x48) and AD7147A proximity sensor (0x2c). + */ + i2c1: i2c@3300000 { + compatible = "apple,s5l8940x-i2c"; + reg = <0x3300000 0x1000>; + clock-frequency = <100000>; + interrupts = <19>; + clocks = <&uart_clk>; + clock-names = "i2c"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + compass@e { + compatible = "asahi-kasei,ak8975"; + reg = <0x0e>; + }; + }; + + /* + * ADT /arm-io/i2c2: i2c,s5l8945x, irq 20 (0x14), clock-gates 0x52 + * (PMGR 0x3f10113c, measured 0x2ff from boot). Carries the motion + * sensors and ambient light sensor: + * - accelerometer,lis331dlh at 0x19 (WHO_AM_I 0x32) + * - als,tsl2581 at 0x39 (ID 0x93) + * - gyro,ap3gdl at 0x68 (WHO_AM_I 0xd3, ST L3G4200D; ADT also + * lists gyro1 at 0x6a, unpopulated on the tested J2A unit) + */ + i2c2: i2c@3400000 { + compatible = "apple,s5l8940x-i2c"; + reg = <0x3400000 0x1000>; + clock-frequency = <100000>; + interrupts = <20>; + clocks = <&uart_clk>; + clock-names = "i2c"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + accelerometer@19 { + compatible = "st,lis331dlh-accel"; + reg = <0x19>; + }; + + als@39 { + compatible = "amstaos,tsl2581"; + reg = <0x39>; + }; + + gyro@68 { + compatible = "st,l3g4200d-gyro"; + reg = <0x68>; + }; + }; + /* ADT /arm-io/spi1: spi-1,samsung, irq 29, clock-gates 68. */ spi1: spi@2100000 { compatible = "apple,s5l8940x-spi";