Skip to content

[power supply]: Cherry pick patches for enabling gs101 power supply #2

Open
fallaciousreasoning wants to merge 4 commits intogs101-mainline:gs101-7.0from
fallaciousreasoning:battery-status
Open

[power supply]: Cherry pick patches for enabling gs101 power supply #2
fallaciousreasoning wants to merge 4 commits intogs101-mainline:gs101-7.0from
fallaciousreasoning:battery-status

Conversation

@fallaciousreasoning
Copy link
Copy Markdown

@fallaciousreasoning fallaciousreasoning commented May 7, 2026

Source of the patches:
https://patchew.org/linux/20250523-b4-gs101._5Fmax77759._5Ffg-v4-0-b49904e35a34@uclouvain.be/

Tested on my Pixel 6a and this is letting me see the current battery level

TEhhhA added 4 commits May 7, 2026 16:06
The interface of the Maxim MAX77759 fuel gauge has a lot of common with the
Maxim MAX1720x. A major difference is the lack of non-volatile memory
slave address. No slave is available at address 0xb of the i2c bus, which
is coherent with the following driver from google: line 5836 disables
non-volatile memory for m5 gauge.

Link: https://android.googlesource.com/kernel/google-modules/bms/+/1a68c36bef474573cc8629cc1d121eb6a81ab68c/max1720x_battery.c

Other differences include the lack of V_BATT register to read the battery
level. The voltage must instead be read from V_CELL, the lowest voltage of
all cells. The mask to identify the chip is different. The computation of
the charge must also be changed to take into account TASKPERIOD, which
can add a factor 2 to the result.

Add support for the MAX77759 by taking into account all of those
differences based on chip type.

Do not advertise temp probes using the non-volatile memory as those are
not available.

The regmap was proposed by André Draszik in

Link: https://lore.kernel.org/all/d1bade77b5281c1de6b2ddcb4dbbd033e455a116.camel@linaro.org/

Signed-off-by: Thomas Antoine <t.antoine@uclouvain.be>
The Maxim MAX77759 is an IC used to manage the power supply of the battery
and the USB-C. Based on drivers from google, it contains at least a PMIC,
a fuel gauge, a TCPCI and a charger.

Use max77759-fg compatible to avoid conflict with drivers for other
functions.

The Maxim MAX77759 has no non-volatile memory so it doesn't require an
address and instead requires a value for the current sensing resistor.

Keep shunt-resistor-micro-ohms optional for the MAX17201/MAX17205 as it is
not be used at the moment but could be in the future. (e.g. as a default
value to be used in case of nvmem failure)

Signed-off-by: Thomas Antoine <t.antoine@uclouvain.be>
Enable the Maxim MAX1720x as it is used by the gs101-oriole
(Google Pixel 6) board.

Signed-off-by: Thomas Antoine <t.antoine@uclouvain.be>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Add the node for the Maxim MAX77759 fuel gauge as a slave of the i2c.

The TODO is still applicable given there are other slaves on the
bus (e.g. PCA9468, other MAX77759 functions and the MAX20339 OVP).

Signed-off-by: Thomas Antoine <t.antoine@uclouvain.be>
@ninelore
Copy link
Copy Markdown
Member

ninelore commented May 7, 2026

I thought these got upstreamed in 6.17/6.18?

@fallaciousreasoning
Copy link
Copy Markdown
Author

I think the first patch in the series of 5 has been upstreamed. Looking at https://github.com/torvalds/linux these other four don't seem to be there (checked the 6.18 tag too).

@fallaciousreasoning
Copy link
Copy Markdown
Author

Looks like this merged recently, but might not be in this fork?
torvalds@3d7bd20

@ninelore
Copy link
Copy Markdown
Member

ninelore commented May 8, 2026

Looks like this merged recently, but might not be in this fork? torvalds@3d7bd20

Thats 7.1-rc1. Might upgrade soon-ish anyway.

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.

3 participants