All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml
@ 2022-05-09 13:10 Holger Brunck
  2022-05-09 13:10 ` [PATCH 2/2] driver/hwmon/lm90: enable extended range according to DTS node Holger Brunck
  2022-05-10  0:41 ` [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Guenter Roeck
  0 siblings, 2 replies; 6+ messages in thread
From: Holger Brunck @ 2022-05-09 13:10 UTC (permalink / raw)
  To: linux-hwmon
  Cc: Holger Brunck, Jean Delvare, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski

Add a boolean extended-range-enable to make the extented temperature
feature for some lm90 devices configurable.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
cc: Jean Delvare <jdelvare@suse.com>
cc: Guenter Roeck <linux@roeck-us.net>
cc: Rob Herring <robh+dt@kernel.org>
cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
---
 Documentation/devicetree/bindings/hwmon/national,lm90.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
index 30db92977937..98d01f6c9331 100644
--- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
+++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
@@ -52,6 +52,10 @@ properties:
   vcc-supply:
     description: phandle to the regulator that provides the +VCC supply
 
+  extended-range-enable:
+    description: Set to enable extended range temperature.
+    type: boolean
+
 required:
   - compatible
   - reg
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] driver/hwmon/lm90: enable extended range according to DTS node
  2022-05-09 13:10 [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Holger Brunck
@ 2022-05-09 13:10 ` Holger Brunck
  2022-05-10  0:41 ` [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Holger Brunck @ 2022-05-09 13:10 UTC (permalink / raw)
  To: linux-hwmon; +Cc: Holger Brunck, Jean Delvare, Guenter Roeck

Some lm90 devices can run in a extended temperature mode, this property
can now be set in the devicetree node of the sensor.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
cc: Jean Delvare <jdelvare@suse.com>
cc: Guenter Roeck <linux@roeck-us.net>
---
 drivers/hwmon/lm90.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 1c9493c70813..9fd315faa066 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,7 +1728,8 @@ 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 (config & 0x04)
+		if (config & 0x04 ||
+		    of_property_read_bool(np, "extended-range-enable"))
 			data->flags |= LM90_FLAG_ADT7461_EXT;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml
  2022-05-09 13:10 [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Holger Brunck
  2022-05-09 13:10 ` [PATCH 2/2] driver/hwmon/lm90: enable extended range according to DTS node Holger Brunck
@ 2022-05-10  0:41 ` Guenter Roeck
  2022-05-10  7:19   ` Holger Brunck
  1 sibling, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2022-05-10  0:41 UTC (permalink / raw)
  To: Holger Brunck, linux-hwmon; +Cc: Jean Delvare, Rob Herring, Krzysztof Kozlowski

On 5/9/22 06:10, Holger Brunck wrote:
> Add a boolean extended-range-enable to make the extented temperature
> feature for some lm90 devices configurable.
> 
> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> cc: Jean Delvare <jdelvare@suse.com>
> cc: Guenter Roeck <linux@roeck-us.net>
> cc: Rob Herring <robh+dt@kernel.org>
> cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> ---
>   Documentation/devicetree/bindings/hwmon/national,lm90.yaml | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> index 30db92977937..98d01f6c9331 100644
> --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> @@ -52,6 +52,10 @@ properties:
>     vcc-supply:
>       description: phandle to the regulator that provides the +VCC supply
>   
> +  extended-range-enable:

This should probably be either "onsemi,extended-range-enable" (for adt7461)
or "ti,extended-range-enable" (for the supported TI chips).

Guenter

> +    description: Set to enable extended range temperature.
> +    type: boolean
> +
>   required:
>     - compatible
>     - reg


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml
  2022-05-10  0:41 ` [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Guenter Roeck
@ 2022-05-10  7:19   ` Holger Brunck
  2022-05-10  7:32     ` Krzysztof Kozlowski
  2022-05-10 14:12     ` Guenter Roeck
  0 siblings, 2 replies; 6+ messages in thread
From: Holger Brunck @ 2022-05-10  7:19 UTC (permalink / raw)
  To: Guenter Roeck, linux-hwmon; +Cc: Jean Delvare, Rob Herring, Krzysztof Kozlowski

> On 5/9/22 06:10, Holger Brunck wrote:
> > Add a boolean extended-range-enable to make the extented temperature
> > feature for some lm90 devices configurable.
> >
> > Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
> > cc: Jean Delvare <jdelvare@suse.com>
> > cc: Guenter Roeck <linux@roeck-us.net>
> > cc: Rob Herring <robh+dt@kernel.org>
> > cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> > ---
> >   Documentation/devicetree/bindings/hwmon/national,lm90.yaml | 4 ++++
> >   1 file changed, 4 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> > b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> > index 30db92977937..98d01f6c9331 100644
> > --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> > +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
> > @@ -52,6 +52,10 @@ properties:
> >     vcc-supply:
> >       description: phandle to the regulator that provides the +VCC
> > supply
> >
> > +  extended-range-enable:
> 
> This should probably be either "onsemi,extended-range-enable" (for
> adt7461) or "ti,extended-range-enable" (for the supported TI chips).
> 

I can change that, but I thought a generic name would be better as the
same property name is already used in drivers/hwmon/max6697.c.

Best regards
Holger





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml
  2022-05-10  7:19   ` Holger Brunck
@ 2022-05-10  7:32     ` Krzysztof Kozlowski
  2022-05-10 14:12     ` Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-10  7:32 UTC (permalink / raw)
  To: Holger Brunck, Guenter Roeck, linux-hwmon
  Cc: Jean Delvare, Rob Herring, Krzysztof Kozlowski

On 10/05/2022 09:19, Holger Brunck wrote:
>> On 5/9/22 06:10, Holger Brunck wrote:
>>> Add a boolean extended-range-enable to make the extented temperature
>>> feature for some lm90 devices configurable.
>>>
>>> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
>>> cc: Jean Delvare <jdelvare@suse.com>
>>> cc: Guenter Roeck <linux@roeck-us.net>
>>> cc: Rob Herring <robh+dt@kernel.org>
>>> cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
>>> ---
>>>   Documentation/devicetree/bindings/hwmon/national,lm90.yaml | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> index 30db92977937..98d01f6c9331 100644
>>> --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> @@ -52,6 +52,10 @@ properties:
>>>     vcc-supply:
>>>       description: phandle to the regulator that provides the +VCC
>>> supply
>>>
>>> +  extended-range-enable:
>>
>> This should probably be either "onsemi,extended-range-enable" (for
>> adt7461) or "ti,extended-range-enable" (for the supported TI chips).
>>
> 
> I can change that, but I thought a generic name would be better as the
> same property name is already used in drivers/hwmon/max6697.c.

That binding was never reviewed by Rob and it does not use vendor
prefixes for any of the fields, so it should not be treated as an example.

Custom properties should have vendor prefix, like Guenter suggested.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml
  2022-05-10  7:19   ` Holger Brunck
  2022-05-10  7:32     ` Krzysztof Kozlowski
@ 2022-05-10 14:12     ` Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-05-10 14:12 UTC (permalink / raw)
  To: Holger Brunck, linux-hwmon; +Cc: Jean Delvare, Rob Herring, Krzysztof Kozlowski

On 5/10/22 00:19, Holger Brunck wrote:
>> On 5/9/22 06:10, Holger Brunck wrote:
>>> Add a boolean extended-range-enable to make the extented temperature
>>> feature for some lm90 devices configurable.
>>>
>>> Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
>>> cc: Jean Delvare <jdelvare@suse.com>
>>> cc: Guenter Roeck <linux@roeck-us.net>
>>> cc: Rob Herring <robh+dt@kernel.org>
>>> cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
>>> ---
>>>    Documentation/devicetree/bindings/hwmon/national,lm90.yaml | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> index 30db92977937..98d01f6c9331 100644
>>> --- a/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> +++ b/Documentation/devicetree/bindings/hwmon/national,lm90.yaml
>>> @@ -52,6 +52,10 @@ properties:
>>>      vcc-supply:
>>>        description: phandle to the regulator that provides the +VCC
>>> supply
>>>
>>> +  extended-range-enable:
>>
>> This should probably be either "onsemi,extended-range-enable" (for
>> adt7461) or "ti,extended-range-enable" (for the supported TI chips).
>>
> 
> I can change that, but I thought a generic name would be better as the
> same property name is already used in drivers/hwmon/max6697.c.
> 

That was introduced at times when things were not always reviewed
by DT maintainers, and was wrong. I'd be open to change that to
maxim,extended-range-enable (it isn't used in any upstream or published
DT file). Let's wait for Rob or Krzysztof to decide.

Guenter

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-10 14:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 13:10 [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Holger Brunck
2022-05-09 13:10 ` [PATCH 2/2] driver/hwmon/lm90: enable extended range according to DTS node Holger Brunck
2022-05-10  0:41 ` [PATCH 1/2] dt-bindings: add extended-range-enable property to lm90.yaml Guenter Roeck
2022-05-10  7:19   ` Holger Brunck
2022-05-10  7:32     ` Krzysztof Kozlowski
2022-05-10 14:12     ` 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.