From 5be190dceb17eba61f536750e7c761c4b0fd6353 Mon Sep 17 00:00:00 2001 From: Joel Guittet Date: Mon, 8 Jan 2024 13:40:44 +0100 Subject: [PATCH] drivers: input: cst816s: add alternative chip id 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 --- drivers/input/input_cst816s.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/input/input_cst816s.c b/drivers/input/input_cst816s.c index 9409deb045a5..6c17af3aca9a 100644 --- a/drivers/input/input_cst816s.c +++ b/drivers/input/input_cst816s.c @@ -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 @@ -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; }