25 #include <linux/module.h>
27 #include <linux/kernel.h>
36 #include <mach/regs-ac97.h>
47 #define WM_READS(sp) ((sp / HZ) + 1)
66 static u16 last, tries;
72 static int cont_rate = 200;
84 MODULE_PARM_DESC(pen_int,
"Pen down detection (1 = interrupt, 0 = polling)");
93 MODULE_PARM_DESC(pressure,
"Pressure readback (1 = pressure, 0 = no pressure)");
100 static int ac97_touch_slot = 5;
107 static void wm97xx_acc_pen_up(
struct wm97xx *wm)
111 while (
MISR & (1 << 2))
115 static void wm97xx_acc_pen_up(
struct wm97xx *wm)
121 for (count = 0; count < 16; count++)
126 static int wm97xx_acc_pen_down(
struct wm97xx *wm)
156 dev_dbg(wm->
dev,
"Raw coordinates: x=%x, y=%x, p=%x\n",
173 }
while (reads < cinfo[sp_idx].reads);
178 static int wm97xx_acc_startup(
struct wm97xx *wm)
187 for (idx = 0; idx <
ARRAY_SIZE(cinfo); idx++) {
188 if (wm->
id != cinfo[idx].
id)
191 if (cont_rate <= cinfo[idx].
speed)
197 "mainstone accelerated touchscreen driver, %d samples/sec\n",
198 cinfo[sp_idx].
speed);
201 if (machine_is_palmt5() || machine_is_palmtx() || machine_is_palmld()) {
207 }
else if (machine_is_mainstone() && pen_int)
245 "pen down irq not supported on this device\n");
255 static void wm97xx_acc_shutdown(
struct wm97xx *wm)
265 static void wm97xx_irq_enable(
struct wm97xx *wm,
int enable)
275 .acc_pen_up = wm97xx_acc_pen_up,
276 .acc_pen_down = wm97xx_acc_pen_down,
277 .acc_startup = wm97xx_acc_startup,
278 .acc_shutdown = wm97xx_acc_shutdown,
279 .irq_enable = wm97xx_irq_enable,
285 struct wm97xx *wm = platform_get_drvdata(pdev);
292 struct wm97xx *wm = platform_get_drvdata(pdev);
299 .probe = mainstone_wm97xx_probe,
300 .remove = mainstone_wm97xx_remove,
302 .name =
"wm97xx-touch",