From fae0f5bb772b6586f7ff2c23d0f2c53fc6fe1880 Mon Sep 17 00:00:00 2001 From: Shang Xiangyao Date: Fri, 2 Aug 2024 21:28:09 +0800 Subject: [PATCH] drivers: input: cst816s: add cst816d support The CST816D touch chip is similar to the CST816S, with the primary difference being the chip ID. This commit extends the existing CST816S driver to support the CST816D by adding its chip ID. There are no other modifications. Signed-off-by: Shang Xiangyao --- drivers/input/input_cst816s.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/input/input_cst816s.c b/drivers/input/input_cst816s.c index 06d68d1ea75..84381bac4c2 100644 --- a/drivers/input/input_cst816s.c +++ b/drivers/input/input_cst816s.c @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(cst816s, CONFIG_INPUT_LOG_LEVEL); #define CST816S_CHIP_ID1 0xB4 #define CST816S_CHIP_ID2 0xB5 +#define CST816S_CHIP_ID3 0xB6 #define CST816S_REG_DATA 0x00 #define CST816S_REG_GESTURE_ID 0x01 @@ -226,7 +227,8 @@ static int cst816s_chip_init(const struct device *dev) return ret; } - if ((chip_id != CST816S_CHIP_ID1) && (chip_id != CST816S_CHIP_ID2)) { + if ((chip_id != CST816S_CHIP_ID1) && (chip_id != CST816S_CHIP_ID2) && + (chip_id != CST816S_CHIP_ID3)) { LOG_ERR("CST816S wrong chip id: returned 0x%x", chip_id); return -ENODEV; }