Repository navigation
Conversation
|
A question on the boost side, before I write its PR. On the 9a, VBUS only held once the RT9470's JEITA control (0x0c bit 7) and its I2C watchdog (0x01 bits 1:0) were off. That's what Google's Mainline's Two ways I can see:
(a) looks more upstream-friendly to me, but it hands the RT9470's charging to Linux. Which would you prefer? Until then the palmtop runs a bring-up module that writes only OTG_EN, JEITA_EN and the watchdog bits. |
|
Thanks for this, and for getting host mode working end to end on the 9a. The design follows Google's closely, and I checked it against their sources. On the 9a, There are three things I'd like changed before it merges:
Smaller points and questions:
On your RT9470 question, I'll answer (a) versus (b) separately. Here are some facts that matter for both. Mainline |
5bf729f to
4970bcd
Compare
|
Thanks, all of this is in the new push, rebased onto #92's amended head (97e64a8):
Smaller points:
The TCPC DT and the RT9470 bring-up module will go up as a draft PR with a runbook, as you asked on #131. |
|
Thanks for working through all of it so quickly. I went through the new push point by point against the code:
Gate on today's What's left before it merges is the run on this exact source. The code now differs from what ran on 10-28 in ways that matter at runtime: the CHGIN_OK check sits in front of every enable, and the unwind order is new. From a kernel built from 4970bcd (or with its
The "Tested on the Pixel 9a" paragraph will be accurate once that's in. Two small things you can fold into the same push, neither blocking:
Merge order: #92 goes in first (it's ready), then this one, rebased onto it, once the run above is posted. On (a) versus (b) for the RT9470, I'll answer separately, as I said. |
…regulator Describe the charger's chgin-otg regulator, VBUS out of CHGIN for a device on the USB port, and the external boost it uses (otg-boost-supply), as on the Pixel 9a, where Google's ext-otg-only use case puts the charger in standby and raises an RT9470 boost. Only the Type-C controller may turn VBUS on, after its vSafe0V check, so the regulator may not be always-on or boot-on. The regulator needs the external boost: the charger's own boost mode is not supported. Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_usecase.c Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Add a chgin-otg regulator for the Type-C controller's vbus, over an external boost (otg-boost-supply). Enabling it puts the charger in standby (mode 0) and then enables the boost, the order Google's ext-otg-only use case uses on the Pixel 9a, whose boost is an RT9470; disabling it reverses that. The charger's own boost mode (0xa) is not used: Google writes it on the 9a only for fast role swap, after setting the OTG current limit, and nothing here has run it, so the regulator refuses to enable without the external boost. It also refuses while CHGIN already has an input, so it never boosts into another source. While VBUS is out, CHGIN carries our own boost, so the supply reports no input and Discharging rather than what CHGIN_OK says. Charge inhibit is refused then. The boost is got before the restore action is registered, so on unbind the boost is turned off and charging restored before the boost consumer is put. Tested on the Pixel 9a: with TCPM as a dual-role port whose vbus-supply is this regulator (over the RT9470's OTG boost), a USB flash drive attaches as source, VBUS holds at 5.2 V, and the drive enumerates at high speed; with the drive out and a laptop back in, the port is a sink again and charges. Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_usecase.c Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zumapro-tegu-usecases.dtsi Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
4970bcd to
66203ab
Compare
|
Rebased onto today's omamobile. The MAX77779 charger driver and its binding are in omamobile now and dropped out; the OTG VBUS regulator binding and the VBUS commit remain, unchanged. checkpatch clean; not rebuilt here (no build container on this machine). |
…not for merge) The setup behind the 10-28 host-mode run on the Pixel 9a, published so the run can be reproduced; not for merge. hsi2c10 with its pins and the RT9470 as an OTG boost (omamobile,tegu-rt9471-boost, an undocumented bring-up compatible, which checkpatch flags), the MAX77779 charger with its chgin-otg regulator over that boost (derekross#124), the TCPC as a dual-role port that prefers sink with chgin-otg as vbus-supply, and the connector's graph to dwc3, which becomes an OTG controller with a role switch. The source PDO (5 V, 900 mA) is the run's value; it isn't traced to a stock file yet. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
… for merge) The Pixel 9a's RT9470 charger, run by Google's rt9471 driver on stock, used here only as the USB OTG boost: a regulator on OTG_EN (FUNCTION 0x02 bit 1) for the MAX77779 charger's chgin-otg regulator. Bring-up only; its upstream shape (mainline rt9471, or an OTG-only driver) is still open on derekross#124. The compatible, omamobile,tegu-rt9471-boost, is undocumented, which checkpatch flags. With the RT9470's JEITA control (0x0C bit 7) or its I2C watchdog (TOP 0x01 bits 1:0) on, VBUS collapsed under the boost within about 60 ms. Enabling turns both off just before OTG_EN, and disabling clears OTG_EN and puts both back as probe found them, so the chip runs without its temperature cut-off only in host mode. Probe only reads. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
|
Thanks for the rebase; range-diff shows it's identical to what I reviewed. It's still waiting on the run on this exact source from my 10-29 comment (attach, unbind with the drive in, phone-smoke). |
|
A partial run on this PR's exact source today, so you know where it stands. The full run (attach, unbind with the device in, the reset with host mode on) is still to come, with a lighter USB device. The kernel was today's The only device to hand was a USB-C powered travel router (no USB stick on this trip). With it on the port, TCPM went TOGGLING, then SRC_ATTACH_WAIT, then the try-sink round, then SRC_ATTACHED. It turned VBUS on through |
|
Thank you, @W4HO-ham, for the partial run and for saying plainly what it does and doesn't cover. The router run tells us something useful too. TCPM turned VBUS on through I re-ran the gate on today's What's still needed before merge is the same as in my 10-29 comment, with a device the boost can carry. A USB stick, a keyboard or a mouse would all do.
Then please update the "Tested on the Pixel 9a" paragraph. It still describes the 10-28 run on the earlier code. Two small points from 10-29 are also still open, if you're pushing anyway. Neither blocks the merge:
|
Stacked on #92 (the MAX77779 charger); only the last commit is new.
This adds a
chgin-otgregulator that a Type-C controller can use as itsvbus-supply. With an external boost (otg-boost-supply, the Pixel 9a's RT9470), the charger goes to standby and then the boost is enabled, the order Google's ext-otg-only use case uses. Without an external boost it uses the charger's own boost mode (0xa). Charge inhibit is refused while VBUS is out, and unbinding the driver turns VBUS off and charging back on. The binding gainsotg-boost-supplyand thechgin-otg-regulatorchild.Tested on the Pixel 9a (
7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, the integration tree):vbus-supplypointing at this regulator, and a graph to dwc3's role switch.sde: sde1 sde2).The RT9470's boost needs its JEITA control and I2C watchdog off for VBUS to hold, as Google's
rt9471_chargersets them on the 9a. That's for the boost's own driver and the board DT, which follow in separate PRs (the plan is mainlinert9471with its OTG regulator).