Skip to contentSkip to conversation

iio: temperature: tmp117: Support the TMP119 sensor

PATCH Superseded Romain Gantois 4 participants 10 messages Jun 5 – Jun 8

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover iio: temperature: tmp117: Support the TMP119 sensor

Hello everyone,

This series adds support for the TMP119, which has an identical programming model to the TMP117, but slightly different specs and electrical characteristics.

Best Regards,

Romain

---
Romain Gantois (1):
dt-bindings: iio: ti,tmp117: add binding for the TMP119

Wil Stark (1):
iio: temperature: tmp117: add TI TMP119 support

 Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml | 6 ++++--
 drivers/iio/temperature/tmp117.c                                 | 4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

---
base-commit: ddd664bbff63e09e7a7f9acae9c43605d4cf185f
change-id: 20260605-tmp119-662d21e4d317

Best regards,

Signature · 1 line
Romain Gantois <[email protected]>
#1 lore raw

PATCH 1/2 dt-bindings: iio: ti,tmp117: add binding for the TMP119

The TMP119 has the same register layout as the TMP117, and a better local sensor accuracy.

---
 Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +4 -2
index fbba5e934861c..9f3b74274b16e 100644
@@ -7,10 +7,11 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: TI TMP117 - Digital temperature sensor with integrated NV memory
 
 description: |
-    TI TMP116/117 - Digital temperature sensor with integrated NV memory that
-    supports I2C interface.
+    TI TMP116/117/119 - Digital temperature sensor with integrated NV memory
+    that supports I2C interface.
       https://www.ti.com/lit/gpn/tmp116
       https://www.ti.com/lit/gpn/tmp117
+      https://www.ti.com/lit/gpn/tmp119
 
 maintainers:
   - Puranjay Mohan <[email protected]>
@@ -20,6 +21,7 @@ properties:
     enum:
       - ti,tmp116
       - ti,tmp117
+      - ti,tmp119
 
   reg:
     maxItems: 1
Signature · 1 line
2.54.0
#7 lore raw

PATCH 2/2 iio: temperature: tmp117: add TI TMP119 support

In reply to Romain Gantois

From: Wil Stark <[email protected]>

Add support for the TMP119 temperature sensor, which has the same programming model as the TMP117.

[rgantois: Rebased from v6.6.58 to v7.1.0-rc6]
[rgantois: Commit log]
---
 drivers/iio/temperature/tmp117.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/iio/temperature/tmp117.c +4 -0
index 8972083d903a2..8e9621171c516 100644
@@ -38,6 +38,7 @@
 
 #define TMP116_DEVICE_ID		0x1116
 #define TMP117_DEVICE_ID		0x0117
+#define TMP119_DEVICE_ID		0x2117
 
 struct tmp117_data {
 	struct i2c_client *client;
@@ -170,6 +171,7 @@ static int tmp117_probe(struct i2c_client *client)
 		match_data = &tmp116_channels_info;
 		break;
 	case TMP117_DEVICE_ID:
+	case TMP119_DEVICE_ID:
 		match_data = &tmp117_channels_info;
 		break;
 	default:
@@ -204,6 +206,7 @@ static int tmp117_probe(struct i2c_client *client)
 static const struct of_device_id tmp117_of_match[] = {
 	{ .compatible = "ti,tmp116", .data = &tmp116_channels_info },
 	{ .compatible = "ti,tmp117", .data = &tmp117_channels_info },
+	{ .compatible = "ti,tmp119", .data = &tmp117_channels_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, tmp117_of_match);
@@ -211,6 +214,7 @@ MODULE_DEVICE_TABLE(of, tmp117_of_match);
 static const struct i2c_device_id tmp117_id[] = {
 	{ "tmp116", (kernel_ulong_t)&tmp116_channels_info },
 	{ "tmp117", (kernel_ulong_t)&tmp117_channels_info },
+	{ "tmp119", (kernel_ulong_t)&tmp117_channels_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tmp117_id);
Signature · 1 line
2.54.0
#8 lore raw

Re: [PATCH 2/2] iio: temperature: tmp117: add TI TMP119 support

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The IIO device name for the TMP119 sensor is incorrectly reported as 'tmp117' to userspace. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The IIO device name for the TMP119 sensor is incorrectly reported as 'tmp117' to userspace. --

commit 3bc7597d636b9eb1df1b77ad9bb9ab2ab8c85398
Author: Wil Stark <[email protected]>

iio: temperature: tmp117: add TI TMP119 support

This commit adds support for the TMP119 temperature sensor to the tmp117 driver. It maps the TMP119 device ID and compatible string to the existing tmp117 match data.

Quoted 4 lines
drivers/iio/temperature/tmp117.c +0 -0
index 8972083d903a2..8e9621171c516 100644

[ ... ]

drivers/iio/temperature/tmp117.c static int tmp117_probe(struct i2c_client *client) · line 176

Quoted 7 lines
drivers/iio/temperature/tmp117.c +1 -0
@@ -170,6 +171,7 @@ static int tmp117_probe(struct i2c_client *client)
 		match_data = &tmp116_channels_info;
 		break;
 	case TMP117_DEVICE_ID:
+	case TMP119_DEVICE_ID:
 		match_data = &tmp117_channels_info;
 		break;

[Severity: Medium]
Will this cause the IIO device name exposed to userspace to be incorrectly reported as "tmp117" for TMP119 devices?

Since TMP119 maps directly to tmp117_channels_info:

static const struct tmp11x_info tmp117_channels_info = {
        .name = "tmp117",
        ...
};

And indio_dev->name is assigned from match_data->name later in tmp117_probe():

        indio_dev->name = match_data->name;

Does this break userspace applications or udev rules that rely on reading the correct sensor part name ("tmp119") from sysfs?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#9 lore raw

Re: [PATCH 2/2] iio: temperature: tmp117: add TI TMP119 support

Quoted 2 lines · On Friday, 5 June 2026 13:08:02 CEST [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The IIO device name for the TMP119 sensor

...

Quoted 8 lines

And indio_dev->name is assigned from match_data->name later in

tmp117_probe():

        indio_dev->name = match_data->name;

Does this break userspace applications or udev rules that rely on reading the correct sensor part name ("tmp119") from sysfs?

While unlikely that userspace applications would need to differentiate between these two sensors, it is preferable that the correct part name appears in sysfs. I'll fix this in version 2.

Signature · 3 lines
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
maintainer
#2 lore raw

Re: [PATCH 1/2] dt-bindings: iio: ti,tmp117: add binding for the TMP119

In reply to Romain Gantois
Quoted 2 lines · On Fri, 05 Jun 2026 11:01:35 +0200 Romain Gantois <[email protected]>…

The TMP119 has the same register layout as the TMP117, and a better local sensor accuracy.

Sounds like (and the driver changes pretty much confirm) that this could use a fallback compatible to the tmp117.

The second patch then just resolves the print that would happen on older kernels using that fallback due to ID mismatch. That's fine but nice if older kernels can work with this part.

Thanks,

Jonathan

Quoted 33 lines
---
 Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +4 -2
index fbba5e934861c..9f3b74274b16e 100644
@@ -7,10 +7,11 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: TI TMP117 - Digital temperature sensor with integrated NV memory
 
 description: |
-    TI TMP116/117 - Digital temperature sensor with integrated NV memory that
-    supports I2C interface.
+    TI TMP116/117/119 - Digital temperature sensor with integrated NV memory
+    that supports I2C interface.
       https://www.ti.com/lit/gpn/tmp116
       https://www.ti.com/lit/gpn/tmp117
+      https://www.ti.com/lit/gpn/tmp119
 
 maintainers:
   - Puranjay Mohan <[email protected]>
@@ -20,6 +21,7 @@ properties:
     enum:
       - ti,tmp116
       - ti,tmp117
+      - ti,tmp119
 
   reg:
     maxItems: 1
#3 lore raw

Re: [PATCH 1/2] dt-bindings: iio: ti,tmp117: add binding for the TMP119

Hi Jonathan,

Quoted 9 lines · On Friday, 5 June 2026 13:53:32 CEST Jonathan Cameron wrote:

On Fri, 05 Jun 2026 11:01:35 +0200

Quoted 2 lines · Romain Gantois

The TMP119 has the same register layout as the TMP117, and a better local sensor accuracy.

Sounds like (and the driver changes pretty much confirm) that this could use a fallback compatible to the tmp117.

What do you mean by "fallback compatible" in this case? Do you mean we should do something like this in the bindings:

```
enum:
       - ti,tmp116
       - ti,tmp119
const:
       - ti,tmp117
```

But wouldn't this invalidate existing device trees which only have:

compatible = "ti,tmp116";

Quoted 3 lines

The second patch then just resolves the print that would happen on older kernels using that fallback due to ID mismatch. That's fine but nice if older kernels can work with this part.

Sorry I don't quite understand: since this is a feature patch, I don't expect it would get backported onto older kernels. Therefore why would the second patch resolve the print happening on older kernels?

Thanks,

Signature · 3 lines
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
maintainer
#4 lore raw

Re: [PATCH 1/2] dt-bindings: iio: ti,tmp117: add binding for the TMP119

Quoted 16 lines · On Fri, 05 Jun 2026 14:24:45 +0200 Romain Gantois <[email protected]>…

Hi Jonathan,

Quoted 9 lines · On Friday, 5 June 2026 13:53:32 CEST Jonathan Cameron wrote:

On Fri, 05 Jun 2026 11:01:35 +0200

Quoted 2 lines · Romain Gantois

The TMP119 has the same register layout as the TMP117, and a better local sensor accuracy.

Sounds like (and the driver changes pretty much confirm) that this could use a fallback compatible to the tmp117.

What do you mean by "fallback compatible" in this case? Do you mean we should do something like this in the bindings:

Quoted 7 lines
```
enum:
       - ti,tmp116
       - ti,tmp119
const:
       - ti,tmp117
```

Something like (I can never remember the syntax so this is modified from another binding doc and untested)

oneOf:
- enum:
- ti,tmp116
- ti,tmp117
- items:
- enum: #enum here because once we have one we tend to get more ;)
- ti,tmp119
- const: ti,tmp117

Quoted 5 lines

But wouldn't this invalidate existing device trees which only have:

compatible = "ti,tmp116";

Quoted 8 lines
Quoted 3 lines

The second patch then just resolves the print that would happen on older kernels using that fallback due to ID mismatch. That's fine but nice if older kernels can work with this part.

Sorry I don't quite understand: since this is a feature patch, I don't expect it would get backported onto older kernels. Therefore why would the second patch resolve the print happening on older kernels?

The point of a fallback compatible is that we don't have to backport anything. New device tree comes along that lists

compatible = "ti,tmp119", "ti,tmp117"

will just work. Older kernel will think it has a tmp117 which is fine as they are register interface compatible. It will print a message to say that it found an unknown ID but then assume it is what the firmware told it, here the tmp117 fallback. With your second patch in place, that harmless message will disappear for new kernels.

Jonathan

Quoted 2 lines

Thanks,

#5 lore raw

Re: [PATCH 1/2] dt-bindings: iio: ti,tmp117: add binding for the TMP119

Quoted 29 lines · Jonathan Cameron
Quoted 16 lines · On Fri, 05 Jun 2026 14:24:45 +0200 Romain Gantois <[email protected]>…

Hi Jonathan,

Quoted 9 lines · On Friday, 5 June 2026 13:53:32 CEST Jonathan Cameron wrote:

On Fri, 05 Jun 2026 11:01:35 +0200

Quoted 2 lines · Romain Gantois

The TMP119 has the same register layout as the TMP117, and a better local sensor accuracy.

Sounds like (and the driver changes pretty much confirm) that this could use a fallback compatible to the tmp117.

What do you mean by "fallback compatible" in this case? Do you mean we should do something like this in the bindings:

Quoted 7 lines
```
enum:
       - ti,tmp116
       - ti,tmp119
const:
       - ti,tmp117
```

Something like (I can never remember the syntax so this is modified from another binding doc and untested)

Quoted 8 lines

oneOf:
- enum:
- ti,tmp116
- ti,tmp117
- items:
- enum: #enum here because once we have one we tend to get more ;)
- ti,tmp119
- const: ti,tmp117

Other than the cheeky comment, this looks okay.

Quoted 31 lines
Quoted 6 lines

But wouldn't this invalidate existing device trees which only have:

compatible = "ti,tmp116";

Quoted 8 lines
Quoted 3 lines

The second patch then just resolves the print that would happen on older kernels using that fallback due to ID mismatch. That's fine but nice if older kernels can work with this part.

Sorry I don't quite understand: since this is a feature patch, I don't expect it would get backported onto older kernels. Therefore why would the second patch resolve the print happening on older kernels?

The point of a fallback compatible is that we don't have to backport anything. New device tree comes along that lists

compatible = "ti,tmp119", "ti,tmp117"

will just work. Older kernel will think it has a tmp117 which is fine as they are register interface compatible. It will print a message to say that it found an unknown ID but then assume it is what the firmware told it, here the tmp117 fallback. With your second patch in place, that harmless message will disappear for new kernels.

Jonathan

Quoted 2 lines

Thanks,

#6 lore raw

Re: [PATCH 1/2] dt-bindings: iio: ti,tmp117: add binding for the TMP119

In reply to Jonathan Cameron
Quoted 1 line · On Friday, 5 June 2026 16:20:05 CEST Jonathan Cameron wrote:

On Fri, 05 Jun 2026 14:24:45 +0200

...

Quoted 12 lines
Quoted 8 lines
Quoted 4 lines

The second patch then just resolves the print that would happen on older kernels using that fallback due to ID mismatch. That's fine but nice if older kernels can work with this part.

Sorry I don't quite understand: since this is a feature patch, I don't expect it would get backported onto older kernels. Therefore why would the second patch resolve the print happening on older kernels?

The point of a fallback compatible is that we don't have to backport anything. New device tree comes along that lists

Quoted 7 lines

compatible = "ti,tmp119", "ti,tmp117"

will just work. Older kernel will think it has a tmp117 which is fine as they are register interface compatible. It will print a message to say that it found an unknown ID but then assume it is what the firmware told it, here the tmp117 fallback. With your second patch in place, that harmless message will disappear for new kernels.

Ok I understand, thanks for the explanation.

Thanks,

Signature · 3 lines
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com