# Re: \[PATCH 2/5\] Read whole message instead of just the first byte to make CHG low

- From: Iiro Valkonen \<hidden\>
- Date: 2011-02-03 14:02:06 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2011/02/8916050
- Thread: https://ratatoskr.run/linux-input/2011/01/8915933/t.md

```text
Input: qt602240_ts - Read whole message instead of just the first byte to make CHG low

From: Iiro Valkonen <redacted>

Read the whole message, as reading just the first byte isn't always guaranteed to clear the message.

Signed-off-by: Iiro Valkonen <redacted>
---
 drivers/input/touchscreen/qt602240_ts.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/qt602240_ts.c b/drivers/input/touchscreen/qt602240_ts.c
index 739d18a..6ef8290 100644
--- a/drivers/input/touchscreen/qt602240_ts.c
+++ b/drivers/input/touchscreen/qt602240_ts.c
@@ -699,16 +699,16 @@ static int mxt_check_matrix_size(struct mxt_data *data)
 static int mxt_make_highchg(struct mxt_data *data)
 {
 	struct device *dev = &data->client->dev;
+	struct mxt_message message;
 	int count = 10;
 	int error;
-	u8 val;
 
 	/* Read dummy message to make high CHG pin */
 	do {
-		error = mxt_read_object(data, MXT_GEN_MESSAGE, 0, &val);
+		error = mxt_read_message(data, &message);
 		if (error)
 			return error;
-	} while ((val != 0xff) && --count);
+	} while ((message.reportid != 0xff) && --count);
 
 	if (!count) {
 		dev_err(dev, "CHG pin isn't cleared\n");
-- 
1.7.0.4
```
