Lines Matching +full:pen +full:- +full:up
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * mainstone-wm97xx.c -- Mainstone Continuous Touch screen driver for
16 * - codecs supported:- WM9705, WM9712, WM9713
17 * - processors supported:- Intel XScale PXA25x, PXA26x, PXA27x
31 #include <sound/pxa2xx-lib.h>
33 #include <asm/mach-types.h>
64 * Pen sampling frequency (Hz) in continuous mode.
71 * Pen down detection.
73 * This driver can either poll or use an interrupt to indicate a pen down
78 MODULE_PARM_DESC(pen_int, "Pen down detection (1 = interrupt, 0 = polling)");
83 * Set to 1 to read back pen down pressure
122 * to buffer up samples otherwise we end up spinning polling in wm97xx_acc_pen_down()
146 dev_dbg(wm->dev, "Raw coordinates: x=%x, y=%x, p=%x\n", in wm97xx_acc_pen_down()
153 goto up; in wm97xx_acc_pen_down()
157 input_report_abs(wm->input_dev, ABS_X, x & 0xfff); in wm97xx_acc_pen_down()
158 input_report_abs(wm->input_dev, ABS_Y, y & 0xfff); in wm97xx_acc_pen_down()
159 input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff); in wm97xx_acc_pen_down()
160 input_report_key(wm->input_dev, BTN_TOUCH, (p != 0)); in wm97xx_acc_pen_down()
161 input_sync(wm->input_dev); in wm97xx_acc_pen_down()
164 up: in wm97xx_acc_pen_down()
173 if (wm->ac97 == NULL) in wm97xx_acc_startup()
174 return -ENODEV; in wm97xx_acc_startup()
178 if (wm->id != cinfo[idx].id) in wm97xx_acc_startup()
184 wm->acc_rate = cinfo[sp_idx].code; in wm97xx_acc_startup()
185 wm->acc_slot = ac97_touch_slot; in wm97xx_acc_startup()
186 dev_info(wm->dev, in wm97xx_acc_startup()
191 gpiod_irq = gpiod_get(wm->dev, "touch", GPIOD_IN); in wm97xx_acc_startup()
197 wm->pen_irq = gpiod_to_irq(gpiod_irq); in wm97xx_acc_startup()
198 irq_set_irq_type(wm->pen_irq, IRQ_TYPE_EDGE_BOTH); in wm97xx_acc_startup()
203 switch (wm->id) { in wm97xx_acc_startup()
219 dev_err(wm->dev, in wm97xx_acc_startup()
220 "pen down irq not supported on this device\n"); in wm97xx_acc_startup()
235 wm->pen_irq = 0; in wm97xx_acc_shutdown()
266 .name = "wm97xx-touch",