2022-06-17 09:50:18

by ChiYuan Huang

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings: iio: adc: Add rtq6056 adc support

From: ChiYuan Huang <[email protected]>

Add the documentation for Richtek RTQ6056.

Signed-off-by: ChiYuan Huang <[email protected]>
---
.../bindings/iio/adc/richtek,rtq6056-adc.yaml | 57 ++++++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml

diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
new file mode 100644
index 00000000..6b4e0e0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056-adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC
+
+maintainers:
+ - ChiYuan Huang <[email protected]>
+
+description: |
+ The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
+ interface, and the device provides full information for system by reading
+ out the loading current and power.
+
+ The device monitors both of the drops across sense resistor and the BUS
+ voltage, converts into the current in amperes, and power in watts through
+ internal analog-to-digital converter ADC. The programmable calibration,
+ adjustable conversion time, and averaging function are also built in for
+ more design flexibility.
+
+ Datasheet is available at
+ https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf
+
+properties:
+ compatible:
+ const: richtek,rtq6056
+
+ reg:
+ maxItems: 1
+
+ "#io-channel-cells":
+ const: 1
+
+ richtek,shunt-resistor-uohm:
+ description: Shunt IN+/IN- sensing node resistor in microohm.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+ - compatible
+ - reg
+ - "#io-channel-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ rtq6056@40 {
+ compatible = "richtek,rtq6056";
+ reg = <0x40>;
+ #io-channel-cells = <1>;
+ };
+ };
--
2.7.4


2022-06-18 02:01:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: Add rtq6056 adc support

On 17/06/2022 02:32, cy_huang wrote:
> From: ChiYuan Huang <[email protected]>
>
> Add the documentation for Richtek RTQ6056.
>
> Signed-off-by: ChiYuan Huang <[email protected]>
> ---
> .../bindings/iio/adc/richtek,rtq6056-adc.yaml | 57 ++++++++++++++++++++++
> 1 file changed, 57 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> new file mode 100644
> index 00000000..6b4e0e0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> @@ -0,0 +1,57 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056-adc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC
> +
> +maintainers:
> + - ChiYuan Huang <[email protected]>
> +
> +description: |
> + The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
> + interface, and the device provides full information for system by reading
> + out the loading current and power.
> +
> + The device monitors both of the drops across sense resistor and the BUS
> + voltage, converts into the current in amperes, and power in watts through
> + internal analog-to-digital converter ADC. The programmable calibration,
> + adjustable conversion time, and averaging function are also built in for
> + more design flexibility.
> +
> + Datasheet is available at
> + https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf
> +
> +properties:
> + compatible:
> + const: richtek,rtq6056
> +
> + reg:
> + maxItems: 1
> +
> + "#io-channel-cells":
> + const: 1
> +
> + richtek,shunt-resistor-uohm:

Use standard properties, so "-micro-ohms". Drop the unit from
description and drop the ref.

> + description: Shunt IN+/IN- sensing node resistor in microohm.
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> +required:
> + - compatible
> + - reg
> + - "#io-channel-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + rtq6056@40 {

Generic node name, so probably "adc" (or something else appropriate).

> + compatible = "richtek,rtq6056";
> + reg = <0x40>;
> + #io-channel-cells = <1>;
> + };
> + };


Best regards,
Krzysztof

2022-06-18 16:05:26

by ChiYuan Huang

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: Add rtq6056 adc support

Krzysztof Kozlowski <[email protected]> 於 2022年6月18日 週六 上午9:45寫道:
>
> On 17/06/2022 02:32, cy_huang wrote:
> > From: ChiYuan Huang <[email protected]>
> >
> > Add the documentation for Richtek RTQ6056.
> >
> > Signed-off-by: ChiYuan Huang <[email protected]>
> > ---
> > .../bindings/iio/adc/richtek,rtq6056-adc.yaml | 57 ++++++++++++++++++++++
> > 1 file changed, 57 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> > new file mode 100644
> > index 00000000..6b4e0e0
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> > @@ -0,0 +1,57 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056-adc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC
> > +
> > +maintainers:
> > + - ChiYuan Huang <[email protected]>
> > +
> > +description: |
> > + The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
> > + interface, and the device provides full information for system by reading
> > + out the loading current and power.
> > +
> > + The device monitors both of the drops across sense resistor and the BUS
> > + voltage, converts into the current in amperes, and power in watts through
> > + internal analog-to-digital converter ADC. The programmable calibration,
> > + adjustable conversion time, and averaging function are also built in for
> > + more design flexibility.
> > +
> > + Datasheet is available at
> > + https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf
> > +
> > +properties:
> > + compatible:
> > + const: richtek,rtq6056
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + "#io-channel-cells":
> > + const: 1
> > +
> > + richtek,shunt-resistor-uohm:
>
> Use standard properties, so "-micro-ohms". Drop the unit from
> description and drop the ref.
>
Use richtek.shunt-resistor-micro-ohms?
Or the prefix 'richtek,' can be removed?
> > + description: Shunt IN+/IN- sensing node resistor in microohm.
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - "#io-channel-cells"
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + i2c {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + rtq6056@40 {
>
> Generic node name, so probably "adc" (or something else appropriate).
>
Ack in next.
> > + compatible = "richtek,rtq6056";
> > + reg = <0x40>;
> > + #io-channel-cells = <1>;
> > + };
> > + };
>
>
> Best regards,
> Krzysztof

2022-06-18 17:17:23

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: Add rtq6056 adc support

On 18/06/2022 08:50, ChiYuan Huang wrote:
> Krzysztof Kozlowski <[email protected]> 於 2022年6月18日 週六 上午9:45寫道:
>>
>> On 17/06/2022 02:32, cy_huang wrote:
>>> From: ChiYuan Huang <[email protected]>
>>>
>>> Add the documentation for Richtek RTQ6056.
>>>
>>> Signed-off-by: ChiYuan Huang <[email protected]>
>>> ---
>>> .../bindings/iio/adc/richtek,rtq6056-adc.yaml | 57 ++++++++++++++++++++++
>>> 1 file changed, 57 insertions(+)
>>> create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
>>> new file mode 100644
>>> index 00000000..6b4e0e0
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
>>> @@ -0,0 +1,57 @@
>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056-adc.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC
>>> +
>>> +maintainers:
>>> + - ChiYuan Huang <[email protected]>
>>> +
>>> +description: |
>>> + The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
>>> + interface, and the device provides full information for system by reading
>>> + out the loading current and power.
>>> +
>>> + The device monitors both of the drops across sense resistor and the BUS
>>> + voltage, converts into the current in amperes, and power in watts through
>>> + internal analog-to-digital converter ADC. The programmable calibration,
>>> + adjustable conversion time, and averaging function are also built in for
>>> + more design flexibility.
>>> +
>>> + Datasheet is available at
>>> + https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf
>>> +
>>> +properties:
>>> + compatible:
>>> + const: richtek,rtq6056
>>> +
>>> + reg:
>>> + maxItems: 1
>>> +
>>> + "#io-channel-cells":
>>> + const: 1
>>> +
>>> + richtek,shunt-resistor-uohm:
>>
>> Use standard properties, so "-micro-ohms". Drop the unit from
>> description and drop the ref.
>>
> Use richtek.shunt-resistor-micro-ohms?

Yes.

> Or the prefix 'richtek,' can be removed?

No, the vendor prefix must stay.

Best regards,
Krzysztof

2022-06-18 17:48:21

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: Add rtq6056 adc support

On Sat, 18 Jun 2022 18:34:40 +0100
Jonathan Cameron <[email protected]> wrote:

> On Sat, 18 Jun 2022 19:00:19 +0200
> Krzysztof Kozlowski <[email protected]> wrote:
>
> > On 18/06/2022 08:50, ChiYuan Huang wrote:
> > > Krzysztof Kozlowski <[email protected]> 於 2022年6月18日 週六 上午9:45寫道:
> > >>
> > >> On 17/06/2022 02:32, cy_huang wrote:
> > >>> From: ChiYuan Huang <[email protected]>
> > >>>
> > >>> Add the documentation for Richtek RTQ6056.
> > >>>
> > >>> Signed-off-by: ChiYuan Huang <[email protected]>
> > >>> ---
> > >>> .../bindings/iio/adc/richtek,rtq6056-adc.yaml | 57 ++++++++++++++++++++++
> > >>> 1 file changed, 57 insertions(+)
> > >>> create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> > >>>
> > >>> diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> > >>> new file mode 100644
> > >>> index 00000000..6b4e0e0
> > >>> --- /dev/null
> > >>> +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> > >>> @@ -0,0 +1,57 @@
> > >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > >>> +%YAML 1.2
> > >>> +---
> > >>> +$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056-adc.yaml#
> > >>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > >>> +
> > >>> +title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC
> > >>> +
> > >>> +maintainers:
> > >>> + - ChiYuan Huang <[email protected]>
> > >>> +
> > >>> +description: |
> > >>> + The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
> > >>> + interface, and the device provides full information for system by reading
> > >>> + out the loading current and power.
> > >>> +
> > >>> + The device monitors both of the drops across sense resistor and the BUS
> > >>> + voltage, converts into the current in amperes, and power in watts through
> > >>> + internal analog-to-digital converter ADC. The programmable calibration,
> > >>> + adjustable conversion time, and averaging function are also built in for
> > >>> + more design flexibility.
> > >>> +
> > >>> + Datasheet is available at
> > >>> + https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf
> > >>> +
> > >>> +properties:
> > >>> + compatible:
> > >>> + const: richtek,rtq6056
> > >>> +
> > >>> + reg:
> > >>> + maxItems: 1
> > >>> +
> > >>> + "#io-channel-cells":
> > >>> + const: 1
> > >>> +
> > >>> + richtek,shunt-resistor-uohm:
> > >>
> > >> Use standard properties, so "-micro-ohms". Drop the unit from
> > >> description and drop the ref.
> > >>
> > > Use richtek.shunt-resistor-micro-ohms?
> >
> > Yes.
> >
> > > Or the prefix 'richtek,' can be removed?
> >
> > No, the vendor prefix must stay.
>
> It's a standard generic binding used in a bunch of IIO and hwmon
> drivers without vendor prefix. Mind you I can't find a definition

by which I meant to say "bindings" not drivers :)

> in any of the top level binding files. Probably wants to be in
> adc.yaml for IIO.
>
> Jonathan
>
>
> >
> > Best regards,
> > Krzysztof
>

2022-06-18 18:08:39

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: Add rtq6056 adc support

On Sat, 18 Jun 2022 19:00:19 +0200
Krzysztof Kozlowski <[email protected]> wrote:

> On 18/06/2022 08:50, ChiYuan Huang wrote:
> > Krzysztof Kozlowski <[email protected]> 於 2022年6月18日 週六 上午9:45寫道:
> >>
> >> On 17/06/2022 02:32, cy_huang wrote:
> >>> From: ChiYuan Huang <[email protected]>
> >>>
> >>> Add the documentation for Richtek RTQ6056.
> >>>
> >>> Signed-off-by: ChiYuan Huang <[email protected]>
> >>> ---
> >>> .../bindings/iio/adc/richtek,rtq6056-adc.yaml | 57 ++++++++++++++++++++++
> >>> 1 file changed, 57 insertions(+)
> >>> create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> >>> new file mode 100644
> >>> index 00000000..6b4e0e0
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
> >>> @@ -0,0 +1,57 @@
> >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >>> +%YAML 1.2
> >>> +---
> >>> +$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056-adc.yaml#
> >>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >>> +
> >>> +title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC
> >>> +
> >>> +maintainers:
> >>> + - ChiYuan Huang <[email protected]>
> >>> +
> >>> +description: |
> >>> + The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
> >>> + interface, and the device provides full information for system by reading
> >>> + out the loading current and power.
> >>> +
> >>> + The device monitors both of the drops across sense resistor and the BUS
> >>> + voltage, converts into the current in amperes, and power in watts through
> >>> + internal analog-to-digital converter ADC. The programmable calibration,
> >>> + adjustable conversion time, and averaging function are also built in for
> >>> + more design flexibility.
> >>> +
> >>> + Datasheet is available at
> >>> + https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf
> >>> +
> >>> +properties:
> >>> + compatible:
> >>> + const: richtek,rtq6056
> >>> +
> >>> + reg:
> >>> + maxItems: 1
> >>> +
> >>> + "#io-channel-cells":
> >>> + const: 1
> >>> +
> >>> + richtek,shunt-resistor-uohm:
> >>
> >> Use standard properties, so "-micro-ohms". Drop the unit from
> >> description and drop the ref.
> >>
> > Use richtek.shunt-resistor-micro-ohms?
>
> Yes.
>
> > Or the prefix 'richtek,' can be removed?
>
> No, the vendor prefix must stay.

