drivers: sensor: mcp9600: fix wrong register address
The address of most of the registers defined in
the driver are wrong. This fixes it, following
the correct numbering as can be found in the
device's datasheet. Moreover, re-grouping of
the macros according to their functionality.
Signed-off-by: Nikos Agianniotis <na@neq.dk>
diff --git a/drivers/sensor/mcp9600/mcp9600.c b/drivers/sensor/mcp9600/mcp9600.c
index ed5fb8b..dfec3a5 100644
--- a/drivers/sensor/mcp9600/mcp9600.c
+++ b/drivers/sensor/mcp9600/mcp9600.c
@@ -25,22 +25,23 @@
#define MCP9600_REG_TC_CONFIG 0x05
#define MCP9600_REG_DEV_CONFIG 0x06
-#define MCP9600_REG_A1_CONFIG 0x07
-#define MCP9600_REG_A2_CONFIG 0x08
-#define MCP9600_REG_A3_CONFIG 0x09
-#define MCP9600_REG_A4_CONFIG 0x0A
-#define MCP9600_A1_HYST 0x0B
+#define MCP9600_REG_A1_CONFIG 0x08
+#define MCP9600_REG_A2_CONFIG 0x09
+#define MCP9600_REG_A3_CONFIG 0x0A
+#define MCP9600_REG_A4_CONFIG 0x0B
-#define MCP9600_A2_HYST 0x0C
-#define MCP9600_A3_HYST 0x0D
-#define MCP9600_A4_HYST 0x0E
-#define MCP9600_A1_LIMIT 0x0F
+#define MCP9600_A1_HYST 0x0C
+#define MCP9600_A2_HYST 0x0D
+#define MCP9600_A3_HYST 0x0E
+#define MCP9600_A4_HYST 0x0F
-#define MCP9600_A2_LIMIT 0x10
-#define MCP9600_A3_LIMIT 0x11
-#define MCP9600_A4_LIMIT 0x12
-#define MCP9600_REG_ID_REVISION 0x13
+#define MCP9600_A1_LIMIT 0x10
+#define MCP9600_A2_LIMIT 0x11
+#define MCP9600_A3_LIMIT 0x12
+#define MCP9600_A4_LIMIT 0x13
+
+#define MCP9600_REG_ID_REVISION 0x20
struct mcp9600_data {
int32_t temp;