diff options
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-baseband.c')
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-baseband.c | 95 |
1 files changed, 8 insertions, 87 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-baseband.c b/arch/arm/mach-tegra/board-enterprise-baseband.c index 91f3d625dde1..3ad83ad4fe8a 100644 --- a/arch/arm/mach-tegra/board-enterprise-baseband.c +++ b/arch/arm/mach-tegra/board-enterprise-baseband.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-enterprise-baseband.c * - * Copyright (c) 2011, NVIDIA Corporation. + * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,10 +27,6 @@ #include <linux/err.h> #include <linux/wakelock.h> #include <linux/platform_data/tegra_usb.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <mach/pinmux.h> -#include <mach/usb_phy.h> #include <mach/tegra_usb_modem_power.h> #include "devices.h" #include "gpio-names.h" @@ -46,38 +42,23 @@ #define AP2MDM_ACK2 TEGRA_GPIO_PE2 #define MDM2AP_ACK2 TEGRA_GPIO_PV0 -/* ULPI GPIO */ -#define ULPI_STP TEGRA_GPIO_PY3 -#define ULPI_DIR TEGRA_GPIO_PY1 -#define ULPI_D0 TEGRA_GPIO_PO1 -#define ULPI_D1 TEGRA_GPIO_PO2 - 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"}, - {MDM2AP_ACK, GPIOF_IN, "MDM2AP_ACK"}, {AP2MDM_ACK2, GPIOF_OUT_INIT_HIGH, "AP2MDM ACK2"}, {AP2MDM_ACK, GPIOF_OUT_INIT_LOW, "AP2MDM ACK"}, - {ULPI_STP, GPIOF_IN, "ULPI_STP"}, - {ULPI_DIR, GPIOF_OUT_INIT_LOW, "ULPI_DIR"}, - {ULPI_D0, GPIOF_OUT_INIT_LOW, "ULPI_D0"}, - {ULPI_D1, GPIOF_OUT_INIT_LOW, "ULPI_D1"}, }; -static void baseband_phy_init(void); -static void baseband_phy_on(void); + +static void baseband_post_phy_on(void); static void baseband_pre_phy_off(void); -static void baseband_post_phy_off(void); -static bool ap2mdm_ack_gpio_off = false; static struct tegra_usb_phy_platform_ops ulpi_null_plat_ops = { - .init = baseband_phy_init, .pre_phy_off = baseband_pre_phy_off, - .post_phy_off = baseband_post_phy_off, - .post_phy_on = baseband_phy_on, + .post_phy_on = baseband_post_phy_on, }; static struct tegra_usb_platform_data tegra_ehci2_ulpi_null_pdata = { @@ -99,6 +80,7 @@ static struct tegra_usb_platform_data tegra_ehci2_ulpi_null_pdata = { .stpdirnxt_trimmer = 1, .dir_trimmer = 1, .clk = NULL, + .phy_restore_gpio = MDM2AP_ACK, }, .ops = &ulpi_null_plat_ops, }; @@ -124,77 +106,16 @@ static irqreturn_t mdm_start_thread(int irq, void *data) return IRQ_HANDLED; } -static void baseband_phy_init(void) +static void baseband_post_phy_on(void) { - 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__); + /* set AP2MDM_ACK2 low */ + gpio_set_value(AP2MDM_ACK2, 0); } -static inline void null_phy_set_tristate(bool enable) -{ - int tristate = (enable) ? TEGRA_TRI_TRISTATE : TEGRA_TRI_NORMAL; - - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA0, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA1, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA2, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA3, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA4, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA5, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA6, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DATA7, tristate); - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_NXT, tristate); - - if (enable) - tegra_pinmux_set_tristate(TEGRA_PINGROUP_ULPI_DIR, tristate); -} - - -static void baseband_post_phy_off(void) -{ - null_phy_set_tristate(true); -} - - static void baseband_pre_phy_off(void) { /* set AP2MDM_ACK2 high */ gpio_set_value(AP2MDM_ACK2, 1); - ap2mdm_ack_gpio_off = true; -} - -static void baseband_phy_on(void) -{ - if (ap2mdm_ack_gpio_off) { - - /* driving linestate using GPIO */ - gpio_set_value(ULPI_D0, 0); - gpio_set_value(ULPI_D1, 0); - - /* remove ULPI tristate */ - null_phy_set_tristate(false); - - gpio_set_value(AP2MDM_ACK2, 0); - - if (gpio_is_valid(MDM2AP_ACK2)) { - int retry = 20000; - while (retry) { - /* poll phy_restore_gpio high */ - if (gpio_get_value(MDM2AP_ACK2)) - break; - retry--; - } - - if (retry == 0) - pr_info("phy_restore_gpio timeout\n"); - } - ap2mdm_ack_gpio_off = false; - } } static void baseband_start(void) |