diff options
Diffstat (limited to 'drivers/input/touchscreen/ucb1400_ts.c')
-rw-r--r-- | drivers/input/touchscreen/ucb1400_ts.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index e8606c48c9c3..6582816a0477 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c | |||
@@ -97,6 +97,8 @@ struct ucb1400 { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | static int adcsync; | 99 | static int adcsync; |
100 | static int ts_delay = 55; /* us */ | ||
101 | static int ts_delay_pressure; /* us */ | ||
100 | 102 | ||
101 | static inline u16 ucb1400_reg_read(struct ucb1400 *ucb, u16 reg) | 103 | static inline u16 ucb1400_reg_read(struct ucb1400 *ucb, u16 reg) |
102 | { | 104 | { |
@@ -159,6 +161,7 @@ static inline unsigned int ucb1400_ts_read_pressure(struct ucb1400 *ucb) | |||
159 | UCB_TS_CR_TSMX_POW | UCB_TS_CR_TSPX_POW | | 161 | UCB_TS_CR_TSMX_POW | UCB_TS_CR_TSPX_POW | |
160 | UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND | | 162 | UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND | |
161 | UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); | 163 | UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); |
164 | udelay(ts_delay_pressure); | ||
162 | return ucb1400_adc_read(ucb, UCB_ADC_INP_TSPY); | 165 | return ucb1400_adc_read(ucb, UCB_ADC_INP_TSPY); |
163 | } | 166 | } |
164 | 167 | ||
@@ -180,7 +183,7 @@ static inline unsigned int ucb1400_ts_read_xpos(struct ucb1400 *ucb) | |||
180 | UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | | 183 | UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | |
181 | UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); | 184 | UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); |
182 | 185 | ||
183 | udelay(55); | 186 | udelay(ts_delay); |
184 | 187 | ||
185 | return ucb1400_adc_read(ucb, UCB_ADC_INP_TSPY); | 188 | return ucb1400_adc_read(ucb, UCB_ADC_INP_TSPY); |
186 | } | 189 | } |
@@ -203,7 +206,7 @@ static inline unsigned int ucb1400_ts_read_ypos(struct ucb1400 *ucb) | |||
203 | UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | | 206 | UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | |
204 | UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); | 207 | UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); |
205 | 208 | ||
206 | udelay(55); | 209 | udelay(ts_delay); |
207 | 210 | ||
208 | return ucb1400_adc_read(ucb, UCB_ADC_INP_TSPX); | 211 | return ucb1400_adc_read(ucb, UCB_ADC_INP_TSPX); |
209 | } | 212 | } |
@@ -369,7 +372,7 @@ static irqreturn_t ucb1400_hard_irq(int irqnr, void *devid) | |||
369 | 372 | ||
370 | static int ucb1400_ts_open(struct input_dev *idev) | 373 | static int ucb1400_ts_open(struct input_dev *idev) |
371 | { | 374 | { |
372 | struct ucb1400 *ucb = idev->private; | 375 | struct ucb1400 *ucb = input_get_drvdata(idev); |
373 | int ret = 0; | 376 | int ret = 0; |
374 | 377 | ||
375 | BUG_ON(ucb->ts_task); | 378 | BUG_ON(ucb->ts_task); |
@@ -385,7 +388,7 @@ static int ucb1400_ts_open(struct input_dev *idev) | |||
385 | 388 | ||
386 | static void ucb1400_ts_close(struct input_dev *idev) | 389 | static void ucb1400_ts_close(struct input_dev *idev) |
387 | { | 390 | { |
388 | struct ucb1400 *ucb = idev->private; | 391 | struct ucb1400 *ucb = input_get_drvdata(idev); |
389 | 392 | ||
390 | if (ucb->ts_task) | 393 | if (ucb->ts_task) |
391 | kthread_stop(ucb->ts_task); | 394 | kthread_stop(ucb->ts_task); |
@@ -507,8 +510,9 @@ static int ucb1400_ts_probe(struct device *dev) | |||
507 | } | 510 | } |
508 | printk(KERN_DEBUG "UCB1400: found IRQ %d\n", ucb->irq); | 511 | printk(KERN_DEBUG "UCB1400: found IRQ %d\n", ucb->irq); |
509 | 512 | ||
510 | idev->private = ucb; | 513 | input_set_drvdata(idev, ucb); |
511 | idev->cdev.dev = dev; | 514 | |
515 | idev->dev.parent = dev; | ||
512 | idev->name = "UCB1400 touchscreen interface"; | 516 | idev->name = "UCB1400 touchscreen interface"; |
513 | idev->id.vendor = ucb1400_reg_read(ucb, AC97_VENDOR_ID1); | 517 | idev->id.vendor = ucb1400_reg_read(ucb, AC97_VENDOR_ID1); |
514 | idev->id.product = id; | 518 | idev->id.product = id; |
@@ -571,7 +575,15 @@ static void __exit ucb1400_ts_exit(void) | |||
571 | driver_unregister(&ucb1400_ts_driver); | 575 | driver_unregister(&ucb1400_ts_driver); |
572 | } | 576 | } |
573 | 577 | ||
574 | module_param(adcsync, int, 0444); | 578 | module_param(adcsync, bool, 0444); |
579 | MODULE_PARM_DESC(adcsync, "Synchronize touch readings with ADCSYNC pin."); | ||
580 | |||
581 | module_param(ts_delay, int, 0444); | ||
582 | MODULE_PARM_DESC(ts_delay, "Delay between panel setup and position read. Default = 55us."); | ||
583 | |||
584 | module_param(ts_delay_pressure, int, 0444); | ||
585 | MODULE_PARM_DESC(ts_delay_pressure, | ||
586 | "delay between panel setup and pressure read. Default = 0us."); | ||
575 | 587 | ||
576 | module_init(ucb1400_ts_init); | 588 | module_init(ucb1400_ts_init); |
577 | module_exit(ucb1400_ts_exit); | 589 | module_exit(ucb1400_ts_exit); |