Lines Matching refs:ts

108 static struct s3c2410ts ts;  variable
130 data0 = readl(ts.io + S3C2410_ADCDAT0); in touch_timer_fire()
131 data1 = readl(ts.io + S3C2410_ADCDAT1); in touch_timer_fire()
136 if (ts.count == (1 << ts.shift)) { in touch_timer_fire()
137 ts.xp >>= ts.shift; in touch_timer_fire()
138 ts.yp >>= ts.shift; in touch_timer_fire()
140 dev_dbg(ts.dev, "%s: X=%lu, Y=%lu, count=%d\n", in touch_timer_fire()
141 __func__, ts.xp, ts.yp, ts.count); in touch_timer_fire()
143 input_report_abs(ts.input, ABS_X, ts.xp); in touch_timer_fire()
144 input_report_abs(ts.input, ABS_Y, ts.yp); in touch_timer_fire()
146 input_report_key(ts.input, BTN_TOUCH, 1); in touch_timer_fire()
147 input_sync(ts.input); in touch_timer_fire()
149 ts.xp = 0; in touch_timer_fire()
150 ts.yp = 0; in touch_timer_fire()
151 ts.count = 0; in touch_timer_fire()
154 s3c_adc_start(ts.client, 0, 1 << ts.shift); in touch_timer_fire()
156 ts.xp = 0; in touch_timer_fire()
157 ts.yp = 0; in touch_timer_fire()
158 ts.count = 0; in touch_timer_fire()
160 input_report_key(ts.input, BTN_TOUCH, 0); in touch_timer_fire()
161 input_sync(ts.input); in touch_timer_fire()
163 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); in touch_timer_fire()
182 data0 = readl(ts.io + S3C2410_ADCDAT0); in stylus_irq()
183 data1 = readl(ts.io + S3C2410_ADCDAT1); in stylus_irq()
192 s3c_adc_start(ts.client, 0, 1 << ts.shift); in stylus_irq()
194 dev_dbg(ts.dev, "%s: count=%d\n", __func__, ts.count); in stylus_irq()
196 if (ts.features & FEAT_PEN_IRQ) { in stylus_irq()
198 writel(0x0, ts.io + S3C64XX_ADCCLRINTPNDNUP); in stylus_irq()
217 dev_dbg(ts.dev, "%s: %d,%d\n", __func__, data0, data1); in s3c24xx_ts_conversion()
219 ts.xp += data0; in s3c24xx_ts_conversion()
220 ts.yp += data1; in s3c24xx_ts_conversion()
222 ts.count++; in s3c24xx_ts_conversion()
245 ts.io + S3C2410_ADCTSC); in s3c24xx_ts_select()
248 writel(WAIT4INT | INT_UP, ts.io + S3C2410_ADCTSC); in s3c24xx_ts_select()
268 memset(&ts, 0, sizeof(struct s3c2410ts)); in s3c2410ts_probe()
270 ts.dev = dev; in s3c2410ts_probe()
280 ts.clock = clk_get(dev, "adc"); in s3c2410ts_probe()
281 if (IS_ERR(ts.clock)) { in s3c2410ts_probe()
286 ret = clk_prepare_enable(ts.clock); in s3c2410ts_probe()
293 ts.irq_tc = ret = platform_get_irq(pdev, 0); in s3c2410ts_probe()
306 ts.io = ioremap(res->start, resource_size(res)); in s3c2410ts_probe()
307 if (ts.io == NULL) { in s3c2410ts_probe()
315 info->cfg_gpio(to_platform_device(ts.dev)); in s3c2410ts_probe()
317 ts.client = s3c_adc_register(pdev, s3c24xx_ts_select, in s3c2410ts_probe()
319 if (IS_ERR(ts.client)) { in s3c2410ts_probe()
321 ret = PTR_ERR(ts.client); in s3c2410ts_probe()
327 writel(info->delay & 0xffff, ts.io + S3C2410_ADCDLY); in s3c2410ts_probe()
329 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); in s3c2410ts_probe()
338 ts.input = input_dev; in s3c2410ts_probe()
339 ts.input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); in s3c2410ts_probe()
340 ts.input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); in s3c2410ts_probe()
341 input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0); in s3c2410ts_probe()
342 input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0); in s3c2410ts_probe()
344 ts.input->name = "S3C24XX TouchScreen"; in s3c2410ts_probe()
345 ts.input->id.bustype = BUS_HOST; in s3c2410ts_probe()
346 ts.input->id.vendor = 0xDEAD; in s3c2410ts_probe()
347 ts.input->id.product = 0xBEEF; in s3c2410ts_probe()
348 ts.input->id.version = 0x0102; in s3c2410ts_probe()
350 ts.shift = info->oversampling_shift; in s3c2410ts_probe()
351 ts.features = platform_get_device_id(pdev)->driver_data; in s3c2410ts_probe()
353 ret = request_irq(ts.irq_tc, stylus_irq, 0, in s3c2410ts_probe()
354 "s3c2410_ts_pen", ts.input); in s3c2410ts_probe()
363 ret = input_register_device(ts.input); in s3c2410ts_probe()
373 free_irq(ts.irq_tc, ts.input); in s3c2410ts_probe()
375 input_free_device(ts.input); in s3c2410ts_probe()
377 iounmap(ts.io); in s3c2410ts_probe()
379 clk_disable_unprepare(ts.clock); in s3c2410ts_probe()
382 clk_put(ts.clock); in s3c2410ts_probe()
394 free_irq(ts.irq_tc, ts.input); in s3c2410ts_remove()
397 clk_disable_unprepare(ts.clock); in s3c2410ts_remove()
398 clk_put(ts.clock); in s3c2410ts_remove()
400 input_unregister_device(ts.input); in s3c2410ts_remove()
401 iounmap(ts.io); in s3c2410ts_remove()
409 writel(TSC_SLEEP, ts.io + S3C2410_ADCTSC); in s3c2410ts_suspend()
410 disable_irq(ts.irq_tc); in s3c2410ts_suspend()
411 clk_disable(ts.clock); in s3c2410ts_suspend()
421 clk_enable(ts.clock); in s3c2410ts_resume()
422 enable_irq(ts.irq_tc); in s3c2410ts_resume()
426 writel(info->delay & 0xffff, ts.io + S3C2410_ADCDLY); in s3c2410ts_resume()
428 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); in s3c2410ts_resume()