diff options
author | Vishal Mahaveer <vishalm@ti.com> | 2011-07-05 06:38:23 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-07-05 06:38:23 -0400 |
commit | 6de8bae86c0459a881cead6735cd6971334cadd3 (patch) | |
tree | 082726ae4578ed93fcf02832be83bb724149b07a /arch | |
parent | 27a69d709e63efc23df18cc411fa341749de750e (diff) |
omap: blaze: add mmc5/wl1283 device support
Add MMC5 support on BLAZE, which has the wl1283 device hardwired to.
The wl1283 is a 4-wire, 1.8V, embedded SDIO WLAN device with an external IRQ line,
and power-controlled by a GPIO-based fixed regulator.
Based on the patch for zoom by Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
[tony@atomide.com: improved formatting a bit]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 5e03ddb0eb17..e5e8bbb00359 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/i2c/twl.h> | 22 | #include <linux/i2c/twl.h> |
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/regulator/fixed.h> | ||
25 | #include <linux/leds.h> | 26 | #include <linux/leds.h> |
26 | #include <linux/leds_pwm.h> | 27 | #include <linux/leds_pwm.h> |
27 | 28 | ||
@@ -37,6 +38,7 @@ | |||
37 | #include <plat/mmc.h> | 38 | #include <plat/mmc.h> |
38 | #include <plat/omap4-keypad.h> | 39 | #include <plat/omap4-keypad.h> |
39 | #include <video/omapdss.h> | 40 | #include <video/omapdss.h> |
41 | #include <linux/wl12xx.h> | ||
40 | 42 | ||
41 | #include "mux.h" | 43 | #include "mux.h" |
42 | #include "hsmmc.h" | 44 | #include "hsmmc.h" |
@@ -51,6 +53,9 @@ | |||
51 | #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ | 53 | #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ |
52 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ | 54 | #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ |
53 | 55 | ||
56 | #define GPIO_WIFI_PMENA 54 | ||
57 | #define GPIO_WIFI_IRQ 53 | ||
58 | |||
54 | static const int sdp4430_keymap[] = { | 59 | static const int sdp4430_keymap[] = { |
55 | KEY(0, 0, KEY_E), | 60 | KEY(0, 0, KEY_E), |
56 | KEY(0, 1, KEY_R), | 61 | KEY(0, 1, KEY_R), |
@@ -326,6 +331,14 @@ static struct omap2_hsmmc_info mmc[] = { | |||
326 | .gpio_cd = -EINVAL, | 331 | .gpio_cd = -EINVAL, |
327 | .gpio_wp = -EINVAL, | 332 | .gpio_wp = -EINVAL, |
328 | }, | 333 | }, |
334 | { | ||
335 | .mmc = 5, | ||
336 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, | ||
337 | .gpio_cd = -EINVAL, | ||
338 | .gpio_wp = -EINVAL, | ||
339 | .ocr_mask = MMC_VDD_165_195, | ||
340 | .nonremovable = true, | ||
341 | }, | ||
329 | {} /* Terminator */ | 342 | {} /* Terminator */ |
330 | }; | 343 | }; |
331 | 344 | ||
@@ -337,6 +350,37 @@ static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | |||
337 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | 350 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), |
338 | }; | 351 | }; |
339 | 352 | ||
353 | static struct regulator_consumer_supply omap4_sdp4430_vmmc5_supply = { | ||
354 | .supply = "vmmc", | ||
355 | .dev_name = "omap_hsmmc.4", | ||
356 | }; | ||
357 | |||
358 | static struct regulator_init_data sdp4430_vmmc5 = { | ||
359 | .constraints = { | ||
360 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
361 | }, | ||
362 | .num_consumer_supplies = 1, | ||
363 | .consumer_supplies = &omap4_sdp4430_vmmc5_supply, | ||
364 | }; | ||
365 | |||
366 | static struct fixed_voltage_config sdp4430_vwlan = { | ||
367 | .supply_name = "vwl1271", | ||
368 | .microvolts = 1800000, /* 1.8V */ | ||
369 | .gpio = GPIO_WIFI_PMENA, | ||
370 | .startup_delay = 70000, /* 70msec */ | ||
371 | .enable_high = 1, | ||
372 | .enabled_at_boot = 0, | ||
373 | .init_data = &sdp4430_vmmc5, | ||
374 | }; | ||
375 | |||
376 | static struct platform_device omap_vwlan_device = { | ||
377 | .name = "reg-fixed-voltage", | ||
378 | .id = 1, | ||
379 | .dev = { | ||
380 | .platform_data = &sdp4430_vwlan, | ||
381 | }, | ||
382 | }; | ||
383 | |||
340 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | 384 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
341 | { | 385 | { |
342 | int ret = 0; | 386 | int ret = 0; |
@@ -511,6 +555,7 @@ static struct regulator_init_data sdp4430_vusb = { | |||
511 | static struct regulator_init_data sdp4430_clk32kg = { | 555 | static struct regulator_init_data sdp4430_clk32kg = { |
512 | .constraints = { | 556 | .constraints = { |
513 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | 557 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
558 | .always_on = true, | ||
514 | }, | 559 | }, |
515 | }; | 560 | }; |
516 | 561 | ||
@@ -715,6 +760,41 @@ static inline void board_serial_init(void) | |||
715 | } | 760 | } |
716 | #endif | 761 | #endif |
717 | 762 | ||
763 | static void omap4_sdp4430_wifi_mux_init(void) | ||
764 | { | ||
765 | omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT | | ||
766 | OMAP_PIN_OFF_WAKEUPENABLE); | ||
767 | omap_mux_init_gpio(GPIO_WIFI_PMENA, OMAP_PIN_OUTPUT); | ||
768 | |||
769 | omap_mux_init_signal("sdmmc5_cmd.sdmmc5_cmd", | ||
770 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
771 | omap_mux_init_signal("sdmmc5_clk.sdmmc5_clk", | ||
772 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
773 | omap_mux_init_signal("sdmmc5_dat0.sdmmc5_dat0", | ||
774 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
775 | omap_mux_init_signal("sdmmc5_dat1.sdmmc5_dat1", | ||
776 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
777 | omap_mux_init_signal("sdmmc5_dat2.sdmmc5_dat2", | ||
778 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
779 | omap_mux_init_signal("sdmmc5_dat3.sdmmc5_dat3", | ||
780 | OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP); | ||
781 | |||
782 | } | ||
783 | |||
784 | static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata = { | ||
785 | .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ), | ||
786 | .board_ref_clock = WL12XX_REFCLOCK_26, | ||
787 | .board_tcxo_clock = WL12XX_TCXOCLOCK_26, | ||
788 | }; | ||
789 | |||
790 | static void omap4_sdp4430_wifi_init(void) | ||
791 | { | ||
792 | omap4_sdp4430_wifi_mux_init(); | ||
793 | if (wl12xx_set_platform_data(&omap4_sdp4430_wlan_data)) | ||
794 | pr_err("Error setting wl12xx data\n"); | ||
795 | platform_device_register(&omap_vwlan_device); | ||
796 | } | ||
797 | |||
718 | static void __init omap_4430sdp_init(void) | 798 | static void __init omap_4430sdp_init(void) |
719 | { | 799 | { |
720 | int status; | 800 | int status; |
@@ -731,6 +811,7 @@ static void __init omap_4430sdp_init(void) | |||
731 | omap_sfh7741prox_init(); | 811 | omap_sfh7741prox_init(); |
732 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 812 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
733 | board_serial_init(); | 813 | board_serial_init(); |
814 | omap4_sdp4430_wifi_init(); | ||
734 | omap4_twl6030_hsmmc_init(mmc); | 815 | omap4_twl6030_hsmmc_init(mmc); |
735 | 816 | ||
736 | usb_musb_init(&musb_board_data); | 817 | usb_musb_init(&musb_board_data); |