tree 6899286d38b985b7499948e029d5a18939d82f5b
parent 347e4843fa1fc21bf542c6f086fcf5ef1ab5f58e
author Richard Purdie <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:19:02 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:53 -0700

[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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/input/touchscreen/corgi_ts.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/input/touchscreen/corgi_ts.c 
b/drivers/input/touchscreen/corgi_ts.c
--- a/drivers/input/touchscreen/corgi_ts.c
+++ b/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(in
 {
        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(in
                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(in
                                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,
 }
 
 #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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to