From: Casey Connolly <casey.connolly@linaro.org>
Introduce the fuel gauge node for pmi8998.
Signed-off-by: David Heidelberg <david@ixit.cz>
---
arch/arm64/boot/dts/qcom/pmi8998.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
index cd3f0790fd420..ab3bc66502657 100644
--- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
@@ -44,6 +44,17 @@ pmi8998_rradc: adc@4500 {
reg = <0x4500>;
#io-channel-cells = <1>;
};
+
+ pmi8998_fg: fuel-gauge@4000 {
+ compatible = "qcom,pmi8998-fg";
+ reg = <0x4000>;
+
+ interrupts = <0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "soc-delta";
+
+ status = "disabled";
+ };
+
};
pmi8998_lsid1: pmic@3 {
--
2.51.0
On 24/11/2025 22:53, David Heidelberg via B4 Relay wrote:
> From: Casey Connolly <casey.connolly@linaro.org>
>
> Introduce the fuel gauge node for pmi8998.
>
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>>
Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> arch/arm64/boot/dts/qcom/pmi8998.dtsi | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> index cd3f0790fd420..ab3bc66502657 100644
> --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> @@ -44,6 +44,17 @@ pmi8998_rradc: adc@4500 {
> reg = <0x4500>;
> #io-channel-cells = <1>;
> };
> +
> + pmi8998_fg: fuel-gauge@4000 {
> + compatible = "qcom,pmi8998-fg";
> + reg = <0x4000>;
> +
> + interrupts = <0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "soc-delta";
I think it makes sense to add all the interrupts here, even if thr
driver only uses one of them currently.
interrupts = <0x2 0x40 0x0 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x40 0x1 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x40 0x2 IRQ_TYPE_EDGE_RISING>,
<0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>,
<0x2 0x40 0x4 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x40 0x5 IRQ_TYPE_EDGE_RISING>,
<0x2 0x40 0x6 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x40 0x7 IRQ_TYPE_EDGE_BOTH>;
interrupt-names = "soc-update",
"soc-ready",
"bsoc-delta",
"msoc-delta",
"msoc-low",
"msoc-empty",
"msoc-high",
"msoc-full";
https://github.com/LineageOS/android_kernel_oneplus_sdm845/blob/lineage-22.2/arch/arm64/boot/dts/qcom/pmi8998.dtsi#L292
Not sure what the difference is between bsoc-delta and msoc-delta, maybe
Richard or Yassine can recall? DT bindings would need updating too.
> +
> + status = "disabled";
> + };
> +
> };
>
> pmi8998_lsid1: pmic@3 {
>
--
// Casey (she/her)
On Thu, Nov 27, 2025 at 06:53:38PM +0100, Casey Connolly wrote:
> On 24/11/2025 22:53, David Heidelberg via B4 Relay wrote:
> > From: Casey Connolly <casey.connolly@linaro.org>
> >
> > Introduce the fuel gauge node for pmi8998.
> >
>
> Signed-off-by: Casey Connolly <casey.connolly@linaro.org>>
> Signed-off-by: David Heidelberg <david@ixit.cz>
> > ---
> > arch/arm64/boot/dts/qcom/pmi8998.dtsi | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> > index cd3f0790fd420..ab3bc66502657 100644
> > --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> > @@ -44,6 +44,17 @@ pmi8998_rradc: adc@4500 {
> > reg = <0x4500>;
> > #io-channel-cells = <1>;
> > };
> > +
> > + pmi8998_fg: fuel-gauge@4000 {
> > + compatible = "qcom,pmi8998-fg";
> > + reg = <0x4000>;
> > +
> > + interrupts = <0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>;
> > + interrupt-names = "soc-delta";
>
> I think it makes sense to add all the interrupts here, even if thr
> driver only uses one of them currently.
>
> interrupts = <0x2 0x40 0x0 IRQ_TYPE_EDGE_BOTH>,
> <0x2 0x40 0x1 IRQ_TYPE_EDGE_BOTH>,
> <0x2 0x40 0x2 IRQ_TYPE_EDGE_RISING>,
> <0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>,
> <0x2 0x40 0x4 IRQ_TYPE_EDGE_BOTH>,
> <0x2 0x40 0x5 IRQ_TYPE_EDGE_RISING>,
> <0x2 0x40 0x6 IRQ_TYPE_EDGE_BOTH>,
> <0x2 0x40 0x7 IRQ_TYPE_EDGE_BOTH>;
> interrupt-names = "soc-update",
> "soc-ready",
> "bsoc-delta",
> "msoc-delta",
> "msoc-low",
> "msoc-empty",
> "msoc-high",
> "msoc-full";
>
> https://github.com/LineageOS/android_kernel_oneplus_sdm845/blob/lineage-22.2/arch/arm64/boot/dts/qcom/pmi8998.dtsi#L292
>
> Not sure what the difference is between bsoc-delta and msoc-delta, maybe
> Richard or Yassine can recall? DT bindings would need updating too.
Well I don't remember, but the downstream kernel seems to reference bsoc
as battery SOC and msoc (used for the battery percentage) as
monotonic SOC. Maybe msoc is based on bsoc and scaled based on battery
health, but that's just from skimming the downstream driver.
On Mon, Nov 24, 2025 at 10:53:36PM +0100, David Heidelberg via B4 Relay wrote:
> From: Casey Connolly <casey.connolly@linaro.org>
>
> Introduce the fuel gauge node for pmi8998.
>
> Signed-off-by: David Heidelberg <david@ixit.cz>
Again, missing author's SoB
> ---
> arch/arm64/boot/dts/qcom/pmi8998.dtsi | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> index cd3f0790fd420..ab3bc66502657 100644
> --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> @@ -44,6 +44,17 @@ pmi8998_rradc: adc@4500 {
> reg = <0x4500>;
> #io-channel-cells = <1>;
> };
> +
> + pmi8998_fg: fuel-gauge@4000 {
> + compatible = "qcom,pmi8998-fg";
> + reg = <0x4000>;
> +
> + interrupts = <0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "soc-delta";
> +
> + status = "disabled";
> + };
> +
> };
>
> pmi8998_lsid1: pmic@3 {
>
> --
> 2.51.0
>
>
--
With best wishes
Dmitry
© 2016 - 2025 Red Hat, Inc.