2023-07-25 11:49:50

by Naresh Solanki

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: hwmon: Add Infineon TDA38640

From: Patrick Rudolph <[email protected]>

The TDA38640 has a bug in SVID mode and to enable a workaround
remove the TDA38640 from trivial-devices and add a complete schema.

The schema adds the custom property 'infineon,en-pin-fixed-level' to
signal a fixed level on the ENABLE pin and to enable the workaround.
When the ENABLE pin is left floating it's internally pulled low.

If not specified the driver will continue to use the PMBUS_OPERATION
register to enable the regulator. When specified the driver will use
the PMBUS_ON_OFF_CONFIG register to enable the regulator.

Signed-off-by: Patrick Rudolph <[email protected]>
Signed-off-by: Naresh Solanki <[email protected]>
---
.../hwmon/pmbus/infineon,tda38640.yaml | 50 +++++++++++++++++++
.../devicetree/bindings/trivial-devices.yaml | 2 -
2 files changed, 50 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
new file mode 100644
index 000000000000..520112e4e271
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/pmbus/infineon,tda38640.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Infineon TDA38640 Synchronous Buck Regulator with SVID and I2C
+
+description: |
+ The Infineon TDA38640 is a 40A Single-voltage Synchronous Buck
+ Regulator with SVID and I2C designed for Industrial use.
+
+ Datasheet: https://www.infineon.com/dgdl/Infineon-TDA38640-0000-DataSheet-v02_04-EN.pdf?fileId=8ac78c8c80027ecd018042f2337f00c9
+
+properties:
+ compatible:
+ enum:
+ - infineon,tda38640
+
+ reg:
+ maxItems: 1
+
+ infineon,en-pin-fixed-level:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Fixed level of the ENABLE pin. When specified the PMBUS_ON_OFF_CONFIG
+ register is used to enable the regulator instead of the PMBUS_OPERATION
+ register to workaround a bug of the tda38640 when operating in SVID-mode.
+ If the ENABLE pin is left floating the internal pull-down causes a low
+ level on the pin.
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ tda38640@40 {
+ compatible = "infineon,tda38640";
+ reg = <0x40>;
+ };
+ };
+
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index 6e24c4d25ec3..2b1fbb2a672b 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -151,8 +151,6 @@ properties:
- infineon,slb9645tt
# Infineon SLB9673 I2C TPM 2.0
- infineon,slb9673
- # Infineon TDA38640 Voltage Regulator
- - infineon,tda38640
# Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
- infineon,tlv493d-a1b6
# Infineon Multi-phase Digital VR Controller xdpe11280

base-commit: 55612007f16b5d7b1fb83a7b0f5bb686829db7c7
--
2.41.0



2023-07-25 12:38:28

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: hwmon: Add Infineon TDA38640


On Tue, 25 Jul 2023 13:40:26 +0200, Naresh Solanki wrote:
> From: Patrick Rudolph <[email protected]>
>
> The TDA38640 has a bug in SVID mode and to enable a workaround
> remove the TDA38640 from trivial-devices and add a complete schema.
>
> The schema adds the custom property 'infineon,en-pin-fixed-level' to
> signal a fixed level on the ENABLE pin and to enable the workaround.
> When the ENABLE pin is left floating it's internally pulled low.
>
> If not specified the driver will continue to use the PMBUS_OPERATION
> register to enable the regulator. When specified the driver will use
> the PMBUS_ON_OFF_CONFIG register to enable the regulator.
>
> Signed-off-by: Patrick Rudolph <[email protected]>
> Signed-off-by: Naresh Solanki <[email protected]>
> ---
> .../hwmon/pmbus/infineon,tda38640.yaml | 50 +++++++++++++++++++
> .../devicetree/bindings/trivial-devices.yaml | 2 -
> 2 files changed, 50 insertions(+), 2 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml: 'maintainers' is a required property
hint: Metaschema for devicetree binding documentation
from schema $id: http://devicetree.org/meta-schemas/core.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


2023-07-25 12:52:26

by Naresh Solanki

[permalink] [raw]
Subject: [PATCH 2/3] hwmon: (pmbus) Add ON_OFF_CONFIG register bits

From: Patrick Rudolph <[email protected]>

Add bits found in the ON_OFF_CONFIG register.

Signed-off-by: Patrick Rudolph <[email protected]>
Signed-off-by: Naresh Solanki <[email protected]>
---
drivers/hwmon/pmbus/pmbus.h | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index b0832a4c690d..7a28bac7f171 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -243,6 +243,15 @@ enum pmbus_regs {
*/
#define PB_OPERATION_CONTROL_ON BIT(7)

+/*
+ * ON_OFF_CONFIG
+ */
+#define PB_ON_OFF_CONFIG_POWERUP_CONTROL BIT(4)
+#define PB_ON_OFF_CONFIG_OPERATION_REQ BIT(3)
+#define PB_ON_OFF_CONFIG_EN_PIN_REQ BIT(2)
+#define PB_ON_OFF_CONFIG_POLARITY_HIGH BIT(1)
+#define PB_ON_OFF_CONFIG_TURN_OFF_FAST BIT(0)
+
/*
* WRITE_PROTECT
*/
--
2.41.0


2023-07-25 13:21:02

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: hwmon: Add Infineon TDA38640

On Tue, Jul 25, 2023 at 01:40:26PM +0200, Naresh Solanki wrote:
> From: Patrick Rudolph <[email protected]>
>
> The TDA38640 has a bug in SVID mode and to enable a workaround
> remove the TDA38640 from trivial-devices and add a complete schema.
>
> The schema adds the custom property 'infineon,en-pin-fixed-level' to
> signal a fixed level on the ENABLE pin and to enable the workaround.
> When the ENABLE pin is left floating it's internally pulled low.
>
> If not specified the driver will continue to use the PMBUS_OPERATION
> register to enable the regulator. When specified the driver will use
> the PMBUS_ON_OFF_CONFIG register to enable the regulator.
>
> Signed-off-by: Patrick Rudolph <[email protected]>
> Signed-off-by: Naresh Solanki <[email protected]>
> ---
> .../hwmon/pmbus/infineon,tda38640.yaml | 50 +++++++++++++++++++
> .../devicetree/bindings/trivial-devices.yaml | 2 -
> 2 files changed, 50 insertions(+), 2 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
>
> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
> new file mode 100644
> index 000000000000..520112e4e271
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/pmbus/infineon,tda38640.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Infineon TDA38640 Synchronous Buck Regulator with SVID and I2C
> +
> +description: |
> + The Infineon TDA38640 is a 40A Single-voltage Synchronous Buck
> + Regulator with SVID and I2C designed for Industrial use.
> +
> + Datasheet: https://www.infineon.com/dgdl/Infineon-TDA38640-0000-DataSheet-v02_04-EN.pdf?fileId=8ac78c8c80027ecd018042f2337f00c9
> +
> +properties:
> + compatible:
> + enum:
> + - infineon,tda38640
> +
> + reg:
> + maxItems: 1
> +
> + infineon,en-pin-fixed-level:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: |
> + Fixed level of the ENABLE pin. When specified the PMBUS_ON_OFF_CONFIG
> + register is used to enable the regulator instead of the PMBUS_OPERATION
> + register to workaround a bug of the tda38640 when operating in SVID-mode.
> + If the ENABLE pin is left floating the internal pull-down causes a low
> + level on the pin.

Neither this nor the commit message answers how do I decide if I set
this property or not? How you work-around it is not that relevant to the
binding.

> +
> +required:
> + - compatible
> + - reg
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + tda38640@40 {
> + compatible = "infineon,tda38640";
> + reg = <0x40>;
> + };
> + };
> +
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> index 6e24c4d25ec3..2b1fbb2a672b 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -151,8 +151,6 @@ properties:
> - infineon,slb9645tt
> # Infineon SLB9673 I2C TPM 2.0
> - infineon,slb9673
> - # Infineon TDA38640 Voltage Regulator
> - - infineon,tda38640
> # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
> - infineon,tlv493d-a1b6
> # Infineon Multi-phase Digital VR Controller xdpe11280
>
> base-commit: 55612007f16b5d7b1fb83a7b0f5bb686829db7c7
> --
> 2.41.0
>

