Lines Matching +full:edge +full:- +full:sensitive

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * wm9712.c -- Codec driver for Wolfson WM9712 AC97 Codecs.
31 * Pull up is in the range 1.02k (least sensitive) to 64k (most sensitive)
87 MODULE_PARM_DESC(five_wire, "Set to '1' to use 5-wire touchscreen.");
99 * 2 = Edge triggered, edge on pin delays conversion by delay param (above)
100 * 3 = Edge triggered, edge on pin starts conversion after delay param
160 dev_dbg(wm->dev, "setting pen detect pull-up to %d Ohms\n", in wm9712_phy_init()
167 dev_dbg(wm->dev, "setting 5-wire touchscreen mode.\n"); in wm9712_phy_init()
170 dev_warn(wm->dev, "pressure measurement is not " in wm9712_phy_init()
171 "supported in 5-wire mode\n"); in wm9712_phy_init()
179 dev_dbg(wm->dev, in wm9712_phy_init()
182 dev_dbg(wm->dev, in wm9712_phy_init()
189 dev_dbg(wm->dev, "supplied delay out of range.\n"); in wm9712_phy_init()
194 dev_dbg(wm->dev, "setting adc sample delay to %d u Secs.\n", in wm9712_phy_init()
208 /* wait - coord mode */ in wm9712_phy_init()
218 u16 dig2 = wm->dig[2]; in wm9712_dig_enable()
231 memcpy(wm->dig_save, wm->dig, sizeof(wm->dig)); in wm9712_aux_prepare()
238 wm97xx_reg_write(wm, AC97_WM97XX_DIGITISER1, wm->dig_save[1]); in wm9712_dig_restore()
239 wm97xx_reg_write(wm, AC97_WM97XX_DIGITISER2, wm->dig_save[2]); in wm9712_dig_restore()
244 return wm->dig[2] & WM9712_PDEN; in is_pden()
255 if (wants_pen && !wm->pen_probably_down) { in wm9712_poll_sample()
259 wm->pen_probably_down = 1; in wm9712_poll_sample()
263 if (wm->mach_ops && wm->mach_ops->pre_sample) in wm9712_poll_sample()
264 wm->mach_ops->pre_sample(adcsel); in wm9712_poll_sample()
275 timeout--; in wm9712_poll_sample()
281 wm->pen_probably_down = 0; in wm9712_poll_sample()
283 dev_dbg(wm->dev, "adc sample timeout\n"); in wm9712_poll_sample()
288 if (wm->mach_ops && wm->mach_ops->post_sample) in wm9712_poll_sample()
289 wm->mach_ops->post_sample(adcsel); in wm9712_poll_sample()
293 dev_dbg(wm->dev, "adc wrong sample, wanted %x got %x\n", in wm9712_poll_sample()
303 wm->pen_probably_down = 0; in wm9712_poll_sample()
318 if (!wm->pen_probably_down) { in wm9712_poll_coord()
322 wm->pen_probably_down = 1; in wm9712_poll_coord()
326 if (wm->mach_ops && wm->mach_ops->pre_sample) in wm9712_poll_coord()
327 wm->mach_ops->pre_sample(WM97XX_ADCSEL_X | WM97XX_ADCSEL_Y); in wm9712_poll_coord()
334 data->x = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD); in wm9712_poll_coord()
339 timeout--; in wm9712_poll_coord()
345 wm->pen_probably_down = 0; in wm9712_poll_coord()
347 dev_dbg(wm->dev, "adc sample timeout\n"); in wm9712_poll_coord()
352 data->y = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD); in wm9712_poll_coord()
354 data->p = wm97xx_reg_read(wm, AC97_WM97XX_DIGITISER_RD); in wm9712_poll_coord()
356 data->p = DEFAULT_PRESSURE; in wm9712_poll_coord()
358 if (wm->mach_ops && wm->mach_ops->post_sample) in wm9712_poll_coord()
359 wm->mach_ops->post_sample(WM97XX_ADCSEL_X | WM97XX_ADCSEL_Y); in wm9712_poll_coord()
362 if (!(data->x & WM97XX_ADCSEL_X) || !(data->y & WM97XX_ADCSEL_Y)) in wm9712_poll_coord()
364 if (pil && !(data->p & WM97XX_ADCSEL_PRES)) in wm9712_poll_coord()
367 if (!(data->x & WM97XX_PEN_DOWN) || !(data->y & WM97XX_PEN_DOWN)) { in wm9712_poll_coord()
368 wm->pen_probably_down = 0; in wm9712_poll_coord()
389 &data->x); in wm9712_poll_touch()
394 &data->y); in wm9712_poll_touch()
400 &data->p); in wm9712_poll_touch()
404 data->p = DEFAULT_PRESSURE; in wm9712_poll_touch()
418 dig1 = wm->dig[1]; in wm9712_acc_enable()
419 dig2 = wm->dig[2]; in wm9712_acc_enable()
423 if (wm->mach_ops->acc_startup) { in wm9712_acc_enable()
424 ret = wm->mach_ops->acc_startup(wm); in wm9712_acc_enable()
432 WM97XX_SLT(wm->acc_slot) | in wm9712_acc_enable()
433 WM97XX_RATE(wm->acc_rate); in wm9712_acc_enable()
440 if (wm->mach_ops->acc_shutdown) in wm9712_acc_enable()
441 wm->mach_ops->acc_shutdown(wm); in wm9712_acc_enable()