Skip to content

Commit

Permalink
drivers: sensor: mcp9600: fix wrong register address
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit ed61040)

Original-Signed-off-by: Nikos Agianniotis <na@neq.dk>
GitOrigin-RevId: ed61040
Change-Id: Ifac6ef60d53cfdb390db8e8207341e52e9777573
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5099397
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
  • Loading branch information
naNEQ authored and Chromeos LUCI committed Dec 7, 2023
1 parent 02b35f4 commit b840a37
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions drivers/sensor/mcp9600/mcp9600.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,23 @@ LOG_MODULE_REGISTER(MCP9600, CONFIG_SENSOR_LOG_LEVEL);

#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_A2_HYST 0x0C
#define MCP9600_A3_HYST 0x0D
#define MCP9600_A4_HYST 0x0E
#define MCP9600_A1_LIMIT 0x0F

#define MCP9600_A2_LIMIT 0x10
#define MCP9600_A3_LIMIT 0x11
#define MCP9600_A4_LIMIT 0x12
#define MCP9600_REG_ID_REVISION 0x13

#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_A1_HYST 0x0C
#define MCP9600_A2_HYST 0x0D
#define MCP9600_A3_HYST 0x0E
#define MCP9600_A4_HYST 0x0F

#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;
Expand Down

0 comments on commit b840a37

Please sign in to comment.