Skip to content

iPhone 7 Plus: the rear, telephoto and front cameras - #157

Merged
henrikklee merged 4 commits into
OrchardLinux:mainfrom
johnbeatty:iphone7plus-cameras
Dec 4, 2026
Merged

henrikklee merged 4 commits into
OrchardLinux:mainfrom
johnbeatty:iphone7plus-cameras

Conversation

@johnbeatty

Copy link
Copy Markdown

Enables the A10 camera ISP on the iPhone 7 Plus (Intel, t8010-d111) and adds its third camera, the telephoto. Builds on #86.

  • arm64: dts: apple: t8010: add the iPhone 7 Plus cameras
    • t8010-d111.dts gets the &isp block that d10/d101 have, with the 7 Plus's own platform id (0x91, from the ADT's sensor-type), the telephoto's tele-shutdown-gpios (GPIO 69) and apple,tele-camera.
    • t8010.dtsi adds pin 70, the telephoto's extclk, to the three isp_refclk_* states. Every iPhone 7 / 7 Plus ADT lists three clock pads (66, 70, 72). Without pin 70 the firmware reports No sensor found on channel 1.
  • media: apple: t8010_isp: add the telephoto camera: registers firmware channel 1 as a third V4L2 capture device when the board's &isp has apple,tele-camera, and names each node from its camera. d10/d101 keep their two nodes.

Tested on an iPhone 7 Plus (d111), booted in RAM and installed. The channel probe finds all three sensors (rear 0x303, telephoto 0x313, front 0x314). All three stream NV12 at 1920x1080, and rear and telephoto at 4032x3024. Omarchy A's Camera app runs all three at 30 fps.

