diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3evm.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 97 |
1 files changed, 34 insertions, 63 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 48789e0bb915..f76d0de7b406 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include "common.h" | 51 | #include "common.h" |
52 | #include <linux/platform_data/spi-omap2-mcspi.h> | 52 | #include <linux/platform_data/spi-omap2-mcspi.h> |
53 | #include <video/omapdss.h> | 53 | #include <video/omapdss.h> |
54 | #include <video/omap-panel-tfp410.h> | 54 | #include <video/omap-panel-data.h> |
55 | 55 | ||
56 | #include "soc.h" | 56 | #include "soc.h" |
57 | #include "mux.h" | 57 | #include "mux.h" |
@@ -155,61 +155,43 @@ static inline void __init omap3evm_init_smsc911x(void) { return; } | |||
155 | #define OMAP3EVM_LCD_PANEL_LR 2 | 155 | #define OMAP3EVM_LCD_PANEL_LR 2 |
156 | #define OMAP3EVM_LCD_PANEL_UD 3 | 156 | #define OMAP3EVM_LCD_PANEL_UD 3 |
157 | #define OMAP3EVM_LCD_PANEL_INI 152 | 157 | #define OMAP3EVM_LCD_PANEL_INI 152 |
158 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 | ||
159 | #define OMAP3EVM_LCD_PANEL_QVGA 154 | 158 | #define OMAP3EVM_LCD_PANEL_QVGA 154 |
160 | #define OMAP3EVM_LCD_PANEL_RESB 155 | 159 | #define OMAP3EVM_LCD_PANEL_RESB 155 |
160 | |||
161 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 | ||
161 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 | 162 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 |
163 | |||
164 | /* | ||
165 | * OMAP3EVM DVI control signals | ||
166 | */ | ||
162 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 | 167 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 |
163 | 168 | ||
164 | static struct gpio omap3_evm_dss_gpios[] __initdata = { | 169 | static struct panel_sharp_ls037v7dw01_data omap3_evm_lcd_data = { |
165 | { OMAP3EVM_LCD_PANEL_RESB, GPIOF_OUT_INIT_HIGH, "lcd_panel_resb" }, | 170 | .resb_gpio = OMAP3EVM_LCD_PANEL_RESB, |
166 | { OMAP3EVM_LCD_PANEL_INI, GPIOF_OUT_INIT_HIGH, "lcd_panel_ini" }, | 171 | .ini_gpio = OMAP3EVM_LCD_PANEL_INI, |
167 | { OMAP3EVM_LCD_PANEL_QVGA, GPIOF_OUT_INIT_LOW, "lcd_panel_qvga" }, | 172 | .mo_gpio = OMAP3EVM_LCD_PANEL_QVGA, |
168 | { OMAP3EVM_LCD_PANEL_LR, GPIOF_OUT_INIT_HIGH, "lcd_panel_lr" }, | 173 | .lr_gpio = OMAP3EVM_LCD_PANEL_LR, |
169 | { OMAP3EVM_LCD_PANEL_UD, GPIOF_OUT_INIT_HIGH, "lcd_panel_ud" }, | 174 | .ud_gpio = OMAP3EVM_LCD_PANEL_UD, |
170 | { OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW, "lcd_panel_envdd" }, | ||
171 | }; | 175 | }; |
172 | 176 | ||
173 | static int lcd_enabled; | ||
174 | static int dvi_enabled; | ||
175 | |||
176 | static void __init omap3_evm_display_init(void) | 177 | static void __init omap3_evm_display_init(void) |
177 | { | 178 | { |
178 | int r; | 179 | int r; |
179 | 180 | ||
180 | r = gpio_request_array(omap3_evm_dss_gpios, | 181 | r = gpio_request_one(OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW, |
181 | ARRAY_SIZE(omap3_evm_dss_gpios)); | 182 | "lcd_panel_envdd"); |
182 | if (r) | 183 | if (r) |
183 | printk(KERN_ERR "failed to get lcd_panel_* gpios\n"); | 184 | pr_err("failed to get lcd_panel_envdd GPIO\n"); |
184 | } | ||
185 | 185 | ||
186 | static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) | 186 | r = gpio_request_one(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, |
187 | { | 187 | GPIOF_OUT_INIT_LOW, "lcd_panel_bklight"); |
188 | if (dvi_enabled) { | 188 | if (r) |
189 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | 189 | pr_err("failed to get lcd_panel_bklight GPIO\n"); |
190 | return -EINVAL; | ||
191 | } | ||
192 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
193 | 190 | ||
194 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | 191 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
195 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | 192 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
196 | else | 193 | else |
197 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | 194 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
198 | |||
199 | lcd_enabled = 1; | ||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) | ||
204 | { | ||
205 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); | ||
206 | |||
207 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
208 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
209 | else | ||
210 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
211 | |||
212 | lcd_enabled = 0; | ||
213 | } | 195 | } |
214 | 196 | ||
215 | static struct omap_dss_device omap3_evm_lcd_device = { | 197 | static struct omap_dss_device omap3_evm_lcd_device = { |
@@ -217,26 +199,14 @@ static struct omap_dss_device omap3_evm_lcd_device = { | |||
217 | .driver_name = "sharp_ls_panel", | 199 | .driver_name = "sharp_ls_panel", |
218 | .type = OMAP_DISPLAY_TYPE_DPI, | 200 | .type = OMAP_DISPLAY_TYPE_DPI, |
219 | .phy.dpi.data_lines = 18, | 201 | .phy.dpi.data_lines = 18, |
220 | .platform_enable = omap3_evm_enable_lcd, | 202 | .data = &omap3_evm_lcd_data, |
221 | .platform_disable = omap3_evm_disable_lcd, | ||
222 | }; | 203 | }; |
223 | 204 | ||
224 | static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) | ||
225 | { | ||
226 | return 0; | ||
227 | } | ||
228 | |||
229 | static void omap3_evm_disable_tv(struct omap_dss_device *dssdev) | ||
230 | { | ||
231 | } | ||
232 | |||
233 | static struct omap_dss_device omap3_evm_tv_device = { | 205 | static struct omap_dss_device omap3_evm_tv_device = { |
234 | .name = "tv", | 206 | .name = "tv", |
235 | .driver_name = "venc", | 207 | .driver_name = "venc", |
236 | .type = OMAP_DISPLAY_TYPE_VENC, | 208 | .type = OMAP_DISPLAY_TYPE_VENC, |
237 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | 209 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, |
238 | .platform_enable = omap3_evm_enable_tv, | ||
239 | .platform_disable = omap3_evm_disable_tv, | ||
240 | }; | 210 | }; |
241 | 211 | ||
242 | static struct tfp410_platform_data dvi_panel = { | 212 | static struct tfp410_platform_data dvi_panel = { |
@@ -496,7 +466,7 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = { | |||
496 | static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = { | 466 | static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = { |
497 | REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */ | 467 | REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */ |
498 | REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */ | 468 | REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */ |
499 | REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"), | 469 | REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"), /* hsusb port 2 */ |
500 | REGULATOR_SUPPLY("vaux2", NULL), | 470 | REGULATOR_SUPPLY("vaux2", NULL), |
501 | }; | 471 | }; |
502 | 472 | ||
@@ -539,17 +509,16 @@ static int __init omap3_evm_i2c_init(void) | |||
539 | return 0; | 509 | return 0; |
540 | } | 510 | } |
541 | 511 | ||
542 | static struct usbhs_omap_platform_data usbhs_bdata __initdata = { | 512 | static struct usbhs_phy_data phy_data[] __initdata = { |
513 | { | ||
514 | .port = 2, | ||
515 | .reset_gpio = -1, /* set at runtime */ | ||
516 | .vcc_gpio = -EINVAL, | ||
517 | }, | ||
518 | }; | ||
543 | 519 | ||
544 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, | 520 | static struct usbhs_omap_platform_data usbhs_bdata __initdata = { |
545 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, | 521 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
546 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, | ||
547 | |||
548 | .phy_reset = true, | ||
549 | /* PHY reset GPIO will be runtime programmed based on EVM version */ | ||
550 | .reset_gpio_port[0] = -EINVAL, | ||
551 | .reset_gpio_port[1] = -EINVAL, | ||
552 | .reset_gpio_port[2] = -EINVAL | ||
553 | }; | 522 | }; |
554 | 523 | ||
555 | #ifdef CONFIG_OMAP_MUX | 524 | #ifdef CONFIG_OMAP_MUX |
@@ -725,7 +694,7 @@ static void __init omap3_evm_init(void) | |||
725 | 694 | ||
726 | /* setup EHCI phy reset config */ | 695 | /* setup EHCI phy reset config */ |
727 | omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); | 696 | omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); |
728 | usbhs_bdata.reset_gpio_port[1] = 21; | 697 | phy_data[0].reset_gpio = 21; |
729 | 698 | ||
730 | /* EVM REV >= E can supply 500mA with EXTVBUS programming */ | 699 | /* EVM REV >= E can supply 500mA with EXTVBUS programming */ |
731 | musb_board_data.power = 500; | 700 | musb_board_data.power = 500; |
@@ -733,10 +702,12 @@ static void __init omap3_evm_init(void) | |||
733 | } else { | 702 | } else { |
734 | /* setup EHCI phy reset on MDC */ | 703 | /* setup EHCI phy reset on MDC */ |
735 | omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); | 704 | omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); |
736 | usbhs_bdata.reset_gpio_port[1] = 135; | 705 | phy_data[0].reset_gpio = 135; |
737 | } | 706 | } |
738 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); | 707 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); |
739 | usb_musb_init(&musb_board_data); | 708 | usb_musb_init(&musb_board_data); |
709 | |||
710 | usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); | ||
740 | usbhs_init(&usbhs_bdata); | 711 | usbhs_init(&usbhs_bdata); |
741 | board_nand_init(omap3evm_nand_partitions, | 712 | board_nand_init(omap3evm_nand_partitions, |
742 | ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS, | 713 | ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS, |