Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B
       [not found] <2904a750-c6e9-719b-7523-0f45e0bc82cc@codethink.co.uk>
@ 2019-04-23 10:11 ` Iker Perez del Palomar
  2019-04-23 13:52   ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Iker Perez del Palomar @ 2019-04-23 10:11 UTC (permalink / raw)
  To: linux-hwmon, linux-kernel, linux, jdelvare

The TMP75B has a different control register, supports 12-bit
resolution and the default conversion rate is 37 Hz.

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
---
  Documentation/hwmon/lm75 |  5 +++--
  drivers/hwmon/lm75.c     | 13 +++++++++++++
  2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75
index 010583608f12..baf052935761 100644
--- a/Documentation/hwmon/lm75
+++ b/Documentation/hwmon/lm75
@@ -47,8 +47,8 @@ Supported chips:
      Addresses scanned: none
      Datasheet: Publicly available at the ST website
             https://www.st.com/resource/en/datasheet/stlm75.pdf
-  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75C, 
TMP175, TMP275
-    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 
'tmp75', 'tmp75c', 'tmp275'
+  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75B, 
TMP75C, TMP175, TMP275
+    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 
'tmp75', 'tmp75b', 'tmp75c', 'tmp275'
      Addresses scanned: none
      Datasheet: Publicly available at the Texas Instruments website
                 http://www.ti.com/product/tmp100
@@ -56,6 +56,7 @@ Supported chips:
                 http://www.ti.com/product/tmp105
                 http://www.ti.com/product/tmp112
                 http://www.ti.com/product/tmp75
+               http://www.ti.com/product/tmp75b
                 http://www.ti.com/product/tmp75c
                 http://www.ti.com/product/tmp175
                 http://www.ti.com/product/tmp275
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 62acb9f16ec5..1b5c32cbdc62 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -32,6 +32,7 @@
  #include "lm75.h"


+
  /*
   * This driver handles the LM75 and compatible digital temperature 
sensors.
   */
@@ -59,6 +60,7 @@ enum lm75_type {        /* keep sorted in alphabetical 
order */
      tmp175,
      tmp275,
      tmp75,
+    tmp75b,
      tmp75c,
  };

@@ -378,6 +380,12 @@ lm75_probe(struct i2c_client *client, const struct 
i2c_device_id *id)
          data->resolution = 12;
          data->sample_time = MSEC_PER_SEC / 2;
          break;
+    case tmp75b:
+        clr_mask |= 1 << 15;        /* not one-shot mode */
+        data->resolution = 12;
+        data->sample_time = MSEC_PER_SEC / 32;
+        break;
+
      case tmp75c:
          clr_mask |= 1 << 5;        /* not one-shot mode */
          data->resolution = 12;
@@ -438,6 +446,7 @@ static const struct i2c_device_id lm75_ids[] = {
      { "tmp175", tmp175, },
      { "tmp275", tmp275, },
      { "tmp75", tmp75, },
+    { "tmp75b", tmp75b,},
      { "tmp75c", tmp75c, },
      { /* LIST END */ }
  };
@@ -537,6 +546,10 @@ static const struct of_device_id lm75_of_match[] = {
          .data = (void *)tmp75
      },
      {
+        .compatible = "ti,tmp75b",
+        .data = (void *)tmp75b
+    },
+    {
          .compatible = "ti,tmp75c",
          .data = (void *)tmp75c
      },

-- 
2.11.0

-- 
Iker Perez del Palomar, Software Engineer
Codethink Ltd                             35 Dale St, Manchester M1 2HF
http://www.codethink.co.uk/          Manchester, M1 2JW, United Kingdom
We respect your privacy.   See https://www.codethink.co.uk/privacy.html


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

* Re: Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B
  2019-04-23 10:11 ` Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B Iker Perez del Palomar
@ 2019-04-23 13:52   ` Guenter Roeck
  2019-04-24 14:54     ` Iker Perez del Palomar
       [not found]     ` <e3d0b580-5552-fc4c-7ecc-660b000bfbc4@codethink.co.uk>
  0 siblings, 2 replies; 4+ messages in thread
From: Guenter Roeck @ 2019-04-23 13:52 UTC (permalink / raw)
  To: Iker Perez del Palomar, linux-hwmon, linux-kernel, jdelvare

On 4/23/19 3:11 AM, Iker Perez del Palomar wrote:
> The TMP75B has a different control register, supports 12-bit
> resolution and the default conversion rate is 37 Hz.
> 
> Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>

This patch is corrupted. It replaces tabs with spaces, and there are line wraps.

> ---
>   Documentation/hwmon/lm75 |  5 +++--
>   drivers/hwmon/lm75.c     | 13 +++++++++++++
>   2 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75
> index 010583608f12..baf052935761 100644
> --- a/Documentation/hwmon/lm75
> +++ b/Documentation/hwmon/lm75
> @@ -47,8 +47,8 @@ Supported chips:
>       Addresses scanned: none
>       Datasheet: Publicly available at the ST website
>              https://www.st.com/resource/en/datasheet/stlm75.pdf
> -  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75C, TMP175, TMP275
> -    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 'tmp75', 'tmp75c', 'tmp275'
> +  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75B, TMP75C, TMP175, TMP275
> +    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 'tmp75', 'tmp75b', 'tmp75c', 'tmp275'
>       Addresses scanned: none
>       Datasheet: Publicly available at the Texas Instruments website
>                  http://www.ti.com/product/tmp100
> @@ -56,6 +56,7 @@ Supported chips:
>                  http://www.ti.com/product/tmp105
>                  http://www.ti.com/product/tmp112
>                  http://www.ti.com/product/tmp75
> +               http://www.ti.com/product/tmp75b
>                  http://www.ti.com/product/tmp75c
>                  http://www.ti.com/product/tmp175
>                  http://www.ti.com/product/tmp275
> diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
> index 62acb9f16ec5..1b5c32cbdc62 100644
> --- a/drivers/hwmon/lm75.c
> +++ b/drivers/hwmon/lm75.c
> @@ -32,6 +32,7 @@
>   #include "lm75.h"
> 
> 
> +

I don't mind if you'd remove one of the two empty lines above, but add yet another one ?
Please don't.

>   /*
>    * This driver handles the LM75 and compatible digital temperature sensors.
>    */
> @@ -59,6 +60,7 @@ enum lm75_type {        /* keep sorted in alphabetical order */
>       tmp175,
>       tmp275,
>       tmp75,
> +    tmp75b,
>       tmp75c,
>   };
> 
> @@ -378,6 +380,12 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
>           data->resolution = 12;
>           data->sample_time = MSEC_PER_SEC / 2;
>           break;
> +    case tmp75b:
> +        clr_mask |= 1 << 15;        /* not one-shot mode */
> +        data->resolution = 12;
> +        data->sample_time = MSEC_PER_SEC / 32;
> +        break;
> +
>       case tmp75c:
>           clr_mask |= 1 << 5;        /* not one-shot mode */
>           data->resolution = 12;
> @@ -438,6 +446,7 @@ static const struct i2c_device_id lm75_ids[] = {
>       { "tmp175", tmp175, },
>       { "tmp275", tmp275, },
>       { "tmp75", tmp75, },
> +    { "tmp75b", tmp75b,},
>       { "tmp75c", tmp75c, },
>       { /* LIST END */ }
>   };
> @@ -537,6 +546,10 @@ static const struct of_device_id lm75_of_match[] = {
>           .data = (void *)tmp75
>       },
>       {
> +        .compatible = "ti,tmp75b",
> +        .data = (void *)tmp75b
> +    },
> +    {
>           .compatible = "ti,tmp75c",
>           .data = (void *)tmp75c
>       },
> 


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

* Re: Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B
  2019-04-23 13:52   ` Guenter Roeck
