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>
|
Thank you, @W4HO-ham, for reopening this from the v3 branch. I checked it against my five points on #139, and each one is in the code: an unmapped pin is skipped, every trigger is cleared at probe and masked bits aren't dispatched; a masked level line is acknowledged and re-checked at unmask; wake is forwarded to the chip's line; the comments describe the other sources as on stock; MAINTAINERS is folded into the driver commit. The registers and fields match Google's Two things before it merges:
Smaller things: a readable/writeable regmap table (the writes are INTSRC_STS, INTB_MASK and 0xe8-0xf4); |
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. Probe clears every pin's trigger before the source is unmasked, so a trigger left by OTP or the bootloader can't latch a bit on a pin nobody requested, and the handler dispatches only pins with a mapping and not masked; a masked pin's bit is acknowledged and, for a level line, the pin is checked again at unmask by running the handler once more. irq_set_wake is forwarded to the chip's line while any pin asks for it, so the boost's watchdog interrupt can wake the SoC from s2idle. The handler reads INTSRC_STS, dispatches the SGPIO source and acknowledges the rest. On stock the gauge, the charger, the I2C master and VIMON interrupt through this block as well and only the Type-C port controller has its own line to the SoC; on this tree their nodes have no interrupts, so those sources 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. Without an interrupt line the block answers with ID 0x79, revision 0x02, OTP 0x21, the chip registers eight lines and the readout matches the OTP defaults (SGPIO6 an input, pull-down set; SGPIO7 off). With the board's node (the chip's line on gpa8-0, the boost's interrupt on SGPIO6), an earlier version of this driver probed with its interrupt on 2026-10-30 and caused no interrupt storm; the PMIC's interrupt count stayed at 0 over 10 s with the RT9470's watchdog off, so no interrupt has come through this block yet. This version has not been booted with the board's node. 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>
18653d0 to
3283751
Compare
|
You're right on point 1, thanks for catching it. The driver commit's tested paragraph now says exactly what happened: an earlier version probed with its interrupt on 10-30 with no storm, the PMIC's count stayed at 0 over 10 s with the RT9470's watchdog off, and this version hasn't booted with the board's node. I've marked the PR as a draft until a v3 boot where the line really fires (a count above zero on On the interrupt cells, I'll take the first shape: the block as a parent with an interrupt controller for its sources and an SGPIO child, as |
|
Thank you, @W4HO-ham. The new tested paragraph is accurate: it says what the 10-30 boot ran, that no interrupt has come through the block yet, and that this version hasn't booted with the board's node. Draft is the right state for it. I checked that this push changed only the message (the tree is identical to the previous head), and the checks pass on today's The parent-and-child shape is a good choice: the block as the interrupt controller for its sources, with the SGPIOs as a child, as
Nothing else needed from me until the rework and the boot where the line really fires. Take your time. |
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.
Opened from
tegu-max77779-pmic-v3, as asked on #139, which this replaces; the content is the v3 you reviewed there.