diff options
author | Colin Cross <ccross@android.com> | 2011-11-09 20:31:11 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-11-14 14:33:44 -0800 |
commit | 2f133aa052438526a1bf1f552a4dcfcac8c7bd6a (patch) | |
tree | 198050b3461d6b2bed278c18aeae502a1d339187 | |
parent | c2d6cadd8bbe9221ca8c9f0d3039326b0f2b336a (diff) | |
download | kernel_samsung_tuna-2f133aa052438526a1bf1f552a4dcfcac8c7bd6a.zip kernel_samsung_tuna-2f133aa052438526a1bf1f552a4dcfcac8c7bd6a.tar.gz kernel_samsung_tuna-2f133aa052438526a1bf1f552a4dcfcac8c7bd6a.tar.bz2 |
ARM: omap4: tuna: force uart on whenever the host wake gpio is set
The bluetooth host wake gpio is set whenever the chip has data
to send to the omap. Use the gpio to force the uart enabled.
Change-Id: I16a465798b2e85ae02422326f81f2646fd658280
Signed-off-by: Colin Cross <ccross@android.com>
-rw-r--r-- | arch/arm/mach-omap2/board-tuna-bluetooth.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/board-tuna-bluetooth.c b/arch/arm/mach-omap2/board-tuna-bluetooth.c index 8192b99..df75021 100644 --- a/arch/arm/mach-omap2/board-tuna-bluetooth.c +++ b/arch/arm/mach-omap2/board-tuna-bluetooth.c @@ -41,6 +41,7 @@ static struct rfkill *bt_rfkill; static struct regulator *clk32kaudio_reg; static bool bt_enabled; +static bool uart_enabled; struct bcm_bt_lpm { int wake; @@ -121,13 +122,19 @@ static void update_host_wake_locked(int host_wake) if (host_wake) { wake_lock(&bt_lpm.wake_lock); + if (!uart_enabled) + omap_uart_enable(2); } else { + if (uart_enabled) + omap_uart_disable(2); // Take a timed wakelock, so that upper layers can take it. // The chipset deasserts the hostwake lock, when there is no // more data to send. wake_lock_timeout(&bt_lpm.wake_lock, HZ/2); } + uart_enabled = host_wake; + } static irqreturn_t host_wake_isr(int irq, void *dev) @@ -135,9 +142,6 @@ static irqreturn_t host_wake_isr(int irq, void *dev) int host_wake; unsigned long flags; - /* wakeup uart by enabling the uart module */ - omap_uart_wake(2); - host_wake = gpio_get_value(BT_HOST_WAKE_GPIO); irq_set_irq_type(irq, host_wake ? IRQF_TRIGGER_LOW : IRQF_TRIGGER_HIGH); @@ -279,7 +283,16 @@ static int bcm4330_bluetooth_remove(struct platform_device *pdev) int bcm4430_bluetooth_suspend(struct platform_device *pdev, pm_message_t state) { int irq = gpio_to_irq(BT_HOST_WAKE_GPIO); + int host_wake; + disable_irq(irq); + host_wake = gpio_get_value(BT_HOST_WAKE_GPIO); + + if (host_wake) { + enable_irq(irq); + return -EBUSY; + } + return 0; } |