From 990f8c78d5132d30e4f37e3043a29b53298d4845 Mon Sep 17 00:00:00 2001 From: ricktav <82380971+ricktav@users.noreply.github.com> Date: Fri, 4 Dec 2026 22:18:38 +0000 Subject: [PATCH 1/2] arm64: dts: apple: n66: Enable the cameras on both iPhone 6s Plus models The iPhone 6s Plus (N66, N66m) wires its cameras as the iPhone 6s does: the D2255 camera rails cam_avdd (pmuL 0x208) and cam0 (0x215), the second analog supply on AP GPIO 194, rear and front shutdown on GPIOs 48 and 52, the clock pads 49 and 53 and the torch enable on 74. Only the ADT sensor-type differs, 0x82 instead of 0x88. The rear camera also has optical stabilisation (ADT has-sphere, sphere_buck_mode on GPIO 111, focus_subdev on GPIO 47). The firmware drives it, and the driver leaves those lines alone. Add the ISP board part to s800x-n66.dtsi, which both models include. The values come from the iOS 15.8.8 device trees of both models, which agree. Tested on an N66 (Samsung): the firmware reports the iPhone 6s sensors (rear 0x247, front 0x190). The rear camera streams 1920x1080 NV12 at 30 fps, the front one 1024x720 and 1280x720, and the images are correct. Over repeated streams of both, the kernel log stays clean. Signed-off-by: ricktav <82380971+ricktav@users.noreply.github.com> Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 --- arch/arm64/boot/dts/apple/s800x-n66.dtsi | 71 ++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/arch/arm64/boot/dts/apple/s800x-n66.dtsi b/arch/arm64/boot/dts/apple/s800x-n66.dtsi index c064335deabc6a..ad474df26e04fb 100644 --- a/arch/arm64/boot/dts/apple/s800x-n66.dtsi +++ b/arch/arm64/boot/dts/apple/s800x-n66.dtsi @@ -27,3 +27,74 @@ &wifi0 { brcm,board-type = "apple,pinotnoir"; }; + +/* + * The cameras (ADT isp, sensor-type 0x82), the same on the Samsung and TSMC + * models and wired as on the iPhone 6s (N71): rails cam_avdd_ldo pmuL(0x208), + * cam_avdd_gpio AP GPIO 194, cam0_ldo pmuL(0x215); firmware channel 0 is the + * rear camera (shutdown GPIO 48, clock pad 49, reference clock 0), channel 1 + * the front one (GPIO 52, pad 53, reference clock 1); torch GPIO 74. The 6s + * Plus adds the rear camera's optical stabiliser (ADT has-sphere, + * function-sphere_buck_mode GPIO 111, function-focus_subdev GPIO 47), which + * the firmware drives; the driver does not touch those lines. + */ +/ { + cam_avdd2: regulator-cam-avdd2 { + compatible = "regulator-fixed"; + regulator-name = "cam-avdd2"; + gpio = <&pinctrl_ap 194 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&i2c0 { + pmic@74 { + cam_avdd: regulator-cam-avdd { + compatible = "apple,antigua-cam-avdd-regulator"; + regulator-name = "cam-avdd"; + }; + + cam0: regulator-cam0 { + compatible = "apple,antigua-cam0-regulator"; + regulator-name = "cam0"; + }; + }; +}; + +&pinctrl_ap { + /* ADT isp function-sensor_extclk and _extclk2 */ + isp_refclk_gpio: isp-refclk-gpio-pins { + pinmux = , + ; + }; + + isp_refclk_f1: isp-refclk-f1-pins { + pinmux = , + ; + }; + + isp_refclk_f2: isp-refclk-f2-pins { + pinmux = , + ; + }; +}; + +&isp { + cam-avdd-supply = <&cam_avdd>; + cam-avdd2-supply = <&cam_avdd2>; + cam0-supply = <&cam0>; + rear-shutdown-gpios = <&pinctrl_ap 48 GPIO_ACTIVE_HIGH>; + front-shutdown-gpios = <&pinctrl_ap 52 GPIO_ACTIVE_HIGH>; + strobe-gpios = <&pinctrl_ap 74 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default", "func1", "func2"; + pinctrl-0 = <&isp_refclk_gpio>; + pinctrl-1 = <&isp_refclk_f1>; + pinctrl-2 = <&isp_refclk_f2>; + apple,platform-id = <0x82>; + firmware-name = "apple/isp-s8000.bin"; + status = "okay"; +}; + +&dart_isp { + status = "okay"; +}; From f79aeaf519adcb80fe6851636b8ca9f6bb4a6dd7 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Sat, 5 Dec 2026 08:38:33 +0800 Subject: [PATCH 2/2] arm64: dts: apple: s800x-6s: Share the camera wiring of the 6s and 6s Plus The iPhone 6s (N71, N71m) and 6s Plus (N66, N66m) wire their cameras the same way: rails, shutdown GPIOs, reference clock pads, torch line, firmware and DART. Only the ADT sensor-type differs, 0x88 on the 6s and 0x82 on the 6s Plus. Move the shared part into s800x-6s.dtsi, which both models include, and keep only apple,platform-id in each model file. The compiled device trees of all four boards are unchanged. Assisted-by: LLM Signed-off-by: Henrik Klee --- arch/arm64/boot/dts/apple/s800x-6s.dtsi | 68 +++++++++++++++++++++++ arch/arm64/boot/dts/apple/s800x-n66.dtsi | 69 ++---------------------- arch/arm64/boot/dts/apple/s800x-n71.dtsi | 65 +--------------------- 3 files changed, 73 insertions(+), 129 deletions(-) diff --git a/arch/arm64/boot/dts/apple/s800x-6s.dtsi b/arch/arm64/boot/dts/apple/s800x-6s.dtsi index 2730e4e33ae4c9..c5224126cb8b4b 100644 --- a/arch/arm64/boot/dts/apple/s800x-6s.dtsi +++ b/arch/arm64/boot/dts/apple/s800x-6s.dtsi @@ -332,3 +332,71 @@ apple,always-on; apple,manual-pm; }; + +/* + * The cameras (ADT isp), wired the same on the iPhone 6s and 6s Plus and on + * their Samsung and TSMC models. Rails: cam_avdd_ldo pmuL(0x208), + * cam_avdd_gpio AP GPIO 194, cam0_ldo pmuL(0x215). Firmware channel 0 is the + * rear camera (shutdown GPIO 48, clock pad 49, reference clock 0), channel 1 + * the front one (GPIO 52, pad 53, reference clock 1); torch GPIO 74. Each + * model sets its ADT sensor-type as apple,platform-id. + */ +/ { + cam_avdd2: regulator-cam-avdd2 { + compatible = "regulator-fixed"; + regulator-name = "cam-avdd2"; + gpio = <&pinctrl_ap 194 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&i2c0 { + pmic@74 { + cam_avdd: regulator-cam-avdd { + compatible = "apple,antigua-cam-avdd-regulator"; + regulator-name = "cam-avdd"; + }; + + cam0: regulator-cam0 { + compatible = "apple,antigua-cam0-regulator"; + regulator-name = "cam0"; + }; + }; +}; + +&pinctrl_ap { + /* ADT isp function-sensor_extclk and _extclk2 */ + isp_refclk_gpio: isp-refclk-gpio-pins { + pinmux = , + ; + }; + + isp_refclk_f1: isp-refclk-f1-pins { + pinmux = , + ; + }; + + isp_refclk_f2: isp-refclk-f2-pins { + pinmux = , + ; + }; +}; + +&isp { + cam-avdd-supply = <&cam_avdd>; + cam-avdd2-supply = <&cam_avdd2>; + cam0-supply = <&cam0>; + rear-shutdown-gpios = <&pinctrl_ap 48 GPIO_ACTIVE_HIGH>; + front-shutdown-gpios = <&pinctrl_ap 52 GPIO_ACTIVE_HIGH>; + strobe-gpios = <&pinctrl_ap 74 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default", "func1", "func2"; + pinctrl-0 = <&isp_refclk_gpio>; + pinctrl-1 = <&isp_refclk_f1>; + pinctrl-2 = <&isp_refclk_f2>; + firmware-name = "apple/isp-s8000.bin"; + status = "okay"; +}; + +&dart_isp { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/s800x-n66.dtsi b/arch/arm64/boot/dts/apple/s800x-n66.dtsi index ad474df26e04fb..fc1b19296097e2 100644 --- a/arch/arm64/boot/dts/apple/s800x-n66.dtsi +++ b/arch/arm64/boot/dts/apple/s800x-n66.dtsi @@ -29,72 +29,11 @@ }; /* - * The cameras (ADT isp, sensor-type 0x82), the same on the Samsung and TSMC - * models and wired as on the iPhone 6s (N71): rails cam_avdd_ldo pmuL(0x208), - * cam_avdd_gpio AP GPIO 194, cam0_ldo pmuL(0x215); firmware channel 0 is the - * rear camera (shutdown GPIO 48, clock pad 49, reference clock 0), channel 1 - * the front one (GPIO 52, pad 53, reference clock 1); torch GPIO 74. The 6s - * Plus adds the rear camera's optical stabiliser (ADT has-sphere, - * function-sphere_buck_mode GPIO 111, function-focus_subdev GPIO 47), which - * the firmware drives; the driver does not touch those lines. + * The cameras: ADT isp sensor-type. The 6s Plus adds the rear camera's + * optical stabiliser (ADT has-sphere, function-sphere_buck_mode GPIO 111, + * function-focus_subdev GPIO 47), which the firmware drives; the driver does + * not touch those lines. */ -/ { - cam_avdd2: regulator-cam-avdd2 { - compatible = "regulator-fixed"; - regulator-name = "cam-avdd2"; - gpio = <&pinctrl_ap 194 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; -}; - -&i2c0 { - pmic@74 { - cam_avdd: regulator-cam-avdd { - compatible = "apple,antigua-cam-avdd-regulator"; - regulator-name = "cam-avdd"; - }; - - cam0: regulator-cam0 { - compatible = "apple,antigua-cam0-regulator"; - regulator-name = "cam0"; - }; - }; -}; - -&pinctrl_ap { - /* ADT isp function-sensor_extclk and _extclk2 */ - isp_refclk_gpio: isp-refclk-gpio-pins { - pinmux = , - ; - }; - - isp_refclk_f1: isp-refclk-f1-pins { - pinmux = , - ; - }; - - isp_refclk_f2: isp-refclk-f2-pins { - pinmux = , - ; - }; -}; - &isp { - cam-avdd-supply = <&cam_avdd>; - cam-avdd2-supply = <&cam_avdd2>; - cam0-supply = <&cam0>; - rear-shutdown-gpios = <&pinctrl_ap 48 GPIO_ACTIVE_HIGH>; - front-shutdown-gpios = <&pinctrl_ap 52 GPIO_ACTIVE_HIGH>; - strobe-gpios = <&pinctrl_ap 74 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default", "func1", "func2"; - pinctrl-0 = <&isp_refclk_gpio>; - pinctrl-1 = <&isp_refclk_f1>; - pinctrl-2 = <&isp_refclk_f2>; apple,platform-id = <0x82>; - firmware-name = "apple/isp-s8000.bin"; - status = "okay"; -}; - -&dart_isp { - status = "okay"; }; diff --git a/arch/arm64/boot/dts/apple/s800x-n71.dtsi b/arch/arm64/boot/dts/apple/s800x-n71.dtsi index 81b92c4f81a456..e814e103bcfa02 100644 --- a/arch/arm64/boot/dts/apple/s800x-n71.dtsi +++ b/arch/arm64/boot/dts/apple/s800x-n71.dtsi @@ -28,70 +28,7 @@ brcm,board-type = "apple,albarossa"; }; -/* - * The cameras (ADT isp, sensor-type 0x88), the same on the Samsung and TSMC - * models. Rails: cam_avdd_ldo pmuL(0x208), cam_avdd_gpio AP GPIO 194, - * cam0_ldo pmuL(0x215). Firmware channel 0 is the rear camera (shutdown - * GPIO 48, clock pad 49, reference clock 0), channel 1 the front one - * (GPIO 52, pad 53, reference clock 1). - */ -/ { - cam_avdd2: regulator-cam-avdd2 { - compatible = "regulator-fixed"; - regulator-name = "cam-avdd2"; - gpio = <&pinctrl_ap 194 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; -}; - -&i2c0 { - pmic@74 { - cam_avdd: regulator-cam-avdd { - compatible = "apple,antigua-cam-avdd-regulator"; - regulator-name = "cam-avdd"; - }; - - cam0: regulator-cam0 { - compatible = "apple,antigua-cam0-regulator"; - regulator-name = "cam0"; - }; - }; -}; - -&pinctrl_ap { - /* ADT isp function-sensor_extclk and _extclk2 */ - isp_refclk_gpio: isp-refclk-gpio-pins { - pinmux = , - ; - }; - - isp_refclk_f1: isp-refclk-f1-pins { - pinmux = , - ; - }; - - isp_refclk_f2: isp-refclk-f2-pins { - pinmux = , - ; - }; -}; - +/* The cameras: ADT isp sensor-type */ &isp { - cam-avdd-supply = <&cam_avdd>; - cam-avdd2-supply = <&cam_avdd2>; - cam0-supply = <&cam0>; - rear-shutdown-gpios = <&pinctrl_ap 48 GPIO_ACTIVE_HIGH>; - front-shutdown-gpios = <&pinctrl_ap 52 GPIO_ACTIVE_HIGH>; - strobe-gpios = <&pinctrl_ap 74 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default", "func1", "func2"; - pinctrl-0 = <&isp_refclk_gpio>; - pinctrl-1 = <&isp_refclk_f1>; - pinctrl-2 = <&isp_refclk_f2>; apple,platform-id = <0x88>; - firmware-name = "apple/isp-s8000.bin"; - status = "okay"; -}; - -&dart_isp { - status = "okay"; };