It's a standard generic binding used in a bunch of IIO and hwmon
drivers without vendor prefix. Mind you I can't find a definition
in any of the top level binding files. Probably wants to be in
adc.yaml for IIO.

Jonathan


>
> Best regards,
> Krzysztof

2022-06-19 10:30:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: Add rtq6056 adc support

On 18/06/2022 19:34, Jonathan Cameron wrote:
> On Sat, 18 Jun 2022 19:00:19 +0200
> Krzysztof Kozlowski <[email protected]> wrote:
>
>> On 18/06/2022 08:50, ChiYuan Huang wrote:
>>> Krzysztof Kozlowski <[email protected]> 於 2022年6月18日 週六 上午9:45寫道:
>>>>
>>>> On 17/06/2022 02:32, cy_huang wrote:
>>>>> From: ChiYuan Huang <[email protected]>
>>>>>
>>>>> Add the documentation for Richtek RTQ6056.
>>>>>
>>>>> Signed-off-by: ChiYuan Huang <[email protected]>
>>>>> ---
>>>>> .../bindings/iio/adc/richtek,rtq6056-adc.yaml | 57 ++++++++++++++++++++++
>>>>> 1 file changed, 57 insertions(+)
>>>>> create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
>>>>> new file mode 100644
>>>>> index 00000000..6b4e0e0
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056-adc.yaml
>>>>> @@ -0,0 +1,57 @@
>>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>>>> +%YAML 1.2
>>>>> +---
>>>>> +$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056-adc.yaml#
>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>>> +
>>>>> +title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC
>>>>> +
>>>>> +maintainers:
>>>>> + - ChiYuan Huang <[email protected]>
>>>>> +
>>>>> +description: |
>>>>> + The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
>>>>> + interface, and the device provides full information for system by reading
>>>>> + out the loading current and power.
>>>>> +
>>>>> + The device monitors both of the drops across sense resistor and the BUS
>>>>> + voltage, converts into the current in amperes, and power in watts through
>>>>> + internal analog-to-digital converter ADC. The programmable calibration,
>>>>> + adjustable conversion time, and averaging function are also built in for
>>>>> + more design flexibility.
>>>>> +
>>>>> + Datasheet is available at
>>>>> + https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf
>>>>> +
>>>>> +properties:
>>>>> + compatible:
>>>>> + const: richtek,rtq6056
>>>>> +
>>>>> + reg:
>>>>> + maxItems: 1
>>>>> +
>>>>> + "#io-channel-cells":
>>>>> + const: 1
>>>>> +
>>>>> + richtek,shunt-resistor-uohm:
>>>>
>>>> Use standard properties, so "-micro-ohms". Drop the unit from
>>>> description and drop the ref.
>>>>
>>> Use richtek.shunt-resistor-micro-ohms?
>>
>> Yes.
>>
>>> Or the prefix 'richtek,' can be removed?
>>
>> No, the vendor prefix must stay.
>
> It's a standard generic binding used in a bunch of IIO and hwmon
> drivers without vendor prefix. Mind you I can't find a definition
> in any of the top level binding files. Probably wants to be in
> adc.yaml for IIO.

Indeed, thanks for correcting me. It should be just
"shunt-resistor-micro-ohms" then.


Best regards,
Krzysztof