tree 9c8afb5ef3d6093857b5d49ca59144c5d1c6c70b
parent 948e12f0bd51db439659fed857971e22fbdd7527
author Richard Purdie <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:19:01 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:53 -0700

[PATCH] Corgi Touchscreen: Allow the driver to share the PMU

The Corgi Touchscreen driver uses the PMU as an accurate timing source which
conflicts with its usage for performance monitoring.  This patch allows it to
be shared with other users such as oprofile.

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 |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 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
@@ -53,8 +53,8 @@ struct corgi_ts {
 
 #define SyncHS()       while((STATUS_HSYNC) == 0); while((STATUS_HSYNC) != 0);
 #define CCNT(a)                asm volatile ("mrc p14, 0, %0, C1, C0, 0" : 
"=r"(a))
-#define CCNT_ON()      {int pmnc = 1; asm volatile ("mcr p14, 0, %0, C0, C0, 
0" : : "r"(pmnc));}
-#define CCNT_OFF()     {int pmnc = 0; asm volatile ("mcr p14, 0, %0, C0, C0, 
0" : : "r"(pmnc));}
+#define PMNC_GET(x)    asm volatile ("mrc p14, 0, %0, C0, C0, 0" : "=r"(x))
+#define PMNC_SET(x)    asm volatile ("mcr p14, 0, %0, C0, C0, 0" : : "r"(x))
 
 #define WAIT_HS_400_VGA                7013U   // 17.615us
 #define WAIT_HS_400_QVGA       16622U  // 41.750us
@@ -96,14 +96,17 @@ static unsigned long calc_waittime(void)
 
 static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int 
address, unsigned long wait_time)
 {
+       unsigned long timer1 = 0, timer2, pmnc = 0;
        int pos = 0;
-       unsigned long timer1 = 0, timer2;
        int dosleep;
 
        dosleep = !w100fb_get_blanking();
 
        if (dosleep && doSend) {
-               CCNT_ON();
+               PMNC_GET(pmnc);
+               if (!(pmnc & 0x01))
+                       PMNC_SET(pmnc | 0x01);
+
                /* polling HSync */
                SyncHS();
                /* get CCNT */
@@ -134,8 +137,8 @@ static int sync_receive_data_send_cmd(in
                                CCNT(timer2);
                }
                corgi_ssp_ads7846_put(cmd);
-               if (dosleep)
-                       CCNT_OFF();
+               if (dosleep && !(pmnc & 0x01))
+                       PMNC_SET(pmnc);
        }
        return pos;
 }
-
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