diff options
author | Steve Lin <stlin@nvidia.com> | 2011-08-03 15:05:55 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:48:02 -0800 |
commit | d4232240226a76b9e97b5695618d0bb075e8398a (patch) | |
tree | c6e0746550cee34b4dce1dcb90e717be96798cd9 /arch/arm/mach-tegra/board-enterprise-baseband.c | |
parent | 40bf3bc730b8bd62db1a616bca41057693ed191d (diff) |
arm: tegra: baseband: add callback functions for null phy power off
Adding pre_phy_off and post_phy_off callback functions in null_phy_power_off
function. So that the modem handshaking GPIO is set to reflect the real phy
status.
Bug 856096
Bug 854339
Original-Change-Id: Ia39a84d3958b9dd078f93ab5be20387fb1ed9103
Reviewed-on: http://git-master/r/44840
Tested-by: Szming Lin <stlin@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: R77bcdb38dc78c01dd8dc517d28e3a45fd0237170
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-baseband.c')
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-baseband.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-baseband.c b/arch/arm/mach-tegra/board-enterprise-baseband.c index eefb230599ff..5d3b0c1e717a 100644 --- a/arch/arm/mach-tegra/board-enterprise-baseband.c +++ b/arch/arm/mach-tegra/board-enterprise-baseband.c @@ -70,16 +70,16 @@ static struct usb_device_id modem_list[] = { {}, }; -static int ph450_reset(void); -static int ph450_handshake(void); +static int ph450_phy_on(void); +static int ph450_phy_off(void); static struct ph450_priv ph450_priv; static struct tegra_ulpi_trimmer e1219_trimmer = { 10, 1, 1, 1 }; static struct tegra_ulpi_config ehci2_null_ulpi_phy_config = { .trimmer = &e1219_trimmer, - .preinit = NULL, - .postinit = ph450_handshake, + .post_phy_on = ph450_phy_on, + .pre_phy_off = ph450_phy_off, }; static struct tegra_ehci_platform_data ehci2_null_ulpi_platform_data = { @@ -170,10 +170,8 @@ static irqreturn_t mdm_start_thread(int irq, void *data) if (gpio_get_value(priv->restart_gpio)) { pr_info("BB_RST_OUT high\n"); - gpio_set_value(AP2MDM_ACK2, 1); } else { pr_info("BB_RST_OUT low\n"); - gpio_set_value(AP2MDM_ACK2, 0); } return IRQ_HANDLED; @@ -183,19 +181,15 @@ static irqreturn_t mdm_wake_thread(int irq, void *data) { struct ph450_priv *priv = (struct ph450_priv *)data; - if (gpio_get_value(priv->wake_gpio) == 0) { - pr_info("MDM2AP_ACK2 low\n"); - - mutex_lock(&priv->lock); - if (priv->udev) { - usb_lock_device(priv->udev); - pr_info("mdm wake (%u)\n", ++(priv->wake_cnt)); - if (usb_autopm_get_interface(priv->intf) == 0) - usb_autopm_put_interface_async(priv->intf); - usb_unlock_device(priv->udev); - } - mutex_unlock(&priv->lock); + mutex_lock(&priv->lock); + if (priv->udev) { + usb_lock_device(priv->udev); + pr_info("mdm wake (%u)\n", ++(priv->wake_cnt)); + if (usb_autopm_get_interface(priv->intf) == 0) + usb_autopm_put_interface_async(priv->intf); + usb_unlock_device(priv->udev); } + mutex_unlock(&priv->lock); return IRQ_HANDLED; } @@ -215,11 +209,19 @@ static int ph450_reset(void) return 0; } -static int ph450_handshake(void) +static int ph450_phy_on(void) { /* set AP2MDM_ACK2 low */ gpio_set_value(AP2MDM_ACK2, 0); + pr_info("%s\n", __func__); + return 0; +} +static int ph450_phy_off(void) +{ + /* set AP2MDM_ACK2 high */ + gpio_set_value(AP2MDM_ACK2, 1); + pr_info("%s\n", __func__); return 0; } @@ -290,8 +292,8 @@ static int __init ph450_init(void) gpio_direction_input(MDM2AP_ACK2); gpio_direction_input(BB_RST_OUT); - /* reset modem */ - ph450_reset(); + /* phy init */ + tegra_null_ulpi_init(); ph450_priv.wake_gpio = TEGRA_GPIO_PV0; ph450_priv.restart_gpio = TEGRA_GPIO_PV1; @@ -340,6 +342,9 @@ static int __init ph450_init(void) return ret; } + /* reset modem */ + ph450_reset(); + return 0; } @@ -353,7 +358,5 @@ int __init enterprise_modem_init(void) return ret; } - tegra_null_ulpi_init(); - return 0; } |