diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 80 |
1 files changed, 72 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index df5a425a49d1..a70bdf28e2bc 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/gpio_keys.h> | 23 | #include <linux/gpio_keys.h> |
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/leds.h> | 25 | #include <linux/leds.h> |
26 | #include <linux/leds_pwm.h> | ||
26 | 27 | ||
27 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
28 | #include <mach/omap4-common.h> | 29 | #include <mach/omap4-common.h> |
@@ -35,6 +36,7 @@ | |||
35 | #include <plat/usb.h> | 36 | #include <plat/usb.h> |
36 | #include <plat/mmc.h> | 37 | #include <plat/mmc.h> |
37 | 38 | ||
39 | #include "mux.h" | ||
38 | #include "hsmmc.h" | 40 | #include "hsmmc.h" |
39 | #include "timer-gp.h" | 41 | #include "timer-gp.h" |
40 | #include "control.h" | 42 | #include "control.h" |
@@ -42,6 +44,7 @@ | |||
42 | #define ETH_KS8851_IRQ 34 | 44 | #define ETH_KS8851_IRQ 34 |
43 | #define ETH_KS8851_POWER_ON 48 | 45 | #define ETH_KS8851_POWER_ON 48 |
44 | #define ETH_KS8851_QUART 138 | 46 | #define ETH_KS8851_QUART 138 |
47 | #define OMAP4SDP_MDM_PWR_EN_GPIO 157 | ||
45 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 | 48 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 |
46 | #define OMAP4_SFH7741_ENABLE_GPIO 188 | 49 | #define OMAP4_SFH7741_ENABLE_GPIO 188 |
47 | 50 | ||
@@ -96,6 +99,28 @@ static struct gpio_led_platform_data sdp4430_led_data = { | |||
96 | .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), | 99 | .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), |
97 | }; | 100 | }; |
98 | 101 | ||
102 | static struct led_pwm sdp4430_pwm_leds[] = { | ||
103 | { | ||
104 | .name = "omap4:green:chrg", | ||
105 | .pwm_id = 1, | ||
106 | .max_brightness = 255, | ||
107 | .pwm_period_ns = 7812500, | ||
108 | }, | ||
109 | }; | ||
110 | |||
111 | static struct led_pwm_platform_data sdp4430_pwm_data = { | ||
112 | .num_leds = ARRAY_SIZE(sdp4430_pwm_leds), | ||
113 | .leds = sdp4430_pwm_leds, | ||
114 | }; | ||
115 | |||
116 | static struct platform_device sdp4430_leds_pwm = { | ||
117 | .name = "leds_pwm", | ||
118 | .id = -1, | ||
119 | .dev = { | ||
120 | .platform_data = &sdp4430_pwm_data, | ||
121 | }, | ||
122 | }; | ||
123 | |||
99 | static int omap_prox_activate(struct device *dev) | 124 | static int omap_prox_activate(struct device *dev) |
100 | { | 125 | { |
101 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); | 126 | gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1); |
@@ -203,6 +228,7 @@ static struct platform_device *sdp4430_devices[] __initdata = { | |||
203 | &sdp4430_lcd_device, | 228 | &sdp4430_lcd_device, |
204 | &sdp4430_gpio_keys_device, | 229 | &sdp4430_gpio_keys_device, |
205 | &sdp4430_leds_gpio, | 230 | &sdp4430_leds_gpio, |
231 | &sdp4430_leds_pwm, | ||
206 | }; | 232 | }; |
207 | 233 | ||
208 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { | 234 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { |
@@ -217,20 +243,37 @@ static void __init omap_4430sdp_init_irq(void) | |||
217 | { | 243 | { |
218 | omap_board_config = sdp4430_config; | 244 | omap_board_config = sdp4430_config; |
219 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); | 245 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); |
220 | omap2_init_common_hw(NULL, NULL); | 246 | omap2_init_common_infrastructure(); |
247 | omap2_init_common_devices(NULL, NULL); | ||
221 | #ifdef CONFIG_OMAP_32K_TIMER | 248 | #ifdef CONFIG_OMAP_32K_TIMER |
222 | omap2_gp_clockevent_set_gptimer(1); | 249 | omap2_gp_clockevent_set_gptimer(1); |
223 | #endif | 250 | #endif |
224 | gic_init_irq(); | 251 | gic_init_irq(); |
225 | omap_gpio_init(); | ||
226 | } | 252 | } |
227 | 253 | ||
254 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | ||
255 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, | ||
256 | .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
257 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
258 | .phy_reset = false, | ||
259 | .reset_gpio_port[0] = -EINVAL, | ||
260 | .reset_gpio_port[1] = -EINVAL, | ||
261 | .reset_gpio_port[2] = -EINVAL, | ||
262 | }; | ||
263 | |||
228 | static struct omap_musb_board_data musb_board_data = { | 264 | static struct omap_musb_board_data musb_board_data = { |
229 | .interface_type = MUSB_INTERFACE_UTMI, | 265 | .interface_type = MUSB_INTERFACE_UTMI, |
230 | .mode = MUSB_PERIPHERAL, | 266 | .mode = MUSB_OTG, |
231 | .power = 100, | 267 | .power = 100, |
232 | }; | 268 | }; |
233 | 269 | ||
270 | static struct twl4030_usb_data omap4_usbphy_data = { | ||
271 | .phy_init = omap4430_phy_init, | ||
272 | .phy_exit = omap4430_phy_exit, | ||
273 | .phy_power = omap4430_phy_power, | ||
274 | .phy_set_clock = omap4430_phy_set_clk, | ||
275 | }; | ||
276 | |||
234 | static struct omap2_hsmmc_info mmc[] = { | 277 | static struct omap2_hsmmc_info mmc[] = { |
235 | { | 278 | { |
236 | .mmc = 1, | 279 | .mmc = 1, |
@@ -450,6 +493,7 @@ static struct twl4030_platform_data sdp4430_twldata = { | |||
450 | .vaux1 = &sdp4430_vaux1, | 493 | .vaux1 = &sdp4430_vaux1, |
451 | .vaux2 = &sdp4430_vaux2, | 494 | .vaux2 = &sdp4430_vaux2, |
452 | .vaux3 = &sdp4430_vaux3, | 495 | .vaux3 = &sdp4430_vaux3, |
496 | .usb = &omap4_usbphy_data | ||
453 | }; | 497 | }; |
454 | 498 | ||
455 | static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { | 499 | static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { |
@@ -464,6 +508,9 @@ static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { | |||
464 | { | 508 | { |
465 | I2C_BOARD_INFO("tmp105", 0x48), | 509 | I2C_BOARD_INFO("tmp105", 0x48), |
466 | }, | 510 | }, |
511 | { | ||
512 | I2C_BOARD_INFO("bh1780", 0x29), | ||
513 | }, | ||
467 | }; | 514 | }; |
468 | static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { | 515 | static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = { |
469 | { | 516 | { |
@@ -505,20 +552,37 @@ static void __init omap_sfh7741prox_init(void) | |||
505 | } | 552 | } |
506 | } | 553 | } |
507 | 554 | ||
555 | #ifdef CONFIG_OMAP_MUX | ||
556 | static struct omap_board_mux board_mux[] __initdata = { | ||
557 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
558 | }; | ||
559 | #else | ||
560 | #define board_mux NULL | ||
561 | #endif | ||
562 | |||
508 | static void __init omap_4430sdp_init(void) | 563 | static void __init omap_4430sdp_init(void) |
509 | { | 564 | { |
510 | int status; | 565 | int status; |
566 | int package = OMAP_PACKAGE_CBS; | ||
567 | |||
568 | if (omap_rev() == OMAP4430_REV_ES1_0) | ||
569 | package = OMAP_PACKAGE_CBL; | ||
570 | omap4_mux_init(board_mux, package); | ||
511 | 571 | ||
512 | omap4_i2c_init(); | 572 | omap4_i2c_init(); |
513 | omap_sfh7741prox_init(); | 573 | omap_sfh7741prox_init(); |
514 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 574 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
515 | omap_serial_init(); | 575 | omap_serial_init(); |
516 | omap4_twl6030_hsmmc_init(mmc); | 576 | omap4_twl6030_hsmmc_init(mmc); |
517 | /* OMAP4 SDP uses internal transceiver so register nop transceiver */ | 577 | |
518 | usb_nop_xceiv_register(); | 578 | /* Power on the ULPI PHY */ |
519 | /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ | 579 | if (gpio_is_valid(OMAP4SDP_MDM_PWR_EN_GPIO)) { |
520 | if (!cpu_is_omap44xx()) | 580 | /* FIXME: Assumes pad is already muxed for GPIO mode */ |
521 | usb_musb_init(&musb_board_data); | 581 | gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3"); |
582 | gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1); | ||
583 | } | ||
584 | usb_ehci_init(&ehci_pdata); | ||
585 | usb_musb_init(&musb_board_data); | ||
522 | 586 | ||
523 | status = omap_ethernet_init(); | 587 | status = omap_ethernet_init(); |
524 | if (status) { | 588 | if (status) { |