Skip to contentSkip to conversation

iio: temperature: tmp117: Support the TMP119 sensor

PATCH Superseded Romain Gantois 6 participants 11 messages Jun 8 – Jun 10

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover iio: temperature: tmp117: Support the TMP119 sensor

Hello everyone,

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

Best Regards,

Romain

---
Changes in v2:
- Used ti,tmp117 as a fallback compatible
- Made sure the correct IIO device name was exposed to userspace
- Link to v1: https://patch.msgid.link/[email protected]

To: Puranjay Mohan <[email protected]>
To: Jonathan Cameron <[email protected]>
To: David Lechner <[email protected]>
To: Nuno Sá <[email protected]>
To: Andy Shevchenko <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

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

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

 .../devicetree/bindings/iio/temperature/ti,tmp117.yaml   | 16 +++++++++++-----
 drivers/iio/temperature/tmp117.c                         | 10 ++++++++++
 2 files changed, 21 insertions(+), 5 deletions(-)

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

Best regards,

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

PATCH v2 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. Add a compatible for it.

Use ti,tmp117 as a fallback compatible for ti,tmp119.

---
 .../devicetree/bindings/iio/temperature/ti,tmp117.yaml   | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +11 -5
index fbba5e934861c..d12dfef315b6c 100644
@@ -7,19 +7,25 @@ $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]>
 
 properties:
   compatible:
-    enum:
-      - ti,tmp116
-      - ti,tmp117
+    oneOf:
+      - enum:
+        - ti,tmp116
+        - ti,tmp117
+      - items:
+        - enum:
+          - ti,tmp119
+        - const: ti,tmp117
 
   reg:
     maxItems: 1
Signature · 1 line
2.54.0
#2 lore raw

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

Quoted 32 lines · Romain Gantois

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

Use ti,tmp117 as a fallback compatible for ti,tmp119.

---
 .../devicetree/bindings/iio/temperature/ti,tmp117.yaml   | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +3 -3
index fbba5e934861c..d12dfef315b6c 100644
@@ -7,19 +7,25 @@ $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]>
 
 properties:
   compatible:
-    enum:

Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml $schema: http://devicetree.org/meta-schemas/core.yaml# · line 28

Quoted 10 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +8 -2
-      - ti,tmp116
-      - ti,tmp117
+    oneOf:
+      - enum:
+        - ti,tmp116
+        - ti,tmp117
+      - items:
+        - enum:
+          - ti,tmp119
+        - const: ti,tmp117

Indent here looks undersized, is that just the diff being weird?

Quoted 7 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +0 -0
   reg:
     maxItems: 1
 
Signature · 1 line
2.54.0
#3 lore raw

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

Quoted 30 lines · Conor Dooley
Quoted 29 lines · Romain Gantois

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

Use ti,tmp117 as a fallback compatible for ti,tmp119.

---
 .../devicetree/bindings/iio/temperature/ti,tmp117.yaml   | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +3 -2
index fbba5e934861c..d12dfef315b6c 100644
@@ -7,19 +7,25 @@ $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]>
 
Quoted 15 lines

Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml $schema: http://devicetree.org/meta-schemas/core.yaml# · line 28

Quoted 13 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +8 -3
 properties:
   compatible:
-    enum:
-      - ti,tmp116
-      - ti,tmp117
+    oneOf:
+      - enum:
+        - ti,tmp116
+        - ti,tmp117
+      - items:
+        - enum:
+          - ti,tmp119
+        - const: ti,tmp117

Indent here looks undersized, is that just the diff being weird?

It's not just the diff. Testing the binding would show you what's wrong.
pw-bot: changes-requested

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml +0 -0
   reg:
     maxItems: 1
 
Signature · 1 line
2.54.0
#4 lore raw

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

In reply to Romain Gantois
Quoted 10 lines · Romain Gantois

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

Use ti,tmp117 as a fallback compatible for ti,tmp119.

---
 .../devicetree/bindings/iio/temperature/ti,tmp117.yaml   | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml:23:9: [warning] wrong indentation: expected 10 but found 8 (indentation) ./Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml:26:9: [warning] wrong indentation: expected 10 but found 8 (indentation) ./Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml:27:11: [warning] wrong indentation: expected 12 but found 10 (indentation)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#5 lore raw

PATCH v2 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 | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/iio/temperature/tmp117.c +10 -0
index 8972083d903a2..18ad40f3e7361 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;
@@ -139,6 +140,12 @@ static const struct tmp11x_info tmp117_channels_info = {
 	.num_channels = ARRAY_SIZE(tmp117_channels)
 };
 
+static const struct tmp11x_info tmp119_channels_info = {
+	.name = "tmp119",
+	.channels = tmp117_channels,
+	.num_channels = ARRAY_SIZE(tmp117_channels)
+};
+
 static const struct iio_info tmp117_info = {
 	.read_raw = tmp117_read_raw,
 	.write_raw = tmp117_write_raw,
@@ -170,6 +177,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 +212,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 = &tmp119_channels_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, tmp117_of_match);
@@ -211,6 +220,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)&tmp119_channels_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tmp117_id);
Signature · 1 line
2.54.0
#6 lore raw

Re: [PATCH v2 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] TMP119 devices are incorrectly assigned `tmp117_channels_info` during hardware probe, resulting…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] TMP119 devices are incorrectly assigned tmp117_channels_info during hardware probe, resulting in the wrong IIO device name. --

commit 39dc1c3727920cc7af5409c8327a8bd65880f8b8
Author: Wil Stark <[email protected]>

iio: temperature: tmp117: add TI TMP119 support

This commit adds support for the TMP119 temperature sensor. It introduces the device ID, channel info, and matching data to allow the tmp117 driver to handle TMP119 devices.

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

[ ... ]

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

Quoted 7 lines
drivers/iio/temperature/tmp117.c +1 -0
@@ -170,6 +177,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 assignment cause TMP119 devices to be registered with the wrong name?

By falling through to the TMP117_DEVICE_ID case, match_data is assigned to &tmp117_channels_info rather than the newly added tmp119_channels_info.

As a result, TMP119 devices are exposed to userspace in the IIO subsystem with the name 'tmp117' instead of 'tmp119'. The new tmp119_channels_info struct appears to be completely bypassed during the hardware probe unless identification fails and fallback match data is used.

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

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

In reply to Romain Gantois
Quoted 2 lines · Romain Gantois

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

...

drivers/iio/temperature/tmp117.c static const struct tmp11x_info tmp117_channels_info = { · line 146

Quoted 4 lines
drivers/iio/temperature/tmp117.c +4 -0
+static const struct tmp11x_info tmp119_channels_info = {
+	.name = "tmp119",
+	.channels = tmp117_channels,
+	.num_channels = ARRAY_SIZE(tmp117_channels)

You want to include array_size.h.

Quoted 1 line

+};

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#8 lore raw
In reply to Romain Gantois
Quoted 11 lines · On Mon, 08 Jun 2026 18:00:23 +0200 Romain Gantois <[email protected]>…

Hello everyone,

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

Best Regards,

Romain

Hi Romain

Other than the DT indent thing Conor calls out this looks fine to me. However, unless the cycle is extended IIO is effectively closed for this kernel cycle. Anything I queue up now will be targeting 7.3 now. On the plus side no rush for v3!

Thanks,

Jonathan

Quoted 37 lines

---
Changes in v2:
- Used ti,tmp117 as a fallback compatible
- Made sure the correct IIO device name was exposed to userspace
- Link to v1: https://patch.msgid.link/[email protected]

To: Puranjay Mohan <[email protected]>
To: Jonathan Cameron <[email protected]>
To: David Lechner <[email protected]>
To: Nuno Sá <[email protected]>
To: Andy Shevchenko <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

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

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

 .../devicetree/bindings/iio/temperature/ti,tmp117.yaml   | 16 +++++++++++-----
 drivers/iio/temperature/tmp117.c                         | 10 ++++++++++
 2 files changed, 21 insertions(+), 5 deletions(-)

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

Best regards,

Signature · 1 line
Romain Gantois <[email protected]>
#9 lore raw
Quoted 11 lines · Jonathan Cameron
Quoted 3 lines · On Mon, 08 Jun 2026 18:00:23 +0200 Romain Gantois <[email protected]>…

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

Other than the DT indent thing Conor calls out this looks fine to me. However, unless the cycle is extended IIO is effectively closed for this kernel cycle. Anything I queue up now will be targeting 7.3 now. On the plus side no rush for v3!

Please, incorporate what I commented on. Id est add #include <linux/array_size.h>

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#10 lore raw
Quoted 8 lines · On Tuesday, 9 June 2026 16:54:47 CEST Andy Shevchenko wrote:
Quoted 7 lines · Jonathan Cameron

On Mon, 08 Jun 2026 18:00:23 +0200

Quoted 3 lines · Romain Gantois

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

Quoted 7 lines
Quoted 4 lines

Other than the DT indent thing Conor calls out this looks fine to me. However, unless the cycle is extended IIO is effectively closed for this kernel cycle. Anything I queue up now will be targeting 7.3 now. On the plus side no rush for v3!

Please, incorporate what I commented on. Id est add #include <linux/array_size.h>

ACK, I will.

Thanks,

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