* [PATCH 2/2] hwmon: (tmp102): add vcc regulator support
2025-04-17 18:04 [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property Peter Korsgaard
@ 2025-04-17 18:04 ` Peter Korsgaard
2025-04-23 14:17 ` Guenter Roeck
2025-04-22 13:26 ` [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property Rob Herring
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2025-04-17 18:04 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck; +Cc: Peter Korsgaard, linux-hwmon, linux-kernel
Make it optional for backwards compatibility.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
drivers/hwmon/tmp102.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c
index 8af44a33055f3..a02daa496c9c4 100644
--- a/drivers/hwmon/tmp102.c
+++ b/drivers/hwmon/tmp102.c
@@ -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;
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property
2025-04-17 18:04 [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property Peter Korsgaard
2025-04-17 18:04 ` [PATCH 2/2] hwmon: (tmp102): add vcc regulator support Peter Korsgaard
@ 2025-04-22 13:26 ` Rob Herring
2025-04-22 13:31 ` Peter Korsgaard
2025-04-23 14:03 ` Rob Herring (Arm)
2025-04-23 14:17 ` Guenter Roeck
3 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2025-04-22 13:26 UTC (permalink / raw)
To: Peter Korsgaard
Cc: Jean Delvare, Guenter Roeck, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, linux-hwmon, devicetree, linux-kernel
On Thu, Apr 17, 2025 at 08:04:25PM +0200, Peter Korsgaard wrote:
> 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?
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
> Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml
> index 7e5b62a0215dd..4c89448eba0dc 100644
> --- a/Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml
> @@ -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>;
> };
> };
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property
2025-04-22 13:26 ` [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property Rob Herring
@ 2025-04-22 13:31 ` Peter Korsgaard
0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2025-04-22 13:31 UTC (permalink / raw)
To: Rob Herring
Cc: Jean Delvare, Guenter Roeck, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, linux-hwmon, devicetree, linux-kernel
>>>>> "Rob" == Rob Herring <robh@kernel.org> writes:
> On Thu, Apr 17, 2025 at 08:04:25PM +0200, Peter Korsgaard wrote:
>> 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:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=699383466851e3fb8284e1eefeed78ec30989b3b
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property
2025-04-17 18:04 [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property Peter Korsgaard
2025-04-17 18:04 ` [PATCH 2/2] hwmon: (tmp102): add vcc regulator support Peter Korsgaard
2025-04-22 13:26 ` [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property Rob Herring
@ 2025-04-23 14:03 ` Rob Herring (Arm)
2025-04-23 14:17 ` Guenter Roeck
3 siblings, 0 replies; 7+ messages in thread
From: Rob Herring (Arm) @ 2025-04-23 14:03 UTC (permalink / raw)
To: Peter Korsgaard
Cc: Krzysztof Kozlowski, Guenter Roeck, Krzysztof Kozlowski,
linux-hwmon, linux-kernel, devicetree, Conor Dooley, Jean Delvare
On Thu, 17 Apr 2025 20:04:25 +0200, Peter Korsgaard wrote:
> 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 <peter@korsgaard.com>
> ---
> Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property
2025-04-17 18:04 [PATCH 1/2] dt-bindings: hwmon: ti,tmp102: document optional V+ supply property Peter Korsgaard
` (2 preceding siblings ...)
2025-04-23 14:03 ` Rob Herring (Arm)
@ 2025-04-23 14:17 ` Guenter Roeck
3 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2025-04-23 14:17 UTC (permalink / raw)
To: Peter Korsgaard
Cc: Jean Delvare, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, linux-hwmon, devicetree, linux-kernel
On Thu, Apr 17, 2025 at 08:04:25PM +0200, Peter Korsgaard wrote:
> 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 <peter@korsgaard.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread