Repository navigation
power: supply: Add the Maxim MAX77779 charger - #92
Conversation
|
Thanks for this. It's a careful first driver for the charger: nothing is written at probe, charge current and voltage are never touched, the write table allows only the mode and protection registers, and it's off unless someone enables it. I checked every register and field against Google's One thing to fix before I merge:
A question:
Smaller things, for the same push if you agree:
|
|
Thanks, all of it is in. Force-pushed, rebased onto today's
checkpatch --strict: the driver commit is clean, and the binding commit has only the MAINTAINERS note. The driver builds with W=1, and |
7c996ff to
fedd32b
Compare
|
Thanks for working through all of it so quickly. I went through the new diff point by point. Probe takes the inhibit from the mode it reads, One small fix to the message before I merge: in the driver commit there's a blank line between the two |
|
The warm-reboot measurement you asked for: with CHG_CNFG_00 set to mode 4 by hand (0x04, read back), then a warm reboot of the 9a, CHG_CNFG_00 read 0x05 at 56 s of uptime, before any charger driver was loaded. So on this palmtop something before Linux (the bootloader or the PMIC's reset) puts the charger back to charge and buck across a warm reboot. The |
The MAX77779 power management IC's switching charger sits on the same I2C bus as its fuel gauge (maxim,max77779-fg), at 0x69. It charges the battery from USB and powers the system; the gauge names it in its power-supplies. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
fedd32b to
47dd225
Compare
|
Thanks for the warm-reboot measurement. Reading 0x05 at 56 s, before any charger driver loaded, settles it: on the 9a something before Linux puts the charger back into charge-and-buck mode. Keeping the The blank line is still there in last night's rebase, though. The driver commit's message is unchanged, so |
Add a driver for the MAX77779's charger, which the Pixel 9a runs under its OTP defaults. It reports whether an input (USB or the wireless receiver) is present, the charge status and type from CHG_DETAILS_01, the input current limit and the charge current, and supplies the fuel gauge, so the battery's status follows the charger. charge_behaviour inhibit-charge stops charging: the charger goes to buck-only mode (CHG_CNFG_00 mode 4; that register isn't behind CHGPROT) and USB powers the system, though near full the battery still supplies part of the load; auto, unbinding and shutdown put it back in charge- and-buck mode. An inhibit survives a warm reboot, since the PMIC stays powered, so probe takes the inhibit state from the mode it finds. Nothing else is written, and the interrupt registers (clear on read) are not read: the state is polled every 10 s. Tested on the Pixel 9a, with the device created at 0x69 by hand in place of the out-of-tree driver it replaces: online, status, charge type, input current limit (1.5 A) and charge current read as the chip reports them; inhibit-charge gives "Not charging" (mode 4) and auto "Charging" (mode 5) again; unbinding while inhibited leaves mode 5; and probing with the charger found in mode 4 reports inhibit-charge and "Not charging", and auto then restores mode 5. At 99 % the battery still gave about 450 mA while inhibited, measured the same way with the out-of-tree driver. The gauge's link to the charger comes from the DT and was not part of this test. Register fields from Google's MAX77779 charger driver and register header. Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_charger.c Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_v20240115_regs.h Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
|
Thanks, I dropped the blank line myself (97e64a8). |
47dd225 to
97e64a8
Compare
|
Thanks, that's it. I'll rebase-merge this now. #124 carries these two commits, so once this lands, it needs a rebase onto |
The matrix after the merges since #118, with each cell going by the merged notes: - Pixel 7 (panther): the board file (derekross/linux-omarchy-mobile#108) and the FT3658 touch driver (derekross/linux-omarchy-mobile#109) have merged into the published kernel, so Boot, Storage, Buttons and USB net say "in the published kernel" instead of "in review". Touch stays "no": the driver and the touch rails are published, but the board file has no touch node, and panther's notes end at boot 8 with the controller not answering. BRINGUP-M1's status and NOTES' header say the same. - Pixel 6 Pro (raven), Charging: no -> works. device-raven 0.1.26 (#112, #126) loads the MAX77759 charger at boot with its temperature guard; USB-PLAN section 4 records C0-C5 passed on 2026-10-28, a full charge to 100 % included. The battery node is derekross/linux-omarchy-mobile#112; the runs were on an unpublished integration kernel, and the cell says so. - raven, Torch: still works; the LED's node is now in the published kernel (derekross/linux-omarchy-mobile#113), tested on omamobile-gs101-torch and not yet run from the published kernel. - Pixel 9a (tegu), Fingerprint: no -> WIP. FINGERPRINT-PLAN records F0 and F2-F6b passed on an unpublished kernel: Trusty's TA runs and the HAL sees the sensor; enrollment waits for the factory calibration (F6c). omamobile-fingerprint 0.1.10 (#101) maps Trusty's stores for it. Left as they were: tegu's Charging (the MAX77779 charger driver, derekross/linux-omarchy-mobile#92, is published, but tegu's notes record no run of it), the gs201 HSI2 pin controller (derekross/linux-omarchy-mobile#123, no cell), felix (#35 is a plan) and cheetah (nothing merged for it). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A driver for the MAX77779's charger, at 0x69 beside the fuel gauge (#38, #66). The Pixel 9a runs the charger under its OTP defaults. This driver reports on it and can stop charging, nothing more:
charge_behaviourinhibit-charge puts the charger in buck-only mode (CHG_CNFG_00 mode 4, behind CHGPROT). auto, and unbinding, put it back in charge-and-buck mode.power_supply_changed()on input or state changes.power-supplies, so the battery's status can follow it throughpower_supply_get_property_from_supplier().Tested on the Pixel 9a (
7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty). I created the device at 0x69 throughnew_devicein place of our out-of-tree driver:One honest note: buck-only isn't "battery idle" near full. At 99 % the battery still gave about 450 mA while inhibited, and our out-of-tree driver shows the same with the same register write. The message and the code comment say so.
Our out-of-tree driver also does two things this one doesn't, which can come later:
checkpatch --strict is clean on the driver commit. The binding commit gets only the MAINTAINERS question, which the driver commit's entry answers.
dt_binding_checkpasses, and the driver builds with W=1.