Re: [EXTERNAL] Re: [PATCH v1 1/2] dt-bindings: power: Add the bq256xx dt bindings

2020-08-27 Thread Ricardo Rivera-Matos

Rob

On 8/18/20 11:43 AM, Rob Herring wrote:

On Mon, Aug 17, 2020 at 02:17:22PM -0500, Ricardo Rivera-Matos wrote:

Add the bindings for the bq256xx series of battery charging ICs.

Datasheets:
- https://www.ti.com/lit/ds/symlink/bq25600.pdf
- https://www.ti.com/lit/ds/symlink/bq25601.pdf
- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
- https://www.ti.com/lit/ds/symlink/bq25618.pdf
- https://www.ti.com/lit/ds/symlink/bq25619.pdf

Signed-off-by: Ricardo Rivera-Matos 
---
  .../bindings/power/supply/bq256xx.yaml| 99 +++
  1 file changed, 99 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/power/supply/bq256xx.yaml

diff --git a/Documentation/devicetree/bindings/power/supply/bq256xx.yaml 
b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
new file mode 100644
index ..67db4ba9fdb6
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
+# Copyright (C) 2020 Texas Instruments Incorporated
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/power/supply/bq256xx.yaml#;
+$schema: "http://devicetree.org/meta-schemas/core.yaml#;
+
+title: TI bq256xx Switch Mode Buck Charger
+
+maintainers:
+  - Ricardo Rivera-Matos 
+
+description: |
+  The bq256xx devices are a family of highly-integrated battery charge
+  management and system power management ICs for single cell Li-ion and Li-
+  polymer batteries.
+
+  Datasheets:
+- https://www.ti.com/lit/ds/symlink/bq25600.pdf
+- https://www.ti.com/lit/ds/symlink/bq25601.pdf
+- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25618.pdf
+- https://www.ti.com/lit/ds/symlink/bq25619.pdf
+
+properties:
+  compatible:
+enum:
+  - ti,bq25600
+  - ti,bq25601
+  - ti,bq25600d
+  - ti,bq25601d
+  - ti,bq25611d
+  - ti,bq25618
+  - ti,bq25619
+
+  reg:
+maxItems: 1
+
+  ti,watchdog-timer:

Poorly named since we have 'ti,watchdog-timers' already and is
completely different.

ACK, will use ti,watchdog-timeout-msĀ  instead



+$ref: /schemas/types.yaml#/definitions/uint32
+description: |
+  Watchdog timer in milli seconds. 0 (default) disables the watchdog

If you have units, then you should use standard unit suffix.

ACK



+minimum: 0
+maximum: 16
+enum: [ 0, 4, 8, 16]
+
+  input-voltage-limit-microvolt:
+description: |
+   Minimum input voltage limit in micro volts with a 10 micro volt step
+minimum: 390
+maximum: 540
+
+  input-current-limit-microamp:
+description: |
+   Maximum input current limit in micro amps with a 10 micro amp step
+minimum: 10
+maximum: 320

Aren't these properties of the battery, not the charger?

These are input current and voltage limit for the charger, not the battery



+
+required:
+  - compatible
+  - reg

monitored-battery not required?

ACK


Add:

additionalProperties: false

additionalProperties: false or unevaluatedProperties: false




