diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | 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 index 3f8b61cfbc37..9fcc7ca2c208 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
@@ -53,8 +53,8 @@ struct corgi_ts { | |||
53 | 53 | ||
54 | #define SyncHS() while((STATUS_HSYNC) == 0); while((STATUS_HSYNC) != 0); | 54 | #define SyncHS() while((STATUS_HSYNC) == 0); while((STATUS_HSYNC) != 0); |
55 | #define CCNT(a) asm volatile ("mrc p14, 0, %0, C1, C0, 0" : "=r"(a)) | 55 | #define CCNT(a) asm volatile ("mrc p14, 0, %0, C1, C0, 0" : "=r"(a)) |
56 | #define CCNT_ON() {int pmnc = 1; asm volatile ("mcr p14, 0, %0, C0, C0, 0" : : "r"(pmnc));} | 56 | #define PMNC_GET(x) asm volatile ("mrc p14, 0, %0, C0, C0, 0" : "=r"(x)) |
57 | #define CCNT_OFF() {int pmnc = 0; asm volatile ("mcr p14, 0, %0, C0, C0, 0" : : "r"(pmnc));} | 57 | #define PMNC_SET(x) asm volatile ("mcr p14, 0, %0, C0, C0, 0" : : "r"(x)) |
58 | 58 | ||
59 | #define WAIT_HS_400_VGA 7013U // 17.615us | 59 | #define WAIT_HS_400_VGA 7013U // 17.615us |
60 | #define WAIT_HS_400_QVGA 16622U // 41.750us | 60 | #define WAIT_HS_400_QVGA 16622U // 41.750us |
@@ -96,14 +96,17 @@ static unsigned long calc_waittime(void) | |||
96 | 96 | ||
97 | static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int address, unsigned long wait_time) | 97 | static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int address, unsigned long wait_time) |
98 | { | 98 | { |
99 | unsigned long timer1 = 0, timer2, pmnc = 0; | ||
99 | int pos = 0; | 100 | int pos = 0; |
100 | unsigned long timer1 = 0, timer2; | ||
101 | int dosleep; | 101 | int dosleep; |
102 | 102 | ||
103 | dosleep = !w100fb_get_blanking(); | 103 | dosleep = !w100fb_get_blanking(); |
104 | 104 | ||
105 | if (dosleep && doSend) { | 105 | if (dosleep && doSend) { |
106 | CCNT_ON(); | 106 | PMNC_GET(pmnc); |
107 | if (!(pmnc & 0x01)) | ||
108 | PMNC_SET(pmnc | 0x01); | ||
109 | |||
107 | /* polling HSync */ | 110 | /* polling HSync */ |
108 | SyncHS(); | 111 | SyncHS(); |
109 | /* get CCNT */ | 112 | /* get CCNT */ |
@@ -134,8 +137,8 @@ static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int add | |||
134 | CCNT(timer2); | 137 | CCNT(timer2); |
135 | } | 138 | } |
136 | corgi_ssp_ads7846_put(cmd); | 139 | corgi_ssp_ads7846_put(cmd); |
137 | if (dosleep) | 140 | if (dosleep && !(pmnc & 0x01)) |
138 | CCNT_OFF(); | 141 | PMNC_SET(pmnc); |
139 | } | 142 | } |
140 | return pos; | 143 | return pos; |
141 | } | 144 | } |