diff mbox series

[27/46] input: touchscreen: mainstone: fix pxa2xx+pxa3xx configuration

Message ID 20191018154201.1276638-27-arnd@arndb.de
State Accepted
Commit bb628a6eb1a1b6539dc5a250a4b0b51c14ea7045
Headers show
Series None | expand

Commit Message

Arnd Bergmann Oct. 18, 2019, 3:41 p.m. UTC
There are two different ways of flushing the ac97 queue
in this driver, selected by a compile time option.

Change this to a runtime selection to make it work when both
are enabled.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/input/touchscreen/mainstone-wm97xx.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

-- 
2.20.0

Comments

Dmitry Torokhov Oct. 18, 2019, 6:40 p.m. UTC | #1
On Fri, Oct 18, 2019 at 05:41:42PM +0200, Arnd Bergmann wrote:
> There are two different ways of flushing the ac97 queue

> in this driver, selected by a compile time option.

> 

> Change this to a runtime selection to make it work when both

> are enabled.

> 

> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> Cc: linux-input@vger.kernel.org

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


-- 
Dmitry
Robert Jarzmik Oct. 28, 2019, 9:33 p.m. UTC | #2
Arnd Bergmann <arnd@arndb.de> writes:

> There are two different ways of flushing the ac97 queue

> in this driver, selected by a compile time option.

>

> Change this to a runtime selection to make it work when both

> are enabled.

>

> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> Cc: linux-input@vger.kernel.org

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>


Cheers.

--
Robert
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c
index 87655105ef3a..618c80847d9f 100644
--- a/drivers/input/touchscreen/mainstone-wm97xx.c
+++ b/drivers/input/touchscreen/mainstone-wm97xx.c
@@ -98,25 +98,20 @@  MODULE_PARM_DESC(ac97_touch_slot, "Touch screen data slot AC97 number");
 
 
 /* flush AC97 slot 5 FIFO on pxa machines */
-#ifdef CONFIG_PXA27x
-static void wm97xx_acc_pen_up(struct wm97xx *wm)
-{
-	schedule_timeout_uninterruptible(1);
-
-	while (MISR & (1 << 2))
-		MODR;
-}
-#else
 static void wm97xx_acc_pen_up(struct wm97xx *wm)
 {
 	unsigned int count;
 
 	schedule_timeout_uninterruptible(1);
 
-	for (count = 0; count < 16; count++)
-		MODR;
+	if (cpu_is_pxa27x()) {
+		while (MISR & (1 << 2))
+			MODR;
+	} else if (cpu_is_pxa3xx()) {
+		for (count = 0; count < 16; count++)
+			MODR;
+	}
 }
-#endif
 
 static int wm97xx_acc_pen_down(struct wm97xx *wm)
 {