Lines Matching refs:ts
76 static struct s3c2410ts ts; variable
98 data0 = readl(ts.io + S3C2410_ADCDAT0); in touch_timer_fire()
99 data1 = readl(ts.io + S3C2410_ADCDAT1); in touch_timer_fire()
104 if (ts.count == (1 << ts.shift)) { in touch_timer_fire()
105 ts.xp >>= ts.shift; in touch_timer_fire()
106 ts.yp >>= ts.shift; in touch_timer_fire()
108 dev_dbg(ts.dev, "%s: X=%lu, Y=%lu, count=%d\n", in touch_timer_fire()
109 __func__, ts.xp, ts.yp, ts.count); in touch_timer_fire()
111 input_report_abs(ts.input, ABS_X, ts.xp); in touch_timer_fire()
112 input_report_abs(ts.input, ABS_Y, ts.yp); in touch_timer_fire()
114 input_report_key(ts.input, BTN_TOUCH, 1); in touch_timer_fire()
115 input_sync(ts.input); in touch_timer_fire()
117 ts.xp = 0; in touch_timer_fire()
118 ts.yp = 0; in touch_timer_fire()
119 ts.count = 0; in touch_timer_fire()
122 s3c_adc_start(ts.client, 0, 1 << ts.shift); in touch_timer_fire()
124 ts.xp = 0; in touch_timer_fire()
125 ts.yp = 0; in touch_timer_fire()
126 ts.count = 0; in touch_timer_fire()
128 input_report_key(ts.input, BTN_TOUCH, 0); in touch_timer_fire()
129 input_sync(ts.input); in touch_timer_fire()
131 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); in touch_timer_fire()
150 data0 = readl(ts.io + S3C2410_ADCDAT0); in stylus_irq()
151 data1 = readl(ts.io + S3C2410_ADCDAT1); in stylus_irq()
160 s3c_adc_start(ts.client, 0, 1 << ts.shift); in stylus_irq()
162 dev_dbg(ts.dev, "%s: count=%d\n", __func__, ts.count); in stylus_irq()
164 if (ts.features & FEAT_PEN_IRQ) { in stylus_irq()
166 writel(0x0, ts.io + S3C64XX_ADCCLRINTPNDNUP); in stylus_irq()
185 dev_dbg(ts.dev, "%s: %d,%d\n", __func__, data0, data1); in s3c24xx_ts_conversion()
187 ts.xp += data0; in s3c24xx_ts_conversion()
188 ts.yp += data1; in s3c24xx_ts_conversion()
190 ts.count++; in s3c24xx_ts_conversion()
213 ts.io + S3C2410_ADCTSC); in s3c24xx_ts_select()
216 writel(WAIT4INT | INT_UP, ts.io + S3C2410_ADCTSC); in s3c24xx_ts_select()
236 memset(&ts, 0, sizeof(struct s3c2410ts)); in s3c2410ts_probe()
238 ts.dev = dev; in s3c2410ts_probe()
248 ts.clock = clk_get(dev, "adc"); in s3c2410ts_probe()
249 if (IS_ERR(ts.clock)) { in s3c2410ts_probe()
254 ret = clk_prepare_enable(ts.clock); in s3c2410ts_probe()
261 ts.irq_tc = ret = platform_get_irq(pdev, 0); in s3c2410ts_probe()
274 ts.io = ioremap(res->start, resource_size(res)); in s3c2410ts_probe()
275 if (ts.io == NULL) { in s3c2410ts_probe()
283 info->cfg_gpio(to_platform_device(ts.dev)); in s3c2410ts_probe()
285 ts.client = s3c_adc_register(pdev, s3c24xx_ts_select, in s3c2410ts_probe()
287 if (IS_ERR(ts.client)) { in s3c2410ts_probe()
289 ret = PTR_ERR(ts.client); in s3c2410ts_probe()
295 writel(info->delay & 0xffff, ts.io + S3C2410_ADCDLY); in s3c2410ts_probe()
297 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); in s3c2410ts_probe()
306 ts.input = input_dev; in s3c2410ts_probe()
307 ts.input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); in s3c2410ts_probe()
308 ts.input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); in s3c2410ts_probe()
309 input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0); in s3c2410ts_probe()
310 input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0); in s3c2410ts_probe()
312 ts.input->name = "S3C24XX TouchScreen"; in s3c2410ts_probe()
313 ts.input->id.bustype = BUS_HOST; in s3c2410ts_probe()
314 ts.input->id.vendor = 0xDEAD; in s3c2410ts_probe()
315 ts.input->id.product = 0xBEEF; in s3c2410ts_probe()
316 ts.input->id.version = 0x0102; in s3c2410ts_probe()
318 ts.shift = info->oversampling_shift; in s3c2410ts_probe()
319 ts.features = platform_get_device_id(pdev)->driver_data; in s3c2410ts_probe()
321 ret = request_irq(ts.irq_tc, stylus_irq, 0, in s3c2410ts_probe()
322 "s3c2410_ts_pen", ts.input); in s3c2410ts_probe()
331 ret = input_register_device(ts.input); in s3c2410ts_probe()
341 free_irq(ts.irq_tc, ts.input); in s3c2410ts_probe()
343 input_free_device(ts.input); in s3c2410ts_probe()
345 iounmap(ts.io); in s3c2410ts_probe()
347 clk_disable_unprepare(ts.clock); in s3c2410ts_probe()
350 clk_put(ts.clock); in s3c2410ts_probe()
362 free_irq(ts.irq_tc, ts.input); in s3c2410ts_remove()
365 clk_disable_unprepare(ts.clock); in s3c2410ts_remove()
366 clk_put(ts.clock); in s3c2410ts_remove()
368 input_unregister_device(ts.input); in s3c2410ts_remove()
369 iounmap(ts.io); in s3c2410ts_remove()
377 writel(TSC_SLEEP, ts.io + S3C2410_ADCTSC); in s3c2410ts_suspend()
378 disable_irq(ts.irq_tc); in s3c2410ts_suspend()
379 clk_disable(ts.clock); in s3c2410ts_suspend()
389 clk_enable(ts.clock); in s3c2410ts_resume()
390 enable_irq(ts.irq_tc); in s3c2410ts_resume()
394 writel(info->delay & 0xffff, ts.io + S3C2410_ADCDLY); in s3c2410ts_resume()
396 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); in s3c2410ts_resume()