diff options
author | Preetham Chandru <pchandru@nvidia.com> | 2011-11-29 17:53:13 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-24 01:57:17 -0700 |
commit | 6d4d267b516c341e46b72b6f09d72aa74c5cf001 (patch) | |
tree | 449b16481a78b83891e12e9554d57d04612782fa /arch/arm/mach-tegra/board-harmony.c | |
parent | bbdb4167ba7c23f63110e2b07196273145e77132 (diff) |
tegra: harmony: wifi: add board support for WiFi
The SDIO WiFi module requires power from external PMU and 1.2V regulator.
The module gets powered on if - (1) all power sources are enabled, and
(2) power (down) and reset (down) pins are enabled as per spec.
To enable mmc/SDIO driver to detect the WiFi hardware, the WiFi chip has
to be powered-up before mmc driver does probing. So, steps should be as
following: (1) required regulators are on, (2) power/reset of WiFi are
enabled, (3) mmc does probing. Later time, when WiFi driver module is
loaded and registers with SDIO, the SDIO driver knows which H/W the driver
has to be associated with.
Bug: 908534
Change-Id: I6510bced5fa9b8b3314c00180f2694903b23145c
Reviewed-on: http://git-master/r/#change,47808,patchset=2
Signed-off-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-on: http://git-master/r/67121
Reviewed-by: Mursalin Akon <makon@nvidia.com>
Reviewed-by: Allen Martin <amartin@nvidia.com>
Rebase-Id: R2cfab6ffed6a810c57178a1387e74cb6ccf7258c
Diffstat (limited to 'arch/arm/mach-tegra/board-harmony.c')
-rw-r--r-- | arch/arm/mach-tegra/board-harmony.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c index f1be4a8f75a3..0addfcc6df54 100644 --- a/arch/arm/mach-tegra/board-harmony.c +++ b/arch/arm/mach-tegra/board-harmony.c @@ -31,6 +31,7 @@ #include <linux/i2c.h> #include <linux/i2c-tegra.h> #include <linux/memblock.h> +#include <linux/delay.h> #include <sound/wm8903.h> @@ -427,6 +428,41 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = { .is_8bit = 1, }; +static int __init harmony_wifi_init(void) +{ + int gpio_pwr, gpio_rst; + + if (!machine_is_harmony()) + return 0; + + /* WLAN - Power up (low) and Reset (low) */ + gpio_pwr = gpio_request(TEGRA_GPIO_WLAN_PWR_LOW, "wlan_pwr"); + gpio_rst = gpio_request(TEGRA_GPIO_WLAN_RST_LOW, "wlan_rst"); + if (gpio_pwr < 0 || gpio_rst < 0) + pr_warning("Unable to get gpio for WLAN Power and Reset\n"); + else { + + tegra_gpio_enable(TEGRA_GPIO_WLAN_PWR_LOW); + tegra_gpio_enable(TEGRA_GPIO_WLAN_RST_LOW); + /* toggle in this order as per spec */ + gpio_direction_output(TEGRA_GPIO_WLAN_PWR_LOW, 0); + gpio_direction_output(TEGRA_GPIO_WLAN_RST_LOW, 0); + udelay(5); + gpio_direction_output(TEGRA_GPIO_WLAN_PWR_LOW, 1); + gpio_direction_output(TEGRA_GPIO_WLAN_RST_LOW, 1); + } + + return 0; +} + +/* + * subsys_initcall_sync is good synch point to call harmony_wifi_init + * This makes sure that the required regulators (LDO3 + * supply of external PMU and 1.2V regulator) are properly enabled, + * and mmc driver has not yet probed for a device on SDIO bus. + */ +subsys_initcall_sync(harmony_wifi_init); + static void __init tegra_harmony_init(void) { tegra_clk_init_from_table(harmony_clk_init_table); |