summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Lin <stlin@nvidia.com>2011-10-17 17:07:54 -0700
committerRyan Wong <ryanw@nvidia.com>2011-10-19 17:11:00 -0700
commit870304b1c34477ab0157d664d09efcae5920a108 (patch)
tree468cecc440c4edfa949af530efd38187d8e9cac1
parente694acfd92427450476c98905a8b87816edaec96 (diff)
arm: tegra: baseband: Adding phy restore callback functions
Adding phy restore callback functions due to the modem handshaking change during LP0 resume. Bug 863224 Reviewed-on: http://git-master/r/58516 (cherry picked from commit e718eac448660ec8844d9f97e8c307d845f6063a) Change-Id: I58af3da0951248448781da3409d392722d2e6a38 Reviewed-on: http://git-master/r/59201 Reviewed-by: Ryan Wong <ryanw@nvidia.com> Tested-by: Ryan Wong <ryanw@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-enterprise-baseband.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-baseband.c b/arch/arm/mach-tegra/board-enterprise-baseband.c
index 3f1b3cfbfcef..145396bea5ba 100644
--- a/arch/arm/mach-tegra/board-enterprise-baseband.c
+++ b/arch/arm/mach-tegra/board-enterprise-baseband.c
@@ -52,11 +52,15 @@ static struct gpio modem_gpios[] = {
{MODEM_PWR_ON, GPIOF_OUT_INIT_LOW, "MODEM PWR ON"},
{MODEM_RESET, GPIOF_IN, "MODEM RESET"},
{BB_RST_OUT, GPIOF_IN, "BB RST OUT"},
+ {MDM2AP_ACK, GPIOF_IN, "MDM2AP_ACK"},
{AP2MDM_ACK2, GPIOF_OUT_INIT_HIGH, "AP2MDM ACK2"},
+ {AP2MDM_ACK, GPIOF_OUT_INIT_LOW, "AP2MDM ACK"},
};
static int baseband_phy_on(void);
static int baseband_phy_off(void);
+static void baseband_phy_restore_start(void);
+static void baseband_phy_restore_end(void);
static struct tegra_ulpi_trimmer e1219_trimmer = { 10, 1, 1, 1 };
@@ -64,11 +68,13 @@ static struct tegra_ulpi_config ehci2_null_ulpi_phy_config = {
.trimmer = &e1219_trimmer,
.post_phy_on = baseband_phy_on,
.pre_phy_off = baseband_phy_off,
+ .phy_restore_start = baseband_phy_restore_start,
+ .phy_restore_end = baseband_phy_restore_end,
};
static struct tegra_ehci_platform_data ehci2_null_ulpi_platform_data = {
.operating_mode = TEGRA_USB_HOST,
- .power_down_on_bus_suspend = 0,
+ .power_down_on_bus_suspend = 1,
.phy_config = &ehci2_null_ulpi_phy_config,
.phy_type = TEGRA_USB_PHY_TYPE_NULL_ULPI,
};
@@ -95,20 +101,35 @@ static irqreturn_t mdm_start_thread(int irq, void *data)
static int baseband_phy_on(void)
{
- /* set AP2MDM_ACK2 low */
- gpio_set_value(AP2MDM_ACK2, 0);
+ static bool phy_init = false;
+
+ if (!phy_init) {
+ /* set AP2MDM_ACK2 low */
+ gpio_set_value(AP2MDM_ACK2, 0);
+ phy_init = true;
+ }
pr_info("%s\n", __func__);
return 0;
}
static int baseband_phy_off(void)
{
- /* set AP2MDM_ACK2 high */
- gpio_set_value(AP2MDM_ACK2, 1);
pr_info("%s\n", __func__);
return 0;
}
+static void baseband_phy_restore_start(void)
+{
+ /* set AP2MDM_ACK2 high */
+ gpio_set_value(AP2MDM_ACK2, 1);
+}
+
+static void baseband_phy_restore_end(void)
+{
+ /* set AP2MDM_ACK2 low */
+ gpio_set_value(AP2MDM_ACK2, 0);
+}
+
static void baseband_start(void)
{
/*
@@ -149,6 +170,7 @@ static int baseband_init(void)
tegra_gpio_enable(MODEM_RESET);
tegra_gpio_enable(AP2MDM_ACK2);
tegra_gpio_enable(BB_RST_OUT);
+ tegra_gpio_enable(AP2MDM_ACK);
/* export GPIO for user space access through sysfs */
gpio_export(MODEM_PWR_ON, false);