diff options
-rw-r--r-- | arch/arm/mach-omap2/board-am3517evm.c | 63 |
1 files changed, 6 insertions, 57 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 1d6c28872505..4ba395f7e88e 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -120,63 +120,14 @@ static int __init am3517_evm_i2c_init(void) | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | static int lcd_enabled; | ||
124 | static int dvi_enabled; | ||
125 | |||
126 | #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ | ||
127 | defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE) | ||
128 | static struct gpio am3517_evm_dss_gpios[] __initdata = { | ||
129 | /* GPIO 182 = LCD Backlight Power */ | ||
130 | { LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" }, | ||
131 | /* GPIO 181 = LCD Panel PWM */ | ||
132 | { LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd bl enable" }, | ||
133 | /* GPIO 176 = LCD Panel Power enable pin */ | ||
134 | { LCD_PANEL_PWR, GPIOF_OUT_INIT_HIGH, "dvi enable" }, | ||
135 | }; | ||
136 | |||
137 | static void __init am3517_evm_display_init(void) | ||
138 | { | ||
139 | int r; | ||
140 | |||
141 | omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP); | ||
142 | omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN); | ||
143 | omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN); | ||
144 | |||
145 | r = gpio_request_array(am3517_evm_dss_gpios, | ||
146 | ARRAY_SIZE(am3517_evm_dss_gpios)); | ||
147 | if (r) { | ||
148 | printk(KERN_ERR "failed to get DSS panel control GPIOs\n"); | ||
149 | return; | ||
150 | } | ||
151 | |||
152 | printk(KERN_INFO "Display initialized successfully\n"); | ||
153 | } | ||
154 | #else | ||
155 | static void __init am3517_evm_display_init(void) {} | ||
156 | #endif | ||
157 | |||
158 | static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
159 | { | ||
160 | if (dvi_enabled) { | ||
161 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
162 | return -EINVAL; | ||
163 | } | ||
164 | gpio_set_value(LCD_PANEL_PWR, 1); | ||
165 | lcd_enabled = 1; | ||
166 | |||
167 | return 0; | ||
168 | } | ||
169 | |||
170 | static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
171 | { | ||
172 | gpio_set_value(LCD_PANEL_PWR, 0); | ||
173 | lcd_enabled = 0; | ||
174 | } | ||
175 | |||
176 | static struct panel_generic_dpi_data lcd_panel = { | 123 | static struct panel_generic_dpi_data lcd_panel = { |
177 | .name = "sharp_lq", | 124 | .name = "sharp_lq", |
178 | .platform_enable = am3517_evm_panel_enable_lcd, | 125 | .num_gpios = 3, |
179 | .platform_disable = am3517_evm_panel_disable_lcd, | 126 | .gpios = { |
127 | LCD_PANEL_PWR, | ||
128 | LCD_PANEL_BKLIGHT_PWR, | ||
129 | LCD_PANEL_PWM, | ||
130 | }, | ||
180 | }; | 131 | }; |
181 | 132 | ||
182 | static struct omap_dss_device am3517_evm_lcd_device = { | 133 | static struct omap_dss_device am3517_evm_lcd_device = { |
@@ -362,8 +313,6 @@ static void __init am3517_evm_init(void) | |||
362 | omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); | 313 | omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); |
363 | usbhs_init(&usbhs_bdata); | 314 | usbhs_init(&usbhs_bdata); |
364 | am3517_evm_hecc_init(&am3517_evm_hecc_pdata); | 315 | am3517_evm_hecc_init(&am3517_evm_hecc_pdata); |
365 | /* DSS */ | ||
366 | am3517_evm_display_init(); | ||
367 | 316 | ||
368 | /* RTC - S35390A */ | 317 | /* RTC - S35390A */ |
369 | am3517_evm_rtc_init(); | 318 | am3517_evm_rtc_init(); |