Skip to contentSkip to conversation

iio: temperature: Add MCP9600 thermocouple EMF converter driver

PATCH Superseded Andrew Hepp 2 participants 4 messages Jan 8, 2023 – Feb 7, 2023 1 message not in the archive IIO

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): Jonathan Cameron <[email protected]

#1 lore raw

PATCH v2 1/1 iio: temperature: Add MCP9600 thermocouple EMF converter driver

From: "Andrew Hepp" <[email protected]>

Add support for the MCP9600 thermocouple EMF converter.

Datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/MCP960X-Data-Sheet-20005426.pdf

---
Changes for v2:
- remove unused sysfs include
- remove unused scan fields from channel
- warn rather than fail when probing unknown device
- register device through devm
- clean up style and prints

---
 drivers/iio/temperature/Kconfig   |  10 ++
 drivers/iio/temperature/Makefile  |   1 +
 drivers/iio/temperature/mcp9600.c | 146 ++++++++++++++++++++++++++++++
 3 files changed, 157 insertions(+)
 create mode 100644 drivers/iio/temperature/mcp9600.c
drivers/iio/temperature/Kconfig +10 -0
index ed384f33e0c7..ea2ce364b2e9 100644
@@ -158,4 +158,14 @@ config MAX31865
 	  This driver can also be build as a module. If so, the module
 	  will be called max31865.
 
+config MCP9600
+	tristate "MCP9600 thermocouple EMF converter"
+	depends on I2C
+	help
+	  If you say yes here you get support for MCP9600
+	  thermocouple EMF converter connected via I2C.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called mcp9600.
+
 endmenu
drivers/iio/temperature/Makefile +1 -0
index dfec8c6d3019..9330d4a39598 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_MAXIM_THERMOCOUPLE) += maxim_thermocouple.o
 obj-$(CONFIG_MAX30208) += max30208.o
 obj-$(CONFIG_MAX31856) += max31856.o
 obj-$(CONFIG_MAX31865) += max31865.o
+obj-$(CONFIG_MCP9600) += mcp9600.o
 obj-$(CONFIG_MLX90614) += mlx90614.o
 obj-$(CONFIG_MLX90632) += mlx90632.o
 obj-$(CONFIG_TMP006) += tmp006.o
drivers/iio/temperature/mcp9600.c new file +146 -0

146 lines not on this page · raw message

Signature · 1 line
2.30.2
maintainer
#2 lore raw
Quoted 6 lines · On Sun, 8 Jan 2023 15:45:04 -0800 Andrew Hepp <[email protected]> wrote:

From: "Andrew Hepp" <[email protected]>

Add support for the MCP9600 thermocouple EMF converter.

Datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/MCP960X-Data-Sheet-20005426.pdf

Driver looks good, but now I realise we don't have a device tree binding doc.

Please add one for v3.

Note that the binding doc is describing the hardware, not what the driver currently supports alone, so include the 4 (or 6?) interrupt lines (and interrupt-names as any random subset of them might be provided) + VDD regulator + anything else I've not noticed in my 10 second look at the datashet.

Thanks,

Jonathan

maintainer
#3 lore raw
Quoted 10 lines · On Thu, 12 Jan 2023 19:05:51 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 6 lines · On Sun, 8 Jan 2023 15:45:04 -0800 Andrew Hepp <[email protected]> wrote:

From: "Andrew Hepp" <[email protected]>

Add support for the MCP9600 thermocouple EMF converter.

Datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/MCP960X-Data-Sheet-20005426.pdf

Quoted 8 lines

Driver looks good, but now I realise we don't have a device tree binding doc.

Please add one for v3.

Note that the binding doc is describing the hardware, not what the driver currently supports alone, so include the 4 (or 6?) interrupt lines (and interrupt-names as any random subset of them might be provided) + VDD regulator + anything else I've not noticed in my 10 second look at the datashet.

Hi Andrew,

If you aren't going to get to this sometime soon, feel free to say so and I might write binding docs for it if I get time. I'd rather do that than lose a driver over some docs!

Jonathan

Quoted 5 lines

Thanks,

Jonathan

#4 lore raw
Quoted 5 lines · Jonathan Cameron

Hi Andrew,

If you aren't going to get to this sometime soon, feel free to say so and I might write binding docs for it if I get time. I'd rather do that than lose a driver over some docs!

Hi Jonathan,

I appreciate the offer! I have been putting this off since I'm not yet familiar with binding docs, but I figure it's important to learn. Apologies for leaving the patch sitting around half-baked, I'll try to have something ready for submission this weekend.

By the way, thanks for the useful feedback on previous versions of the patch! I've really enjoyed using the IIO subsystem and am excited to contribute upstream.

Thanks,
Andrew

Quoted 2 lines

Jonathan