[power supply]: Cherry pick patches for enabling gs101 power supply #2
Open
fallaciousreasoning wants to merge 4 commits intogs101-mainline:gs101-7.0from
Open
[power supply]: Cherry pick patches for enabling gs101 power supply #2fallaciousreasoning wants to merge 4 commits intogs101-mainline:gs101-7.0from
fallaciousreasoning wants to merge 4 commits intogs101-mainline:gs101-7.0from
Conversation
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>
Member
|
I thought these got upstreamed in 6.17/6.18? |
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). |
Author
|
Looks like this merged recently, but might not be in this fork? |
Member
Thats 7.1-rc1. Might upgrade soon-ish anyway. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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