Lines Matching refs:ts

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