hwmon: (pmbus) Use PMBUS_REGULATOR_ONE to declare regulators with single output
Guenter Roeck
maintainercover hwmon: (pmbus) Use PMBUS_REGULATOR_ONE to declare regulators with single output
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulators for chips with a single ouput using PMBUS_REGULATOR_ONE() to make that happen.
----------------------------------------------------------------
Guenter Roeck (3):
hwmon: (pmbus/tda38640) Use PMBUS_REGULATOR_ONE to declare regulator
hwmon: (pmbus/lm25066) Use PMBUS_REGULATOR_ONE to declare regulator
hwmon: (pmbus/ir38064) Use PMBUS_REGULATOR_ONE to declare regulator
drivers/hwmon/pmbus/ir38064.c | 2 +- drivers/hwmon/pmbus/lm25066.c | 2 +- drivers/hwmon/pmbus/tda38640.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Guenter Roeck
maintainerPATCH 1/3 hwmon: (pmbus/tda38640) Use PMBUS_REGULATOR_ONE to declare regulator
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulator using PMBUS_REGULATOR_ONE() to make that happen.
--- drivers/hwmon/pmbus/tda38640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/pmbus/tda38640.c +1 -1
@@ -15,7 +15,7 @@#include "pmbus.h" static const struct regulator_desc __maybe_unused tda38640_reg_desc[] = { -PMBUS_REGULATOR ("vout" ,0 ), +PMBUS_REGULATOR_ONE ("vout" ), };struct tda38640_data {
Signature · 1 line
2.39.2
Guenter Roeck
maintainerPATCH 2/3 hwmon: (pmbus/lm25066) Use PMBUS_REGULATOR_ONE to declare regulator
In reply to Guenter RoeckIf a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulator using PMBUS_REGULATOR_ONE() to make that happen.
--- drivers/hwmon/pmbus/lm25066.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/pmbus/lm25066.c +1 -1
@@ -437,7 +437,7 @@ static int lm25066_write_word_data(struct i2c_client *client, int page, int reg,#if IS_ENABLED (CONFIG_SENSORS_LM25066_REGULATOR )static const struct regulator_desc lm25066_reg_desc[] = { -PMBUS_REGULATOR ("vout" ,0 ), +PMBUS_REGULATOR_ONE ("vout" ), };#endif
Signature · 1 line
2.39.2
Re: [PATCH 2/3] hwmon: (pmbus/lm25066) Use PMBUS_REGULATOR_ONE to declare regulator
Quoted 4 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulator using
PMBUS_REGULATOR_ONE()to make that happen.
Hi Guenter,
This will necessitate a DTS update on at least one platform to maintain compatibility (Delta ahe50dc BMC, [1]). I'm not sure offhand if there are process/policy rules about mixing code changes and device-tree changes in the same commit, but changing either one without the other would break things.
Thanks,
Zev
Guenter Roeck
maintainerRe: [PATCH 2/3] hwmon: (pmbus/lm25066) Use PMBUS_REGULATOR_ONE to declare regulator
Quoted 6 lines · Zev Weiss
Quoted 4 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulator using
PMBUS_REGULATOR_ONE()to make that happen.
Quoted 7 lines
Hi Guenter,
This will necessitate a DTS update on at least one platform to maintain compatibility (Delta ahe50dc BMC, [1]). I'm not sure offhand if there are process/policy rules about mixing code changes and device-tree changes in the same commit, but changing either one without the other would break things.
Sigh. Agreed, especially since changing the dts file in the kernel won't change the dtb files on actual hardware.
I really have no good solution for this. We (Well, I) didn't realize that there are regulator naming conventions/restrictions when we introduced regulator support into PMBus drivers. My bad. Let's see what others say.
Guenter
Re: [PATCH 2/3] hwmon: (pmbus/lm25066) Use PMBUS_REGULATOR_ONE to declare regulator
Quoted 15 lines · Guenter Roeck
Quoted 6 lines · Zev Weiss
Quoted 4 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulator using
PMBUS_REGULATOR_ONE()to make that happen.Quoted 7 lines
Hi Guenter,
This will necessitate a DTS update on at least one platform to maintain compatibility (Delta ahe50dc BMC, [1]). I'm not sure offhand if there are process/policy rules about mixing code changes and device-tree changes in the same commit, but changing either one without the other would break things.
Quoted 9 lines
Sigh. Agreed, especially since changing the dts file in the kernel won't change the dtb files on actual hardware.
I really have no good solution for this. We (Well, I) didn't realize that there are regulator naming conventions/restrictions when we introduced regulator support into PMBus drivers. My bad. Let's see what others say.
Guenter
Well, perhaps mitigating that slightly: I don't see any obvious cases of any other platforms' device-trees having any dependencies on the regulator naming that would be affected by this (judging by 'git grep vout0 arch/*/boot/dts' anyway), and at least with OpenBMC on the ahe50dc (the primary and AFAIK only user of that device-tree) the dtb would also be updated along with any kernel update.
So I wouldn't expect it to cause anyone any actual problems if we went ahead and changed it anyway; as long as the dts & driver do stay in sync with each other, maybe we could let it slide if it's otherwise a desirable change to make?
Zev
Re: [PATCH 2/3] hwmon: (pmbus/lm25066) Use PMBUS_REGULATOR_ONE to declare regulator
Quoted 23 lines · Zev Weiss
Quoted 22 lines · Guenter Roeck
Quoted 6 lines · Zev Weiss
Quoted 4 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulator using
PMBUS_REGULATOR_ONE()to make that happen.Quoted 7 lines
Hi Guenter,
This will necessitate a DTS update on at least one platform to maintain compatibility (Delta ahe50dc BMC, [1]). I'm not sure offhand if there are process/policy rules about mixing code changes and device-tree changes in the same commit, but changing either one without the other would break things.
Sigh. Agreed, especially since changing the dts file in the kernel won't change the dtb files on actual hardware.
I really have no good solution for this. We (Well, I) didn't realize that there are regulator naming conventions/restrictions when we introduced regulator support into PMBus drivers. My bad. Let's see what others say.
Quoted 7 lines
Quoted 2 lines
Guenter
Well, perhaps mitigating that slightly: I don't see any obvious cases of any other platforms' device-trees having any dependencies on the regulator naming that would be affected by this (judging by 'git grep vout0
arch/*/boot/dts' anyway),
Which is a good thing, as none of these devices' bindings actually allow
regulator. Aspeed devicetrees are a mess of non-compliance with the
bindings, so I suppose that this is not surprising, but somewhere in the
wall of complaints there is a:
aspeed-bmc-delta-ahe50dc.dtb: /ahb/apb/bus@1e78a000/i2c-bus@40/pca9541@79/i2c-arb/efuse@12: failed to match any schema with compatible: ['lm25066']
I mentioned this on the other thread, but I guess the kernel is actually using the i2c_device_ids to probe the driver and not the compatible, since the documented compatible and the compatibles in the driver have a vendor prefix?
Quoted 8 lines
and at least with OpenBMC on the ahe50dc (the
primary and AFAIK only user of that device-tree) the dtb would also be updated along with any kernel update.So I wouldn't expect it to cause anyone any actual problems if we went ahead and changed it anyway; as long as the dts & driver do stay in sync with each other, maybe we could let it slide if it's otherwise a desirable change to make?
I think having "vout0" when there's nothing else looks a bit odd, but I'm not gonna lose sleep over "vout0" being used if its used in device documentation or is convention.
Whatever is done, please document the regulator child node in the binding for this device and fix the dts to use a real compatible.
Cheers,
Conor.
Guenter Roeck
maintainerPATCH 3/3 hwmon: (pmbus/ir38064) Use PMBUS_REGULATOR_ONE to declare regulator
In reply to Guenter RoeckIf a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulator using PMBUS_REGULATOR_ONE() to make that happen.
--- drivers/hwmon/pmbus/ir38064.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/pmbus/ir38064.c +1 -1
@@ -22,7 +22,7 @@#if IS_ENABLED (CONFIG_SENSORS_IR38064_REGULATOR )static const struct regulator_desc ir38064_reg_desc[] = { -PMBUS_REGULATOR ("vout" ,0 ), +PMBUS_REGULATOR_ONE ("vout" ), };#endif /* CONFIG_SENSORS_IR38064_REGULATOR */
Signature · 1 line
2.39.2
Quoted 3 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulators for chips with a single ouput using
PMBUS_REGULATOR_ONE()to make that happen.
If we're gonna do this, we should go ahead and document each of these regulators. If Naresh sends a v2 for the tda, I could do the others.
Quoted 11 lines
----------------------------------------------------------------
Guenter Roeck (3):
hwmon: (pmbus/tda38640) UsePMBUS_REGULATOR_ONEto declare regulator
hwmon: (pmbus/lm25066) UsePMBUS_REGULATOR_ONEto declare regulator
hwmon: (pmbus/ir38064) UsePMBUS_REGULATOR_ONEto declare regulatordrivers/hwmon/pmbus/ir38064.c | 2 +- drivers/hwmon/pmbus/lm25066.c | 2 +- drivers/hwmon/pmbus/tda38640.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Quoted 7 lines · Conor Dooley
Quoted 3 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulators for chips with a single ouput using
PMBUS_REGULATOR_ONE()to make that happen.If we're gonna do this, we should go ahead and document each of these regulators. If Naresh sends a v2 for the tda, I could do the others.
As it turns out, the infineon devices in question are not PMICs, but regulators themselves. I think something like the following is what we need. Perhaps Zev or the 9elements guys can comment.
Cheers,
Conor.
commit 9cf2671c0b98c0a0dd599fe9152985d1320bf320
Author: Conor Dooley <[email protected]> Date: Mon Feb 19 14:24:48 2024 +0000
dt-bindings: regulator: promote infineon buck converters to their own binding
These devices may need to make use of the common regulator properties, but these are not permitted while only documented in trivial-devices.yaml
Documentation/devicetree/bindings/regulator/infineon,ir38060.yaml new file +46 -0
@@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/infineon,ir38060.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Infineon Buck Regulators with PMBUS interfaces + +maintainers: + - Not Me. + +allOf: + - $ref: regulator.yaml# + +properties: + compatible: + enum: + - infineon,ir38060 + - infineon,ir38064 + - infineon,ir38164 + - infineon,ir38263 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + regulator@34 { + compatible = "infineon,ir38060"; + reg = <0x34>; + + regulator-min-microvolt = <437500>; + regulator-max-microvolt = <1387500>; + }; + }; +
Documentation/devicetree/bindings/trivial-devices.yaml +0 -8
@@ -130,14 +130,6 @@ properties: - infineon,dps310 # Infineon IR36021 digital POL buck controller - infineon,ir36021 - # Infineon IR38060 Voltage Regulator - - infineon,ir38060 - # Infineon IR38064 Voltage Regulator - - infineon,ir38064 - # Infineon IR38164 Voltage Regulator - - infineon,ir38164 - # Infineon IR38263 Voltage Regulator - - infineon,ir38263 # Infineon IRPS5401 Voltage Regulator (PMIC) - infineon,irps5401 # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
commit 597739840d2bc95ebb884d7f5fc4f3cc206d9af6
Author: Conor Dooley <[email protected]> Date: Mon Feb 19 13:29:12 2024 +0000
dt-bindings: hwmon/pmbus: ti,lm25066: document regulators
All devices documented in the lm25066 binding are intended for use with a regulator, be that for purely monitoring purposes (lm25056) or, for the other devices, as the controller of that regulator. The binding does not currently allow regulator child nodes, so add one.
Each of these devices interacts with only a single regulator and documentation refers to it as "Vout", hence the choice of child node name.
Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml +12 -0
@@ -34,6 +34,18 @@ properties: Shunt (sense) resistor value in micro-Ohms default: 1000 + regulators: + type: object + + properties: + vout: + $ref: /schemas/regulator/regulator.yaml# + type: object + + unevaluatedProperties: false + + additionalProperties: false + required: - compatible - reg
Guenter Roeck
maintainerQuoted 6 lines · Conor Dooley
Quoted 5 lines · Conor Dooley
Quoted 3 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulators for chips with a single ouput using
PMBUS_REGULATOR_ONE()to make that happen.
Quoted 7 lines
Quoted 2 lines
If we're gonna do this, we should go ahead and document each of these regulators. If Naresh sends a v2 for the tda, I could do the others.
As it turns out, the infineon devices in question are not PMICs, but regulators themselves. I think something like the following is what we need. Perhaps Zev or the 9elements guys can comment.
IMO The lm25066 patch should be separate.
Guenter
Quoted 127 lines
Cheers,
Conor.commit
9cf2671c0b98c0a0dd599fe9152985d1320bf320Author: Conor Dooley <[email protected]> Date: Mon Feb 19 14:24:48 2024 +0000dt-bindings: regulator: promote infineon buck converters to their own binding
These devices may need to make use of the common regulator properties, but these are not permitted while only documented in
trivial-devices.yamlSigned-off-by Conor Dooley <[email protected]>Documentation/devicetree/bindings/regulator/infineon,ir38060.yaml new file +46
-0@@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/infineon,ir38060.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Infineon Buck Regulators with PMBUS interfaces + +maintainers: + - Not Me. + +allOf: + - $ref: regulator.yaml# + +properties: + compatible: + enum: + - infineon,ir38060 + - infineon,ir38064 + - infineon,ir38164 + - infineon,ir38263 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + regulator@34 { + compatible = "infineon,ir38060"; + reg = <0x34>; + + regulator-min-microvolt = <437500>; + regulator-max-microvolt = <1387500>; + }; + }; +Documentation/devicetree/bindings/trivial-devices.yaml +0
-8@@ -130,14 +130,6 @@ properties: - infineon,dps310 # Infineon IR36021 digital POL buck controller - infineon,ir36021 - # Infineon IR38060 Voltage Regulator - - infineon,ir38060 - # Infineon IR38064 Voltage Regulator - - infineon,ir38064 - # Infineon IR38164 Voltage Regulator - - infineon,ir38164 - # Infineon IR38263 Voltage Regulator - - infineon,ir38263 # Infineon IRPS5401 Voltage Regulator (PMIC) - infineon,irps5401 # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensorcommit
597739840d2bc95ebb884d7f5fc4f3cc206d9af6Author: Conor Dooley <[email protected]> Date: Mon Feb 19 13:29:12 2024 +0000dt-bindings: hwmon/pmbus: ti,lm25066: document regulators
All devices documented in the lm25066 binding are intended for use with a regulator, be that for purely monitoring purposes (lm25056) or, for the other devices, as the controller of that regulator. The binding does not currently allow regulator child nodes, so add one.
Each of these devices interacts with only a single regulator and documentation refers to it as "Vout", hence the choice of child node name.
Signed-off-by Conor Dooley <[email protected]>Documentation/devicetree/bindings/hwmon/pmbus/ti,lm25066.yaml +12
-0@@ -34,6 +34,18 @@ properties: Shunt (sense) resistor value in micro-Ohms default: 1000 + regulators: + type: object + + properties: + vout: + $ref: /schemas/regulator/regulator.yaml# + type: object + + unevaluatedProperties: false + + additionalProperties: false + required: - compatible - reg
Quoted 7 lines · Guenter Roeck
Quoted 6 lines · Conor Dooley
Quoted 5 lines · Conor Dooley
Quoted 3 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulators for chips with a single ouput using
PMBUS_REGULATOR_ONE()to make that happen.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
If we're gonna do this, we should go ahead and document each of these regulators. If Naresh sends a v2 for the tda, I could do the others.
As it turns out, the infineon devices in question are not PMICs, but regulators themselves. I think something like the following is what we need. Perhaps Zev or the 9elements guys can comment.
IMO The lm25066 patch should be separate.
It should already be a pair of changes - one for the infineon stuff and another for the ti devices:
Quoted 23 lines
Quoted 23 lines
commit
9cf2671c0b98c0a0dd599fe9152985d1320bf320Author: Conor Dooley <[email protected]> Date: Mon Feb 19 14:24:48 2024 +0000dt-bindings: regulator: promote infineon buck converters to their own binding These devices may need to make use of the common regulator properties, but these are not permitted while only documented in
trivial-devices.yamlSigned-off-by Conor Dooley <[email protected]>commit
597739840d2bc95ebb884d7f5fc4f3cc206d9af6Author: Conor Dooley <[email protected]> Date: Mon Feb 19 13:29:12 2024 +0000dt-bindings: hwmon/pmbus: ti,lm25066: document regulators All devices documented in the lm25066 binding are intended for use with a regulator, be that for purely monitoring purposes (lm25056) or, for the other devices, as the controller of that regulator. The binding does not currently allow regulator child nodes, so add one.
Each of these devices interacts with only a single regulator and documentation refers to it as "Vout", hence the choice of child node name.Signed-off-by Conor Dooley <[email protected]>
Zev Weiss
Acked-byQuoted 11 lines · Conor Dooley
Quoted 10 lines · Guenter Roeck
Quoted 9 lines · Conor Dooley
Quoted 7 lines · Conor Dooley
Quoted 3 lines · Guenter Roeck
If a chip only provides a single regulator, it should be named 'vout' and not 'vout0'. Declare regulators for chips with a single ouput using
PMBUS_REGULATOR_ONE()to make that happen.If we're gonna do this, we should go ahead and document each of these regulators. If Naresh sends a v2 for the tda, I could do the others.
Quoted 33 lines
Quoted 5 lines
Quoted 4 lines
As it turns out, the infineon devices in question are not PMICs, but regulators themselves. I think something like the following is what we need. Perhaps Zev or the 9elements guys can comment.
IMO The lm25066 patch should be separate.
It should already be a pair of changes - one for the infineon stuff and another for the ti devices:
Quoted 23 lines
Quoted 23 lines
commit
9cf2671c0b98c0a0dd599fe9152985d1320bf320Author: Conor Dooley <[email protected]> Date: Mon Feb 19 14:24:48 2024 +0000dt-bindings: regulator: promote infineon buck converters to their own binding These devices may need to make use of the common regulator properties, but these are not permitted while only documented in
trivial-devices.yamlSigned-off-by Conor Dooley <[email protected]>commit
597739840d2bc95ebb884d7f5fc4f3cc206d9af6Author: Conor Dooley <[email protected]> Date: Mon Feb 19 13:29:12 2024 +0000dt-bindings: hwmon/pmbus: ti,lm25066: document regulators All devices documented in the lm25066 binding are intended for use with a regulator, be that for purely monitoring purposes (lm25056) or, for the other devices, as the controller of that regulator. The binding does not currently allow regulator child nodes, so add one.
Each of these devices interacts with only a single regulator and documentation refers to it as "Vout", hence the choice of child node name.Signed-off-by Conor Dooley <[email protected]>
This looks fine to me -- as far as the lm25066 patch goes,
Thanks,
Zev