2023-07-25 14:59:25

by Naresh Solanki

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: hwmon: Add Infineon TDA38640

Hi Rob,


On Tue, 25 Jul 2023 at 18:40, Rob Herring <[email protected]> wrote:
>
> On Tue, Jul 25, 2023 at 01:40:26PM +0200, Naresh Solanki wrote:
> > From: Patrick Rudolph <[email protected]>
> >
> > The TDA38640 has a bug in SVID mode and to enable a workaround
> > remove the TDA38640 from trivial-devices and add a complete schema.
> >
> > The schema adds the custom property 'infineon,en-pin-fixed-level' to
> > signal a fixed level on the ENABLE pin and to enable the workaround.
> > When the ENABLE pin is left floating it's internally pulled low.
> >
> > If not specified the driver will continue to use the PMBUS_OPERATION
> > register to enable the regulator. When specified the driver will use
> > the PMBUS_ON_OFF_CONFIG register to enable the regulator.
> >
> > Signed-off-by: Patrick Rudolph <[email protected]>
> > Signed-off-by: Naresh Solanki <[email protected]>
> > ---
> > .../hwmon/pmbus/infineon,tda38640.yaml | 50 +++++++++++++++++++
> > .../devicetree/bindings/trivial-devices.yaml | 2 -
> > 2 files changed, 50 insertions(+), 2 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
> > new file mode 100644
> > index 000000000000..520112e4e271
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
> > @@ -0,0 +1,50 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +
> > +$id: http://devicetree.org/schemas/hwmon/pmbus/infineon,tda38640.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Infineon TDA38640 Synchronous Buck Regulator with SVID and I2C
> > +
> > +description: |
> > + The Infineon TDA38640 is a 40A Single-voltage Synchronous Buck
> > + Regulator with SVID and I2C designed for Industrial use.
> > +
> > + Datasheet: https://www.infineon.com/dgdl/Infineon-TDA38640-0000-DataSheet-v02_04-EN.pdf?fileId=8ac78c8c80027ecd018042f2337f00c9
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - infineon,tda38640
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + infineon,en-pin-fixed-level:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: |
> > + Fixed level of the ENABLE pin. When specified the PMBUS_ON_OFF_CONFIG
> > + register is used to enable the regulator instead of the PMBUS_OPERATION
> > + register to workaround a bug of the tda38640 when operating in SVID-mode.
> > + If the ENABLE pin is left floating the internal pull-down causes a low
> > + level on the pin.
>
> Neither this nor the commit message answers how do I decide if I set
> this property or not? How you work-around it is not that relevant to the
> binding.
Sure will update this as:
The property becomes relevant when dealing with the tda38640 in
SVID-mode, providing an alternative method to enable the regulator by
using the PMBUS_ON_OFF_CONFIG register instead of the PMBUS_OPERATION
register

Regards,
Naresh
>
> > +
> > +required:
> > + - compatible
> > + - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + i2c {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + tda38640@40 {
> > + compatible = "infineon,tda38640";
> > + reg = <0x40>;
> > + };
> > + };
> > +
> > diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> > index 6e24c4d25ec3..2b1fbb2a672b 100644
> > --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> > +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> > @@ -151,8 +151,6 @@ properties:
> > - infineon,slb9645tt
> > # Infineon SLB9673 I2C TPM 2.0
> > - infineon,slb9673
> > - # Infineon TDA38640 Voltage Regulator
> > - - infineon,tda38640
> > # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
> > - infineon,tlv493d-a1b6
> > # Infineon Multi-phase Digital VR Controller xdpe11280
> >
> > base-commit: 55612007f16b5d7b1fb83a7b0f5bb686829db7c7
> > --
> > 2.41.0
> >

2023-07-25 15:02:00

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: hwmon: Add Infineon TDA38640

