Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7478
b: refs/heads/master
c: 347e484
h: refs/heads/master
v: v3
  • Loading branch information
Richard Purdie authored and Linus Torvalds committed Sep 7, 2005
1 parent e42a301 commit ed6bf21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 948e12f0bd51db439659fed857971e22fbdd7527
refs/heads/master: 347e4843fa1fc21bf542c6f086fcf5ef1ab5f58e
15 changes: 9 additions & 6 deletions trunk/drivers/input/touchscreen/corgi_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -134,8 +137,8 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add
CCNT(timer2);
}
corgi_ssp_ads7846_put(cmd);
if (dosleep)
CCNT_OFF();
if (dosleep && !(pmnc & 0x01))
PMNC_SET(pmnc);
}
return pos;
}
Expand Down

0 comments on commit ed6bf21

Please sign in to comment.