diff options
author | Jaikumar Ganesh <jaikumarg@android.com> | 2011-08-22 10:12:46 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumarg@android.com> | 2011-08-22 14:36:55 -0700 |
commit | f1a5e7f53e3a5de6c7519b5a12ac92e3553503ec (patch) | |
tree | 4abaf1225414929da7a4466b91de0199841d7da1 | |
parent | 4ac92a20d133da7b9c728f2b6760481ce7ef3acd (diff) | |
download | kernel_samsung_tuna-f1a5e7f53e3a5de6c7519b5a12ac92e3553503ec.zip kernel_samsung_tuna-f1a5e7f53e3a5de6c7519b5a12ac92e3553503ec.tar.gz kernel_samsung_tuna-f1a5e7f53e3a5de6c7519b5a12ac92e3553503ec.tar.bz2 |
OMAP4: tuna: Bluetooth: Add uart wake-peer function for wake up bluetooth.
Wake up BT-LPM for transaction using uart2 wake_peer function.
Change-Id: Ia2103b2cd82516fa40dd94b57ac29ddc9a15bd9e
Signed-off-by: jin <nayaksj.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-omap2/board-tuna-bluetooth.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-tuna.c | 16 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/board-tuna-bluetooth.h | 30 |
3 files changed, 47 insertions, 20 deletions
diff --git a/arch/arm/mach-omap2/board-tuna-bluetooth.c b/arch/arm/mach-omap2/board-tuna-bluetooth.c index cc36aa4..b69a94b 100644 --- a/arch/arm/mach-omap2/board-tuna-bluetooth.c +++ b/arch/arm/mach-omap2/board-tuna-bluetooth.c @@ -26,10 +26,10 @@ #include <linux/irq.h> #include <linux/rfkill.h> #include <linux/platform_device.h> -#include <linux/serial_core.h> #include <linux/wakelock.h> #include <asm/mach-types.h> #include <plat/serial.h> +#include <plat/board-tuna-bluetooth.h> #define BT_REG_GPIO 103 #define BT_RESET_GPIO 42 @@ -42,7 +42,6 @@ static struct rfkill *bt_rfkill; struct bcm_bt_lpm { int wake; int host_wake; - bool rx_wake_lock_taken; struct hrtimer enter_lpm_timer; ktime_t enter_lpm_delay; @@ -103,15 +102,6 @@ void bcm_bt_lpm_exit_lpm_locked(struct uart_port *uport) { } EXPORT_SYMBOL(bcm_bt_lpm_exit_lpm_locked); -void bcm_bt_rx_done_locked(struct uart_port *uport) { - if (bt_lpm.host_wake) { - // Release wake in 500 ms so that higher layers can take it. - wake_lock_timeout(&bt_lpm.wake_lock, HZ/2); - bt_lpm.rx_wake_lock_taken = true; - } -} -EXPORT_SYMBOL(bcm_bt_rx_done_locked); - static void update_host_wake_locked(int host_wake) { if (host_wake == bt_lpm.host_wake) @@ -120,12 +110,11 @@ static void update_host_wake_locked(int host_wake) bt_lpm.host_wake = host_wake; if (host_wake) { - bt_lpm.rx_wake_lock_taken = false; wake_lock(&bt_lpm.wake_lock); - } else if (!bt_lpm.rx_wake_lock_taken) { - // Failsafe timeout of wakelock. - // If the host wake pin is asserted and no data is sent, - // when its deasserted we will enter this path + } else { + // 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); } diff --git a/arch/arm/mach-omap2/board-tuna.c b/arch/arm/mach-omap2/board-tuna.c index c897169..12e4644 100644 --- a/arch/arm/mach-omap2/board-tuna.c +++ b/arch/arm/mach-omap2/board-tuna.c @@ -44,6 +44,8 @@ #include <asm/mach/arch.h> #include <asm/mach/map.h> +#include <plat/board-tuna-bluetooth.h> +#include <plat/omap-serial.h> #include <plat/board.h> #include <plat/common.h> #include <plat/cpu.h> @@ -759,10 +761,6 @@ static struct omap_device_pad tuna_uart2_pads[] __initdata = { }, }; -static struct omap_uart_port_info tuna_uart2_info __initdata = { - .rts_mux_driver_control = 1, -}; - static struct omap_device_pad tuna_uart3_pads[] __initdata = { { .name = "uart3_tx_irtx.uart3_tx_irtx", @@ -776,6 +774,16 @@ static struct omap_device_pad tuna_uart3_pads[] __initdata = { }, }; +static struct omap_uart_port_info tuna_uart2_info __initdata = { + .use_dma = 0, + .dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE, + .dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE, + .dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT, + .auto_sus_timeout = DEFAULT_AUTOSUSPEND_DELAY, + .wake_peer = bcm_bt_lpm_exit_lpm_locked, + .rts_mux_driver_control = 1, +}; + static inline void __init board_serial_init(void) { omap_serial_init_port_pads(0, tuna_uart1_pads, diff --git a/arch/arm/plat-omap/include/plat/board-tuna-bluetooth.h b/arch/arm/plat-omap/include/plat/board-tuna-bluetooth.h new file mode 100644 index 0000000..c74de05 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/board-tuna-bluetooth.h @@ -0,0 +1,30 @@ +/* + * Bluetooth Broadcomm and low power control via GPIO + * + * Copyright (C) 2011 Samsung, Inc. + * Copyright (C) 2011 Google, Inc. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __BOARD_TUNA_BLUETOOTH_H__ +#define __BOARD_TUNA_BLUETOOTH_H__ + +#include <linux/serial_core.h> + +extern void bcm_bt_lpm_exit_lpm_locked(struct uart_port *uport); + +#endif /* __BOARD_TUNA_BLUETOOTH_H__ */ |