diff options
author | Andrei Lalaev <andrei.lalaev@anton-paar.com> | 2024-06-17 20:30:18 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-06-25 18:13:08 +0200 |
commit | 866a5c7e2781cf1b019072288f1f5c64186dcb63 (patch) | |
tree | 388b743aeb60317ab1b3914b28a2d69871d9218f /drivers/input | |
parent | Input: edt-ft5x06 - add ft5426 (diff) | |
download | linux-866a5c7e2781cf1b019072288f1f5c64186dcb63.tar.xz linux-866a5c7e2781cf1b019072288f1f5c64186dcb63.zip |
Input: qt1050 - handle CHIP_ID reading error
If the device is missing, we get the following error:
qt1050 3-0041: ID -1340767592 not supported
Let's handle this situation and print more informative error
when reading of CHIP_ID fails:
qt1050 3-0041: Failed to read chip ID: -6
Fixes: cbebf5addec1 ("Input: qt1050 - add Microchip AT42QT1050 support")
Signed-off-by: Andrei Lalaev <andrei.lalaev@anton-paar.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20240617183018.916234-1-andrey.lalaev@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/qt1050.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c index b51dfcd76038..056e9bc26026 100644 --- a/drivers/input/keyboard/qt1050.c +++ b/drivers/input/keyboard/qt1050.c @@ -226,7 +226,12 @@ static bool qt1050_identify(struct qt1050_priv *ts) int err; /* Read Chip ID */ - regmap_read(ts->regmap, QT1050_CHIP_ID, &val); + err = regmap_read(ts->regmap, QT1050_CHIP_ID, &val); + if (err) { + dev_err(&ts->client->dev, "Failed to read chip ID: %d\n", err); + return false; + } + if (val != QT1050_CHIP_ID_VER) { dev_err(&ts->client->dev, "ID %d not supported\n", val); return false; |