dt-bindings: hwmon: ti,tmp102: document optional V+ supply property
Subsystems (2)
PATCH 1/2 dt-bindings: hwmon: ti,tmp102: document optional V+ supply property
TMP102 is powered by its V+ supply, document it. The property is called "vcc-supply" since the plus sign (+) is not a valid property character.
--- Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml +4 -0
@@ -23,6 +23,9 @@ properties: "#thermal-sensor-cells": const: 1 + vcc-supply: + description: Power supply for tmp102 + required: - compatible - reg
@@ -42,6 +45,7 @@ examples: reg = <0x48>; interrupt-parent = <&gpio7>; interrupts = <16 IRQ_TYPE_LEVEL_LOW>; + vcc-supply = <&supply>; #thermal-sensor-cells = <1>; }; };
Signature · 1 line
2.39.5
PATCH 2/2 hwmon: (tmp102): add vcc regulator support
Make it optional for backwards compatibility.
--- drivers/hwmon/tmp102.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwmon/tmp102.c +5 -0
@@ -16,6 +16,7 @@#include <linux/device.h> #include <linux/jiffies.h> #include <linux/regmap.h> +#include <linux/regulator/consumer.h> #include <linux/of.h> #define DRIVER_NAME "tmp102"
@@ -204,6 +205,10 @@ static int tmp102_probe(struct i2c_client *client)return -ENODEV ; } + err =devm_regulator_get_enable_optional (dev,"vcc" ); +if (err <0 && err != -ENODEV ) +return dev_err_probe (dev, err,"Failed to enable regulator\n" ); + tmp102 =devm_kzalloc (dev,sizeof (*tmp102),GFP_KERNEL );if (!tmp102)return -ENOMEM ;
Signature · 1 line
2.39.5
Re: [PATCH 2/2] hwmon: (tmp102): add vcc regulator support
Quoted 3 lines · Peter Korsgaard
Make it optional for backwards compatibility.
Signed-off-by Peter Korsgaard <[email protected]>
Applied.
Thanks,
Guenter
Rob Herring
maintainerQuoted 2 lines · Peter Korsgaard
TMP102 is powered by its V+ supply, document it. The property is called "vcc-supply" since the plus sign (+) is not a valid property character.
Wouldn't "vplus-supply" or "vp-supply" work?
Quoted 31 lines
Signed-off-by Peter Korsgaard <[email protected]>--- Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml +4
-0@@ -23,6 +23,9 @@ properties: "#thermal-sensor-cells": const: 1 + vcc-supply: + description: Power supply for tmp102 + required: - compatible - reg@@ -42,6 +45,7 @@ examples: reg = <0x48>; interrupt-parent = <&gpio7>; interrupts = <16 IRQ_TYPE_LEVEL_LOW>; + vcc-supply = <&supply>; #thermal-sensor-cells = <1>; }; };Signature · 1 line
2.39.5
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Rob" == Rob Herring <[email protected]> writes:
Quoted 2 lines · Peter Korsgaard
TMP102 is powered by its V+ supply, document it. The property is called "vcc-supply" since the plus sign (+) is not a valid property character.
Wouldn't "vplus-supply" or "vp-supply" work?
It could, but gcc-supply is what we use for the very similar tmp108 binding, so I think it makes sense to use that here for consistency as well:
Signature · 1 line
Bye, Peter Korsgaard
Quoted 8 lines · Peter Korsgaard
TMP102 is powered by its V+ supply, document it. The property is called "vcc-supply" since the plus sign (+) is not a valid property character.
Signed-off-by Peter Korsgaard <[email protected]>--- Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Quoted 5 lines · Peter Korsgaard
TMP102 is powered by its V+ supply, document it. The property is called "vcc-supply" since the plus sign (+) is not a valid property character.
Signed-off-by Peter Korsgaard <[email protected]>Reviewed-by Rob Herring (Arm) <[email protected]>
Applied.
Thanks,
Guenter