[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240517081050.168698-2-dima.fedrau@gmail.com>
Date: Fri, 17 May 2024 10:10:49 +0200
From: Dimitri Fedrau <dima.fedrau@...il.com>
To:
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Dimitri Fedrau <dima.fedrau@...il.com>,
Andrew Hepp <andrew.hepp@...pp.dev>,
Marcelo Schmitt <marcelo.schmitt1@...il.com>,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/2] iio: temperature: mcp9600: Provide index for both channels
The mapping from cold junction to ambient temperature is inaccurate. We
provide an index for hot and cold junction temperatures.
Suggested-by: Jonathan Cameron <jic23@...nel.org>
Signed-off-by: Dimitri Fedrau <dima.fedrau@...il.com>
---
drivers/iio/temperature/mcp9600.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/temperature/mcp9600.c b/drivers/iio/temperature/mcp9600.c
index 46845804292b..22451d1d9e1f 100644
--- a/drivers/iio/temperature/mcp9600.c
+++ b/drivers/iio/temperature/mcp9600.c
@@ -14,6 +14,9 @@
#include <linux/iio/iio.h>
+#define MCP9600_CHAN_HOT_JUNCTION 0
+#define MCP9600_CHAN_COLD_JUNCTION 1
+
/* MCP9600 registers */
#define MCP9600_HOT_JUNCTION 0x0
#define MCP9600_COLD_JUNCTION 0x2
@@ -25,17 +28,19 @@
static const struct iio_chan_spec mcp9600_channels[] = {
{
.type = IIO_TEMP,
+ .channel = MCP9600_CHAN_HOT_JUNCTION,
.address = MCP9600_HOT_JUNCTION,
.info_mask_separate =
BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
+ .indexed = 1,
},
{
.type = IIO_TEMP,
+ .channel = MCP9600_CHAN_COLD_JUNCTION,
.address = MCP9600_COLD_JUNCTION,
- .channel2 = IIO_MOD_TEMP_AMBIENT,
- .modified = 1,
.info_mask_separate =
BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
+ .indexed = 1,
},
};
--
2.39.2
Powered by blists - more mailing lists