The orchard side (the firmware in d111's recipe, and the bring-up notes) is a separate PR on OrchardLinux/orchard. Not done here: the Qualcomm 7 Plus (t8010-d11), whose ADT sensor-type hasn't been read yet.

henrikklee and others added 4 commits December 5, 2026 05:33
The iPhone 7 Plus has a third camera, the telephoto, beside the rear and
front cameras of the iPhone 7. Its shutdown line is already in the
binding; say that only boards with a telephoto camera have it, so that
its presence describes the camera, and add the 7 Plus's camera platform
(0x91, the ADT's sensor-type) to apple,platform-id's examples.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
The iPhone 7 Plus has a third camera on firmware channel 1. Register it
as a third V4L2 capture device on the boards that wire its shutdown line
(tele-shutdown-gpios); the iPhone 7 (d10, d101) keeps its two nodes. The
telephoto shares the rear camera's mode table and has autofocus, no
torch.

Name each video node from its camera (rear, telephoto, front) instead of
the old two-camera rear/front split.

[Orchard: rebased onto the A9 support, which moved the cameras' channels
 and modes into match data: the cameras are now a per-SoC table (the A9
 has no telephoto and its front camera on channel 1), and the telephoto
 is registered when the board has tele-shutdown-gpios instead of the
 unbound "apple,tele-camera" property.]
Signed-off-by: John Beatty <john@thebeattys.org>
Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
The iPhone 7 Plus (d111) has the same ISP, DART and PMU camera rails as
the iPhone 7 (d10, d101), plus a telephoto camera on firmware channel 1.

Enable &isp on d111 with platform ID 0x91 (the ADT's sensor-type; d10 and
d101 use 0x90) and its three sensor shutdown lines. Mux the telephoto's
reference-clock pad (GPIO 70) with the rear's (66) and the front's (72)
in the shared iPhone 7 pinctrl states: every iPhone 7 and 7 Plus ADT
lists all three extclk pads, and without it the firmware finds no sensor
on channel 1.

[Orchard: dropped "apple,tele-camera"; the telephoto's shutdown line
 describes it.]
Signed-off-by: John Beatty <john@thebeattys.org>
Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
Every iPhone 7 and 7 Plus wires its cameras the same: the ISP's rails,
the rear and front cameras' shutdown lines (AP GPIO 65 and 43) and the
flash's supply (176). Describe them once in t8010-7.dtsi, which enables
the cameras on all four boards, and keep per board only what differs:
the camera platform (0x90 on the iPhone 7, 0x91 on the 7 Plus) and the
7 Plus's telephoto shutdown line (69).

This adds the cameras of the iPhone 7 Plus (Qualcomm), D11. Its ADT
(d11ap, iOS 15.8.8 19H422) has the D111's values: sensor-type 0x91, the
shutdown lines on 65, 69 and 43, the reference clocks on 66, 70 and 72,
and the torch on 176.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
@henrikklee
henrikklee merged commit 182354d into OrchardLinux:main Dec 4, 2026
4 checks passed
@henrikklee

Copy link
Copy Markdown

Thank you, John! This is a great first contribution: you found the missing reference clock for the telephoto, and the iPhone 7 Plus now has all three cameras. It is merged as 182354d.

What we changed on your branch

  • Rebased onto main. media: apple: t8010-isp: Cameras on the iPhone 6s (A9) #135 (the iPhone 6s cameras) landed today in the same driver and moved each SoC's cameras into match data. Your driver commit is now built on that: each SoC has a table of its cameras. The A10 has rear (channel 0), telephoto (channel 1) and front (channel 2); the A9 has rear and front (channel 1). Your commits keep your authorship, with an [Orchard: …] note on what changed.
  • No more apple,tele-camera. The binding didn't define that property. The driver now registers the telephoto when the board's &isp has tele-shutdown-gpios, which the binding already had. A small binding commit says that only boards with a telephoto have that line, and adds 0x91 to the platform-id examples.
  • One camera block for all four iPhone 7 boards. Everything the boards share is now in t8010-7.dtsi: the rails, the rear and front shutdown lines, the flash and the firmware name. Each board keeps only its platform id (0x90 on the iPhone 7, 0x91 on the 7 Plus) and, on the 7 Plus, the telephoto line.
  • The Qualcomm 7 Plus (D11) gets the cameras too. Its device tree in the same 19H422 IPSW (d11ap) has exactly D111's values: sensor-type 0x91, shutdown lines 65/69/43, clocks 66/70/72 and the torch on 176. It's untested on hardware.
  • Commit subjects now use the driver's t8010-isp: prefix. The order is binding, then driver, then device tree.

Nothing was left out.

Follow-ups

  • Your pin-70 clock change is in the shared pinctrl states, so it also reaches the iPhone 7 (D10/D101). The ADT lists all three pads there too, so it should be harmless. A check on a D10 or D101 is welcome: the rear and front cameras should still stream.
  • If anyone has a D11, a test there is welcome too.
  • The driver's probe log changed: it now prints one line per camera (rear camera: video0, tele camera: video1, front camera: video2).
  • The orchard side (#548) lands next. Users get the cameras once orchard moves its kernel lock past this merge, which is a separate step.

henrikklee pushed a commit to ricktav/linux that referenced this pull request Dec 5, 2026
The A9 cameras had no controls, so the 6s Plus's rear flash could not be
used as a torch. Its firmware has the A10's torch commands: the command
table names CH_LED_TORCH_OFF 0x602 and CH_LED_TORCH_ON 0x603, and the
handler for 0x603 passes the u32 at +0xc on to the strobe task, as the
A10's does with the level. The flash driver sits on the firmware's own
I2C; the kernel only raises its enable (the strobe GPIO, ADT
function-torch_enable) at power-on, which the A9 path already does.

On the A9 the level is not the A10's 1-255 of 50 mA per driver. The
flash driver's torch method writes the module's calibrated torch code
as it is for level 6 and above, and scales it for levels 1-5: the level
is in sixths of the module's calibrated current. Read back with
CH_LED_TORCH_CURRENTS_GET on an N66, levels 1 to 6 give 22, 22, 46, 46,
68 and 94 mA in all: the drivers' current only changes at 1, 3, 5 and 6.

Split the torch from the A10-only controls with its top level in the
match data, 255 on the A10 (unchanged) and 4 on the A9, plus a table of
the firmware's level per step (1, 3, 5, 6) on the A9. The camera with
the torch flag gets the V4L2_CID_FLASH_LED_MODE and
V4L2_CID_FLASH_TORCH_INTENSITY controls (1 to the top level, its middle
as the default) and the "white:flash" LED is registered with the same
max_brightness, both through the existing isp_set_torch().

Tested on an N66 (Samsung): the rear node gets led_mode and
intensity_torch_mode and the white:flash LED registers; the control
reads 1-4, default 2, each step lights the rear LED brighter than the
one before, and led_mode=0 turns it off, with no firmware errors.

[Orchard: rebased onto the per-camera table (OrchardLinux#157), keyed on its torch
flag instead of camera index 0, and squashed the three commits of the
pull request (torch, six levels, four steps) into one]

Signed-off-by: ricktav <82380971+ricktav@users.noreply.github.com>
Assisted-by: LLM
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.

2 participants