summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Doucet <todd.doucet@timesys.com>2010-02-03 17:18:29 -0500
committerTodd Doucet <todd.doucet@timesys.com>2010-02-03 17:18:29 -0500
commit411044962864ed8da7a2e051844d368515bc37cf (patch)
treeae02e8c4ef2341047d8b47bd735b0564fccab1aa
parentff238a4df84428befc55d49f58864dfc47ff853d (diff)
Initial patches to enable the wvga LCD display sent by Digi.
-rw-r--r--arch/arm/mach-mx51/mx51_ccwmx51js.c43
-rw-r--r--arch/arm/mach-mx51/mx51_ccwmx51js_gpio.c48
2 files changed, 85 insertions, 6 deletions
diff --git a/arch/arm/mach-mx51/mx51_ccwmx51js.c b/arch/arm/mach-mx51/mx51_ccwmx51js.c
index 2d603bb..5bef0f1 100644
--- a/arch/arm/mach-mx51/mx51_ccwmx51js.c
+++ b/arch/arm/mach-mx51/mx51_ccwmx51js.c
@@ -364,11 +364,37 @@ static inline void ccwmx51_init_mmc(void) {}
#if defined(CONFIG_FB_MXC_SYNC_PANEL) || \
defined(CONFIG_FB_MXC_SYNC_PANEL_MODULE)
+static struct fb_videomode wvga_video_mode =
+{
+ .name = "Digi LCD",
+ .xres = 800,
+ .yres = 480,
+ .refresh = 60,
+ .pixclock = 30062,
+ .left_margin = 64,
+ .right_margin = 64,
+ .lower_margin = 10,
+ .upper_margin = 30,
+ .hsync_len = 128,
+ .vsync_len = 5,
+ .vmode = FB_VMODE_NONINTERLACED,
+ .flag = FB_MODE_IS_DETAILED
+
+};
+
+// ttd: todo: support both video=displayfb:VGA and video=displayfb:LCD
+// on the kernel boot line.
static struct mxc_fb_platform_data fb_data_vga = {
+// ttd: test for LCD
+ .mode = &wvga_video_mode,
.interface_pix_fmt = IPU_PIX_FMT_RGB24,
- .mode_str = "1024x768M-16@60", /* Default */
+
+// works best on lcd panel, avoids resampling
+ .mode_str = "800x480-24@60",
+
};
+
static struct platform_device mxc_fb_device[] = {
{
.name = "mxc_sdc_fb",
@@ -376,7 +402,7 @@ static struct platform_device mxc_fb_device[] = {
.dev = {
.release = mxc_nop_release,
.coherent_dma_mask = 0xFFFFFFFF,
- .platform_data = &fb_data_vga,
+ .platform_data = &fb_data_vga
},
}, {
.name = "mxc_sdc_fb",
@@ -384,7 +410,6 @@ static struct platform_device mxc_fb_device[] = {
.dev = {
.release = mxc_nop_release,
.coherent_dma_mask = 0xFFFFFFFF,
- .platform_data = NULL,
},
}, {
.name = "mxc_sdc_fb",
@@ -396,12 +421,19 @@ static struct platform_device mxc_fb_device[] = {
},
};
+extern void gpio_lcd_active(void);
+
static int __init ccwmx51_init_fb(void)
{
char *options = NULL, *p;
+// ttd: hack for testing
+// ttd: todo: clean this up and also do blanking properly on lcd when
+// it is being used.
+ gpio_lcd_active();
+
if (fb_get_options("displayfb", &options))
- pr_warning("no display information available in commnad line\n");
+ pr_warning("no display information available in command line\n");
if (!options)
return -ENODEV;
@@ -413,6 +445,7 @@ static int __init ccwmx51_init_fb(void)
if (options[3] != '@') {
pr_info("Video resolution for VGA interface not provided, using default\n");
/* TODO set default video here */
+
} else {
options = &options[4];
if (((p = strsep (&options, "@")) != NULL) && *p) {
@@ -431,6 +464,8 @@ static int __init ccwmx51_init_fb(void)
}
}
(void)platform_device_register(&mxc_fb_device[0]); /* VGA */
+
+
}
return 0;
diff --git a/arch/arm/mach-mx51/mx51_ccwmx51js_gpio.c b/arch/arm/mach-mx51/mx51_ccwmx51js_gpio.c
index 3458935..bc156e9 100644
--- a/arch/arm/mach-mx51/mx51_ccwmx51js_gpio.c
+++ b/arch/arm/mach-mx51/mx51_ccwmx51js_gpio.c
@@ -207,6 +207,13 @@ static struct mxc_iomux_pin_cfg __initdata ccwmx51_iomux_usbh1_pins[] = {
#if defined(CONFIG_FB_MXC_SYNC_PANEL) || defined(CONFIG_FB_MXC_SYNC_PANEL_MODULE)
static struct mxc_iomux_pin_cfg __initdata ccwmx51_iomux_video1_pins[] = {
+ // ttd: setting up pins for our lcd panel
+ {
+ MX51_PIN_DI1_PIN11, IOMUX_CONFIG_ALT4,
+ (PAD_CTL_HYS_NONE | PAD_CTL_DRV_LOW | PAD_CTL_SRE_FAST),
+ },
+ // ttd: end of experimental sections
+
{ /* DISP1 DAT0 */
MX51_PIN_DISP1_DAT0, IOMUX_CONFIG_ALT0,
(PAD_CTL_HYS_NONE | PAD_CTL_DRV_LOW | PAD_CTL_SRE_FAST),
@@ -420,15 +427,24 @@ void __init ccwmx51_io_init(void)
#endif
#if defined(CONFIG_FB_MXC_SYNC_PANEL) || defined(CONFIG_FB_MXC_SYNC_PANEL_MODULE)
+ printk("ttd: setting up video gpio mappings\n");
for (i = 0; i < ARRAY_SIZE(ccwmx51_iomux_video1_pins); i++) {
- mxc_request_iomux(ccwmx51_iomux_video1_pins[i].pin,
- ccwmx51_iomux_video1_pins[i].mux_mode);
+// ttd: debug
+ int r = mxc_request_iomux(ccwmx51_iomux_video1_pins[i].pin,
+ ccwmx51_iomux_video1_pins[i].mux_mode);
+// ttd: debug
+ if (r){
+ printk("ttd: mxc_request_iomux() for video failed, pin %d\n",
+ ccwmx51_iomux_video1_pins[i].pin);
+ }
if (ccwmx51_iomux_video1_pins[i].pad_cfg)
mxc_iomux_set_pad(ccwmx51_iomux_video1_pins[i].pin,
ccwmx51_iomux_video1_pins[i].pad_cfg);
+
if (ccwmx51_iomux_video1_pins[i].in_select)
mxc_iomux_set_input(ccwmx51_iomux_video1_pins[i].in_select,
ccwmx51_iomux_video1_pins[i].in_mode);
+
}
#endif
@@ -469,6 +485,33 @@ void __init ccwmx51_io_init(void)
#endif
}
+// ttd: experimental for lcd
+
+
+void gpio_lcd_active(void)
+{
+// ttd: testing...
+#if 1
+ int r;
+ printk("ttd: gpio_lcd_active\n");
+// r = gpio_request(IOMUX_TO_GPIO(MX51_PIN_DI1_PIN11), "di1_pin11");
+// printk(" ttd: gpio_request() returns %d\n", r);
+
+
+
+// The last one that is required. I don't quite understand the
+// inter-related semantics of the gpio_direction_output and the
+// underlying chip->direction method, and the chip->request.
+ r = gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_DI1_PIN11), 0);
+
+ printk(" ttd: gpio_set_direction_output() returns %d\n", r);
+// gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_DI1_PIN11), 0);
+#endif
+}
+
+
+EXPORT_SYMBOL(gpio_lcd_active);
+
#if defined(CONFIG_SERIAL_MXC) || defined(CONFIG_SERIAL_MXC_MODULE)
#define SERIAL_PORT_PAD (PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE | \
@@ -526,3 +569,4 @@ void gpio_uart_active(int port, int no_irda) {}
void gpio_uart_inactive(int port, int no_irda) {}
EXPORT_SYMBOL(gpio_uart_active);
EXPORT_SYMBOL(gpio_uart_inactive);
+