Repository navigation
Conversation
The MAX77779 interface PMIC (Google Pixel 9a) is a set of I2C blocks on one chip; the charger, the fuel gauge and the Type-C port controller have their bindings. The PMIC block at 0x66 owns the chip's interrupt line and eight SGPIO pins with interrupt support, which carry the board's charger side signals (the RT9470 boost's interrupt and enable, the wireless charger's lines). Describe it as a GPIO and interrupt controller. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The MAX77779 (Google Pixel 9a) is a set of I2C blocks on one chip. The PMIC block at 0x66 owns the chip's interrupt line (INTB) and eight SGPIO pins; on the 9a they carry the RT9470 OTG boost's interrupt (SGPIO6) and chip enable (SGPIO7) and the wireless charger's lines. Without them the boost can't keep its 40 s I2C watchdog, which Google's driver services from that interrupt. Add a driver for the block: a GPIO chip for the eight pins (direction, level, pull-up and pull-down through set_config) with an interrupt chip. Each pin's edge trigger is programmed in its CNFG register; a level request takes the edge into the level and the handler re-checks the pin, leaving the interrupt uncleared while the level holds, as Google's driver does. The handler reads INTSRC_STS, dispatches the SGPIO source and acknowledges the rest; the other sources the block gathers (charger, gauge, port controller) have their own lines to the SoC on this board and stay masked. The register map is Google's max77779_regs.h (google-modules/bms): ID 0x00, INTSRC_STS 0x22, INTB_MASK 0x24, SGPIO_INT 0xe8, PU 0xe9, PD 0xea, CNFG0-7 0xed-0xf4. Tested on the Pixel 9a against the running kernel, the device instantiated on hsi2c6 without an interrupt line: the block answers with ID 0x79, revision 0x02, OTP 0x21; the chip registers eight lines and the register readout matches the OTP defaults (SGPIO6 an input, pull-down set; SGPIO7 off). The interrupt path and the pin configurations stock applies (pull-up on SGPIO6, SGPIO7 as the enable) wait for the board commit that adds the node and the RT9470's lines. Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_pmic_sgpio.c Link: https://android.googlesource.com/kernel/devices/google/zuma/+/42395e8adcb880aa336f0da6bb2a19ed53929c40/dts/zuma-max777xx.dtsi Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
|
Thank you, @W4HO-ham. This is the right piece to unblock the RT9470, and the register map matches Google's header everywhere I checked. Some things to address before it leaves draft:
The probe readout looks right. I'll look for the interrupt-path boot when the board node is in. |
|
All five, on a reworked branch:
Built W=1 against the palmtop's build with no warnings; the module for the next USB-C boot is |
|
GitHub can't retarget a PR's head branch, so please open a new PR from |
|
Reopened from |
The piece #127 point 4 turned out to need: the RT9470 boost's interrupt and chip enable are MAX77779 sub-GPIOs (SGPIO6 and SGPIO7 on the PMIC block at 0x66, stock's
rt,intr_gpioandrt,ceb_gpio), and Google's driver services the boost's 40 s watchdog from that interrupt. Nothing onomamobileprovided the block, so here it is: a binding, a GPIO driver with an interrupt chip for the eight SGPIOs (edge triggers per pin in CNFG, level requests re-checked by the handler as Google's driver does, pulls through set_config), and a MAINTAINERS entry. The register map is Google's max77779_regs.h, cited by commit in the message, and the shape follows mainline's gpio-max77759 (the 7 Pro's chip), minus the MFD core, since on this chip the other blocks already have their own drivers and lines.Tested on the palmtop against the running kernel, the device instantiated on hsi2c6 by hand (no interrupt line in the running tree): the block answers ID 0x79, revision 0x02, the chip registers eight lines, and the register readout is the OTP default (SGPIO6 an input with its pull-down, SGPIO7 off), which also says the boost's enable isn't driven by anyone today. The interrupt path and the pin states stock applies (pull-up on SGPIO6, SGPIO7 as the enable) need the board node (
interrupts = <&gpa8 0 LEVEL_LOW>, pinned like stock'sif_pmic_irq) and the RT9470's lines on it; that is the next commit on the host-mode series and a boot I'll do with the owner at the palmtop, so this stays a draft until then.checkpatch --strict: clean per commit (the ENOTSUPP in set_config is what gpiolib tests for an unsupported configuration). W=1 build of the driver clean; dt_binding_check on the binding and its example passes.