From d81d89144db3f7fa8c41293792fd4eaa166ac40f Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 6 Sep 2005 15:19:02 -0700 Subject: [PATCH] --- yaml --- r: 7479 b: refs/heads/master c: 74b74890bc23b8c6f5b0c0d99f6e1b3d39cb3dae h: refs/heads/master i: 7477: e42a3019807ab026cc45ed2463c09f7ccb59a57e 7475: 0ae64773170ed46beff71c8bfafb3c54271ce769 7471: 816a7212a73ab17048c48640362d2b538179c2fe v: v3 --- [refs] | 2 +- trunk/drivers/input/touchscreen/corgi_ts.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index b3774930f60b..d6fb1b00b642 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 347e4843fa1fc21bf542c6f086fcf5ef1ab5f58e +refs/heads/master: 74b74890bc23b8c6f5b0c0d99f6e1b3d39cb3dae diff --git a/trunk/drivers/input/touchscreen/corgi_ts.c b/trunk/drivers/input/touchscreen/corgi_ts.c index 9fcc7ca2c208..768ab4a55630 100644 --- a/trunk/drivers/input/touchscreen/corgi_ts.c +++ b/trunk/drivers/input/touchscreen/corgi_ts.c @@ -79,6 +79,9 @@ static unsigned long calc_waittime(void) int w100fb_xres = w100fb_get_xres(); unsigned int waittime = 0; + if (w100fb_get_blanking()) + return 0; + if (w100fb_xres == 480 || w100fb_xres == 640) { waittime = WAIT_HS_400_VGA * get_clk_frequency_khz(0) / 398131U; @@ -98,11 +101,8 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add { unsigned long timer1 = 0, timer2, pmnc = 0; int pos = 0; - int dosleep; - - dosleep = !w100fb_get_blanking(); - if (dosleep && doSend) { + if (wait_time && doSend) { PMNC_GET(pmnc); if (!(pmnc & 0x01)) PMNC_SET(pmnc | 0x01); @@ -122,11 +122,11 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add corgi_ssp_ads7846_put(cmd); corgi_ssp_ads7846_get(); - if (dosleep) { + if (wait_time) { /* Wait after HSync */ CCNT(timer2); if (timer2-timer1 > wait_time) { - /* timeout */ + /* too slow - timeout, try again */ SyncHS(); /* get OSCR */ CCNT(timer1); @@ -137,7 +137,7 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add CCNT(timer2); } corgi_ssp_ads7846_put(cmd); - if (dosleep && !(pmnc & 0x01)) + if (wait_time && !(pmnc & 0x01)) PMNC_SET(pmnc); } return pos; @@ -247,7 +247,7 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs) } #ifdef CONFIG_PM -static int corgits_suspend(struct device *dev, uint32_t state, uint32_t level) +static int corgits_suspend(struct device *dev, pm_message_t state, uint32_t level) { if (level == SUSPEND_POWER_DOWN) { struct corgi_ts *corgi_ts = dev_get_drvdata(dev);