summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-harmony-power.c
diff options
context:
space:
mode:
authorPreetham Chandru <pchandru@nvidia.com>2011-11-29 17:53:13 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-08 16:54:46 +0530
commitb9acd4bb941790c9e654e031d9818b35e74b0256 (patch)
tree3f120570abcb5d73edfca274934892eb4067b715 /arch/arm/mach-tegra/board-harmony-power.c
parentd6f914ce0a6043b8fcbe642b826eeea3a4d3d4cf (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>
Diffstat (limited to 'arch/arm/mach-tegra/board-harmony-power.c')
-rw-r--r--arch/arm/mach-tegra/board-harmony-power.c107
1 files changed, 107 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c
index a8da38f53f27..9ebc04baee2f 100644
--- a/arch/arm/mach-tegra/board-harmony-power.c
+++ b/arch/arm/mach-tegra/board-harmony-power.c
@@ -20,6 +20,7 @@
#include <linux/gpio.h>
#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
#include <linux/mfd/tps6586x.h>
#include <linux/io.h>
@@ -90,6 +91,101 @@ static struct regulator_consumer_supply tps658621_ldo9_supply[] = {
REGULATOR_SUPPLY("avdd_amp", NULL),
};
+/* regulator supplies power to WWAN - by default disable */
+static struct regulator_consumer_supply vdd_1v5_consumer_supply[] = {
+ REGULATOR_SUPPLY("vdd_1v5", NULL),
+};
+
+static struct regulator_init_data vdd_1v5_initdata = {
+ .consumer_supplies = vdd_1v5_consumer_supply,
+ .num_consumer_supplies = 1,
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .always_on = 0,
+ },
+};
+
+static struct fixed_voltage_config vdd_1v5 = {
+ .supply_name = "vdd_1v5",
+ .microvolts = 1500000, /* Enable 1.5V */
+ .gpio = TPS_GPIO_EN_1V5, /* GPIO BASE+0 */
+ .startup_delay = 0,
+ .enable_high = 0,
+ .enabled_at_boot = 0,
+ .init_data = &vdd_1v5_initdata,
+};
+
+/* regulator supplies power to WLAN - enable here, to satisfy SDIO probing */
+static struct regulator_consumer_supply vdd_1v2_consumer_supply[] = {
+ REGULATOR_SUPPLY("vdd_1v2", NULL),
+};
+
+static struct regulator_init_data vdd_1v2_initdata = {
+ .consumer_supplies = vdd_1v2_consumer_supply,
+ .num_consumer_supplies = 1,
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .always_on = 1,
+ },
+};
+
+static struct fixed_voltage_config vdd_1v2 = {
+ .supply_name = "vdd_1v2",
+ .microvolts = 1200000, /* Enable 1.2V */
+ .gpio = TPS_GPIO_EN_1V2, /* GPIO BASE+1 */
+ .startup_delay = 0,
+ .enable_high = 1,
+ .enabled_at_boot = 1,
+ .init_data = &vdd_1v2_initdata,
+};
+
+/* regulator supplies power to PLL - enable here */
+static struct regulator_consumer_supply vdd_1v05_consumer_supply[] = {
+ REGULATOR_SUPPLY("vdd_1v05", NULL),
+};
+
+static struct regulator_init_data vdd_1v05_initdata = {
+ .consumer_supplies = vdd_1v05_consumer_supply,
+ .num_consumer_supplies = 1,
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .always_on = 1,
+ },
+};
+
+static struct fixed_voltage_config vdd_1v05 = {
+ .supply_name = "vdd_1v05",
+ .microvolts = 1050000, /* Enable 1.05V */
+ .gpio = TPS_GPIO_EN_1V05, /* BASE+2 */
+ .startup_delay = 0,
+ .enable_high = 1,
+ .enabled_at_boot = 0,
+ .init_data = &vdd_1v05_initdata,
+};
+
+/* mode pin for 1.05V regulator - enable here */
+static struct regulator_consumer_supply vdd_1v05_mode_consumer_supply[] = {
+ REGULATOR_SUPPLY("vdd_1v05_mode", NULL),
+};
+
+static struct regulator_init_data vdd_1v05_mode_initdata = {
+ .consumer_supplies = vdd_1v05_mode_consumer_supply,
+ .num_consumer_supplies = 1,
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .always_on = 1,
+ },
+};
+
+static struct fixed_voltage_config vdd_1v05_mode = {
+ .supply_name = "vdd_1v05_mode",
+ .microvolts = 1050000, /* Enable 1.05V */
+ .gpio = TPS_GPIO_MODE_1V05, /* BASE+3 */
+ .startup_delay = 0,
+ .enable_high = 1,
+ .enabled_at_boot = 0,
+ .init_data = &vdd_1v05_mode_initdata,
+};
#define REGULATOR_INIT(_id, _minmv, _maxmv) \
{ \
@@ -131,6 +227,13 @@ static struct tps6586x_rtc_platform_data rtc_data = {
.platform_data = _data, \
}
+#define TPS_GPIO_FIXED_REG(_id, _data) \
+ { \
+ .id = _id, \
+ .name = "reg-fixed-voltage", \
+ .platform_data = _data, \
+ }
+
static struct tps6586x_subdev_info tps_devs[] = {
TPS_REG(SM_0, &sm0_data),
TPS_REG(SM_1, &sm1_data),
@@ -145,6 +248,10 @@ static struct tps6586x_subdev_info tps_devs[] = {
TPS_REG(LDO_7, &ldo7_data),
TPS_REG(LDO_8, &ldo8_data),
TPS_REG(LDO_9, &ldo9_data),
+ TPS_GPIO_FIXED_REG(0, &vdd_1v5),
+ TPS_GPIO_FIXED_REG(1, &vdd_1v2),
+ TPS_GPIO_FIXED_REG(2, &vdd_1v05),
+ TPS_GPIO_FIXED_REG(3, &vdd_1v05_mode),
{
.id = 0,
.name = "tps6586x-rtc",