On 7/25/23 07:17, Naresh Solanki wrote:
> Hi Rob,
>
>
> On Tue, 25 Jul 2023 at 18:40, Rob Herring <[email protected]> wrote:
>>
>> On Tue, Jul 25, 2023 at 01:40:26PM +0200, Naresh Solanki wrote:
>>> From: Patrick Rudolph <[email protected]>
>>>
>>> The TDA38640 has a bug in SVID mode and to enable a workaround
>>> remove the TDA38640 from trivial-devices and add a complete schema.
>>>
>>> The schema adds the custom property 'infineon,en-pin-fixed-level' to
>>> signal a fixed level on the ENABLE pin and to enable the workaround.
>>> When the ENABLE pin is left floating it's internally pulled low.
>>>
>>> If not specified the driver will continue to use the PMBUS_OPERATION
>>> register to enable the regulator. When specified the driver will use
>>> the PMBUS_ON_OFF_CONFIG register to enable the regulator.
>>>
>>> Signed-off-by: Patrick Rudolph <[email protected]>
>>> Signed-off-by: Naresh Solanki <[email protected]>
>>> ---
>>> .../hwmon/pmbus/infineon,tda38640.yaml | 50 +++++++++++++++++++
>>> .../devicetree/bindings/trivial-devices.yaml | 2 -
>>> 2 files changed, 50 insertions(+), 2 deletions(-)
>>> create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
>>> new file mode 100644
>>> index 000000000000..520112e4e271
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/hwmon/pmbus/infineon,tda38640.yaml
>>> @@ -0,0 +1,50 @@
>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +
>>> +$id: http://devicetree.org/schemas/hwmon/pmbus/infineon,tda38640.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Infineon TDA38640 Synchronous Buck Regulator with SVID and I2C
>>> +
>>> +description: |
>>> + The Infineon TDA38640 is a 40A Single-voltage Synchronous Buck
>>> + Regulator with SVID and I2C designed for Industrial use.
>>> +
>>> + Datasheet: https://www.infineon.com/dgdl/Infineon-TDA38640-0000-DataSheet-v02_04-EN.pdf?fileId=8ac78c8c80027ecd018042f2337f00c9
>>> +
>>> +properties:
>>> + compatible:
>>> + enum:
>>> + - infineon,tda38640
>>> +
>>> + reg:
>>> + maxItems: 1
>>> +
>>> + infineon,en-pin-fixed-level:
>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>> + description: |
>>> + Fixed level of the ENABLE pin. When specified the PMBUS_ON_OFF_CONFIG
>>> + register is used to enable the regulator instead of the PMBUS_OPERATION
>>> + register to workaround a bug of the tda38640 when operating in SVID-mode.
>>> + If the ENABLE pin is left floating the internal pull-down causes a low
>>> + level on the pin.
>>
>> Neither this nor the commit message answers how do I decide if I set
>> this property or not? How you work-around it is not that relevant to the
>> binding.
> Sure will update this as:
> The property becomes relevant when dealing with the tda38640 in
> SVID-mode, providing an alternative method to enable the regulator by
> using the PMBUS_ON_OFF_CONFIG register instead of the PMBUS_OPERATION
> register
>

As mentioned in the other e-mail, I'll want to see an explanation why
this property is even needed. The series claims that the chip has a bug
in SVID mode. It is kind of unusual that we would enable a workaround
for a bug with a devicetree property if the circumstance (SVID mode)
can be determined automatically.

Guenter

> Regards,
> Naresh
>>
>>> +
>>> +required:
>>> + - compatible
>>> + - reg
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> + - |
>>> + i2c {
>>> + #address-cells = <1>;
>>> + #size-cells = <0>;
>>> +
>>> + tda38640@40 {
>>> + compatible = "infineon,tda38640";
>>> + reg = <0x40>;
>>> + };
>>> + };
>>> +
>>> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
>>> index 6e24c4d25ec3..2b1fbb2a672b 100644
>>> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
>>> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
>>> @@ -151,8 +151,6 @@ properties:
>>> - infineon,slb9645tt
>>> # Infineon SLB9673 I2C TPM 2.0
>>> - infineon,slb9673
>>> - # Infineon TDA38640 Voltage Regulator
>>> - - infineon,tda38640
>>> # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
>>> - infineon,tlv493d-a1b6
>>> # Infineon Multi-phase Digital VR Controller xdpe11280
>>>
>>> base-commit: 55612007f16b5d7b1fb83a7b0f5bb686829db7c7
>>> --
>>> 2.41.0
>>>