Repository navigation
j81: charging — the Lightning charger on the iPad Air 2's D2207 - #197
Merged
Merged
Conversation
The iPad Air 2 drained on a cable: iBoot leaves the D2207 PMIC's input current limit at 100 mA and nothing raised it. The Lightning charger driver now supports the D2207 (its charger registers, ADC and plug state, as iOS 15.8 uses them), and the J81 device tree describes the Tristar and the charger. A computer's charging port or an Apple adapter gets up to 1.5 A. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SmartIO on the A8/A8X (AppleA7IOP version 1), MCA version 1 in the S8000 MCA driver, the MAX98721 speaker amplifier driver, the T7001 NCO, the device tree and a UCM profile; both speakers play in stereo. The headphone jack and the microphones are not part of it. Squashed from ricktav's j81/audio (17aa5eb); patch files renumbered to follow main.
From ricktav's j81/bluetooth (988f955).
From ricktav's j81/power (2806bca).
The Lightning charger driver learns the iPad Air 2's D2207 PMIC, so a charging port or an Apple adapter gets up to 1.5 A instead of iBoot's 100 mA. From ricktav's j81/charging (2bbdaa3); patch files renumbered to follow main.
Patch numbers follow main's, and the changelog, compatibility table and driver catalog are combined with the other J81 changes. ricktav's patches are unchanged.
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.
Summary
The iPad Air 2 (J81) drained on a cable: iBoot leaves the D2207 PMIC's input-current limit at 100 mA, and nothing raised it. This PR teaches the existing Lightning charger driver (
apple_tristar_charger) the D2207, and describes the Tristar and the charger in the J81 device tree. A computer's charging port or an Apple adapter now gets up to 1.5 A.Changes
drivers/power0041):Per-PMIC match data.
apple,tristar-chargerkeeps the D2365 layout unchanged.apple,d2207-tristar-chargeruses the D2207's addresses, from iOS 15.8'sAppleD2207PMU:The limit encoding (mA = code × 12.5 + 75) and the ADC result format are the same. After a D2207 conversion, the driver clears the start bit and the latch in 0x501, as iOS does.
A node may now have no source events. The driver's 100 ms poll of the connection state then sees plugging in and unplugging.
drivers/power0040):devices/t70010012):usb-input-limit-maxis 0x960.usb-psy-nameon the device controller.chargingandcharging_controlareworking. Includes the regenerated matrix and a CHANGELOG line.No plug event on the J81
iOS's charger also subscribes event 0 (plug) and event 21. With the plug event subscribed, it stays unmasked when the iPad is reset into DFU from a running Linux, because that reset skips iBoot, which would mask it. The cable replugs of the next boot then latch it.
Over these tests, RAM boots after a DFU from a Linux with the charger active got through 0 of 5 times with the plug event subscribed. With the charger unbound first, 2 of 2 got through. Without the plug event, 3 of 4 got through.
This is not the whole story. RAM boots after a DFU from Linux also freeze sometimes without any of this PR: 3 of 6 base
mainprobes, with and without Wi-Fi loaded, froze after such a DFU. After a freeze, the next boot freezes too, until Recovery → DFU from a powered-off iPad. Installed Omarchy (orchard launch) did not freeze in any test, including after a DFU from Linux with the charger active. I'll file the RAM-boot freeze separately.The poll sees a plug within 100 ms, so leaving the plug event out costs nothing measurable.
Testing
iPad Air 2 Wi-Fi (J81, iPad5,3). Host: a MacBook Air M2 under Asahi Linux, USB-C port.
orchard run, this branch's kernel):CDP, BC1.2 D- 623 mV, D+ 39 mV: up to 1500 mA.boot-entries sync.omarchy-powerdlogssuspend did not happen; the sleep did happen. The USB reconnect after resume probably hides the end of the suspend unit from it. Not looked into further.orchard launch: it boots, charging included.kernel/audit-patches.pypasses for j81, j71b and j71t.tools/catalog/generate matrix --checkpasses.python -m unittest discover -s tests: everything passes except the 5 that also fail on unmodifiedmainon this host.Not included
0x10bit 2 (possibly "input disable"). iOS sets it below 75 mA; this PR never goes that low.CONFIG_APPLE_TRISTAR_ACCESSORYis not built on apple-4k.#192 and #195 also add
devices/t7001patches and CHANGELOG lines, so whichever merges later gets its patch renumbered.🤖 Generated with Claude Code