diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2011-03-05 11:40:22 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-03-07 13:29:49 -0500 |
commit | b73d77b2b75091b09d31f5c47924c99d4f19930a (patch) | |
tree | f0761ad2c48aa9953b95791baa521846da297d68 /arch | |
parent | 122eb103924316c1229f1b8aeea7492893d910c9 (diff) |
ARM: mxs/mx23evk: add framebuffer device
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mxs/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/mach-mx23evk.c | 79 |
2 files changed, 80 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 4f0b67345179..989c08c6dd93 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig | |||
@@ -22,6 +22,7 @@ config MACH_MX23EVK | |||
22 | select SOC_IMX23 | 22 | select SOC_IMX23 |
23 | select MXS_HAVE_AMBA_DUART | 23 | select MXS_HAVE_AMBA_DUART |
24 | select MXS_HAVE_PLATFORM_AUART | 24 | select MXS_HAVE_PLATFORM_AUART |
25 | select MXS_HAVE_PLATFORM_MXSFB | ||
25 | default y | 26 | default y |
26 | help | 27 | help |
27 | Include support for MX23EVK platform. This includes specific | 28 | Include support for MX23EVK platform. This includes specific |
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c index d7240547f0db..a66994f0518f 100644 --- a/arch/arm/mach-mxs/mach-mx23evk.c +++ b/arch/arm/mach-mxs/mach-mx23evk.c | |||
@@ -26,6 +26,9 @@ | |||
26 | 26 | ||
27 | #include "devices-mx23.h" | 27 | #include "devices-mx23.h" |
28 | 28 | ||
29 | #define MX23EVK_LCD_ENABLE MXS_GPIO_NR(1, 18) | ||
30 | #define MX23EVK_BL_ENABLE MXS_GPIO_NR(1, 28) | ||
31 | |||
29 | static const iomux_cfg_t mx23evk_pads[] __initconst = { | 32 | static const iomux_cfg_t mx23evk_pads[] __initconst = { |
30 | /* duart */ | 33 | /* duart */ |
31 | MX23_PAD_PWM0__DUART_RX | MXS_PAD_CTRL, | 34 | MX23_PAD_PWM0__DUART_RX | MXS_PAD_CTRL, |
@@ -36,14 +39,90 @@ static const iomux_cfg_t mx23evk_pads[] __initconst = { | |||
36 | MX23_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL, | 39 | MX23_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL, |
37 | MX23_PAD_AUART1_CTS__AUART1_CTS | MXS_PAD_CTRL, | 40 | MX23_PAD_AUART1_CTS__AUART1_CTS | MXS_PAD_CTRL, |
38 | MX23_PAD_AUART1_RTS__AUART1_RTS | MXS_PAD_CTRL, | 41 | MX23_PAD_AUART1_RTS__AUART1_RTS | MXS_PAD_CTRL, |
42 | |||
43 | /* mxsfb (lcdif) */ | ||
44 | MX23_PAD_LCD_D00__LCD_D00 | MXS_PAD_CTRL, | ||
45 | MX23_PAD_LCD_D01__LCD_D01 | MXS_PAD_CTRL, | ||
46 | MX23_PAD_LCD_D02__LCD_D02 | MXS_PAD_CTRL, | ||
47 | MX23_PAD_LCD_D03__LCD_D03 | MXS_PAD_CTRL, | ||
48 | MX23_PAD_LCD_D04__LCD_D04 | MXS_PAD_CTRL, | ||
49 | MX23_PAD_LCD_D05__LCD_D05 | MXS_PAD_CTRL, | ||
50 | MX23_PAD_LCD_D06__LCD_D06 | MXS_PAD_CTRL, | ||
51 | MX23_PAD_LCD_D07__LCD_D07 | MXS_PAD_CTRL, | ||
52 | MX23_PAD_LCD_D08__LCD_D08 | MXS_PAD_CTRL, | ||
53 | MX23_PAD_LCD_D09__LCD_D09 | MXS_PAD_CTRL, | ||
54 | MX23_PAD_LCD_D10__LCD_D10 | MXS_PAD_CTRL, | ||
55 | MX23_PAD_LCD_D11__LCD_D11 | MXS_PAD_CTRL, | ||
56 | MX23_PAD_LCD_D12__LCD_D12 | MXS_PAD_CTRL, | ||
57 | MX23_PAD_LCD_D13__LCD_D13 | MXS_PAD_CTRL, | ||
58 | MX23_PAD_LCD_D14__LCD_D14 | MXS_PAD_CTRL, | ||
59 | MX23_PAD_LCD_D15__LCD_D15 | MXS_PAD_CTRL, | ||
60 | MX23_PAD_LCD_D16__LCD_D16 | MXS_PAD_CTRL, | ||
61 | MX23_PAD_LCD_D17__LCD_D17 | MXS_PAD_CTRL, | ||
62 | MX23_PAD_GPMI_D08__LCD_D18 | MXS_PAD_CTRL, | ||
63 | MX23_PAD_GPMI_D09__LCD_D19 | MXS_PAD_CTRL, | ||
64 | MX23_PAD_GPMI_D10__LCD_D20 | MXS_PAD_CTRL, | ||
65 | MX23_PAD_GPMI_D11__LCD_D21 | MXS_PAD_CTRL, | ||
66 | MX23_PAD_GPMI_D12__LCD_D22 | MXS_PAD_CTRL, | ||
67 | MX23_PAD_GPMI_D13__LCD_D23 | MXS_PAD_CTRL, | ||
68 | MX23_PAD_LCD_VSYNC__LCD_VSYNC | MXS_PAD_CTRL, | ||
69 | MX23_PAD_LCD_HSYNC__LCD_HSYNC | MXS_PAD_CTRL, | ||
70 | MX23_PAD_LCD_DOTCK__LCD_DOTCK | MXS_PAD_CTRL, | ||
71 | MX23_PAD_LCD_ENABLE__LCD_ENABLE | MXS_PAD_CTRL, | ||
72 | /* LCD panel enable */ | ||
73 | MX23_PAD_LCD_RESET__GPIO_1_18 | MXS_PAD_CTRL, | ||
74 | /* backlight control */ | ||
75 | MX23_PAD_PWM2__GPIO_1_28 | MXS_PAD_CTRL, | ||
76 | }; | ||
77 | |||
78 | /* mxsfb (lcdif) */ | ||
79 | static struct fb_videomode mx23evk_video_modes[] = { | ||
80 | { | ||
81 | .name = "Samsung-LMS430HF02", | ||
82 | .refresh = 60, | ||
83 | .xres = 480, | ||
84 | .yres = 272, | ||
85 | .pixclock = 108096, /* picosecond (9.2 MHz) */ | ||
86 | .left_margin = 15, | ||
87 | .right_margin = 8, | ||
88 | .upper_margin = 12, | ||
89 | .lower_margin = 4, | ||
90 | .hsync_len = 1, | ||
91 | .vsync_len = 1, | ||
92 | .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT | | ||
93 | FB_SYNC_DOTCLK_FAILING_ACT, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | static const struct mxsfb_platform_data mx23evk_mxsfb_pdata __initconst = { | ||
98 | .mode_list = mx23evk_video_modes, | ||
99 | .mode_count = ARRAY_SIZE(mx23evk_video_modes), | ||
100 | .default_bpp = 32, | ||
101 | .ld_intf_width = STMLCDIF_24BIT, | ||
39 | }; | 102 | }; |
40 | 103 | ||
41 | static void __init mx23evk_init(void) | 104 | static void __init mx23evk_init(void) |
42 | { | 105 | { |
106 | int ret; | ||
107 | |||
43 | mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads)); | 108 | mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads)); |
44 | 109 | ||
45 | mx23_add_duart(); | 110 | mx23_add_duart(); |
46 | mx23_add_auart0(); | 111 | mx23_add_auart0(); |
112 | |||
113 | ret = gpio_request_one(MX23EVK_LCD_ENABLE, GPIOF_DIR_OUT, "lcd-enable"); | ||
114 | if (ret) | ||
115 | pr_warn("failed to request gpio lcd-enable: %d\n", ret); | ||
116 | else | ||
117 | gpio_set_value(MX23EVK_LCD_ENABLE, 1); | ||
118 | |||
119 | ret = gpio_request_one(MX23EVK_BL_ENABLE, GPIOF_DIR_OUT, "bl-enable"); | ||
120 | if (ret) | ||
121 | pr_warn("failed to request gpio bl-enable: %d\n", ret); | ||
122 | else | ||
123 | gpio_set_value(MX23EVK_BL_ENABLE, 1); | ||
124 | |||
125 | mx23_add_mxsfb(&mx23evk_mxsfb_pdata); | ||
47 | } | 126 | } |
48 | 127 | ||
49 | static void __init mx23evk_timer_init(void) | 128 | static void __init mx23evk_timer_init(void) |