/
0030-CHROMIUM-Input-atmel_mxt_ts-remove-mxt_make_highchg.patch
108 lines (95 loc) · 3.35 KB
/
0030-CHROMIUM-Input-atmel_mxt_ts-remove-mxt_make_highchg.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
From 104d4b56907b56ba09dde0bd35ef9007a8a2af96 Mon Sep 17 00:00:00 2001
From: Daniel Kurtz <djkurtz@chromium.org>
Date: Wed, 19 Dec 2012 17:48:36 +0800
Subject: [PATCH 30/57] CHROMIUM: Input: atmel_mxt_ts - remove mxt_make_highchg
This function attempts to make the CHG pin high by reading a messages
until the device queue is empty.
Instead of throwing away the message contents, let's actually process them.
Also, instead of stopping after a fixed (10) number of messages, keep
reading until the device reports that it has no more valid messages - at
that point, the CHG line should truly be high.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:27713
TEST=builds clean; messages after boot are processed;
Config Checksum displayed in dmesg:
$ grep "Config Checksum" /var/log/messages
Change-Id: I3d1e266d1ac53f5640e65c5acc3fe6672a0c1451
Reviewed-on: https://gerrit.chromium.org/gerrit/17957
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
v3.7 rebase:
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 33 ++------------------------------
1 file changed, 2 insertions(+), 31 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 8c29fb3..8dfdba9 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -314,7 +314,6 @@ static int mxt_calc_resolution(struct mxt_data *data);
static void mxt_free_object_table(struct mxt_data *data);
static int mxt_initialize(struct mxt_data *data);
static int mxt_input_dev_create(struct mxt_data *data);
-static int mxt_make_highchg(struct mxt_data *data);
static inline size_t mxt_obj_size(const struct mxt_object *obj)
{
@@ -665,12 +664,6 @@ static int mxt_read_messages(struct mxt_data *data, u8 count,
sizeof(struct mxt_message) * count, messages);
}
-static int mxt_read_message(struct mxt_data *data,
- struct mxt_message *message)
-{
- return mxt_read_messages(data, 1, message);
-}
-
static int mxt_write_obj_instance(struct mxt_data *data, u8 type, u8 instance,
u8 offset, u8 val)
{
@@ -925,7 +918,7 @@ static void mxt_exit_bl(struct mxt_data *data)
return;
}
- error = mxt_make_highchg(data);
+ error = mxt_handle_messages(data);
if (error)
dev_err(dev, "Failed to clear CHG after init. error = %d\n",
error);
@@ -981,28 +974,6 @@ static int mxt_check_reg_init(struct mxt_data *data)
return 0;
}
-static int mxt_make_highchg(struct mxt_data *data)
-{
- struct device *dev = &data->client->dev;
- struct mxt_message message;
- int count = 10;
- int error;
-
- /* Read dummy message to make high CHG pin */
- do {
- error = mxt_read_message(data, &message);
- if (error)
- return error;
- } while (message.reportid != 0xff && --count);
-
- if (!count) {
- dev_err(dev, "CHG pin isn't cleared\n");
- return -EBUSY;
- }
-
- return 0;
-}
-
static void mxt_handle_pdata(struct mxt_data *data)
{
const struct mxt_platform_data *pdata = data->pdata;
@@ -2025,7 +1996,7 @@ static int __devinit mxt_probe(struct i2c_client *client,
}
if (!mxt_in_bootloader(data)) {
- error = mxt_make_highchg(data);
+ error = mxt_handle_messages(data);
if (error)
goto err_free_irq;
}
--
1.8.2.1