Repository navigation
iPhone 7 Plus: the rear, telephoto and front cameras - #157
Merged
Merged
Conversation
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
force-pushed
the
iphone7plus-cameras
branch
from
December 4, 2026 21:46
fec2cf6 to
ce6ac51
Compare
|
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
Nothing was left out. Follow-ups
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables the A10 camera ISP on the iPhone 7 Plus (Intel,
t8010-d111) and adds its third camera, the telephoto. Builds on #86.t8010-d111.dtsgets the&ispblock thatd10/d101have, with the 7 Plus's own platform id (0x91, from the ADT'ssensor-type), the telephoto'stele-shutdown-gpios(GPIO 69) andapple,tele-camera.t8010.dtsiadds pin 70, the telephoto'sextclk, to the threeisp_refclk_*states. Every iPhone 7 / 7 Plus ADT lists three clock pads (66, 70, 72). Without pin 70 the firmware reportsNo sensor found on channel 1.&isphasapple,tele-camera, and names each node from its camera.d10/d101keep their two nodes.Tested on an iPhone 7 Plus (
d111), booted in RAM and installed. The channel probe finds all three sensors (rear0x303, telephoto0x313, front0x314). 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 ADTsensor-typehasn't been read yet.