Skip to content

USB-C-PLAN, usbc-deadman: K1b, a NO_AUTOIBUS left set stops charging - #815

Merged
derekross merged 5 commits into
mainfrom
usbc-plan-autoibus
Nov 18, 2026
Merged

derekross merged 5 commits into
mainfrom
usbc-plan-autoibus

Conversation

@derekross

Copy link
Copy Markdown
Owner

The plan and test tooling for derekross/linux-omarchy-mobile#261, which clears the MAX77759 charger's NO_AUTOIBUS bit when it charges without a Type-C report. A bit left set by the bootloader holds the input at 500 mA, so a phone in use gains nothing on the cable (#169; a community chat report of "sometimes won't take a charge").

device/cheetah/USB-C-PLAN.md, new K1b:

  • the report, the cause, the fix and its checks;
  • a trap for testing: the charger regmap is cached from the hardware at MFD probe, so an i2cset followed by a rebind would make the fix look broken;
  • a gated runbook, K1b.0 to K1b.5: read-only first; reproduce on the release kernel; back to normal; push the test kernel; set the bit across a warm reboot; then the field case at the next flat-battery boot.
  • The K1 row in "To build" points at it.

tools/usbc-deadman, tools/usbc-deadman-phone: the MAX77759 also owns the USB data switch, so every K1b write runs under the dead-man switch. There are two new steps, k1b-autoibus-on and k1b-autoibus-off. Each one:

  • saves 0xc2 and changes only bit 7;
  • reads the register back;
  • is confirmed over a fresh SSH login, or else the phone undoes it (the saved value is written back and the data switch is closed if VBUS is there), with the watchdog behind that.

Tested offline with stub i2cget/i2cset: apply and undo give 0x13→0x93→0x13 and 0x93→0x13→0x93. Not run on a phone; K1b runs after the 2026.11.15 install and the M6-D sleep test.

tools/pr-check and tests/packages pass.

🤖 Generated with Claude Code

derekross and others added 5 commits November 15, 2026 11:18
A community 7 Pro on #169 read CHG_CNFG_09 0x93 after a boot from an
empty battery and gained nothing on the cable; a chat user reports the
same symptom. The driver never clears the bit. The fix is on the kernel
branch omamobile-charger-autoibus; this records the cause, the regmap
cache trap that makes an i2cset-then-rebind test lie, and a gated
runbook.

The MAX77759 also owns the USB data switch, so the runbook's writes go
through tools/usbc-deadman: two new steps, k1b-autoibus-on and
k1b-autoibus-off, change only bit 7 of 0xc2, read it back, and undo to the
saved value unless confirmed over a fresh SSH login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setup needs the laptop's USB link (the dead-man tool and the checks
run over it) and a source advertising Rp 1.5 A or 3.0 A, or the bit
changes nothing and K1b.1 can't fail: K1b.0 now reads CC_STATUS and
stops at Rp default. The modem is stopped for the test, NV backups are
checked first, K1b.3 lists the whole build, K1b.4 has a rollback, and
the wording follows the evidence (every read on record, the input
following Rp, who may set the bit).

usbc-deadman-phone: the k1b steps save the value from the same read that
decides the write, in their own file, and refuse when that read fails,
so the undo always has what it needs and doesn't touch b3-charger's
saved registers. undo <step> restores what was there before that step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e boot

K1b.3 pushed the test kernel and masked the modem's boot target after the
boot. The 7 Pro starts the modem at boot and masking a target stops nothing
that boot already started, so K1b.4 would have armed the dead-man watchdog
with the modem up, against the runbook's own Setup. The mask now goes in
before the push, K1b.3 and K1b.4 each check that the modem reads inactive,
and K1b.4 stops if it doesn't.

Also from round 60's review: K1b.2 is K1b.1's rollback of record (a second
k1b-autoibus-on in one boot makes the undo keep the bit set), and the
heading says no write has run, since a read has.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A second 7 Pro read NO_AUTOIBUS set after a flat boot (2026-11-16), the
same phone charged normally after two earlier flat boots, and a third read
it clear on flat boots, so the bit isn't set on every boot from empty and
K1b.5 says a flat boot without the suffix is no result.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@derekross
derekross merged commit 0de100f into main Nov 18, 2026
2 checks passed
@derekross
derekross deleted the usbc-plan-autoibus branch November 18, 2026 17:56
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.

1 participant