summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-enterprise-baseband.c
diff options
context:
space:
mode:
authorSteve Lin <stlin@nvidia.com>2012-06-14 18:12:46 -0700
committerSimone Willett <swillett@nvidia.com>2012-06-27 17:28:52 -0700
commit025ead78f874daf44daaf5512c77f334ba6d339d (patch)
tree630bf389b1dacd9e41a4df5b0bf5a0ccebb12686 /arch/arm/mach-tegra/board-enterprise-baseband.c
parentbdf416ebd0dcca569fdac1bb4230177310534be0 (diff)
arm: tegra: baseband: add sysfs file for modem boot, etc.
1. Add sysfs file so the fild can load/unload host controller before modem power cycle. 2. Move modem boot irq to modem PM driver. 3. Add short autosuspend to optimize power consumption if the wake source of system resume is not modem. 4. Avoid LP0 abort if remote wakeup happens during L0/L2 -> L3 transition. 5. Fix deadlock in pm_notifier function. Bug 975990 Signed-off-by: Steve Lin <stlin@nvidia.com> Reviewed-on: http://git-master/r/109079 (cherry picked from commit 0b60aade303a022ff3335b4a238ba2dbae4da4b5) Change-Id: I9bcac40e2f93f95c702b42a2eb5e4e9aa7a9d721 Reviewed-on: http://git-master/r/103981 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Uday Raval <uraval@nvidia.com> Tested-by: Steve Lin <stlin@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Steve Lin <stlin@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-baseband.c')
-rw-r--r--arch/arm/mach-tegra/board-enterprise-baseband.c62
1 files changed, 8 insertions, 54 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-baseband.c b/arch/arm/mach-tegra/board-enterprise-baseband.c
index 3ad83ad4fe8a..c73a7ad5e5b4 100644
--- a/arch/arm/mach-tegra/board-enterprise-baseband.c
+++ b/arch/arm/mach-tegra/board-enterprise-baseband.c
@@ -22,10 +22,7 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/gpio.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
#include <linux/err.h>
-#include <linux/wakelock.h>
#include <linux/platform_data/tegra_usb.h>
#include <mach/tegra_usb_modem_power.h>
#include "devices.h"
@@ -36,23 +33,19 @@
#define MODEM_RESET TEGRA_GPIO_PE1
#define BB_RST_OUT TEGRA_GPIO_PV1
-/* Icera BB GPIO */
+/* Icera modem handshaking GPIO */
#define AP2MDM_ACK TEGRA_GPIO_PE3
#define MDM2AP_ACK TEGRA_GPIO_PU5
#define AP2MDM_ACK2 TEGRA_GPIO_PE2
#define MDM2AP_ACK2 TEGRA_GPIO_PV0
-static struct wake_lock mdm_wake_lock;
-
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"},
{AP2MDM_ACK2, GPIOF_OUT_INIT_HIGH, "AP2MDM ACK2"},
{AP2MDM_ACK, GPIOF_OUT_INIT_LOW, "AP2MDM ACK"},
};
-
static void baseband_post_phy_on(void);
static void baseband_pre_phy_off(void);
@@ -85,27 +78,6 @@ static struct tegra_usb_platform_data tegra_ehci2_ulpi_null_pdata = {
.ops = &ulpi_null_plat_ops,
};
-static int __init tegra_null_ulpi_init(void)
-{
- tegra_ehci2_device.dev.platform_data = &tegra_ehci2_ulpi_null_pdata;
- platform_device_register(&tegra_ehci2_device);
- return 0;
-}
-
-static irqreturn_t mdm_start_thread(int irq, void *data)
-{
- if (gpio_get_value(BB_RST_OUT)) {
- pr_info("BB_RST_OUT high\n");
- } else {
- pr_info("BB_RST_OUT low\n");
- }
-
- /* hold wait lock to complete the enumeration */
- wake_lock_timeout(&mdm_wake_lock, HZ * 10);
-
- return IRQ_HANDLED;
-}
-
static void baseband_post_phy_on(void)
{
/* set AP2MDM_ACK2 low */
@@ -139,7 +111,6 @@ static void baseband_reset(void)
static int baseband_init(void)
{
- int irq;
int ret;
ret = gpio_request_array(modem_gpios, ARRAY_SIZE(modem_gpios));
@@ -157,29 +128,6 @@ static int baseband_init(void)
/* export GPIO for user space access through sysfs */
gpio_export(MODEM_PWR_ON, false);
- /* phy init */
- tegra_null_ulpi_init();
-
- wake_lock_init(&mdm_wake_lock, WAKE_LOCK_SUSPEND, "mdm_lock");
-
- /* enable IRQ for BB_RST_OUT */
- irq = gpio_to_irq(BB_RST_OUT);
-
- ret = request_threaded_irq(irq, NULL, mdm_start_thread,
- IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
- "mdm_start", NULL);
- if (ret < 0) {
- pr_err("%s: request_threaded_irq error\n", __func__);
- return ret;
- }
-
- ret = enable_irq_wake(irq);
- if (ret) {
- pr_err("%s: enable_irq_wake error\n", __func__);
- free_irq(irq, NULL);
- return ret;
- }
-
return 0;
}
@@ -192,7 +140,13 @@ static const struct tegra_modem_operations baseband_operations = {
static struct tegra_usb_modem_power_platform_data baseband_pdata = {
.ops = &baseband_operations,
.wake_gpio = MDM2AP_ACK2,
- .flags = IRQF_TRIGGER_FALLING,
+ .wake_irq_flags = IRQF_TRIGGER_FALLING,
+ .boot_gpio = BB_RST_OUT,
+ .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ .autosuspend_delay = 2000,
+ .short_autosuspend_delay = 50,
+ .tegra_ehci_device = &tegra_ehci2_device,
+ .tegra_ehci_pdata = &tegra_ehci2_ulpi_null_pdata,
};
static struct platform_device icera_baseband_device = {