[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2855688dcb6898af0d4b03913c6193da8b115760.camel@linaro.org>
Date: Mon, 25 Aug 2025 13:25:59 +0100
From: André Draszik <andre.draszik@...aro.org>
To: t.antoine@...ouvain.be, Sebastian Reichel <sre@...nel.org>, Rob Herring
<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Dimitri Fedrau <dima.fedrau@...il.com>, Catalin
Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>, Peter
Griffin <peter.griffin@...aro.org>, Tudor Ambarus
<tudor.ambarus@...aro.org>, Alim Akhtar <alim.akhtar@...sung.com>
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v5 4/4] arm64: dts: exynos: google: add Maxim MAX77759
Fuel-gauge
On Mon, 2025-08-04 at 16:26 +0200, Thomas Antoine via B4 Relay wrote:
> From: Thomas Antoine <t.antoine@...ouvain.be>
>
> 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).
>
> For the device specific values (full design capacity and terminal
> current), the device should check an EEPROM at address 0x50 of the
> hsi2c_8 for a battery id stored in register 0x17. A set of parameters
> for the initialization of the fuel gauge should be chosen based on
> this id. Those sets are defined here:
>
> Link:
> https://android.googlesource.com/kernel/gs/+/refs/heads/android-gs-raviole-5.10-android15/arch/arm64/boot/dts/google/gs101-oriole-battery-data.dtsi
> Link:
> https://android.googlesource.com/kernel/gs/+/refs/heads/android-gs-raviole-5.10-android15/arch/arm64/boot/dts/google/gs101-raven-battery-data.dtsi
>
> This does not seem to be a standard pattern in the kernel currently
> so it is not implemented. Values observed on tested devices are
> instead used. The driver or the devicetree should be should be
> extended in the future to take versions into account.
>
> The pinctrl name follows the convention proposed in
> Link: https://lore.kernel.org/all/20250524-b4-max77759-mfd-dts-v2-2-b479542eb97d@linaro.org/
>
> Signed-off-by: Thomas Antoine <t.antoine@...ouvain.be>
> ---
> arch/arm64/boot/dts/exynos/google/gs101-oriole.dts | 10 ++++++++
> .../boot/dts/exynos/google/gs101-pixel-common.dtsi | 30 ++++++++++++++++++++++
> arch/arm64/boot/dts/exynos/google/gs101-raven.dts | 11 ++++++++
> 3 files changed, 51 insertions(+)
[...]
> diff --git a/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi b/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
> index d6ddcc13f7b20c6dfbe92e86abafe965870d0c78..3362ad89ef6bacb7349259cf9e14452193ff7361 100644
> --- a/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
> +++ b/arch/arm64/boot/dts/exynos/google/gs101-pixel-common.dtsi
> @@ -10,6 +10,7 @@
>
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> #include <dt-bindings/usb/pd.h>
> #include "gs101-pinctrl.h"
> #include "gs101.dtsi"
> @@ -99,6 +100,16 @@ &hsi2c_8 {
> eeprom: eeprom@50 {
> compatible = "atmel,24c08";
> reg = <0x50>;
> +
> + nvmem-layout {
> + compatible = "fixed-layout";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + fg_state: fgstate@42 {
> + reg = <0x42 0x17>;
> + };
> + };
> };
> };
>
> @@ -188,6 +199,18 @@ usbc0_role_sw: endpoint {
> };
> };
> };
> +
> + fuel_gauge: fuel-gauge@36 {
> + compatible = "maxim,max77759-fg";
> + reg = <0x36>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&if_pmic_fg_int>;
> + interrupt-parent = <&gpa9>;
> + interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
small nit - for consistency with other interrupt specs in this file,
could you switch to using interrupts-extended please?
Cheers,
Andre'
Powered by blists - more mailing lists