From 41b1bce80b43f7c6a6c64006b2abe3a8d52ab120 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 6 Sep 2005 15:19:05 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/input/touchscreen/corgi_ts.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'drivers') 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 { #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 - /* ADS7846 Touch Screen Controller bit definitions */ #define ADSCTRL_PD0 (1u << 0) /* PD0 */ @@ -69,32 +66,17 @@ struct corgi_ts { #define ADSCTRL_STS (1u << 7) /* Start Bit */ /* External Functions */ -extern int w100fb_get_xres(void); -extern int w100fb_get_blanking(void); -extern int w100fb_get_fastsysclk(void); +extern unsigned long w100fb_get_hsynclen(struct device *dev); extern unsigned int get_clk_frequency_khz(int info); static unsigned long calc_waittime(void) { - int w100fb_xres = w100fb_get_xres(); - unsigned int waittime = 0; + unsigned long hsync_len = w100fb_get_hsynclen(&corgifb_device.dev); - if (w100fb_get_blanking()) + if (hsync_len) + return get_clk_frequency_khz(0)*1000/hsync_len; + else return 0; - - if (w100fb_xres == 480 || w100fb_xres == 640) { - waittime = WAIT_HS_400_VGA * get_clk_frequency_khz(0) / 398131U; - - if (w100fb_get_fastsysclk() == 100) - waittime = waittime * 75 / 100; - - if (w100fb_xres == 640) - waittime *= 3; - - return waittime; - } - - return WAIT_HS_400_QVGA * get_clk_frequency_khz(0) / 398131U; } static int sync_receive_data_send_cmd(int doRecive, int doSend, unsigned int address, unsigned long wait_time) -- cgit v1.2.3-58-ga151