diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-09-06 18:19:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:53 -0400 |
commit | 41b1bce80b43f7c6a6c64006b2abe3a8d52ab120 (patch) | |
tree | 729b4693ea52f4fcd53bfe5474d6c274bc2347ca /drivers/input/touchscreen | |
parent | aac51f09d96a0acfb73c1d1c0796358bb47ea07b (diff) |
[PATCH] w100fb: Update corgi platform code to match new driver
This patch moves the platform specific Sharp SL-C7x0 LCD code from the
w100fb driver into a more appropriate place and updates the Corgi code to
match the new w100fb driver.
It also updates the corgi touchscreen code to match the new simplified
interface available from w100fb.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/corgi_ts.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index 512940ecb357..5d19261b884f 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
@@ -56,9 +56,6 @@ struct corgi_ts { | |||
56 | #define PMNC_GET(x) asm volatile ("mrc p14, 0, %0, C0, C0, 0" : "=r"(x)) | 56 | #define PMNC_GET(x) asm volatile ("mrc p14, 0, %0, C0, C0, 0" : "=r"(x)) |
57 | #define PMNC_SET(x) asm volatile ("mcr p14, 0, %0, C0, C0, 0" : : "r"(x)) | 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 | ||
60 | #define WAIT_HS_400_QVGA 16622U // 41.750us | ||
61 | |||
62 | 59 | ||
63 | /* ADS7846 Touch Screen Controller bit definitions */ | 60 | /* ADS7846 Touch Screen Controller bit definitions */ |
64 | #define ADSCTRL_PD0 (1u << 0) /* PD0 */ | 61 | #define ADSCTRL_PD0 (1u << 0) /* PD0 */ |
@@ -69,32 +66,17 @@ struct corgi_ts { | |||
69 | #define ADSCTRL_STS (1u << 7) /* Start Bit */ | 66 | #define ADSCTRL_STS (1u << 7) /* Start Bit */ |
70 | 67 | ||
71 | /* External Functions */ | 68 | /* External Functions */ |
72 | extern int w100fb_get_xres(void); | 69 | extern unsigned long w100fb_get_hsynclen(struct device *dev); |
73 | extern int w100fb_get_blanking(void); | ||
74 | extern int w100fb_get_fastsysclk(void); | ||
75 | extern unsigned int get_clk_frequency_khz(int info); | 70 | extern unsigned int get_clk_frequency_khz(int info); |
76 | 71 | ||
77 | static unsigned long calc_waittime(void) | 72 | static unsigned long calc_waittime(void) |
78 | { | 73 | { |
79 | int w100fb_xres = w100fb_get_xres(); | 74 | unsigned long hsync_len = w100fb_get_hsynclen(&corgifb_device.dev); |
80 | unsigned int waittime = 0; | ||
81 | 75 | ||
82 | if (w100fb_get_blanking()) | 76 | if (hsync_len) |
77 | return get_clk_frequency_khz(0)*1000/hsync_len; | ||
78 | else | ||
83 | return 0; | 79 | return 0; |
84 | |||
85 | if (w100fb_xres == 480 || w100fb_xres == 640) { | ||
86 | waittime = WAIT_HS_400_VGA * get_clk_frequency_khz(0) / 398131U; | ||
87 | |||
88 | if (w100fb_get_fastsysclk() == 100) | ||
89 | waittime = waittime * 75 / 100; | ||
90 | |||
91 | if (w100fb_xres == 640) | ||
92 | waittime *= 3; | ||
93 | |||
94 | return waittime; | ||
95 | } | ||
96 | |||
97 | return WAIT_HS_400_QVGA * get_clk_frequency_khz(0) / 398131U; | ||
98 | } | 80 | } |
99 | 81 | ||
100 | static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int address, unsigned long wait_time) | 82 | static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int address, unsigned long wait_time) |