diff options
author | wu guoxing <b39297@freescale.com> | 2012-03-13 22:10:54 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-03-14 15:07:58 -0400 |
commit | 881e09f8c615e105000ca914c489311a2533c893 (patch) | |
tree | 9909e4ff057ec63eff17295bc0a0a86aab6bdcdc | |
parent | 192cfd58774b4d17b2fe8bdc77d89c2ef4e0591d (diff) |
ARM : mx35: 3ds-board: add framebuffer device
This patch adds framebuffer support for freescale mx35 3ds board
Signed-off-by: Wu Guoxing <b39297@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-imx/mach-mx35_3ds.c | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c index 0af6c9c5b3fd..e6c64d04d363 100644 --- a/arch/arm/mach-imx/mach-mx35_3ds.c +++ b/arch/arm/mach-imx/mach-mx35_3ds.c | |||
@@ -40,9 +40,93 @@ | |||
40 | #include <mach/iomux-mx35.h> | 40 | #include <mach/iomux-mx35.h> |
41 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
42 | #include <mach/3ds_debugboard.h> | 42 | #include <mach/3ds_debugboard.h> |
43 | #include <video/platform_lcd.h> | ||
43 | 44 | ||
44 | #include "devices-imx35.h" | 45 | #include "devices-imx35.h" |
45 | 46 | ||
47 | #define GPIO_MC9S08DZ60_GPS_ENABLE 0 | ||
48 | #define GPIO_MC9S08DZ60_HDD_ENABLE 4 | ||
49 | #define GPIO_MC9S08DZ60_WIFI_ENABLE 5 | ||
50 | #define GPIO_MC9S08DZ60_LCD_ENABLE 6 | ||
51 | #define GPIO_MC9S08DZ60_SPEAKER_ENABLE 8 | ||
52 | |||
53 | static const struct fb_videomode fb_modedb[] = { | ||
54 | { | ||
55 | /* 800x480 @ 55 Hz */ | ||
56 | .name = "Ceramate-CLAA070VC01", | ||
57 | .refresh = 55, | ||
58 | .xres = 800, | ||
59 | .yres = 480, | ||
60 | .pixclock = 40000, | ||
61 | .left_margin = 40, | ||
62 | .right_margin = 40, | ||
63 | .upper_margin = 5, | ||
64 | .lower_margin = 5, | ||
65 | .hsync_len = 20, | ||
66 | .vsync_len = 10, | ||
67 | .sync = FB_SYNC_OE_ACT_HIGH, | ||
68 | .vmode = FB_VMODE_NONINTERLACED, | ||
69 | .flag = 0, | ||
70 | }, | ||
71 | }; | ||
72 | |||
73 | static const struct ipu_platform_data mx3_ipu_data __initconst = { | ||
74 | .irq_base = MXC_IPU_IRQ_START, | ||
75 | }; | ||
76 | |||
77 | static struct mx3fb_platform_data mx3fb_pdata __initdata = { | ||
78 | .name = "Ceramate-CLAA070VC01", | ||
79 | .mode = fb_modedb, | ||
80 | .num_modes = ARRAY_SIZE(fb_modedb), | ||
81 | }; | ||
82 | |||
83 | static struct i2c_board_info __initdata i2c_devices_3ds[] = { | ||
84 | { | ||
85 | I2C_BOARD_INFO("mc9s08dz60", 0x69), | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | static int lcd_power_gpio = -ENXIO; | ||
90 | |||
91 | static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip, | ||
92 | void *data) | ||
93 | { | ||
94 | return !strcmp(chip->label, data); | ||
95 | } | ||
96 | |||
97 | static void mx35_3ds_lcd_set_power( | ||
98 | struct plat_lcd_data *pd, unsigned int power) | ||
99 | { | ||
100 | struct gpio_chip *chip; | ||
101 | |||
102 | if (!gpio_is_valid(lcd_power_gpio)) { | ||
103 | chip = gpiochip_find( | ||
104 | "mc9s08dz60", mc9s08dz60_gpiochip_match); | ||
105 | if (chip) { | ||
106 | lcd_power_gpio = | ||
107 | chip->base + GPIO_MC9S08DZ60_LCD_ENABLE; | ||
108 | if (gpio_request(lcd_power_gpio, "lcd_power") < 0) { | ||
109 | pr_err("error: gpio already requested!\n"); | ||
110 | lcd_power_gpio = -ENXIO; | ||
111 | } | ||
112 | } else { | ||
113 | pr_err("error: didn't find mc9s08dz60 gpio chip\n"); | ||
114 | } | ||
115 | } | ||
116 | |||
117 | if (gpio_is_valid(lcd_power_gpio)) | ||
118 | gpio_set_value_cansleep(lcd_power_gpio, power); | ||
119 | } | ||
120 | |||
121 | static struct plat_lcd_data mx35_3ds_lcd_data = { | ||
122 | .set_power = mx35_3ds_lcd_set_power, | ||
123 | }; | ||
124 | |||
125 | static struct platform_device mx35_3ds_lcd = { | ||
126 | .name = "platform-lcd", | ||
127 | .dev.platform_data = &mx35_3ds_lcd_data, | ||
128 | }; | ||
129 | |||
46 | #define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 1)) | 130 | #define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 1)) |
47 | 131 | ||
48 | static const struct imxuart_platform_data uart_pdata __initconst = { | 132 | static const struct imxuart_platform_data uart_pdata __initconst = { |
@@ -120,6 +204,32 @@ static iomux_v3_cfg_t mx35pdk_pads[] = { | |||
120 | /* I2C1 */ | 204 | /* I2C1 */ |
121 | MX35_PAD_I2C1_CLK__I2C1_SCL, | 205 | MX35_PAD_I2C1_CLK__I2C1_SCL, |
122 | MX35_PAD_I2C1_DAT__I2C1_SDA, | 206 | MX35_PAD_I2C1_DAT__I2C1_SDA, |
207 | /* Display */ | ||
208 | MX35_PAD_LD0__IPU_DISPB_DAT_0, | ||
209 | MX35_PAD_LD1__IPU_DISPB_DAT_1, | ||
210 | MX35_PAD_LD2__IPU_DISPB_DAT_2, | ||
211 | MX35_PAD_LD3__IPU_DISPB_DAT_3, | ||
212 | MX35_PAD_LD4__IPU_DISPB_DAT_4, | ||
213 | MX35_PAD_LD5__IPU_DISPB_DAT_5, | ||
214 | MX35_PAD_LD6__IPU_DISPB_DAT_6, | ||
215 | MX35_PAD_LD7__IPU_DISPB_DAT_7, | ||
216 | MX35_PAD_LD8__IPU_DISPB_DAT_8, | ||
217 | MX35_PAD_LD9__IPU_DISPB_DAT_9, | ||
218 | MX35_PAD_LD10__IPU_DISPB_DAT_10, | ||
219 | MX35_PAD_LD11__IPU_DISPB_DAT_11, | ||
220 | MX35_PAD_LD12__IPU_DISPB_DAT_12, | ||
221 | MX35_PAD_LD13__IPU_DISPB_DAT_13, | ||
222 | MX35_PAD_LD14__IPU_DISPB_DAT_14, | ||
223 | MX35_PAD_LD15__IPU_DISPB_DAT_15, | ||
224 | MX35_PAD_LD16__IPU_DISPB_DAT_16, | ||
225 | MX35_PAD_LD17__IPU_DISPB_DAT_17, | ||
226 | MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC, | ||
227 | MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK, | ||
228 | MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY, | ||
229 | MX35_PAD_CONTRAST__IPU_DISPB_CONTR, | ||
230 | MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC, | ||
231 | MX35_PAD_D3_REV__IPU_DISPB_D3_REV, | ||
232 | MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS, | ||
123 | }; | 233 | }; |
124 | 234 | ||
125 | static int mx35_3ds_otg_init(struct platform_device *pdev) | 235 | static int mx35_3ds_otg_init(struct platform_device *pdev) |
@@ -179,6 +289,8 @@ static const struct imxi2c_platform_data mx35_3ds_i2c0_data __initconst = { | |||
179 | */ | 289 | */ |
180 | static void __init mx35_3ds_init(void) | 290 | static void __init mx35_3ds_init(void) |
181 | { | 291 | { |
292 | struct platform_device *imx35_fb_pdev; | ||
293 | |||
182 | imx35_soc_init(); | 294 | imx35_soc_init(); |
183 | 295 | ||
184 | mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); | 296 | mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); |
@@ -204,6 +316,14 @@ static void __init mx35_3ds_init(void) | |||
204 | pr_warn("Init of the debugboard failed, all " | 316 | pr_warn("Init of the debugboard failed, all " |
205 | "devices on the debugboard are unusable.\n"); | 317 | "devices on the debugboard are unusable.\n"); |
206 | imx35_add_imx_i2c0(&mx35_3ds_i2c0_data); | 318 | imx35_add_imx_i2c0(&mx35_3ds_i2c0_data); |
319 | |||
320 | i2c_register_board_info( | ||
321 | 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds)); | ||
322 | |||
323 | imx35_add_ipu_core(&mx3_ipu_data); | ||
324 | imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata); | ||
325 | mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev; | ||
326 | platform_device_register(&mx35_3ds_lcd); | ||
207 | } | 327 | } |
208 | 328 | ||
209 | static void __init mx35pdk_timer_init(void) | 329 | static void __init mx35pdk_timer_init(void) |