Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[sfrench/cifs-2.6.git] / arch / arm / mach-omap2 / board-zoom-peripherals.c
index 3c6530475710a890aaf47a5768d2bfa292030dd1..bc8232845d7ade22e219b4c4ddf01ef08acf24df 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/gpio.h>
 #include <linux/i2c/twl.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/wl12xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -29,6 +31,9 @@
 #include "mux.h"
 #include "hsmmc.h"
 
+#define OMAP_ZOOM_WLAN_PMENA_GPIO      (101)
+#define OMAP_ZOOM_WLAN_IRQ_GPIO                (162)
+
 /* Zoom2 has Qwerty keyboard*/
 static int board_keymap[] = {
        KEY(0, 0, KEY_E),
@@ -108,6 +113,11 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = {
        .supply         = "vmmc",
 };
 
+static struct regulator_consumer_supply zoom_vmmc3_supply = {
+       .supply         = "vmmc",
+       .dev_name       = "mmci-omap-hs.2",
+};
+
 /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
 static struct regulator_init_data zoom_vmmc1 = {
        .constraints = {
@@ -153,6 +163,38 @@ static struct regulator_init_data zoom_vsim = {
        .consumer_supplies      = &zoom_vsim_supply,
 };
 
+static struct regulator_init_data zoom_vmmc3 = {
+       .constraints = {
+               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = 1,
+       .consumer_supplies = &zoom_vmmc3_supply,
+};
+
+static struct fixed_voltage_config zoom_vwlan = {
+       .supply_name            = "vwl1271",
+       .microvolts             = 1800000, /* 1.8V */
+       .gpio                   = OMAP_ZOOM_WLAN_PMENA_GPIO,
+       .startup_delay          = 70000, /* 70msec */
+       .enable_high            = 1,
+       .enabled_at_boot        = 0,
+       .init_data              = &zoom_vmmc3,
+};
+
+static struct platform_device omap_vwlan_device = {
+       .name           = "reg-fixed-voltage",
+       .id             = 1,
+       .dev = {
+               .platform_data  = &zoom_vwlan,
+       },
+};
+
+struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
+       .irq = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
+       /* ZOOM ref clock is 26 MHz */
+       .board_ref_clock = 1,
+};
+
 static struct omap2_hsmmc_info mmc[] __initdata = {
        {
                .name           = "external",
@@ -170,6 +212,14 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
                .nonremovable   = true,
                .power_saving   = true,
        },
+       {
+               .name           = "wl1271",
+               .mmc            = 3,
+               .caps           = MMC_CAP_4_BIT_DATA,
+               .gpio_wp        = -EINVAL,
+               .gpio_cd        = -EINVAL,
+               .nonremovable   = true,
+       },
        {}      /* Terminator */
 };
 
@@ -291,7 +341,11 @@ static void enable_board_wakeup_source(void)
 
 void __init zoom_peripherals_init(void)
 {
+       if (wl12xx_set_platform_data(&omap_zoom_wlan_data))
+               pr_err("error setting wl12xx data\n");
+
        omap_i2c_init();
+       platform_device_register(&omap_vwlan_device);
        usb_musb_init(&musb_board_data);
        enable_board_wakeup_source();
 }