Skip to content

Commit ca1cd36

Browse files
sredtor
authored andcommitted
Input: atmel_mxt_ts - fix reset-gpio for level based irqs
The current reset-gpio support triggers an interrupt storm on platforms using the maxtouch with level based interrupt. The Motorola Droid 4, which I used for some of the tests is not affected, since it uses a edge based interrupt. This change avoids the interrupt storm by enabling the device while its interrupt is disabled. Afterwards we wait 100ms. This is important for two reasons: The device is unresponsive for some time (~22ms for mxt224E) and the CHG (interrupt) line is not working properly for 100ms. We don't need to wait for any following interrupts, since the following mxt_initialize() checks for bootloader mode anyways. This fixes a boot issue on GE PPD (watchdog kills device due to interrupt storm) and does not cause regression on Motorola Droid 4. Fixes: f657b00 ("Input: atmel_mxt_ts - add support for reset line") Signed-off-by: Sebastian Reichel <[email protected]> Reviewed-by: Pavel Machek <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 7cf432b commit ca1cd36

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ enum t100_type {
194194

195195
/* Delay times */
196196
#define MXT_BACKUP_TIME 50 /* msec */
197+
#define MXT_RESET_GPIO_TIME 20 /* msec */
198+
#define MXT_RESET_INVALID_CHG 100 /* msec */
197199
#define MXT_RESET_TIME 200 /* msec */
198200
#define MXT_RESET_TIMEOUT 3000 /* msec */
199201
#define MXT_CRC_TIMEOUT 1000 /* msec */
@@ -1208,7 +1210,7 @@ static int mxt_soft_reset(struct mxt_data *data)
12081210
return ret;
12091211

12101212
/* Ignore CHG line for 100ms after reset */
1211-
msleep(100);
1213+
msleep(MXT_RESET_INVALID_CHG);
12121214

12131215
mxt_acquire_irq(data);
12141216

@@ -3082,20 +3084,14 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
30823084
return error;
30833085
}
30843086

3087+
disable_irq(client->irq);
3088+
30853089
if (data->reset_gpio) {
3086-
data->in_bootloader = true;
3087-
msleep(MXT_RESET_TIME);
3088-
reinit_completion(&data->bl_completion);
3090+
msleep(MXT_RESET_GPIO_TIME);
30893091
gpiod_set_value(data->reset_gpio, 1);
3090-
error = mxt_wait_for_completion(data, &data->bl_completion,
3091-
MXT_RESET_TIMEOUT);
3092-
if (error)
3093-
return error;
3094-
data->in_bootloader = false;
3092+
msleep(MXT_RESET_INVALID_CHG);
30953093
}
30963094

3097-
disable_irq(client->irq);
3098-
30993095
error = mxt_initialize(data);
31003096
if (error)
31013097
return error;

0 commit comments

Comments
 (0)