Input: qt1050 - handle CHIP_ID reading error
Subsystems (2)
PATCH 1/1 Input: qt1050 - handle CHIP_ID reading error
From: Andrei Lalaev <[email protected]>
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
--- drivers/input/keyboard/qt1050.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/input/keyboard/qt1050.c +6 -1
@@ -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;
Signature · 1 line
2.35.2
Quoted 6 lines · Andrei Lalaev
From: Andrei Lalaev <[email protected]>
If the device is missing, we get the following error:
qt1050 3-0041: ID -1340767592 not supported
Quoted 7 lines
Let's handle this situation and print more informative error when reading of
CHIP_IDfails:qt1050 3-0041: Failed to read chip ID: -6
Fixes cbebf5addec1 ("Input: qt1050 - add Microchip AT42QT1050 support")Signed-off-by Andrei Lalaev <[email protected]>
Quoted 6 lines · Andrei Lalaev
From: Andrei Lalaev <[email protected]>
If the device is missing, we get the following error:
qt1050 3-0041: ID -1340767592 not supported
Quoted 7 lines
Let's handle this situation and print more informative error when reading of
CHIP_IDfails:qt1050 3-0041: Failed to read chip ID: -6
Fixes cbebf5addec1 ("Input: qt1050 - add Microchip AT42QT1050 support")Signed-off-by Andrei Lalaev <[email protected]>
Applied, thank you.
But how did we get into the situation with the chip being missing? Incorrect DTB for the board?
Thanks.
Signature · 1 line
Dmitry
Quoted 1 line
But how did we get into the situation with the chip being missing?
In my case, this chip is a part of an external board.
So, for example, I see this message in the case of a bad cable connection.
Also, I prefer to see messages with error codes instead of random values from a stack :)
P.S. sorry for the previous email, I made a typo in git-send-email args.
Best regards,
Andrei Lalaev