diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-04-19 12:23:05 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-09-30 09:21:04 -0400 |
commit | 6e896ff9ff1c2afde8ec7a71b87539c07b337c5e (patch) | |
tree | 9aa7ec6597fc80c4db061b576e4409f3dc081007 | |
parent | 1382f897e6136f504b227e27bec64842ed7bc150 (diff) |
OMAP: 2420SDP: Port the display driver to new DSS2
Port the old omapfb panel driver to DSS2. This patch changes the board
file only, the driver is ported in separate patch.
Cc: Hunyue Yau <hyau@mvista.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/board-2430sdp.c | 78 |
1 files changed, 64 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 2028464cf5b..6ab6350b015 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -39,6 +39,9 @@ | |||
39 | #include <plat/usb.h> | 39 | #include <plat/usb.h> |
40 | #include <plat/gpmc-smc91x.h> | 40 | #include <plat/gpmc-smc91x.h> |
41 | 41 | ||
42 | #include <video/omapdss.h> | ||
43 | #include <video/omap-panel-generic-dpi.h> | ||
44 | |||
42 | #include "mux.h" | 45 | #include "mux.h" |
43 | #include "hsmmc.h" | 46 | #include "hsmmc.h" |
44 | #include "common-board-devices.h" | 47 | #include "common-board-devices.h" |
@@ -99,20 +102,72 @@ static struct platform_device sdp2430_flash_device = { | |||
99 | .resource = &sdp2430_flash_resource, | 102 | .resource = &sdp2430_flash_resource, |
100 | }; | 103 | }; |
101 | 104 | ||
102 | static struct platform_device sdp2430_lcd_device = { | ||
103 | .name = "sdp2430_lcd", | ||
104 | .id = -1, | ||
105 | }; | ||
106 | |||
107 | static struct platform_device *sdp2430_devices[] __initdata = { | 105 | static struct platform_device *sdp2430_devices[] __initdata = { |
108 | &sdp2430_flash_device, | 106 | &sdp2430_flash_device, |
107 | }; | ||
108 | |||
109 | /* LCD */ | ||
110 | #define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91 | ||
111 | #define SDP2430_LCD_PANEL_ENABLE_GPIO 154 | ||
112 | |||
113 | static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
114 | { | ||
115 | gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1); | ||
116 | gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1); | ||
117 | |||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
122 | { | ||
123 | gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0); | ||
124 | gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0); | ||
125 | } | ||
126 | |||
127 | static struct panel_generic_dpi_data sdp2430_panel_data = { | ||
128 | .name = "nec_nl2432dr22-11b", | ||
129 | .platform_enable = sdp2430_panel_enable_lcd, | ||
130 | .platform_disable = sdp2430_panel_disable_lcd, | ||
131 | }; | ||
132 | |||
133 | static struct omap_dss_device sdp2430_lcd_device = { | ||
134 | .name = "lcd", | ||
135 | .driver_name = "generic_dpi_panel", | ||
136 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
137 | .phy.dpi.data_lines = 16, | ||
138 | .data = &sdp2430_panel_data, | ||
139 | }; | ||
140 | |||
141 | static struct omap_dss_device *sdp2430_dss_devices[] = { | ||
109 | &sdp2430_lcd_device, | 142 | &sdp2430_lcd_device, |
110 | }; | 143 | }; |
111 | 144 | ||
112 | static struct omap_lcd_config sdp2430_lcd_config __initdata = { | 145 | static struct omap_dss_board_info sdp2430_dss_data = { |
113 | .ctrl_name = "internal", | 146 | .num_devices = ARRAY_SIZE(sdp2430_dss_devices), |
147 | .devices = sdp2430_dss_devices, | ||
148 | .default_device = &sdp2430_lcd_device, | ||
114 | }; | 149 | }; |
115 | 150 | ||
151 | static void __init sdp2430_display_init(void) | ||
152 | { | ||
153 | int r; | ||
154 | |||
155 | static struct gpio gpios[] __initdata = { | ||
156 | { SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, | ||
157 | "LCD reset" }, | ||
158 | { SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, | ||
159 | "LCD Backlight" }, | ||
160 | }; | ||
161 | |||
162 | r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); | ||
163 | if (r) { | ||
164 | pr_err("Cannot request LCD GPIOs, error %d\n", r); | ||
165 | return; | ||
166 | } | ||
167 | |||
168 | omap_display_init(&sdp2430_dss_data); | ||
169 | } | ||
170 | |||
116 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE) | 171 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE) |
117 | 172 | ||
118 | static struct omap_smc91x_platform_data board_smc91x_data = { | 173 | static struct omap_smc91x_platform_data board_smc91x_data = { |
@@ -137,10 +192,6 @@ static inline void board_smc91x_init(void) | |||
137 | 192 | ||
138 | #endif | 193 | #endif |
139 | 194 | ||
140 | static struct omap_board_config_kernel sdp2430_config[] __initdata = { | ||
141 | {OMAP_TAG_LCD, &sdp2430_lcd_config}, | ||
142 | }; | ||
143 | |||
144 | static void __init omap_2430sdp_init_early(void) | 195 | static void __init omap_2430sdp_init_early(void) |
145 | { | 196 | { |
146 | omap2_init_common_infrastructure(); | 197 | omap2_init_common_infrastructure(); |
@@ -228,9 +279,6 @@ static void __init omap_2430sdp_init(void) | |||
228 | { | 279 | { |
229 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 280 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); |
230 | 281 | ||
231 | omap_board_config = sdp2430_config; | ||
232 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); | ||
233 | |||
234 | omap2430_i2c_init(); | 282 | omap2430_i2c_init(); |
235 | 283 | ||
236 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 284 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
@@ -246,6 +294,8 @@ static void __init omap_2430sdp_init(void) | |||
246 | /* Turn off secondary LCD backlight */ | 294 | /* Turn off secondary LCD backlight */ |
247 | gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, | 295 | gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, |
248 | "Secondary LCD backlight"); | 296 | "Secondary LCD backlight"); |
297 | |||
298 | sdp2430_display_init(); | ||
249 | } | 299 | } |
250 | 300 | ||
251 | static void __init omap_2430sdp_map_io(void) | 301 | static void __init omap_2430sdp_map_io(void) |