+
+examples:
+  - |
+bat: battery {
+  compatible = "simple-battery";
+  constant-charge-current-max-microamp = <204>;
+  constant-charge-voltage-max-microvolt = <4352000>;
+  precharge-current-microamp = <18>;
+  termination-current-microamp = <18>;
+};
+#include 
+#include 
+i2c0 {

i2c {

ACK



+  pinctrl-names = "default";
+  pinctrl-0 = <_pins>;

Not relevant to the example.

ACK



+
+  status = "okay";

Don't show status in examples.

ACK



+  clock-frequency = <40>;
+
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  bq25601@6b {

charger@6b

ACK



+compatible = "ti,bq25601";
+reg = <0x6b>;
+monitored-battery = <>;
+
+interrupt-parent = <>;
+interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
+watchdog-timer = <4>;
+
+input-voltage-limit-microvolt = <450>;
+input-current-limit-microamp = <240>;
+   };
+};
+...
--
2.28.0


Ricardo


Re: [PATCH v1 1/2] dt-bindings: power: Add the bq256xx dt bindings

2020-08-18 Thread Dan Murphy

Rob

On 8/18/20 11:43 AM, Rob Herring wrote:

On Mon, Aug 17, 2020 at 02:17:22PM -0500, Ricardo Rivera-Matos wrote:

Add the bindings for the bq256xx series of battery charging ICs.

Datasheets:
- https://www.ti.com/lit/ds/symlink/bq25600.pdf
- https://www.ti.com/lit/ds/symlink/bq25601.pdf
- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
- https://www.ti.com/lit/ds/symlink/bq25618.pdf
- https://www.ti.com/lit/ds/symlink/bq25619.pdf

Signed-off-by: Ricardo Rivera-Matos 
---
  .../bindings/power/supply/bq256xx.yaml| 99 +++
  1 file changed, 99 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/power/supply/bq256xx.yaml

diff --git a/Documentation/devicetree/bindings/power/supply/bq256xx.yaml 
b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
new file mode 100644
index ..67db4ba9fdb6
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
+# Copyright (C) 2020 Texas Instruments Incorporated
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/power/supply/bq256xx.yaml#;
+$schema: "http://devicetree.org/meta-schemas/core.yaml#;
+
+title: TI bq256xx Switch Mode Buck Charger
+
+maintainers:
+  - Ricardo Rivera-Matos 
+
+description: |
+  The bq256xx devices are a family of highly-integrated battery charge
+  management and system power management ICs for single cell Li-ion and Li-
+  polymer batteries.
+
+  Datasheets:
+- https://www.ti.com/lit/ds/symlink/bq25600.pdf
+- https://www.ti.com/lit/ds/symlink/bq25601.pdf
+- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25618.pdf
+- https://www.ti.com/lit/ds/symlink/bq25619.pdf
+
+properties:
+  compatible:
+enum:
+  - ti,bq25600
+  - ti,bq25601
+  - ti,bq25600d
+  - ti,bq25601d
+  - ti,bq25611d
+  - ti,bq25618
+  - ti,bq25619
+
+  reg:
+maxItems: 1
+
+  ti,watchdog-timer:

Poorly named since we have 'ti,watchdog-timers' already and is
completely different.


I think you made a comment on my DT to make this ti,watchdog-timeout-ms 
and then we can remove the type.






+$ref: /schemas/types.yaml#/definitions/uint32
+description: |
+  Watchdog timer in milli seconds. 0 (default) disables the watchdog

If you have units, then you should use standard unit suffix.


+minimum: 0
+maximum: 16
+enum: [ 0, 4, 8, 16]
+
+  input-voltage-limit-microvolt:
+description: |
+   Minimum input voltage limit in micro volts with a 10 micro volt step
+minimum: 390
+maximum: 540
+
+  input-current-limit-microamp:
+description: |
+   Maximum input current limit in micro amps with a 10 micro amp step
+minimum: 10
+maximum: 320

Aren't these properties of the battery, not the charger?


+
+required:
+  - compatible
+  - reg

monitored-battery not required?

Add:

additionalProperties: false


What about using

unevaluatedProperties: false

Dan



Re: [PATCH v1 1/2] dt-bindings: power: Add the bq256xx dt bindings

2020-08-18 Thread Rob Herring
On Mon, Aug 17, 2020 at 02:17:22PM -0500, Ricardo Rivera-Matos wrote:
> Add the bindings for the bq256xx series of battery charging ICs.
> 
> Datasheets:
> - https://www.ti.com/lit/ds/symlink/bq25600.pdf
> - https://www.ti.com/lit/ds/symlink/bq25601.pdf
> - https://www.ti.com/lit/ds/symlink/bq25600d.pdf
> - https://www.ti.com/lit/ds/symlink/bq25601d.pdf
> - https://www.ti.com/lit/ds/symlink/bq25611d.pdf
> - https://www.ti.com/lit/ds/symlink/bq25618.pdf
> - https://www.ti.com/lit/ds/symlink/bq25619.pdf
> 
> Signed-off-by: Ricardo Rivera-Matos 
> ---
>  .../bindings/power/supply/bq256xx.yaml| 99 +++
>  1 file changed, 99 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/power/supply/bq256xx.yaml
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/bq256xx.yaml 
> b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
> new file mode 100644
> index ..67db4ba9fdb6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
> +# Copyright (C) 2020 Texas Instruments Incorporated
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/power/supply/bq256xx.yaml#;
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#;
> +
> +title: TI bq256xx Switch Mode Buck Charger
> +
> +maintainers:
> +  - Ricardo Rivera-Matos 
> +
> +description: |
> +  The bq256xx devices are a family of highly-integrated battery charge
> +  management and system power management ICs for single cell Li-ion and Li-
> +  polymer batteries.
> +
> +  Datasheets:
> +- https://www.ti.com/lit/ds/symlink/bq25600.pdf
> +- https://www.ti.com/lit/ds/symlink/bq25601.pdf
> +- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
> +- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
> +- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
> +- https://www.ti.com/lit/ds/symlink/bq25618.pdf
> +- https://www.ti.com/lit/ds/symlink/bq25619.pdf
> +
> +properties:
> +  compatible:
> +enum:
> +  - ti,bq25600
> +  - ti,bq25601
> +  - ti,bq25600d
> +  - ti,bq25601d
> +  - ti,bq25611d
> +  - ti,bq25618
> +  - ti,bq25619
> +
> +  reg:
> +maxItems: 1
> +
> +  ti,watchdog-timer:

Poorly named since we have 'ti,watchdog-timers' already and is 
completely different.

> +$ref: /schemas/types.yaml#/definitions/uint32
> +description: |
> +  Watchdog timer in milli seconds. 0 (default) disables the watchdog

If you have units, then you should use standard unit suffix.

> +minimum: 0
> +maximum: 16
> +enum: [ 0, 4, 8, 16]
> +
> +  input-voltage-limit-microvolt:
> +description: |
> +   Minimum input voltage limit in micro volts with a 10 micro volt 
> step
> +minimum: 390
> +maximum: 540
> +
> +  input-current-limit-microamp:
> +description: |
> +   Maximum input current limit in micro amps with a 10 micro amp step
> +minimum: 10
> +maximum: 320

Aren't these properties of the battery, not the charger?

> +
> +required:
> +  - compatible
> +  - reg

monitored-battery not required?

Add:

additionalProperties: false


> +
> +examples:
> +  - |
> +bat: battery {
> +  compatible = "simple-battery";
> +  constant-charge-current-max-microamp = <204>;
> +  constant-charge-voltage-max-microvolt = <4352000>;
> +  precharge-current-microamp = <18>;
> +  termination-current-microamp = <18>;
> +};
> +#include 
> +#include 
> +i2c0 {

i2c {

> +  pinctrl-names = "default";
> +  pinctrl-0 = <_pins>;

Not relevant to the example.

> +
> +  status = "okay";

Don't show status in examples.

> +  clock-frequency = <40>;
> +
> +  #address-cells = <1>;
> +  #size-cells = <0>;
> +
> +  bq25601@6b {

charger@6b

> +compatible = "ti,bq25601";
> +reg = <0x6b>;
> +monitored-battery = <>;
> +
> +interrupt-parent = <>;
> +interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
> +watchdog-timer = <4>;
> +
> +input-voltage-limit-microvolt = <450>;
> +input-current-limit-microamp = <240>;
> +   };
> +};
> +...
> -- 
> 2.28.0
> 


Re: [PATCH v1 1/2] dt-bindings: power: Add the bq256xx dt bindings

2020-08-18 Thread Rob Herring
On Mon, 17 Aug 2020 14:17:22 -0500, Ricardo Rivera-Matos wrote:
> Add the bindings for the bq256xx series of battery charging ICs.
> 
> Datasheets:
> - https://www.ti.com/lit/ds/symlink/bq25600.pdf
> - https://www.ti.com/lit/ds/symlink/bq25601.pdf
> - https://www.ti.com/lit/ds/symlink/bq25600d.pdf
> - https://www.ti.com/lit/ds/symlink/bq25601d.pdf
> - https://www.ti.com/lit/ds/symlink/bq25611d.pdf
> - https://www.ti.com/lit/ds/symlink/bq25618.pdf
> - https://www.ti.com/lit/ds/symlink/bq25619.pdf
> 
> Signed-off-by: Ricardo Rivera-Matos 
> ---
>  .../bindings/power/supply/bq256xx.yaml| 99 +++
>  1 file changed, 99 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/power/supply/bq256xx.yaml
> 


My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/power/supply/bq256xx.example.dt.yaml:
 battery: 'termination-current-microamp' does not match any of the regexes: 
'^ocv-capacity-table-[0-9]+$', 'pinctrl-[0-9]+'


See https://patchwork.ozlabs.org/patch/1346479

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master 
--upgrade

Please check and re-submit.



[PATCH v1 1/2] dt-bindings: power: Add the bq256xx dt bindings

2020-08-17 Thread Ricardo Rivera-Matos
Add the bindings for the bq256xx series of battery charging ICs.

Datasheets:
- https://www.ti.com/lit/ds/symlink/bq25600.pdf
- https://www.ti.com/lit/ds/symlink/bq25601.pdf
- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
- https://www.ti.com/lit/ds/symlink/bq25618.pdf
- https://www.ti.com/lit/ds/symlink/bq25619.pdf

Signed-off-by: Ricardo Rivera-Matos 
---
 .../bindings/power/supply/bq256xx.yaml| 99 +++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/bq256xx.yaml

diff --git a/Documentation/devicetree/bindings/power/supply/bq256xx.yaml 
b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
new file mode 100644
index ..67db4ba9fdb6
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/bq256xx.yaml
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
+# Copyright (C) 2020 Texas Instruments Incorporated
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/power/supply/bq256xx.yaml#;
+$schema: "http://devicetree.org/meta-schemas/core.yaml#;
+
+title: TI bq256xx Switch Mode Buck Charger
+
+maintainers:
+  - Ricardo Rivera-Matos 
+
+description: |
+  The bq256xx devices are a family of highly-integrated battery charge
+  management and system power management ICs for single cell Li-ion and Li-
+  polymer batteries.
+
+  Datasheets:
+- https://www.ti.com/lit/ds/symlink/bq25600.pdf
+- https://www.ti.com/lit/ds/symlink/bq25601.pdf
+- https://www.ti.com/lit/ds/symlink/bq25600d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25601d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25611d.pdf
+- https://www.ti.com/lit/ds/symlink/bq25618.pdf
+- https://www.ti.com/lit/ds/symlink/bq25619.pdf
+
+properties:
+  compatible:
+enum:
+  - ti,bq25600
+  - ti,bq25601
+  - ti,bq25600d
+  - ti,bq25601d
+  - ti,bq25611d
+  - ti,bq25618
+  - ti,bq25619
+
+  reg:
+maxItems: 1
+
+  ti,watchdog-timer:
+$ref: /schemas/types.yaml#/definitions/uint32
+description: |
+  Watchdog timer in milli seconds. 0 (default) disables the watchdog
+minimum: 0
+maximum: 16
+enum: [ 0, 4, 8, 16]
+
+  input-voltage-limit-microvolt:
+description: |
+   Minimum input voltage limit in micro volts with a 10 micro volt step
+minimum: 390
+maximum: 540
+
+  input-current-limit-microamp:
+description: |
+   Maximum input current limit in micro amps with a 10 micro amp step
+minimum: 10
+maximum: 320
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+bat: battery {
+  compatible = "simple-battery";
+  constant-charge-current-max-microamp = <204>;
+  constant-charge-voltage-max-microvolt = <4352000>;
+  precharge-current-microamp = <18>;
+  termination-current-microamp = <18>;
+};
+#include 
+#include 
+i2c0 {
+  pinctrl-names = "default";
+  pinctrl-0 = <_pins>;
+
+  status = "okay";
+  clock-frequency = <40>;
+
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  bq25601@6b {
+compatible = "ti,bq25601";
+reg = <0x6b>;
+monitored-battery = <>;
+
+interrupt-parent = <>;
+interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
+watchdog-timer = <4>;
+
+input-voltage-limit-microvolt = <450>;
+input-current-limit-microamp = <240>;
+   };
+};
+...
-- 
2.28.0