Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3 0/2] Version Log
@ 2019-04-30 14:46 Iker Perez
  2019-04-30 14:46 ` [PATCH v3 1/2] hwmon: (lm75) Add support for TMP75B Iker Perez
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Iker Perez @ 2019-04-30 14:46 UTC (permalink / raw)
  To: linux-hwmon; +Cc: linux, Iker Perez del Palomar Sustatxa

From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>

Changes from V2:
  - Correct bad style:
    - Bad assigment, missing spaces before and
       after "=".
    - Divide in two lines longer than 80 characters.
  - Separate dt-bindings and driver-documentation into different
    commits.

Changes from V1:
  - Delete empty lines.
  - Restore replaced tabs by spaces.

Iker Perez del Palomar Sustatxa (2):
  hwmon: (lm75) Add support for TMP75B
  dt-bindings: hwmon: Add tmp75b to lm75.txt

 Documentation/devicetree/bindings/hwmon/lm75.txt |  1 +
 Documentation/hwmon/lm75                         |  7 +++++--
 drivers/hwmon/lm75.c                             | 11 +++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)

-- 
2.11.0

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

* [PATCH v3 1/2] hwmon: (lm75) Add support for TMP75B
  2019-04-30 14:46 [PATCH v3 0/2] Version Log Iker Perez
@ 2019-04-30 14:46 ` Iker Perez
  2019-04-30 16:55   ` Guenter Roeck
  2019-04-30 14:46 ` [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt Iker Perez
  2019-04-30 16:56 ` [PATCH v3 0/2] Version Log Guenter Roeck
  2 siblings, 1 reply; 7+ messages in thread
From: Iker Perez @ 2019-04-30 14:46 UTC (permalink / raw)
  To: linux-hwmon; +Cc: linux, Iker Perez del Palomar Sustatxa

From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>

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 |  7 +++++--
 drivers/hwmon/lm75.c     | 11 +++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75
index 010583608f12..0cff924cdbba 100644
--- a/Documentation/hwmon/lm75
+++ b/Documentation/hwmon/lm75
@@ -47,8 +47,10 @@ 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 +58,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 447af07450f1..cdb1e7833976 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -59,6 +59,7 @@ enum lm75_type {		/* keep sorted in alphabetical order */
 	tmp175,
 	tmp275,
 	tmp75,
+	tmp75b,
 	tmp75c,
 };
 
@@ -378,6 +379,11 @@ 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 / 4;
+		break;
 	case tmp75c:
 		clr_mask |= 1 << 5;		/* not one-shot mode */
 		data->resolution = 12;
@@ -438,6 +444,7 @@ static const struct i2c_device_id lm75_ids[] = {
 	{ "tmp175", tmp175, },
 	{ "tmp275", tmp275, },
 	{ "tmp75", tmp75, },
+	{ "tmp75b", tmp75b, },
 	{ "tmp75c", tmp75c, },
 	{ /* LIST END */ }
 };
@@ -537,6 +544,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


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

* [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt
  2019-04-30 14:46 [PATCH v3 0/2] Version Log Iker Perez
  2019-04-30 14:46 ` [PATCH v3 1/2] hwmon: (lm75) Add support for TMP75B Iker Perez
@ 2019-04-30 14:46 ` Iker Perez
  2019-04-30 16:57   ` Guenter Roeck
  2019-04-30 16:56 ` [PATCH v3 0/2] Version Log Guenter Roeck
  2 siblings, 1 reply; 7+ messages in thread
From: Iker Perez @ 2019-04-30 14:46 UTC (permalink / raw)
  To: linux-hwmon; +Cc: linux, Iker Perez del Palomar Sustatxa

From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>

Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
---
 Documentation/devicetree/bindings/hwmon/lm75.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/hwmon/lm75.txt b/Documentation/devicetree/bindings/hwmon/lm75.txt
index 12d8cf7cf592..586b5ed70be7 100644
--- a/Documentation/devicetree/bindings/hwmon/lm75.txt
+++ b/Documentation/devicetree/bindings/hwmon/lm75.txt
@@ -25,6 +25,7 @@ Required properties:
 		"ti,tmp175",
 		"ti,tmp275",
 		"ti,tmp75",
+		"ti,tmp75b",
 		"ti,tmp75c",
 
 - reg: I2C bus address of the device
-- 
2.11.0


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

* Re: [PATCH v3 1/2] hwmon: (lm75) Add support for TMP75B
  2019-04-30 14:46 ` [PATCH v3 1/2] hwmon: (lm75) Add support for TMP75B Iker Perez
@ 2019-04-30 16:55   ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2019-04-30 16:55 UTC (permalink / raw)
  To: Iker Perez; +Cc: linux-hwmon

On Tue, Apr 30, 2019 at 03:46:08PM +0100, Iker Perez wrote:
> From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
> 
> 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 |  7 +++++--
>  drivers/hwmon/lm75.c     | 11 +++++++++++
>  2 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75
> index 010583608f12..0cff924cdbba 100644
> --- a/Documentation/hwmon/lm75
> +++ b/Documentation/hwmon/lm75
> @@ -47,8 +47,10 @@ 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 +58,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 447af07450f1..cdb1e7833976 100644
> --- a/drivers/hwmon/lm75.c
> +++ b/drivers/hwmon/lm75.c
> @@ -59,6 +59,7 @@ enum lm75_type {		/* keep sorted in alphabetical order */
>  	tmp175,
>  	tmp275,
>  	tmp75,
> +	tmp75b,
>  	tmp75c,
>  };
>  
> @@ -378,6 +379,11 @@ 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 / 4;

Looking into the datasheet, this isn't really correct,
since the configuration register is not updated accordingly.
The default, as mentioned in the description of this patch,
is 37 ms, not 250 ms. There are multiple options:
- Set the sample time to a fixed value, and update the
  configuration register accordingly.
- Read the sample time from the configuration register
  and report it.
- Add support for updating the sample time to the driver.

Either case, the reported value should match reality.

Thanks,
Guenter

> +		break;
>  	case tmp75c:
>  		clr_mask |= 1 << 5;		/* not one-shot mode */
>  		data->resolution = 12;
> @@ -438,6 +444,7 @@ static const struct i2c_device_id lm75_ids[] = {
>  	{ "tmp175", tmp175, },
>  	{ "tmp275", tmp275, },
>  	{ "tmp75", tmp75, },
> +	{ "tmp75b", tmp75b, },
>  	{ "tmp75c", tmp75c, },
>  	{ /* LIST END */ }
>  };
> @@ -537,6 +544,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
> 

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

* Re: [PATCH v3 0/2] Version Log
  2019-04-30 14:46 [PATCH v3 0/2] Version Log Iker Perez
  2019-04-30 14:46 ` [PATCH v3 1/2] hwmon: (lm75) Add support for TMP75B Iker Perez
  2019-04-30 14:46 ` [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt Iker Perez
@ 2019-04-30 16:56 ` Guenter Roeck
  2 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2019-04-30 16:56 UTC (permalink / raw)
  To: Iker Perez; +Cc: linux-hwmon

On Tue, Apr 30, 2019 at 03:46:07PM +0100, Iker Perez wrote:
> From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
> 
> Changes from V2:
>   - Correct bad style:
>     - Bad assigment, missing spaces before and
>        after "=".
>     - Divide in two lines longer than 80 characters.
>   - Separate dt-bindings and driver-documentation into different
>     commits.
> 
> Changes from V1:
>   - Delete empty lines.
>   - Restore replaced tabs by spaces.
> 

FWIW, I would expect the change log in the patch(es).
If you want to add a summary like here, its subject should
describe what the patch series does. "Version log" does not
describe the patch series.

> Iker Perez del Palomar Sustatxa (2):
>   hwmon: (lm75) Add support for TMP75B
>   dt-bindings: hwmon: Add tmp75b to lm75.txt
> 
>  Documentation/devicetree/bindings/hwmon/lm75.txt |  1 +
>  Documentation/hwmon/lm75                         |  7 +++++--
>  drivers/hwmon/lm75.c                             | 11 +++++++++++
>  3 files changed, 17 insertions(+), 2 deletions(-)
> 
> -- 
> 2.11.0

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

* Re: [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt
  2019-04-30 14:46 ` [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt Iker Perez
@ 2019-04-30 16:57   ` Guenter Roeck
  2019-04-30 16:58     ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2019-04-30 16:57 UTC (permalink / raw)
  To: Iker Perez; +Cc: linux-hwmon

On Tue, Apr 30, 2019 at 03:46:09PM +0100, Iker Perez wrote:
> From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
> 
There should be some description / rationale for the patch here.

> Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
> ---
>  Documentation/devicetree/bindings/hwmon/lm75.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/lm75.txt b/Documentation/devicetree/bindings/hwmon/lm75.txt
> index 12d8cf7cf592..586b5ed70be7 100644
> --- a/Documentation/devicetree/bindings/hwmon/lm75.txt
> +++ b/Documentation/devicetree/bindings/hwmon/lm75.txt
> @@ -25,6 +25,7 @@ Required properties:
>  		"ti,tmp175",
>  		"ti,tmp275",
>  		"ti,tmp75",
> +		"ti,tmp75b",
>  		"ti,tmp75c",
>  
>  - reg: I2C bus address of the device
> -- 
> 2.11.0
> 

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

* Re: [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt
  2019-04-30 16:57   ` Guenter Roeck
@ 2019-04-30 16:58     ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2019-04-30 16:58 UTC (permalink / raw)
  To: Iker Perez; +Cc: linux-hwmon

On Tue, Apr 30, 2019 at 09:57:19AM -0700, Guenter Roeck wrote:
> On Tue, Apr 30, 2019 at 03:46:09PM +0100, Iker Perez wrote:
> > From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
> > 
> There should be some description / rationale for the patch here.
> 
... and, if it is a separate patch because it touches devicetree
documentation, you should copy the DT maining list and DT maintainers.

> > Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
> > ---
> >  Documentation/devicetree/bindings/hwmon/lm75.txt | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/hwmon/lm75.txt b/Documentation/devicetree/bindings/hwmon/lm75.txt
> > index 12d8cf7cf592..586b5ed70be7 100644
> > --- a/Documentation/devicetree/bindings/hwmon/lm75.txt
> > +++ b/Documentation/devicetree/bindings/hwmon/lm75.txt
> > @@ -25,6 +25,7 @@ Required properties:
> >  		"ti,tmp175",
> >  		"ti,tmp275",
> >  		"ti,tmp75",
> > +		"ti,tmp75b",
> >  		"ti,tmp75c",
> >  
> >  - reg: I2C bus address of the device
> > -- 
> > 2.11.0
> > 

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30 14:46 [PATCH v3 0/2] Version Log Iker Perez
2019-04-30 14:46 ` [PATCH v3 1/2] hwmon: (lm75) Add support for TMP75B Iker Perez
2019-04-30 16:55   ` Guenter Roeck
2019-04-30 14:46 ` [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt Iker Perez
2019-04-30 16:57   ` Guenter Roeck
2019-04-30 16:58     ` Guenter Roeck
2019-04-30 16:56 ` [PATCH v3 0/2] Version Log 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