@ 2019-04-24 14:54     ` Iker Perez del Palomar
       [not found]     ` <e3d0b580-5552-fc4c-7ecc-660b000bfbc4@codethink.co.uk>
  1 sibling, 0 replies; 4+ messages in thread
From: Iker Perez del Palomar @ 2019-04-24 14:54 UTC (permalink / raw)
  To: Guenter Roeck, linux-hwmon, linux-kernel, jdelvare

Hi,


Thank you for the review, I will submit a fixed patch soon. I have one
question before doing it though, after running scrips/chechpatch.sh I
obtain the next message:

WARNING: DT compatible string "ti,tmp75b" appears un-documented -- check
./Documentation/devicetree/bindings/
#83: FILE: drivers/hwmon/lm75.c:549:
+		.compatible = "ti,tmp75b",

total: 0 errors, 1 warnings, 60 lines checked

So I added the next in
"Documentation/devicetree/bindings/trivial-devices.yaml":

	- ti,amc6821
	# I2C Touch-Screen Controller
  	- ti,tsc2003
+ 	# Digital Temperature Sensor with Two-Wire Interface and Alert
+ 	- ti,tmp75b
  	# Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial
Interface
  	- ti,tmp102
  	# Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial
Interface


Is that the proper procedure??

Thank you for your help.



Regards,


Iker

On 23/04/2019 14:52, Guenter Roeck wrote:
> On 4/23/19 3:11 AM, Iker Perez del Palomar wrote:
>> The TMP75B has a different control register, supports 12-bit
>> resolution and the default conversion rate is 37 Hz.
>>
>> Signed-off-by: Iker Perez del Palomar Sustatxa
>> <iker.perez@codethink.co.uk>
> 
> This patch is corrupted. It replaces tabs with spaces, and there are
> line wraps.
> 
>> ---
>>   Documentation/hwmon/lm75 |  5 +++--
>>   drivers/hwmon/lm75.c     | 13 +++++++++++++
>>   2 files changed, 16 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75
>> index 010583608f12..baf052935761 100644
>> --- a/Documentation/hwmon/lm75
>> +++ b/Documentation/hwmon/lm75
>> @@ -47,8 +47,8 @@ Supported chips:
>>       Addresses scanned: none
>>       Datasheet: Publicly available at the ST website
>>              https://www.st.com/resource/en/datasheet/stlm75.pdf
>> -  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75C,
>> TMP175, TMP275
>> -    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175',
>> 'tmp75', 'tmp75c', 'tmp275'
>> +  * Texas Instruments TMP100, TMP101, TMP105, TMP112, TMP75, TMP75B,
>> TMP75C, TMP175, TMP275
>> +    Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175',
>> 'tmp75', 'tmp75b', 'tmp75c', 'tmp275'
>>       Addresses scanned: none
>>       Datasheet: Publicly available at the Texas Instruments website
>>                  http://www.ti.com/product/tmp100
>> @@ -56,6 +56,7 @@ Supported chips:
>>                  http://www.ti.com/product/tmp105
>>                  http://www.ti.com/product/tmp112
>>                  http://www.ti.com/product/tmp75
>> +               http://www.ti.com/product/tmp75b
>>                  http://www.ti.com/product/tmp75c
>>                  http://www.ti.com/product/tmp175
>>                  http://www.ti.com/product/tmp275
>> diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
>> index 62acb9f16ec5..1b5c32cbdc62 100644
>> --- a/drivers/hwmon/lm75.c
>> +++ b/drivers/hwmon/lm75.c
>> @@ -32,6 +32,7 @@
>>   #include "lm75.h"
>>
>>
>> +
> 
> I don't mind if you'd remove one of the two empty lines above, but add
> yet another one ?
> Please don't.
> 
>>   /*
>>    * This driver handles the LM75 and compatible digital temperature
>> sensors.
>>    */
>> @@ -59,6 +60,7 @@ enum lm75_type {        /* keep sorted in
>> alphabetical order */
>>       tmp175,
>>       tmp275,
>>       tmp75,
>> +    tmp75b,
>>       tmp75c,
>>   };
>>
>> @@ -378,6 +380,12 @@ lm75_probe(struct i2c_client *client, const
>> struct i2c_device_id *id)
>>           data->resolution = 12;
>>           data->sample_time = MSEC_PER_SEC / 2;
>>           break;
>> +    case tmp75b:
>> +        clr_mask |= 1 << 15;        /* not one-shot mode */
>> +        data->resolution = 12;
>> +        data->sample_time = MSEC_PER_SEC / 32;
>> +        break;
>> +
>>       case tmp75c:
>>           clr_mask |= 1 << 5;        /* not one-shot mode */
>>           data->resolution = 12;
>> @@ -438,6 +446,7 @@ static const struct i2c_device_id lm75_ids[] = {
>>       { "tmp175", tmp175, },
>>       { "tmp275", tmp275, },
>>       { "tmp75", tmp75, },
>> +    { "tmp75b", tmp75b,},
>>       { "tmp75c", tmp75c, },
>>       { /* LIST END */ }
>>   };
>> @@ -537,6 +546,10 @@ static const struct of_device_id lm75_of_match[] = {
>>           .data = (void *)tmp75
>>       },
>>       {
>> +        .compatible = "ti,tmp75b",
>> +        .data = (void *)tmp75b
>> +    },
>> +    {
>>           .compatible = "ti,tmp75c",
>>           .data = (void *)tmp75c
>>       },
>>
> 
> 

-- 
Iker Perez del Palomar, Software Engineer
Codethink Ltd                             35 Dale St, Manchester M1 2HF
http://www.codethink.co.uk/          Manchester, M1 2JW, United Kingdom
We respect your privacy.   See https://www.codethink.co.uk/privacy.html

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

* Re: Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B
       [not found]     ` <e3d0b580-5552-fc4c-7ecc-660b000bfbc4@codethink.co.uk>
@ 2019-04-24 17:37       ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2019-04-24 17:37 UTC (permalink / raw)
  To: Iker Perez del Palomar; +Cc: linux-hwmon, linux-kernel, jdelvare

On Wed, Apr 24, 2019 at 03:10:38PM +0100, Iker Perez del Palomar wrote:
> Hi,
> 
> 
> Thank you for the review, I will submitted fixed soon. I have one question
> before doing it though, after running scrips/chechpatch.sh I obtain the next
> message:
> 
> WARNING: DT compatible string "ti,tmp75b" appears un-documented -- check ./Documentation/devicetree/bindings/
> #83: FILE: drivers/hwmon/lm75.c:549:
> +		.compatible = "ti,tmp75b",
> 
> total: 0 errors, 1 warnings, 60 lines checked
> 
> So I added the next in
> "Documentation/devicetree/bindings/trivial-devices.yaml":
> 
>            - ti,amc6821
>              # I2C Touch-Screen Controller
>            - ti,tsc2003
> +            # Digital Temperature Sensor with Two-Wire Interface and Alert
> +          - ti,tmp75b
>              # Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
>            - ti,tmp102
>              # Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
> 
> 
> Is that the proper procedure??

It would make more sense to add it to
Documentation/devicetree/bindings/hwmon/lm75.txt
since this is where most of the lm75 compatible chips are listed.

Thanks,
Guenter

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <2904a750-c6e9-719b-7523-0f45e0bc82cc@codethink.co.uk>
2019-04-23 10:11 ` Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B Iker Perez del Palomar
2019-04-23 13:52   ` Guenter Roeck
2019-04-24 14:54     ` Iker Perez del Palomar
     [not found]     ` <e3d0b580-5552-fc4c-7ecc-660b000bfbc4@codethink.co.uk>
2019-04-24 17:37       ` Guenter Roeck

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org linux-hwmon@archiver.kernel.org
	public-inbox-index linux-hwmon


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/ public-inbox