Repository navigation
kernel: USB host through the Lightning camera adapter on the iPad 5, 6 and 7 - #126
Merged
Merged
Conversation
With Apple's Lightning camera adapter, the port turns into a USB host: the Tristar charger talks to the adapter over the Lightning ID bus, an S8000 USB role switch moves the port between device (USB serial and network to a computer) and host, and the AUSB PHY follows. USB sticks, SD readers, Ethernet adapters and USB audio work (J71t, tested by hand); class drivers for them are built on both platforms. From orchard PR OrchardLinux#126 (commit 864b497), reworked: the source behind the adapter is not identified, so host mode takes the 500 mA of any unidentified source instead of 2.1 A; host mode only follows the adapter (no manual sysfs selection, no 60 s timer); the iPad 5 device tree change moved to the iPad 5 layer. Boards without apple,usb-role-switch are unchanged.
Apple's device trees of the iPad 6 (J71b, J72b) match the iPad 5 in everything the camera adapter needs: the USB complex (device, EHCI and OHCI at the same offsets), the otgphyctrl bank and tunables, the D2365 and the cbtl1610 Tristar at i2c0 0x1a, and the dock accessory power on LDO5. Add the S8000 role switch to the T8010 and enable it on the iPad 6. Untested on the iPad 6; the iPad 7 keeps it off.
…-off Apple's device tree of the iPad 7 has the iPad 6's Lightning port hardware (Tristar, USB complex, accessory power); the Bellatrix that Orchard used as its port controller is the Smart Connector's. The iPad 7 now uses the iPad 6 charger, so it identifies chargers and Apple hosts instead of staying at 500 mA, wakes on plug and gets USB host. The PMIC power-off moves from the J71b file to the shared iPad 6 file, for the J72b and both iPad 7 models. Untested on those boards.
Driver list regenerated from a built apple-16k kernel.
henrikklee
force-pushed
the
j71t/usb-host
branch
from
November 12, 2026 22:45
864b497 to
ae59743
Compare
The power-off node moved from the J71b board file to t8010-ipad6.dtsi, which every iPad 6 and iPad 7 board includes. Resolve that file from its pinned upstream copy through the real series, as for the J71b file.
Contributor
|
Landing this as your commit with changes: host mode follows the camera adapter only (no manual sysfs selection or 60 s timer), and it takes 500 mA because nothing identifies the source behind the adapter's power port. The iPad 5 device tree change sits in the iPad 5 layer. On top: Apple's device trees give the iPad 6 and iPad 7 the same Lightning port hardware (the iPad 7's Bellatrix is the Smart Connector's), so both get USB host, and the iPad 7 now uses the Tristar charger like the iPad 6; the PMIC power-off moved to the shared iPad 6 file. Your previous head is kept as tag |
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.
Part 21 of 23 of the iPad 5 (J71t) series in this repository; merge after #125.
Problem
The Lightning port only worked as a USB device, so USB sticks, keyboards and other peripherals behind Apple's camera adapter did not work.
Change
Add the S8000 USB role switch (binding, driver, DT with EHCI/OHCI), switch the AUSB PHY between host and device, add the Lightning ID-bus master and host mode for the camera adapter to the TriStar charger, and bound a manual host selection to 60 seconds. Enables USB storage, UAS and exFAT/UTF-8 as modules, adds the
usb_hostfeature (working on J71t, missing elsewhere) and its catalog rows. For devices behind the adapter, the Apple configs also build USB Ethernet (RTL8152/8153, AX88179, ASIX AX88772, CDC Ethernet/NCM/EEM, RNDIS) and USB audio as modules. The iPad 5 DT patch records the J71t validation.Testing
Dependencies
Depends on #125.
This branch is stacked on the PRs it depends on and carries their commits; the change of this PR is its last commit, "j71t: USB host through the Lightning camera adapter".
🤖 Generated with Claude Code