* [PATCH v2 0/2] Add driver for TI BQ25630 charger
@ 2026-06-18 13:37 Waqar Hameed
2026-06-18 13:37 ` [PATCH v2 1/2] dt-bindings: power: supply: Add " Waqar Hameed
0 siblings, 1 reply; 6+ messages in thread
From: Waqar Hameed @ 2026-06-18 13:37 UTC (permalink / raw)
To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, linux-kernel, linux-pm, devicetree
This patch series contains a fully working driver for the basic
functionality for the new TI BQ25630 charger (see datasheet [1]). The
other "advanced" functionalities such as USB OTG, BATFET control and
liquid detection, will be handled in separate patches (after necessary
framework changes) according to the design discussions in the first RFC
version.
[1] https://www.ti.com/lit/gpn/bq25630
Changes in v2:
[power]
* Fix return value check for `data->regmap16be` initialization in probe
(check was wrongly for `data->regmap16le`).
* Remove TODO-comment about BATFET `sysfs` ABI (we will add a new sysfs
ABI entry in the framework for this).
* Check registers `BQ25630_REG_CHARGER_STATUS_X` as well in IRQ handler.
Because there might be changes that is not necessarily *only*
triggered from hardware faults. For example, manually
enabling/disabling with `echo 0 > /online`.
[dt-bindings]
* Rename file with `ti,` prefix.
* Remove battery-node in example.
Link to v1: https://lore.kernel.org/lkml/cover.1772201049.git.waqar.hameed@axis.com/
Waqar Hameed (2):
dt-bindings: power: supply: Add TI BQ25630 charger
power: supply: Add driver for TI BQ25630 charger
.../bindings/power/supply/ti,bq25630.yaml | 59 +
drivers/power/supply/Kconfig | 7 +
drivers/power/supply/Makefile | 1 +
drivers/power/supply/bq25630_charger.c | 1073 +++++++++++++++++
4 files changed, 1140 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/supply/ti,bq25630.yaml
create mode 100644 drivers/power/supply/bq25630_charger.c
base-commit: e771677c937da5808f7b6c1f0e4a97ec1a84f8a8
prerequisite-patch-id: 7dfa938b45374a748d43880f3e8416e665134104
prerequisite-patch-id: c22d643d2a260a8dbcc92df0754cfdb480879578
prerequisite-patch-id: 12e94680b398a795657d3d2addcf55bed5ce62de
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] dt-bindings: power: supply: Add TI BQ25630 charger
2026-06-18 13:37 [PATCH v2 0/2] Add driver for TI BQ25630 charger Waqar Hameed
@ 2026-06-18 13:37 ` Waqar Hameed
2026-06-22 11:06 ` Krzysztof Kozlowski
0 siblings, 1 reply; 6+ messages in thread
From: Waqar Hameed @ 2026-06-18 13:37 UTC (permalink / raw)
To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: kernel, linux-pm, devicetree, linux-kernel
Add devicetree bindings for the TI BQ25630 battery charger. It's I2C
controlled and sends interrupts.
Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
---
.../bindings/power/supply/ti,bq25630.yaml | 59 +++++++++++++++++++
1 file changed, 59 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/supply/ti,bq25630.yaml
diff --git a/Documentation/devicetree/bindings/power/supply/ti,bq25630.yaml b/Documentation/devicetree/bindings/power/supply/ti,bq25630.yaml
new file mode 100644
index 0000000000000..1e2c7aacb26d8
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/ti,bq25630.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/supply/ti,bq25630.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI BQ25630 battery charger
+
+maintainers:
+ - Waqar Hameed <waqar.hameed@axis.com>
+
+description: |
+ I2C controlled single cell Li-ion and Li-polymer 5A buck charger.
+ Datasheet: https://www.ti.com/lit/gpn/bq25630
+
+allOf:
+ - $ref: power-supply.yaml#
+
+properties:
+ compatible:
+ const: ti,bq25630
+
+ reg:
+ const: 0x6b
+ description:
+ Device I2C address.
+
+ interrupts:
+ maxItems: 1
+ description: |
+ Device sends active low 256 µs pulse. Type should therefore be
+ IRQ_TYPE_EDGE_FALLING.
+
+ monitored-battery: true
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - monitored-battery
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ charger@6b {
+ compatible = "ti,bq25630";
+ reg = <0x6b>;
+ interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+ monitored-battery = <&bat>;
+ };
+ };
+...
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: power: supply: Add TI BQ25630 charger
2026-06-18 13:37 ` [PATCH v2 1/2] dt-bindings: power: supply: Add " Waqar Hameed
@ 2026-06-22 11:06 ` Krzysztof Kozlowski
2026-06-25 11:27 ` Waqar Hameed
0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-22 11:06 UTC (permalink / raw)
To: Waqar Hameed
Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
kernel, linux-pm, devicetree, linux-kernel
On Thu, Jun 18, 2026 at 03:37:59PM +0200, Waqar Hameed wrote:
> +allOf:
> + - $ref: power-supply.yaml#
> +
> +properties:
> + compatible:
> + const: ti,bq25630
> +
> + reg:
> + const: 0x6b
> + description:
> + Device I2C address.
Drop description, obvious.
> +
> + interrupts:
> + maxItems: 1
> + description: |
Do not need '|' unless you need to preserve formatting.
> + Device sends active low 256 µs pulse. Type should therefore be
> + IRQ_TYPE_EDGE_FALLING.
> +
> + monitored-battery: true
Drop this one
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - monitored-battery
> +
> +additionalProperties: false
And here use 'unevaluatedProperties: false' instead.
With these fixed:
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: power: supply: Add TI BQ25630 charger
2026-06-22 11:06 ` Krzysztof Kozlowski
@ 2026-06-25 11:27 ` Waqar Hameed
2026-06-25 12:10 ` Krzysztof Kozlowski
0 siblings, 1 reply; 6+ messages in thread
From: Waqar Hameed @ 2026-06-25 11:27 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
kernel, linux-pm, devicetree, linux-kernel
On Mon, Jun 22, 2026 at 13:06 +0200 Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Thu, Jun 18, 2026 at 03:37:59PM +0200, Waqar Hameed wrote:
>> +allOf:
>> + - $ref: power-supply.yaml#
>> +
>> +properties:
>> + compatible:
>> + const: ti,bq25630
>> +
>> + reg:
>> + const: 0x6b
>> + description:
>> + Device I2C address.
>
> Drop description, obvious.
I see that several others actually don't have a description for this
property. I'll drop it!
>
>> +
>> + interrupts:
>> + maxItems: 1
>> + description: |
>
> Do not need '|' unless you need to preserve formatting.
Right, let's remove it.
>
>> + Device sends active low 256 µs pulse. Type should therefore be
>> + IRQ_TYPE_EDGE_FALLING.
>> +
>> + monitored-battery: true
>
> Drop this one
I was actually unsure about this one, but several other bindings had
this one. We can remove it.
>
>> +
>> +required:
>> + - compatible
>> + - reg
>> + - interrupts
>> + - monitored-battery
>> +
>> +additionalProperties: false
>
> And here use 'unevaluatedProperties: false' instead.
Hm, reading the documentation [1], `unevaluatedProperties` should be
used, because of the "include" of `power-supply.yaml`. I'll change to
that.
However, there are tons of other places where `additionalProperties` is
used instead _with_ a reference to `power-supply.yaml` (which is what I
followed). Are all of them actually "wrong" then?
>
> With these fixed:
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Thank you for your review Krzysztof!
[1] `Documentation/devicetree/bindings/writing-schema.rst`
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: power: supply: Add TI BQ25630 charger
2026-06-25 11:27 ` Waqar Hameed
@ 2026-06-25 12:10 ` Krzysztof Kozlowski
2026-06-25 12:20 ` Waqar Hameed
0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-25 12:10 UTC (permalink / raw)
To: Waqar Hameed
Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
kernel, linux-pm, devicetree, linux-kernel
On 25/06/2026 13:27, Waqar Hameed wrote:
>>> +
>>> +required:
>>> + - compatible
>>> + - reg
>>> + - interrupts
>>> + - monitored-battery
>>> +
>>> +additionalProperties: false
>>
>> And here use 'unevaluatedProperties: false' instead.
>
> Hm, reading the documentation [1], `unevaluatedProperties` should be
> used, because of the "include" of `power-supply.yaml`. I'll change to
> that.
>
> However, there are tons of other places where `additionalProperties` is
> used instead _with_ a reference to `power-supply.yaml` (which is what I
> followed). Are all of them actually "wrong" then?
No, they are not wrong, but usually preferred is to allow all properties
from referenced power-supply schema.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: power: supply: Add TI BQ25630 charger
2026-06-25 12:10 ` Krzysztof Kozlowski
@ 2026-06-25 12:20 ` Waqar Hameed
0 siblings, 0 replies; 6+ messages in thread
From: Waqar Hameed @ 2026-06-25 12:20 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
kernel, linux-pm, devicetree, linux-kernel
On Thu, Jun 25, 2026 at 14:10 +0200 Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On 25/06/2026 13:27, Waqar Hameed wrote:
>>>> +
>>>> +required:
>>>> + - compatible
>>>> + - reg
>>>> + - interrupts
>>>> + - monitored-battery
>>>> +
>>>> +additionalProperties: false
>>>
>>> And here use 'unevaluatedProperties: false' instead.
>>
>> Hm, reading the documentation [1], `unevaluatedProperties` should be
>> used, because of the "include" of `power-supply.yaml`. I'll change to
>> that.
>>
>> However, there are tons of other places where `additionalProperties` is
>> used instead _with_ a reference to `power-supply.yaml` (which is what I
>> followed). Are all of them actually "wrong" then?
>
> No, they are not wrong, but usually preferred is to allow all properties
> from referenced power-supply schema.
Ah ok, I can see why it's more preferable to be more "permissive" with
`unevaluatedProperties`. Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-25 12:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 13:37 [PATCH v2 0/2] Add driver for TI BQ25630 charger Waqar Hameed
2026-06-18 13:37 ` [PATCH v2 1/2] dt-bindings: power: supply: Add " Waqar Hameed
2026-06-22 11:06 ` Krzysztof Kozlowski
2026-06-25 11:27 ` Waqar Hameed
2026-06-25 12:10 ` Krzysztof Kozlowski
2026-06-25 12:20 ` Waqar Hameed
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox