From: Richard Purdie <rpurdie@rpsys.net>
To: akpm@osdl.org
Cc: vojtech@suse.cz, linux-kernel@vger.kernel.org
Subject: [patch 5/8] Corgi Touchscreen: Code cleanup / fixes
Date: Fri, 29 Jul 2005 10:46:51 +0100 [thread overview]
Message-ID: <1122630411.7747.94.camel@localhost.localdomain> (raw)
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>
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 16:20:38.000000000 +0100
+++ linux-2.6.12/drivers/input/touchscreen/corgi_ts.c 2005-07-28 16:21:17.000000000 +0100
@@ -79,6 +79,9 @@
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 @@
{
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 @@
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 @@
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 @@
}
#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);
reply other threads:[~2005-07-29 9:58 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=1122630411.7747.94.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
all inboxes | Powered by JetHome®