aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-05-20 13:54:37 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2009-05-26 06:31:28 -0400
commitb99238721bf62c216d556b4ba63bdf410e068284 (patch)
tree3631a09b960fdd78cc9320ca10f33e56f9d4f51f
parentd0b1eabc7b255daa978849229703b4d70a4c0555 (diff)
ARM: MX3: add framebuffer support for lilly1131-db
Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-mx3/mx31lilly-db.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c
index b7821163fc17..99b0a6e30b29 100644
--- a/arch/arm/mach-mx3/mx31lilly-db.c
+++ b/arch/arm/mach-mx3/mx31lilly-db.c
@@ -28,6 +28,7 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/platform_device.h>
31 32
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
@@ -39,6 +40,8 @@
39#include <mach/iomux-mx3.h> 40#include <mach/iomux-mx3.h>
40#include <mach/board-mx31lilly.h> 41#include <mach/board-mx31lilly.h>
41#include <mach/mmc.h> 42#include <mach/mmc.h>
43#include <mach/mx3fb.h>
44#include <mach/ipu.h>
42 45
43#include "devices.h" 46#include "devices.h"
44 47
@@ -59,6 +62,29 @@ static unsigned int lilly_db_board_pins[] __initdata = {
59 MX31_PIN_SD1_DATA0__SD1_DATA0, 62 MX31_PIN_SD1_DATA0__SD1_DATA0,
60 MX31_PIN_SD1_CLK__SD1_CLK, 63 MX31_PIN_SD1_CLK__SD1_CLK,
61 MX31_PIN_SD1_CMD__SD1_CMD, 64 MX31_PIN_SD1_CMD__SD1_CMD,
65 MX31_PIN_LD0__LD0,
66 MX31_PIN_LD1__LD1,
67 MX31_PIN_LD2__LD2,
68 MX31_PIN_LD3__LD3,
69 MX31_PIN_LD4__LD4,
70 MX31_PIN_LD5__LD5,
71 MX31_PIN_LD6__LD6,
72 MX31_PIN_LD7__LD7,
73 MX31_PIN_LD8__LD8,
74 MX31_PIN_LD9__LD9,
75 MX31_PIN_LD10__LD10,
76 MX31_PIN_LD11__LD11,
77 MX31_PIN_LD12__LD12,
78 MX31_PIN_LD13__LD13,
79 MX31_PIN_LD14__LD14,
80 MX31_PIN_LD15__LD15,
81 MX31_PIN_LD16__LD16,
82 MX31_PIN_LD17__LD17,
83 MX31_PIN_VSYNC3__VSYNC3,
84 MX31_PIN_HSYNC__HSYNC,
85 MX31_PIN_FPSHIFT__FPSHIFT,
86 MX31_PIN_DRDY0__DRDY0,
87 MX31_PIN_CONTRAST__CONTRAST,
62}; 88};
63 89
64/* UART */ 90/* UART */
@@ -124,6 +150,50 @@ static struct imxmmc_platform_data mmc_pdata = {
124 .exit = mxc_mmc1_exit, 150 .exit = mxc_mmc1_exit,
125}; 151};
126 152
153/* Framebuffer support */
154static struct ipu_platform_data ipu_data __initdata = {
155 .irq_base = MXC_IPU_IRQ_START,
156};
157
158static const struct fb_videomode fb_modedb = {
159 /* 640x480 TFT panel (IPS-056T) */
160 .name = "CRT-VGA",
161 .refresh = 64,
162 .xres = 640,
163 .yres = 480,
164 .pixclock = 30000,
165 .left_margin = 200,
166 .right_margin = 2,
167 .upper_margin = 2,
168 .lower_margin = 2,
169 .hsync_len = 3,
170 .vsync_len = 1,
171 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
172 .vmode = FB_VMODE_NONINTERLACED,
173 .flag = 0,
174};
175
176static struct mx3fb_platform_data fb_pdata __initdata = {
177 .dma_dev = &mx3_ipu.dev,
178 .name = "CRT-VGA",
179 .mode = &fb_modedb,
180 .num_modes = 1,
181};
182
183#define LCD_VCC_EN_GPIO (7)
184
185static void __init mx31lilly_init_fb(void)
186{
187 if (gpio_request(LCD_VCC_EN_GPIO, "LCD enable") != 0) {
188 printk(KERN_WARNING "unable to request LCD_VCC_EN pin.\n");
189 return;
190 }
191
192 mxc_register_device(&mx3_ipu, &ipu_data);
193 mxc_register_device(&mx3_fb, &fb_pdata);
194 gpio_direction_output(LCD_VCC_EN_GPIO, 1);
195}
196
127void __init mx31lilly_db_init(void) 197void __init mx31lilly_db_init(void)
128{ 198{
129 mxc_iomux_setup_multiple_pins(lilly_db_board_pins, 199 mxc_iomux_setup_multiple_pins(lilly_db_board_pins,
@@ -131,5 +201,6 @@ void __init mx31lilly_db_init(void)
131 "development board pins"); 201 "development board pins");
132 mxc_register_device(&mxc_uart_device0, &uart_pdata); 202 mxc_register_device(&mxc_uart_device0, &uart_pdata);
133 mxc_register_device(&mxcsdhc_device0, &mmc_pdata); 203 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
204 mx31lilly_init_fb();
134} 205}
135 206