aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-am3517evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-am3517evm.c')
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c77
1 files changed, 7 insertions, 70 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 191f9762ba63..d63f14b534b5 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -35,8 +35,7 @@
35 35
36#include "common.h" 36#include "common.h"
37#include <video/omapdss.h> 37#include <video/omapdss.h>
38#include <video/omap-panel-generic-dpi.h> 38#include <video/omap-panel-data.h>
39#include <video/omap-panel-tfp410.h>
40 39
41#include "am35xx-emac.h" 40#include "am35xx-emac.h"
42#include "mux.h" 41#include "mux.h"
@@ -121,63 +120,14 @@ static int __init am3517_evm_i2c_init(void)
121 return 0; 120 return 0;
122} 121}
123 122
124static int lcd_enabled;
125static int dvi_enabled;
126
127#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
128 defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
129static struct gpio am3517_evm_dss_gpios[] __initdata = {
130 /* GPIO 182 = LCD Backlight Power */
131 { LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
132 /* GPIO 181 = LCD Panel PWM */
133 { LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd bl enable" },
134 /* GPIO 176 = LCD Panel Power enable pin */
135 { LCD_PANEL_PWR, GPIOF_OUT_INIT_HIGH, "dvi enable" },
136};
137
138static void __init am3517_evm_display_init(void)
139{
140 int r;
141
142 omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
143 omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
144 omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
145
146 r = gpio_request_array(am3517_evm_dss_gpios,
147 ARRAY_SIZE(am3517_evm_dss_gpios));
148 if (r) {
149 printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
150 return;
151 }
152
153 printk(KERN_INFO "Display initialized successfully\n");
154}
155#else
156static void __init am3517_evm_display_init(void) {}
157#endif
158
159static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
160{
161 if (dvi_enabled) {
162 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
163 return -EINVAL;
164 }
165 gpio_set_value(LCD_PANEL_PWR, 1);
166 lcd_enabled = 1;
167
168 return 0;
169}
170
171static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
172{
173 gpio_set_value(LCD_PANEL_PWR, 0);
174 lcd_enabled = 0;
175}
176
177static struct panel_generic_dpi_data lcd_panel = { 123static struct panel_generic_dpi_data lcd_panel = {
178 .name = "sharp_lq", 124 .name = "sharp_lq",
179 .platform_enable = am3517_evm_panel_enable_lcd, 125 .num_gpios = 3,
180 .platform_disable = am3517_evm_panel_disable_lcd, 126 .gpios = {
127 LCD_PANEL_PWR,
128 LCD_PANEL_BKLIGHT_PWR,
129 LCD_PANEL_PWM,
130 },
181}; 131};
182 132
183static struct omap_dss_device am3517_evm_lcd_device = { 133static struct omap_dss_device am3517_evm_lcd_device = {
@@ -188,22 +138,11 @@ static struct omap_dss_device am3517_evm_lcd_device = {
188 .phy.dpi.data_lines = 16, 138 .phy.dpi.data_lines = 16,
189}; 139};
190 140
191static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev)
192{
193 return 0;
194}
195
196static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev)
197{
198}
199
200static struct omap_dss_device am3517_evm_tv_device = { 141static struct omap_dss_device am3517_evm_tv_device = {
201 .type = OMAP_DISPLAY_TYPE_VENC, 142 .type = OMAP_DISPLAY_TYPE_VENC,
202 .name = "tv", 143 .name = "tv",
203 .driver_name = "venc", 144 .driver_name = "venc",
204 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, 145 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
205 .platform_enable = am3517_evm_panel_enable_tv,
206 .platform_disable = am3517_evm_panel_disable_tv,
207}; 146};
208 147
209static struct tfp410_platform_data dvi_panel = { 148static struct tfp410_platform_data dvi_panel = {
@@ -366,8 +305,6 @@ static void __init am3517_evm_init(void)
366 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); 305 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
367 usbhs_init(&usbhs_bdata); 306 usbhs_init(&usbhs_bdata);
368 am3517_evm_hecc_init(&am3517_evm_hecc_pdata); 307 am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
369 /* DSS */
370 am3517_evm_display_init();
371 308
372 /* RTC - S35390A */ 309 /* RTC - S35390A */
373 am3517_evm_rtc_init(); 310 am3517_evm_rtc_init();