aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-09-06 18:19:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 19:57:53 -0400
commit74b74890bc23b8c6f5b0c0d99f6e1b3d39cb3dae (patch)
tree6899286d38b985b7499948e029d5a18939d82f5b /drivers/input
parent347e4843fa1fc21bf542c6f086fcf5ef1ab5f58e (diff)
[PATCH] Corgi Touchscreen: Code cleanup / fixes
Clean up some Corgi Touchscreen logic and merge the repeat calls to w100fb_blanking() in anticipation of the w100fb patch. Fix a pm_message_t reference. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/corgi_ts.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c
index 9fcc7ca2c208..768ab4a55630 100644
--- a/drivers/input/touchscreen/corgi_ts.c
+++ b/drivers/input/touchscreen/corgi_ts.c
@@ -79,6 +79,9 @@ static unsigned long calc_waittime(void)
79 int w100fb_xres = w100fb_get_xres(); 79 int w100fb_xres = w100fb_get_xres();
80 unsigned int waittime = 0; 80 unsigned int waittime = 0;
81 81
82 if (w100fb_get_blanking())
83 return 0;
84
82 if (w100fb_xres == 480 || w100fb_xres == 640) { 85 if (w100fb_xres == 480 || w100fb_xres == 640) {
83 waittime = WAIT_HS_400_VGA * get_clk_frequency_khz(0) / 398131U; 86 waittime = WAIT_HS_400_VGA * get_clk_frequency_khz(0) / 398131U;
84 87
@@ -98,11 +101,8 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add
98{ 101{
99 unsigned long timer1 = 0, timer2, pmnc = 0; 102 unsigned long timer1 = 0, timer2, pmnc = 0;
100 int pos = 0; 103 int pos = 0;
101 int dosleep;
102
103 dosleep = !w100fb_get_blanking();
104 104
105 if (dosleep && doSend) { 105 if (wait_time && doSend) {
106 PMNC_GET(pmnc); 106 PMNC_GET(pmnc);
107 if (!(pmnc & 0x01)) 107 if (!(pmnc & 0x01))
108 PMNC_SET(pmnc | 0x01); 108 PMNC_SET(pmnc | 0x01);
@@ -122,11 +122,11 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add
122 corgi_ssp_ads7846_put(cmd); 122 corgi_ssp_ads7846_put(cmd);
123 corgi_ssp_ads7846_get(); 123 corgi_ssp_ads7846_get();
124 124
125 if (dosleep) { 125 if (wait_time) {
126 /* Wait after HSync */ 126 /* Wait after HSync */
127 CCNT(timer2); 127 CCNT(timer2);
128 if (timer2-timer1 > wait_time) { 128 if (timer2-timer1 > wait_time) {
129 /* timeout */ 129 /* too slow - timeout, try again */
130 SyncHS(); 130 SyncHS();
131 /* get OSCR */ 131 /* get OSCR */
132 CCNT(timer1); 132 CCNT(timer1);
@@ -137,7 +137,7 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add
137 CCNT(timer2); 137 CCNT(timer2);
138 } 138 }
139 corgi_ssp_ads7846_put(cmd); 139 corgi_ssp_ads7846_put(cmd);
140 if (dosleep && !(pmnc & 0x01)) 140 if (wait_time && !(pmnc & 0x01))
141 PMNC_SET(pmnc); 141 PMNC_SET(pmnc);
142 } 142 }
143 return pos; 143 return pos;
@@ -247,7 +247,7 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs)
247} 247}
248 248
249#ifdef CONFIG_PM 249#ifdef CONFIG_PM
250static int corgits_suspend(struct device *dev, uint32_t state, uint32_t level) 250static int corgits_suspend(struct device *dev, pm_message_t state, uint32_t level)
251{ 251{
252 if (level == SUSPEND_POWER_DOWN) { 252 if (level == SUSPEND_POWER_DOWN) {
253 struct corgi_ts *corgi_ts = dev_get_drvdata(dev); 253 struct corgi_ts *corgi_ts = dev_get_drvdata(dev);