* [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property
@ 2022-05-17 13:56 Holger Brunck
2022-05-17 13:56 ` [PATCH v4 2/2] hwmon: (lm90) enable extended range according to DTS node Holger Brunck
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Holger Brunck @ 2022-05-17 13:56 UTC (permalink / raw)
To: linux-hwmon
Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
Holger Brunck
Some devices can operate in an extended temperature mode.
Therefore add a boolean ti,extended-range-enable to be able to
select this feature in the device tree node. Also make sure that this
feature can only be enabled for the devices supporting this feature.
Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
---
changes for v4:
- use "if:not:then" instead of "if:else"
.../bindings/hwmon/national,lm90.yaml | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
index 48b7065798b0..b04657849852 100644
--- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
+++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
@@ -53,10 +53,29 @@ properties:
vcc-supply:
description: phandle to the regulator that provides the +VCC supply
+ ti,extended-range-enable:
+ description: Set to enable extended range temperature.
+ type: boolean
+
required:
- compatible
- reg
+allOf:
+ - if:
+ not:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - adi,adt7461
+ - adi,adt7461a
+ - ti,tmp451
+ - ti,tmp461
+ then:
+ properties:
+ ti,extended-range-enable: false
+
additionalProperties: false
examples:
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v4 2/2] hwmon: (lm90) enable extended range according to DTS node
2022-05-17 13:56 [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Holger Brunck
@ 2022-05-17 13:56 ` Holger Brunck
2022-05-17 16:47 ` Guenter Roeck
2022-05-17 14:28 ` [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Krzysztof Kozlowski
2022-05-17 16:46 ` Guenter Roeck
2 siblings, 1 reply; 5+ messages in thread
From: Holger Brunck @ 2022-05-17 13:56 UTC (permalink / raw)
To: linux-hwmon
Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
Holger Brunck
Some lm90 compatible devices can operate in an extended temperature mode.
This feature is now enabled if the property is set in the corresponding
device tree node.
Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
changes ofr v4:
- add reviewd-by tag
drivers/hwmon/lm90.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 1c9493c70813..3820f0e61510 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -1707,6 +1707,7 @@ static void lm90_restore_conf(void *_data)
static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
{
+ struct device_node *np = client->dev.of_node;
int config, convrate;
convrate = lm90_read_reg(client, LM90_REG_R_CONVRATE);
@@ -1727,6 +1728,9 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
/* Check Temperature Range Select */
if (data->flags & LM90_HAVE_EXTENDED_TEMP) {
+ if (of_property_read_bool(np, "ti,extended-range-enable"))
+ config |= 0x04;
+
if (config & 0x04)
data->flags |= LM90_FLAG_ADT7461_EXT;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v4 2/2] hwmon: (lm90) enable extended range according to DTS node
2022-05-17 13:56 ` [PATCH v4 2/2] hwmon: (lm90) enable extended range according to DTS node Holger Brunck
@ 2022-05-17 16:47 ` Guenter Roeck
0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2022-05-17 16:47 UTC (permalink / raw)
To: Holger Brunck; +Cc: linux-hwmon, Jean Delvare, Rob Herring, Krzysztof Kozlowski
On Tue, May 17, 2022 at 03:56:14PM +0200, Holger Brunck wrote:
> Some lm90 compatible devices can operate in an extended temperature mode.
> This feature is now enabled if the property is set in the corresponding
> device tree node.
>
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Applied.
Thanks,
Guenter
> ---
> changes ofr v4:
> - add reviewd-by tag
>
> drivers/hwmon/lm90.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
> index 1c9493c70813..3820f0e61510 100644
> --- a/drivers/hwmon/lm90.c
> +++ b/drivers/hwmon/lm90.c
> @@ -1707,6 +1707,7 @@ static void lm90_restore_conf(void *_data)
>
> static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
> {
> + struct device_node *np = client->dev.of_node;
> int config, convrate;
>
> convrate = lm90_read_reg(client, LM90_REG_R_CONVRATE);
> @@ -1727,6 +1728,9 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
>
> /* Check Temperature Range Select */
> if (data->flags & LM90_HAVE_EXTENDED_TEMP) {
> + if (of_property_read_bool(np, "ti,extended-range-enable"))
> + config |= 0x04;
> +
> if (config & 0x04)
> data->flags |= LM90_FLAG_ADT7461_EXT;
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property
2022-05-17 13:56 [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Holger Brunck
2022-05-17 13:56 ` [PATCH v4 2/2] hwmon: (lm90) enable extended range according to DTS node Holger Brunck
@ 2022-05-17 14:28 ` Krzysztof Kozlowski
2022-05-17 16:46 ` Guenter Roeck
2 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-17 14:28 UTC (permalink / raw)
To: Holger Brunck, linux-hwmon
Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski
On 17/05/2022 15:56, Holger Brunck wrote:
> Some devices can operate in an extended temperature mode.
> Therefore add a boolean ti,extended-range-enable to be able to
> select this feature in the device tree node. Also make sure that this
> feature can only be enabled for the devices supporting this feature.
>
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> ---
> changes for v4:
> - use "if:not:then" instead of "if:else"
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property
2022-05-17 13:56 [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Holger Brunck
2022-05-17 13:56 ` [PATCH v4 2/2] hwmon: (lm90) enable extended range according to DTS node Holger Brunck
2022-05-17 14:28 ` [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Krzysztof Kozlowski
@ 2022-05-17 16:46 ` Guenter Roeck
2 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2022-05-17 16:46 UTC (permalink / raw)
To: Holger Brunck; +Cc: linux-hwmon, Jean Delvare, Rob Herring, Krzysztof Kozlowski
On Tue, May 17, 2022 at 03:56:13PM +0200, Holger Brunck wrote:
> Some devices can operate in an extended temperature mode.
> Therefore add a boolean ti,extended-range-enable to be able to
> select this feature in the device tree node. Also make sure that this
> feature can only be enabled for the devices supporting this feature.
>
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied.
Thanks,
Guenter
> ---
> changes for v4:
> - use "if:not:then" instead of "if:else"
>
> .../bindings/hwmon/national,lm90.yaml | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> index 48b7065798b0..b04657849852 100644
> --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> @@ -53,10 +53,29 @@ properties:
> vcc-supply:
> description: phandle to the regulator that provides the +VCC supply
>
> + ti,extended-range-enable:
> + description: Set to enable extended range temperature.
> + type: boolean
> +
> required:
> - compatible
> - reg
>
> +allOf:
> + - if:
> + not:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - adi,adt7461
> + - adi,adt7461a
> + - ti,tmp451
> + - ti,tmp461
> + then:
> + properties:
> + ti,extended-range-enable: false
> +
> additionalProperties: false
>
> examples:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-17 16:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 13:56 [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Holger Brunck
2022-05-17 13:56 ` [PATCH v4 2/2] hwmon: (lm90) enable extended range according to DTS node Holger Brunck
2022-05-17 16:47 ` Guenter Roeck
2022-05-17 14:28 ` [PATCH v4 1/2] dt-bindings: hwmon: lm90: add ti,extended-range-enable property Krzysztof Kozlowski
2022-05-17 16:46 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.