Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: power: supply: battery: allow 101 ocv-capacity points
@ 2026-09-24  3:15 Ryan Brue
  2026-09-24 17:24 ` Conor Dooley
  2026-10-04 17:46 ` Sebastian Reichel
  0 siblings, 2 replies; 3+ messages in thread
From: Ryan Brue @ 2026-09-24  3:15 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Henrik Grimler, linux-pm, devicetree, linux-kernel, Ryan Brue

ocv-capacity-table-N is capped at 100 points, while the capacity percent
in each point may be anything from 0 to 100. A table with a point for
every percent, both ends included, needs 101 and does not fit. Raise the
cap to 101.

power_supply_get_battery_info() sizes each table from the property, so
no kernel change is needed.

Assisted-by: LLM
Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
---
As discussed with Henrik on v1: rather than a larger cap for one vendor's
tables, which fit in 100 points once resampled, allow the one extra point
that a table at every percent from 0 to 100 needs, and say so in the
binding.
---
Changes in v2:
- Raise the cap to 101 instead of 128, with a comment saying why (Henrik)
- Drop the justification from the vendor's tables; the figures in v1
  were for a different cell, and resampled tables fit in 100 points
- Rebase on v7.3-rc4
- Link to v1: https://patch.msgid.link/20260918-rbrue-suez-upstreaming-battery-ocv-table-128-v1-1-f477ef39ef0d@gmail.com
---
 Documentation/devicetree/bindings/power/supply/battery.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/power/supply/battery.yaml b/Documentation/devicetree/bindings/power/supply/battery.yaml
index 8ebf05d9497c..9575ee1491bb 100644
--- a/Documentation/devicetree/bindings/power/supply/battery.yaml
+++ b/Documentation/devicetree/bindings/power/supply/battery.yaml
@@ -154,7 +154,8 @@ patternProperties:
       of the battery and corresponding battery capacity percent, which is used
       to look up battery capacity according to current OCV value. And the open
       circuit voltage unit is microvolt.
-    maxItems: 100
+    # One point for each capacity percent from 0 to 100
+    maxItems: 101
     items:
       items:
         - description: open circuit voltage (OCV) in microvolts

---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260917-rbrue-suez-upstreaming-battery-ocv-table-128-9ba83f9313bb

Best regards,
--  
Ryan Brue <ryanbrue.dev@gmail.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] dt-bindings: power: supply: battery: allow 101 ocv-capacity points
  2026-09-24  3:15 [PATCH v2] dt-bindings: power: supply: battery: allow 101 ocv-capacity points Ryan Brue
@ 2026-09-24 17:24 ` Conor Dooley
  2026-10-04 17:46 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2026-09-24 17:24 UTC (permalink / raw)
  To: Ryan Brue
  Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Henrik Grimler, linux-pm, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2386 bytes --]

On Wed, Sep 23, 2026 at 10:15:35PM -0500, Ryan Brue wrote:
> ocv-capacity-table-N is capped at 100 points, while the capacity percent
> in each point may be anything from 0 to 100. A table with a point for
> every percent, both ends included, needs 101 and does not fit. Raise the
> cap to 101.
> 
> power_supply_get_battery_info() sizes each table from the property, so
> no kernel change is needed.
> 
> Assisted-by: LLM

Crazy what people seem to need LLMs to help with.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

> Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
> ---
> As discussed with Henrik on v1: rather than a larger cap for one vendor's
> tables, which fit in 100 points once resampled, allow the one extra point
> that a table at every percent from 0 to 100 needs, and say so in the
> binding.
> ---
> Changes in v2:
> - Raise the cap to 101 instead of 128, with a comment saying why (Henrik)
> - Drop the justification from the vendor's tables; the figures in v1
>   were for a different cell, and resampled tables fit in 100 points
> - Rebase on v7.3-rc4
> - Link to v1: https://patch.msgid.link/20260918-rbrue-suez-upstreaming-battery-ocv-table-128-v1-1-f477ef39ef0d@gmail.com
> ---
>  Documentation/devicetree/bindings/power/supply/battery.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/battery.yaml b/Documentation/devicetree/bindings/power/supply/battery.yaml
> index 8ebf05d9497c..9575ee1491bb 100644
> --- a/Documentation/devicetree/bindings/power/supply/battery.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/battery.yaml
> @@ -154,7 +154,8 @@ patternProperties:
>        of the battery and corresponding battery capacity percent, which is used
>        to look up battery capacity according to current OCV value. And the open
>        circuit voltage unit is microvolt.
> -    maxItems: 100
> +    # One point for each capacity percent from 0 to 100
> +    maxItems: 101
>      items:
>        items:
>          - description: open circuit voltage (OCV) in microvolts
> 
> ---
> base-commit: 93f51579e7df248780214094418f205253383cc5
> change-id: 20260917-rbrue-suez-upstreaming-battery-ocv-table-128-9ba83f9313bb
> 
> Best regards,
> --  
> Ryan Brue <ryanbrue.dev@gmail.com>
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] dt-bindings: power: supply: battery: allow 101 ocv-capacity points
  2026-09-24  3:15 [PATCH v2] dt-bindings: power: supply: battery: allow 101 ocv-capacity points Ryan Brue
  2026-09-24 17:24 ` Conor Dooley
@ 2026-10-04 17:46 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2026-10-04 17:46 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Ryan Brue
  Cc: Henrik Grimler, linux-pm, devicetree, linux-kernel


On Wed, 23 Sep 2026 22:15:35 -0500, Ryan Brue wrote:
> ocv-capacity-table-N is capped at 100 points, while the capacity percent
> in each point may be anything from 0 to 100. A table with a point for
> every percent, both ends included, needs 101 and does not fit. Raise the
> cap to 101.
> 
> power_supply_get_battery_info() sizes each table from the property, so
> no kernel change is needed.
> 
> [...]

Applied, thanks!

[1/1] dt-bindings: power: supply: battery: allow 101 ocv-capacity points
      commit: ab2f870a67f547d3a6a55f5557cb7aecffb0ecde

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-04 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24  3:15 [PATCH v2] dt-bindings: power: supply: battery: allow 101 ocv-capacity points Ryan Brue
2026-09-24 17:24 ` Conor Dooley
2026-10-04 17:46 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox