Skip to content

Commit

Permalink
drivers: input: cst816s: add alternative chip id
Browse files Browse the repository at this point in the history
The CST816S chip ID have an alternative value. It seems that this
field represents in fact a version number of controller. Fix by adding
the new chip ID.

Signed-off-by: Joel Guittet <[email protected]>
  • Loading branch information
joelguittet committed Feb 5, 2024
1 parent 826d67a commit 5be190d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/input/input_cst816s.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

LOG_MODULE_REGISTER(cst816s, CONFIG_INPUT_LOG_LEVEL);

#define CST816S_CHIP_ID 0xB4
#define CST816S_CHIP_ID1 0xB4
#define CST816S_CHIP_ID2 0xB5

#define CST816S_REG_DATA 0x00
#define CST816S_REG_GESTURE_ID 0x01
Expand Down Expand Up @@ -202,7 +203,7 @@ static int cst816s_chip_init(const struct device *dev)
return ret;
}

if (chip_id != CST816S_CHIP_ID) {
if ((chip_id != CST816S_CHIP_ID1) && (chip_id != CST816S_CHIP_ID2)) {
LOG_ERR("CST816S wrong chip id: returned 0x%x", chip_id);
return -ENODEV;
}
Expand Down

0 comments on commit 5be190d

Please sign in to comment.