Input: touchscreen: use wrapper for pxa2xx ac97 registers
To avoid a dependency on the pxa platform header files with hardcoded registers, change the driver to call a wrapper in the pxa2xx-ac97-lib that encapsulates all the other ac97 stuff. Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: linux-input@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Родитель
7b8a0b90b6
Коммит
e217b085a1
|
@ -902,6 +902,7 @@ config TOUCHSCREEN_WM9713
|
||||||
config TOUCHSCREEN_WM97XX_MAINSTONE
|
config TOUCHSCREEN_WM97XX_MAINSTONE
|
||||||
tristate "WM97xx Mainstone/Palm accelerated touch"
|
tristate "WM97xx Mainstone/Palm accelerated touch"
|
||||||
depends on TOUCHSCREEN_WM97XX && ARCH_PXA
|
depends on TOUCHSCREEN_WM97XX && ARCH_PXA
|
||||||
|
depends on SND_PXA2XX_LIB_AC97
|
||||||
help
|
help
|
||||||
Say Y here for support for streaming mode with WM97xx touchscreens
|
Say Y here for support for streaming mode with WM97xx touchscreens
|
||||||
on Mainstone, Palm Tungsten T5, TX and LifeDrive systems.
|
on Mainstone, Palm Tungsten T5, TX and LifeDrive systems.
|
||||||
|
@ -914,6 +915,7 @@ config TOUCHSCREEN_WM97XX_MAINSTONE
|
||||||
config TOUCHSCREEN_WM97XX_ZYLONITE
|
config TOUCHSCREEN_WM97XX_ZYLONITE
|
||||||
tristate "Zylonite accelerated touch"
|
tristate "Zylonite accelerated touch"
|
||||||
depends on TOUCHSCREEN_WM97XX && MACH_ZYLONITE
|
depends on TOUCHSCREEN_WM97XX && MACH_ZYLONITE
|
||||||
|
depends on SND_PXA2XX_LIB_AC97
|
||||||
select TOUCHSCREEN_WM9713
|
select TOUCHSCREEN_WM9713
|
||||||
help
|
help
|
||||||
Say Y here for support for streaming mode with the touchscreen
|
Say Y here for support for streaming mode with the touchscreen
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <linux/soc/pxa/cpu.h>
|
#include <linux/soc/pxa/cpu.h>
|
||||||
#include <linux/wm97xx.h>
|
#include <linux/wm97xx.h>
|
||||||
|
|
||||||
#include <mach/regs-ac97.h>
|
#include <sound/pxa2xx-lib.h>
|
||||||
|
|
||||||
#include <asm/mach-types.h>
|
#include <asm/mach-types.h>
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ static void wm97xx_acc_pen_up(struct wm97xx *wm)
|
||||||
msleep(1);
|
msleep(1);
|
||||||
|
|
||||||
if (cpu_is_pxa27x()) {
|
if (cpu_is_pxa27x()) {
|
||||||
while (MISR & (1 << 2))
|
while (pxa2xx_ac97_read_misr() & (1 << 2))
|
||||||
MODR;
|
pxa2xx_ac97_read_modr();
|
||||||
} else if (cpu_is_pxa3xx()) {
|
} else if (cpu_is_pxa3xx()) {
|
||||||
for (count = 0; count < 16; count++)
|
for (count = 0; count < 16; count++)
|
||||||
MODR;
|
pxa2xx_ac97_read_modr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)
|
||||||
return RC_PENUP;
|
return RC_PENUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = MODR;
|
x = pxa2xx_ac97_read_modr();
|
||||||
if (x == last) {
|
if (x == last) {
|
||||||
tries++;
|
tries++;
|
||||||
return RC_AGAIN;
|
return RC_AGAIN;
|
||||||
|
@ -138,10 +138,10 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)
|
||||||
last = x;
|
last = x;
|
||||||
do {
|
do {
|
||||||
if (reads)
|
if (reads)
|
||||||
x = MODR;
|
x = pxa2xx_ac97_read_modr();
|
||||||
y = MODR;
|
y = pxa2xx_ac97_read_modr();
|
||||||
if (pressure)
|
if (pressure)
|
||||||
p = MODR;
|
p = pxa2xx_ac97_read_modr();
|
||||||
|
|
||||||
dev_dbg(wm->dev, "Raw coordinates: x=%x, y=%x, p=%x\n",
|
dev_dbg(wm->dev, "Raw coordinates: x=%x, y=%x, p=%x\n",
|
||||||
x, y, p);
|
x, y, p);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <linux/soc/pxa/cpu.h>
|
#include <linux/soc/pxa/cpu.h>
|
||||||
#include <linux/wm97xx.h>
|
#include <linux/wm97xx.h>
|
||||||
|
|
||||||
#include <mach/regs-ac97.h>
|
#include <sound/pxa2xx-lib.h>
|
||||||
|
|
||||||
struct continuous {
|
struct continuous {
|
||||||
u16 id; /* codec id */
|
u16 id; /* codec id */
|
||||||
|
@ -79,7 +79,7 @@ static void wm97xx_acc_pen_up(struct wm97xx *wm)
|
||||||
msleep(1);
|
msleep(1);
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
MODR;
|
pxa2xx_ac97_read_modr();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wm97xx_acc_pen_down(struct wm97xx *wm)
|
static int wm97xx_acc_pen_down(struct wm97xx *wm)
|
||||||
|
@ -100,7 +100,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)
|
||||||
return RC_PENUP;
|
return RC_PENUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = MODR;
|
x = pxa2xx_ac97_read_modr();
|
||||||
if (x == last) {
|
if (x == last) {
|
||||||
tries++;
|
tries++;
|
||||||
return RC_AGAIN;
|
return RC_AGAIN;
|
||||||
|
@ -108,10 +108,10 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)
|
||||||
last = x;
|
last = x;
|
||||||
do {
|
do {
|
||||||
if (reads)
|
if (reads)
|
||||||
x = MODR;
|
x = pxa2xx_ac97_read_modr();
|
||||||
y = MODR;
|
y = pxa2xx_ac97_read_modr();
|
||||||
if (pressure)
|
if (pressure)
|
||||||
p = MODR;
|
p = pxa2xx_ac97_read_modr();
|
||||||
|
|
||||||
dev_dbg(wm->dev, "Raw coordinates: x=%x, y=%x, p=%x\n",
|
dev_dbg(wm->dev, "Raw coordinates: x=%x, y=%x, p=%x\n",
|
||||||
x, y, p);
|
x, y, p);
|
||||||
|
|
|
@ -52,4 +52,8 @@ extern int pxa2xx_ac97_hw_resume(void);
|
||||||
extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
|
extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
|
||||||
extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
|
extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
|
||||||
|
|
||||||
|
/* modem registers, used by touchscreen driver */
|
||||||
|
u32 pxa2xx_ac97_read_modr(void);
|
||||||
|
u32 pxa2xx_ac97_read_misr(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -428,6 +428,18 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_remove);
|
EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_remove);
|
||||||
|
|
||||||
|
u32 pxa2xx_ac97_read_modr(void)
|
||||||
|
{
|
||||||
|
return MODR;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(pxa2xx_ac97_read_modr);
|
||||||
|
|
||||||
|
u32 pxa2xx_ac97_read_misr(void)
|
||||||
|
{
|
||||||
|
return MISR;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(pxa2xx_ac97_read_misr);
|
||||||
|
|
||||||
MODULE_AUTHOR("Nicolas Pitre");
|
MODULE_AUTHOR("Nicolas Pitre");
|
||||||
MODULE_DESCRIPTION("Intel/Marvell PXA sound library");
|
MODULE_DESCRIPTION("Intel/Marvell PXA sound library");
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче