Commit 41b1bce8 authored by Richard Purdie's avatar Richard Purdie Committed by Linus Torvalds

[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: default avatarRichard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent aac51f09
......@@ -11,7 +11,7 @@ obj-$(CONFIG_PXA27x) += pxa27x.o
obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o ssp.o
obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o ssp.o
obj-$(CONFIG_MACH_POODLE) += poodle.o
# Support for blinky lights
......
......@@ -39,7 +39,6 @@
#include <asm/mach/sharpsl_param.h>
#include <asm/hardware/scoop.h>
#include <video/w100fb.h>
#include "generic.h"
......@@ -87,7 +86,7 @@ struct platform_device corgiscoop_device = {
* also use scoop functions and this makes the power up/down order
* work correctly.
*/
static struct platform_device corgissp_device = {
struct platform_device corgissp_device = {
.name = "corgi-ssp",
.dev = {
.parent = &corgiscoop_device.dev,
......@@ -96,35 +95,6 @@ static struct platform_device corgissp_device = {
};
/*
* Corgi w100 Frame Buffer Device
*/
static struct w100fb_mach_info corgi_fb_info = {
.w100fb_ssp_send = corgi_ssp_lcdtg_send,
.comadj = -1,
.phadadj = -1,
};
static struct resource corgi_fb_resources[] = {
[0] = {
.start = 0x08000000,
.end = 0x08ffffff,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device corgifb_device = {
.name = "w100fb",
.id = -1,
.dev = {
.platform_data = &corgi_fb_info,
.parent = &corgissp_device.dev,
},
.num_resources = ARRAY_SIZE(corgi_fb_resources),
.resource = corgi_fb_resources,
};
/*
* Corgi Backlight Device
*/
......@@ -243,9 +213,6 @@ static struct platform_device *devices[] __initdata = {
static void __init corgi_init(void)
{
corgi_fb_info.comadj=sharpsl_param.comadj;
corgi_fb_info.phadadj=sharpsl_param.phadadj;
pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT);
pxa_set_udc_info(&udc_info);
pxa_set_mci_info(&corgi_mci_platform_data);
......
This diff is collapsed.
......@@ -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)
......
......@@ -103,18 +103,20 @@
* Shared data structures
*/
extern struct platform_device corgiscoop_device;
extern struct platform_device corgissp_device;
extern struct platform_device corgifb_device;
/*
* External Functions
*/
extern unsigned long corgi_ssp_ads7846_putget(unsigned long);
extern unsigned long corgi_ssp_ads7846_get(void);
extern void corgi_ssp_ads7846_put(ulong data);
extern void corgi_ssp_ads7846_put(unsigned long data);
extern void corgi_ssp_ads7846_lock(void);
extern void corgi_ssp_ads7846_unlock(void);
extern void corgi_ssp_lcdtg_send (u8 adrs, u8 data);
extern void corgi_ssp_lcdtg_send (unsigned char adrs, unsigned char data);
extern void corgi_ssp_blduty_set(int duty);
extern int corgi_ssp_max1111_get(ulong data);
extern int corgi_ssp_max1111_get(unsigned long data);
#endif /* __ASM_ARCH_CORGI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment