diff options
author | Eric Nelson <eric.nelson@boundarydevices.com> | 2012-08-30 09:37:23 -0700 |
---|---|---|
committer | Eric Nelson <eric.nelson@boundarydevices.com> | 2012-08-31 18:06:47 -0700 |
commit | 769f6121b7fc09d64e3ee2e63383307e2b3fe0e7 (patch) | |
tree | a9b2766d8a13249744401ef3c9ea0ee11dc53914 /arch/arm | |
parent | 0384012123e34bed1d5a51e4592cae2e6a740a80 (diff) |
i.MX6: mx6q_sabre_lite: add wl1271 interface on ESDHC2
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_sabrelite.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_sabrelite.c b/arch/arm/mach-mx6/board-mx6q_sabrelite.c index 36d15e7e8034..7903e8ddde8c 100644 --- a/arch/arm/mach-mx6/board-mx6q_sabrelite.c +++ b/arch/arm/mach-mx6/board-mx6q_sabrelite.c @@ -63,6 +63,7 @@ #include <mach/mxc_hdmi.h> #include <mach/mxc_asrc.h> #include <linux/i2c/tsc2007.h> +#include <linux/wl12xx.h> #include <asm/irq.h> #include <asm/setup.h> @@ -328,6 +329,7 @@ static iomux_v3_cfg_t mx6q_sabrelite_pads[] = { NEW_PAD_CTRL(MX6Q_PAD_NANDF_CS1__GPIO_6_14, MX6Q_SABRELITE_WL_IRQ_PADCFG), /* wl1271 wl_irq */ NEW_PAD_CTRL(MX6Q_PAD_NANDF_CS2__GPIO_6_15, MX6Q_SABRELITE_WL_EN_PADCFG), /* wl1271 wl_en */ NEW_PAD_CTRL(MX6Q_PAD_NANDF_CS3__GPIO_6_16, MX6Q_SABRELITE_WL_EN_PADCFG), /* wl1271 bt_en */ + MX6Q_PAD_SD1_CLK__OSC32K_32K_OUT, /* wl1271 clock */ /* UART3 for wl1271 */ MX6Q_PAD_EIM_D24__UART3_TXD, @@ -1068,6 +1070,23 @@ static void __init sabrelite_add_device_buttons(void) static void __init sabrelite_add_device_buttons(void) {} #endif +#ifdef CONFIG_WL12XX_PLATFORM_DATA +static void wl1271_set_power(bool enable) +{ + if (0 == enable) { + gpio_set_value(N6_WL1271_WL_EN, 0); /* momentarily disable */ + mdelay(2); + gpio_set_value(N6_WL1271_WL_EN, 1); + } +} + +struct wl12xx_platform_data n6q_wlan_data __initdata = { + .irq = gpio_to_irq(N6_WL1271_WL_IRQ), + .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */ + .set_power = wl1271_set_power, +}; +#endif + static struct regulator_consumer_supply sabrelite_vmmc_consumers[] = { REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.2"), REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.3"), @@ -1383,6 +1402,25 @@ static void __init mx6_sabrelite_board_init(void) clk_enable(clko2); imx6q_add_busfreq(); +#ifdef CONFIG_WL12XX_PLATFORM_DATA + if (isn6) { + imx6q_add_sdhci_usdhc_imx(1, &mx6q_sabrelite_sd2_data); + /* WL12xx WLAN Init */ + if (wl12xx_set_platform_data(&n6q_wlan_data)) + pr_err("error setting wl12xx data\n"); + + gpio_set_value(N6_WL1271_WL_EN, 1); /* momentarily enable */ + gpio_set_value(N6_WL1271_BT_EN, 1); + mdelay(2); + gpio_set_value(N6_WL1271_WL_EN, 0); + gpio_set_value(N6_WL1271_BT_EN, 0); + + gpio_free(N6_WL1271_WL_EN); + gpio_free(N6_WL1271_BT_EN); + mdelay(1); + } +#endif + imx6q_add_pcie(&pcie_data); imx6q_add_perfmon(0); |