aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorCliff Brake <cbrake@bec-systems.com>2007-04-12 01:35:43 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:35:43 -0400
commitb5b16c5296c3276bb409a948173d557241b74379 (patch)
treeaed70c1431d3500d2961faab150b0e52bb398752 /drivers/input/touchscreen
parent293e6392d72dfaef1f6aef605769869512bec45d (diff)
Input: ucb1400 - make delays configurable
This patch adds module parameters for several timing values used in the driver. These values can vary based on the hardware design and how much capacitive filtering there is on the touch panel inputs, and the resistance of the panel. Signed-off-by: Cliff Brake <cbrake@bec-systems.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/ucb1400_ts.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 5200f4cbfe01..24000f0efeaa 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
99static int adcsync; 99static int adcsync;
100static int ts_delay = 55; /* us */
101static int ts_delay_pressure; /* us */
100 102
101static inline u16 ucb1400_reg_read(struct ucb1400 *ucb, u16 reg) 103static 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}
@@ -571,7 +574,15 @@ static void __exit ucb1400_ts_exit(void)
571 driver_unregister(&ucb1400_ts_driver); 574 driver_unregister(&ucb1400_ts_driver);
572} 575}
573 576
574module_param(adcsync, int, 0444); 577module_param(adcsync, bool, 0444);
578MODULE_PARM_DESC(adcsync, "Synchronize touch readings with ADCSYNC pin.");
579
580module_param(ts_delay, int, 0444);
581MODULE_PARM_DESC(ts_delay, "Delay between panel setup and position read. Default = 55us.");
582
583module_param(ts_delay_pressure, int, 0444);
584MODULE_PARM_DESC(ts_delay_pressure,
585 "delay between panel setup and pressure read. Default = 0us.");
575 586
576module_init(ucb1400_ts_init); 587module_init(ucb1400_ts_init);
577module_exit(ucb1400_ts_exit); 588module_exit(ucb1400_ts_exit);