aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPatil, Rachna <rachna@ti.com>2012-10-16 03:25:42 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-05 17:50:27 -0500
commit55c04de5176ea3eac6fdc469a6a063c5cb91ed7c (patch)
tree62cf144d9429ba60ef02f102b69ffc12ab7801b3 /drivers
parentc6e86db2bec56e05c7ad1524ed2273a4cc8e8868 (diff)
input: TSC: ti_tscadc: Rename the existing touchscreen driver
Make way for addition of MFD driver. The existing touchsreen driver is a MFD client. For better readability we rename the file to indicate its functionality as only touchscreen. Signed-off-by: Patil, Rachna <rachna@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/Kconfig4
-rw-r--r--drivers/input/touchscreen/Makefile2
-rw-r--r--drivers/input/touchscreen/ti_am335x_tsc.c (renamed from drivers/input/touchscreen/ti_tscadc.c)96
3 files changed, 51 insertions, 51 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index f7668b24c378..d31dc5faeaaf 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -529,7 +529,7 @@ config TOUCHSCREEN_TOUCHWIN
529 To compile this driver as a module, choose M here: the 529 To compile this driver as a module, choose M here: the
530 module will be called touchwin. 530 module will be called touchwin.
531 531
532config TOUCHSCREEN_TI_TSCADC 532config TOUCHSCREEN_TI_AM335X_TSC
533 tristate "TI Touchscreen Interface" 533 tristate "TI Touchscreen Interface"
534 depends on ARCH_OMAP2PLUS 534 depends on ARCH_OMAP2PLUS
535 help 535 help
@@ -539,7 +539,7 @@ config TOUCHSCREEN_TI_TSCADC
539 If unsure, say N. 539 If unsure, say N.
540 540
541 To compile this driver as a module, choose M here: the 541 To compile this driver as a module, choose M here: the
542 module will be called ti_tscadc. 542 module will be called ti_am335x_tsc.
543 543
544config TOUCHSCREEN_ATMEL_TSADCC 544config TOUCHSCREEN_ATMEL_TSADCC
545 tristate "Atmel Touchscreen Interface" 545 tristate "Atmel Touchscreen Interface"
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 178eb128d90f..7c4c78ebe49e 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -52,7 +52,7 @@ obj-$(CONFIG_TOUCHSCREEN_PIXCIR) += pixcir_i2c_ts.o
52obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o 52obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o
53obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o 53obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o
54obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o 54obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o
55obj-$(CONFIG_TOUCHSCREEN_TI_TSCADC) += ti_tscadc.o 55obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o
56obj-$(CONFIG_TOUCHSCREEN_TNETV107X) += tnetv107x-ts.o 56obj-$(CONFIG_TOUCHSCREEN_TNETV107X) += tnetv107x-ts.o
57obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o 57obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o
58obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o 58obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index ec0a442478a8..462950acb97b 100644
--- a/drivers/input/touchscreen/ti_tscadc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -24,7 +24,7 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/input/ti_tscadc.h> 27#include <linux/input/ti_am335x_tsc.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29 29
30#define REG_RAWIRQSTATUS 0x024 30#define REG_RAWIRQSTATUS 0x024
@@ -123,7 +123,7 @@
123#define ADC_CLK 3000000 123#define ADC_CLK 3000000
124#define MAX_12BIT ((1 << 12) - 1) 124#define MAX_12BIT ((1 << 12) - 1)
125 125
126struct tscadc { 126struct titsc {
127 struct input_dev *input; 127 struct input_dev *input;
128 struct clk *tsc_ick; 128 struct clk *tsc_ick;
129 void __iomem *tsc_base; 129 void __iomem *tsc_base;
@@ -134,18 +134,18 @@ struct tscadc {
134 int steps_to_configure; 134 int steps_to_configure;
135}; 135};
136 136
137static unsigned int tscadc_readl(struct tscadc *ts, unsigned int reg) 137static unsigned int titsc_readl(struct titsc *ts, unsigned int reg)
138{ 138{
139 return readl(ts->tsc_base + reg); 139 return readl(ts->tsc_base + reg);
140} 140}
141 141
142static void tscadc_writel(struct tscadc *tsc, unsigned int reg, 142static void titsc_writel(struct titsc *tsc, unsigned int reg,
143 unsigned int val) 143 unsigned int val)
144{ 144{
145 writel(val, tsc->tsc_base + reg); 145 writel(val, tsc->tsc_base + reg);
146} 146}
147 147
148static void tscadc_step_config(struct tscadc *ts_dev) 148static void titsc_step_config(struct titsc *ts_dev)
149{ 149{
150 unsigned int config; 150 unsigned int config;
151 int i, total_steps; 151 int i, total_steps;
@@ -170,8 +170,8 @@ static void tscadc_step_config(struct tscadc *ts_dev)
170 } 170 }
171 171
172 for (i = 1; i <= ts_dev->steps_to_configure; i++) { 172 for (i = 1; i <= ts_dev->steps_to_configure; i++) {
173 tscadc_writel(ts_dev, REG_STEPCONFIG(i), config); 173 titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
174 tscadc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY); 174 titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
175 } 175 }
176 176
177 config = 0; 177 config = 0;
@@ -192,8 +192,8 @@ static void tscadc_step_config(struct tscadc *ts_dev)
192 } 192 }
193 193
194 for (i = (ts_dev->steps_to_configure + 1); i <= total_steps; i++) { 194 for (i = (ts_dev->steps_to_configure + 1); i <= total_steps; i++) {
195 tscadc_writel(ts_dev, REG_STEPCONFIG(i), config); 195 titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
196 tscadc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY); 196 titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
197 } 197 }
198 198
199 config = 0; 199 config = 0;
@@ -202,40 +202,40 @@ static void tscadc_step_config(struct tscadc *ts_dev)
202 STEPCHARGE_RFP_XPUL | STEPCHARGE_RFM_XNUR | 202 STEPCHARGE_RFP_XPUL | STEPCHARGE_RFM_XNUR |
203 STEPCHARGE_INM_AN1 | STEPCHARGE_INP_AN1; 203 STEPCHARGE_INM_AN1 | STEPCHARGE_INP_AN1;
204 204
205 tscadc_writel(ts_dev, REG_CHARGECONFIG, config); 205 titsc_writel(ts_dev, REG_CHARGECONFIG, config);
206 tscadc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY); 206 titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY);
207 207
208 config = 0; 208 config = 0;
209 /* Configure to calculate pressure */ 209 /* Configure to calculate pressure */
210 config = STEPCONFIG_MODE_HWSYNC | 210 config = STEPCONFIG_MODE_HWSYNC |
211 STEPCONFIG_AVG_16 | STEPCONFIG_YPP | 211 STEPCONFIG_AVG_16 | STEPCONFIG_YPP |
212 STEPCONFIG_XNN | STEPCONFIG_INM_ADCREFM; 212 STEPCONFIG_XNN | STEPCONFIG_INM_ADCREFM;
213 tscadc_writel(ts_dev, REG_STEPCONFIG(total_steps + 1), config); 213 titsc_writel(ts_dev, REG_STEPCONFIG(total_steps + 1), config);
214 tscadc_writel(ts_dev, REG_STEPDELAY(total_steps + 1), 214 titsc_writel(ts_dev, REG_STEPDELAY(total_steps + 1),
215 STEPCONFIG_OPENDLY); 215 STEPCONFIG_OPENDLY);
216 216
217 config |= STEPCONFIG_INP_AN3 | STEPCONFIG_FIFO1; 217 config |= STEPCONFIG_INP_AN3 | STEPCONFIG_FIFO1;
218 tscadc_writel(ts_dev, REG_STEPCONFIG(total_steps + 2), config); 218 titsc_writel(ts_dev, REG_STEPCONFIG(total_steps + 2), config);
219 tscadc_writel(ts_dev, REG_STEPDELAY(total_steps + 2), 219 titsc_writel(ts_dev, REG_STEPDELAY(total_steps + 2),
220 STEPCONFIG_OPENDLY); 220 STEPCONFIG_OPENDLY);
221 221
222 tscadc_writel(ts_dev, REG_SE, STPENB_STEPENB); 222 titsc_writel(ts_dev, REG_SE, STPENB_STEPENB);
223} 223}
224 224
225static void tscadc_idle_config(struct tscadc *ts_config) 225static void titsc_idle_config(struct titsc *ts_config)
226{ 226{
227 unsigned int idleconfig; 227 unsigned int idleconfig;
228 228
229 idleconfig = STEPCONFIG_YNN | 229 idleconfig = STEPCONFIG_YNN |
230 STEPCONFIG_INM_ADCREFM | 230 STEPCONFIG_INM_ADCREFM |
231 STEPCONFIG_YPN | STEPCONFIG_INP_ADCREFM; 231 STEPCONFIG_YPN | STEPCONFIG_INP_ADCREFM;
232 tscadc_writel(ts_config, REG_IDLECONFIG, idleconfig); 232 titsc_writel(ts_config, REG_IDLECONFIG, idleconfig);
233} 233}
234 234
235static void tscadc_read_coordinates(struct tscadc *ts_dev, 235static void titsc_read_coordinates(struct titsc *ts_dev,
236 unsigned int *x, unsigned int *y) 236 unsigned int *x, unsigned int *y)
237{ 237{
238 unsigned int fifocount = tscadc_readl(ts_dev, REG_FIFO0CNT); 238 unsigned int fifocount = titsc_readl(ts_dev, REG_FIFO0CNT);
239 unsigned int prev_val_x = ~0, prev_val_y = ~0; 239 unsigned int prev_val_x = ~0, prev_val_y = ~0;
240 unsigned int prev_diff_x = ~0, prev_diff_y = ~0; 240 unsigned int prev_diff_x = ~0, prev_diff_y = ~0;
241 unsigned int read, diff; 241 unsigned int read, diff;
@@ -250,7 +250,7 @@ static void tscadc_read_coordinates(struct tscadc *ts_dev,
250 * if true the value is reported to the sub system. 250 * if true the value is reported to the sub system.
251 */ 251 */
252 for (i = 0; i < fifocount - 1; i++) { 252 for (i = 0; i < fifocount - 1; i++) {
253 read = tscadc_readl(ts_dev, REG_FIFO0) & 0xfff; 253 read = titsc_readl(ts_dev, REG_FIFO0) & 0xfff;
254 diff = abs(read - prev_val_x); 254 diff = abs(read - prev_val_x);
255 if (diff < prev_diff_x) { 255 if (diff < prev_diff_x) {
256 prev_diff_x = diff; 256 prev_diff_x = diff;
@@ -258,7 +258,7 @@ static void tscadc_read_coordinates(struct tscadc *ts_dev,
258 } 258 }
259 prev_val_x = read; 259 prev_val_x = read;
260 260
261 read = tscadc_readl(ts_dev, REG_FIFO1) & 0xfff; 261 read = titsc_readl(ts_dev, REG_FIFO1) & 0xfff;
262 diff = abs(read - prev_val_y); 262 diff = abs(read - prev_val_y);
263 if (diff < prev_diff_y) { 263 if (diff < prev_diff_y) {
264 prev_diff_y = diff; 264 prev_diff_y = diff;
@@ -268,21 +268,21 @@ static void tscadc_read_coordinates(struct tscadc *ts_dev,
268 } 268 }
269} 269}
270 270
271static irqreturn_t tscadc_irq(int irq, void *dev) 271static irqreturn_t titsc_irq(int irq, void *dev)
272{ 272{
273 struct tscadc *ts_dev = dev; 273 struct titsc *ts_dev = dev;
274 struct input_dev *input_dev = ts_dev->input; 274 struct input_dev *input_dev = ts_dev->input;
275 unsigned int status, irqclr = 0; 275 unsigned int status, irqclr = 0;
276 unsigned int x = 0, y = 0; 276 unsigned int x = 0, y = 0;
277 unsigned int z1, z2, z; 277 unsigned int z1, z2, z;
278 unsigned int fsm; 278 unsigned int fsm;
279 279
280 status = tscadc_readl(ts_dev, REG_IRQSTATUS); 280 status = titsc_readl(ts_dev, REG_IRQSTATUS);
281 if (status & IRQENB_FIFO0THRES) { 281 if (status & IRQENB_FIFO0THRES) {
282 tscadc_read_coordinates(ts_dev, &x, &y); 282 titsc_read_coordinates(ts_dev, &x, &y);
283 283
284 z1 = tscadc_readl(ts_dev, REG_FIFO0) & 0xfff; 284 z1 = titsc_readl(ts_dev, REG_FIFO0) & 0xfff;
285 z2 = tscadc_readl(ts_dev, REG_FIFO1) & 0xfff; 285 z2 = titsc_readl(ts_dev, REG_FIFO1) & 0xfff;
286 286
287 if (ts_dev->pen_down && z1 != 0 && z2 != 0) { 287 if (ts_dev->pen_down && z1 != 0 && z2 != 0) {
288 /* 288 /*
@@ -313,10 +313,10 @@ static irqreturn_t tscadc_irq(int irq, void *dev)
313 */ 313 */
314 udelay(SEQ_SETTLE); 314 udelay(SEQ_SETTLE);
315 315
316 status = tscadc_readl(ts_dev, REG_RAWIRQSTATUS); 316 status = titsc_readl(ts_dev, REG_RAWIRQSTATUS);
317 if (status & IRQENB_PENUP) { 317 if (status & IRQENB_PENUP) {
318 /* Pen up event */ 318 /* Pen up event */
319 fsm = tscadc_readl(ts_dev, REG_ADCFSM); 319 fsm = titsc_readl(ts_dev, REG_ADCFSM);
320 if (fsm == ADCFSM_STEPID) { 320 if (fsm == ADCFSM_STEPID) {
321 ts_dev->pen_down = false; 321 ts_dev->pen_down = false;
322 input_report_key(input_dev, BTN_TOUCH, 0); 322 input_report_key(input_dev, BTN_TOUCH, 0);
@@ -328,9 +328,9 @@ static irqreturn_t tscadc_irq(int irq, void *dev)
328 irqclr |= IRQENB_PENUP; 328 irqclr |= IRQENB_PENUP;
329 } 329 }
330 330
331 tscadc_writel(ts_dev, REG_IRQSTATUS, irqclr); 331 titsc_writel(ts_dev, REG_IRQSTATUS, irqclr);
332 332
333 tscadc_writel(ts_dev, REG_SE, STPENB_STEPENB); 333 titsc_writel(ts_dev, REG_SE, STPENB_STEPENB);
334 return IRQ_HANDLED; 334 return IRQ_HANDLED;
335} 335}
336 336
@@ -338,11 +338,11 @@ static irqreturn_t tscadc_irq(int irq, void *dev)
338 * The functions for inserting/removing driver as a module. 338 * The functions for inserting/removing driver as a module.
339 */ 339 */
340 340
341static int __devinit tscadc_probe(struct platform_device *pdev) 341static int __devinit titsc_probe(struct platform_device *pdev)
342{ 342{
343 const struct tsc_data *pdata = pdev->dev.platform_data; 343 const struct tsc_data *pdata = pdev->dev.platform_data;
344 struct resource *res; 344 struct resource *res;
345 struct tscadc *ts_dev; 345 struct titsc *ts_dev;
346 struct input_dev *input_dev; 346 struct input_dev *input_dev;
347 struct clk *clk; 347 struct clk *clk;
348 int err; 348 int err;
@@ -366,7 +366,7 @@ static int __devinit tscadc_probe(struct platform_device *pdev)
366 } 366 }
367 367
368 /* Allocate memory for device */ 368 /* Allocate memory for device */
369 ts_dev = kzalloc(sizeof(struct tscadc), GFP_KERNEL); 369 ts_dev = kzalloc(sizeof(struct titsc), GFP_KERNEL);
370 input_dev = input_allocate_device(); 370 input_dev = input_allocate_device();
371 if (!ts_dev || !input_dev) { 371 if (!ts_dev || !input_dev) {
372 dev_err(&pdev->dev, "failed to allocate memory.\n"); 372 dev_err(&pdev->dev, "failed to allocate memory.\n");
@@ -394,7 +394,7 @@ static int __devinit tscadc_probe(struct platform_device *pdev)
394 goto err_release_mem_region; 394 goto err_release_mem_region;
395 } 395 }
396 396
397 err = request_irq(ts_dev->irq, tscadc_irq, 397 err = request_irq(ts_dev->irq, titsc_irq,
398 0, pdev->dev.driver->name, ts_dev); 398 0, pdev->dev.driver->name, ts_dev);
399 if (err) { 399 if (err) {
400 dev_err(&pdev->dev, "failed to allocate irq.\n"); 400 dev_err(&pdev->dev, "failed to allocate irq.\n");
@@ -423,10 +423,10 @@ static int __devinit tscadc_probe(struct platform_device *pdev)
423 goto err_disable_clk; 423 goto err_disable_clk;
424 } 424 }
425 /* CLKDIV needs to be configured to the value minus 1 */ 425 /* CLKDIV needs to be configured to the value minus 1 */
426 tscadc_writel(ts_dev, REG_CLKDIV, clk_value - 1); 426 titsc_writel(ts_dev, REG_CLKDIV, clk_value - 1);
427 427
428 /* Enable wake-up of the SoC using touchscreen */ 428 /* Enable wake-up of the SoC using touchscreen */
429 tscadc_writel(ts_dev, REG_IRQWAKEUP, IRQWKUP_ENB); 429 titsc_writel(ts_dev, REG_IRQWAKEUP, IRQWKUP_ENB);
430 430
431 ctrl = CNTRLREG_STEPCONFIGWRT | 431 ctrl = CNTRLREG_STEPCONFIGWRT |
432 CNTRLREG_TSCENB | 432 CNTRLREG_TSCENB |
@@ -442,15 +442,15 @@ static int __devinit tscadc_probe(struct platform_device *pdev)
442 ctrl |= CNTRLREG_8WIRE; 442 ctrl |= CNTRLREG_8WIRE;
443 break; 443 break;
444 } 444 }
445 tscadc_writel(ts_dev, REG_CTRL, ctrl); 445 titsc_writel(ts_dev, REG_CTRL, ctrl);
446 446
447 tscadc_idle_config(ts_dev); 447 titsc_idle_config(ts_dev);
448 tscadc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES); 448 titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES);
449 tscadc_step_config(ts_dev); 449 titsc_step_config(ts_dev);
450 tscadc_writel(ts_dev, REG_FIFO0THR, ts_dev->steps_to_configure); 450 titsc_writel(ts_dev, REG_FIFO0THR, ts_dev->steps_to_configure);
451 451
452 ctrl |= CNTRLREG_TSCSSENB; 452 ctrl |= CNTRLREG_TSCSSENB;
453 tscadc_writel(ts_dev, REG_CTRL, ctrl); 453 titsc_writel(ts_dev, REG_CTRL, ctrl);
454 454
455 input_dev->name = "ti-tsc-adc"; 455 input_dev->name = "ti-tsc-adc";
456 input_dev->dev.parent = &pdev->dev; 456 input_dev->dev.parent = &pdev->dev;
@@ -485,9 +485,9 @@ err_free_mem:
485 return err; 485 return err;
486} 486}
487 487
488static int __devexit tscadc_remove(struct platform_device *pdev) 488static int __devexit titsc_remove(struct platform_device *pdev)
489{ 489{
490 struct tscadc *ts_dev = platform_get_drvdata(pdev); 490 struct titsc *ts_dev = platform_get_drvdata(pdev);
491 struct resource *res; 491 struct resource *res;
492 492
493 free_irq(ts_dev->irq, ts_dev); 493 free_irq(ts_dev->irq, ts_dev);
@@ -508,8 +508,8 @@ static int __devexit tscadc_remove(struct platform_device *pdev)
508} 508}
509 509
510static struct platform_driver ti_tsc_driver = { 510static struct platform_driver ti_tsc_driver = {
511 .probe = tscadc_probe, 511 .probe = titsc_probe,
512 .remove = __devexit_p(tscadc_remove), 512 .remove = __devexit_p(titsc_remove),
513 .driver = { 513 .driver = {
514 .name = "tsc", 514 .name = "tsc",
515 .owner = THIS_MODULE, 515 .owner = THIS_MODULE,