From 1bb624bc1d680d1a9fe172e2ad3f33bc09ebd0d0 Mon Sep 17 00:00:00 2001 From: Klaus Pedersen Date: Fri, 15 Feb 2008 23:31:42 +0200 Subject: [PATCH] tsc2301 - fix keyboard stuck problem The following steps could provoke a lock-up in the tsc2301: cd /sys/devices/platform/omap2_mcspi.1/spi1.0 echo 1 > disable_kp echo 0 > disable_kp echo 1 > disable_ts Signed-off-by: Klaus Pedersen Signed-off-by: Tony Lindgren --- drivers/input/keyboard/tsc2301_kp.c | 9 ++------- drivers/input/touchscreen/tsc2301_ts.c | 8 ++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/input/keyboard/tsc2301_kp.c b/drivers/input/keyboard/tsc2301_kp.c index 473c0f2d9a4..3703cd5489b 100644 --- a/drivers/input/keyboard/tsc2301_kp.c +++ b/drivers/input/keyboard/tsc2301_kp.c @@ -270,14 +270,9 @@ out: */ void tsc2301_kp_restart(struct tsc2301 *tsc) { - struct tsc2301_kp *kp = tsc->kp; - - mutex_lock(&kp->mutex); - if (!kp->user_disabled) { - tsc2301_kp_disable(tsc, 0); - tsc2301_kp_enable(tsc); + if (!tsc2301_kp_disabled(tsc)) { + tsc2301_kp_start_scan(tsc); } - mutex_unlock(&kp->mutex); } static ssize_t tsc2301_kp_disable_show(struct device *dev, diff --git a/drivers/input/touchscreen/tsc2301_ts.c b/drivers/input/touchscreen/tsc2301_ts.c index a01aa58c2ce..03c1317ccd0 100644 --- a/drivers/input/touchscreen/tsc2301_ts.c +++ b/drivers/input/touchscreen/tsc2301_ts.c @@ -275,11 +275,13 @@ static int tsc2301_ts_configure(struct tsc2301 *tsc, int flags) static void tsc2301_ts_start_scan(struct tsc2301 *tsc) { tsc2301_ts_configure(tsc, tsc->ts->hw_flags); + tsc2301_kp_restart(tsc); } static void tsc2301_ts_stop_scan(struct tsc2301 *tsc) { tsc2301_write_reg(tsc, TSC2301_REG_ADC, TSC2301_ADCREG_STOP_CONVERSION); + tsc2301_kp_restart(tsc); } static void update_pen_state(struct tsc2301_ts *ts, int x, int y, int pressure) @@ -439,10 +441,6 @@ static void tsc2301_ts_disable(struct tsc2301 *tsc) } while (ts->event_sent); tsc2301_ts_stop_scan(tsc); - /* Workaround a bug where turning on / off touchscreen scanner - * can get the keypad scanner stuck. - */ - tsc2301_kp_restart(tsc); } static void tsc2301_ts_enable(struct tsc2301 *tsc) @@ -455,8 +453,6 @@ static void tsc2301_ts_enable(struct tsc2301 *tsc) enable_irq(ts->irq); tsc2301_ts_start_scan(tsc); - /* Same workaround as above. */ - tsc2301_kp_restart(tsc); } #ifdef CONFIG_PM -- 2.41.0