summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-enterprise-baseband.c
diff options
context:
space:
mode:
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 = {