From: Richard Purdie <rpurdie@rpsys.net>
To: akpm@osdl.org
Cc: vojtech@suse.cz, linux-kernel@vger.kernel.org
Subject: [patch 4/8] Corgi Touchscreen: Allow the driver to share the PMU
Date: Fri, 29 Jul 2005 10:46:46 +0100 [thread overview]
Message-ID: <1122630406.7747.92.camel@localhost.localdomain> (raw)
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 <rpurdie@rpsys.net>
Index: linux-2.6.12/drivers/input/touchscreen/corgi_ts.c
===================================================================
--- linux-2.6.12.orig/drivers/input/touchscreen/corgi_ts.c 2005-07-28 15:21:39.000000000 +0100
+++ linux-2.6.12/drivers/input/touchscreen/corgi_ts.c 2005-07-28 16:20:38.000000000 +0100
@@ -53,8 +53,8 @@
#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 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 @@
CCNT(timer2);
}
corgi_ssp_ads7846_put(cmd);
- if (dosleep)
- CCNT_OFF();
+ if (dosleep && !(pmnc & 0x01))
+ PMNC_SET(pmnc);
}
return pos;
}
reply other threads:[~2005-07-29 9:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1122630406.7747.92.camel@localhost.localdomain \
--to=rpurdie@rpsys.net \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox