Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f3cc422 authored by Rupesh Tatiya's avatar Rupesh Tatiya
Browse files

Bluetooth: add Qualcomm In-Band Sleep support to hci_uart



Add new HCIUART protocol HCIUART_IBS which enables the Bluetooth
device to enter a low power state when possible.  It also tells
the msm_serial_hs UART driver that it may go to a low-power state
even though the port is open.

This code was originally written by Mike Feldman in
project: kernel/msm branch: android-msm-2.6.29b
commit: 81fda6eb1b506a36bcdbbe77a59b6fe82c997568 (Bluetooth:
add Qualcomm In-Band Sleep support to hci_uart).

CRs-Fixed: 713897
Change-Id: I18207f076c9fb39c04275a8db2625a2d31bb0ae2
Git-commit: 81fda6eb1b506a36bcdbbe77a59b6fe82c997568
[ananthk@codeaurora.org: Resolved merge conflicts]
Signed-off-by: default avatarAnantha Krishnan <ananthk@codeaurora.org>
Signed-off-by: default avatarRupesh Tatiya <rtatiya@codeaurora.org>
parent f108fc85
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -94,6 +94,17 @@ config BT_HCIUART_3WIRE

	  Say Y here to compile support for Three-wire UART protocol.

config BT_HCIUART_IBS
	bool "HCI_IBS protocol support"
	depends on BT_HCIUART
	default n
	help
	  HCI_IBS (HCI In-Band Sleep) is a serial protocol for communication
	  between Bluetooth device and host. This protocol is required for
	  UART clock control for some Qualcomm Bluetooth devices.

	  Say Y here to compile support for HCI_IBS protocol.

config BT_HCIBCM203X
	tristate "HCI BCM203x USB driver"
	depends on USB
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o
hci_uart-$(CONFIG_BT_HCIUART_LL)	+= hci_ll.o
hci_uart-$(CONFIG_BT_HCIUART_ATH3K)	+= hci_ath.o
hci_uart-$(CONFIG_BT_HCIUART_3WIRE)	+= hci_h5.o
hci_uart-$(CONFIG_BT_HCIUART_IBS)	+= hci_ibs.o
hci_uart-objs				:= $(hci_uart-y)

ccflags-y += -D__CHECK_ENDIAN__
+816 −0

File added.

Preview size limit exceeded, changes collapsed.

+7 −1
Original line number Diff line number Diff line
@@ -2,9 +2,9 @@
 *
 *  Bluetooth HCI UART driver
 *
 *  Copyright (C) 2000-2001  Qualcomm Incorporated
 *  Copyright (C) 2002-2003  Maxim Krasnyansky <maxk@qualcomm.com>
 *  Copyright (C) 2004-2005  Marcel Holtmann <marcel@holtmann.org>
 *  Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
 *
 *
 *  This program is free software; you can redistribute it and/or modify
@@ -625,6 +625,9 @@ static int __init hci_uart_init(void)
#ifdef CONFIG_BT_HCIUART_3WIRE
	h5_init();
#endif
#ifdef CONFIG_BT_HCIUART_IBS
	ibs_init();
#endif

	return 0;
}
@@ -648,6 +651,9 @@ static void __exit hci_uart_exit(void)
#ifdef CONFIG_BT_HCIUART_3WIRE
	h5_deinit();
#endif
#ifdef CONFIG_BT_HCIUART_IBS
	ibs_deinit();
#endif

	/* Release tty registration of line discipline */
	err = tty_unregister_ldisc(N_HCI);
+7 −1
Original line number Diff line number Diff line
@@ -2,9 +2,9 @@
 *
 *  Bluetooth HCI UART driver
 *
 *  Copyright (C) 2000-2001  Qualcomm Incorporated
 *  Copyright (C) 2002-2003  Maxim Krasnyansky <maxk@qualcomm.com>
 *  Copyright (C) 2004-2005  Marcel Holtmann <marcel@holtmann.org>
 *  Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
 *
 *
 *  This program is free software; you can redistribute it and/or modify
@@ -43,6 +43,7 @@
#define HCI_UART_H4DS	3
#define HCI_UART_LL	4
#define HCI_UART_ATH3K	5
#define HCI_UART_IBS	6

#define HCI_UART_RAW_DEVICE	0
#define HCI_UART_RESET_ON_INIT	1
@@ -116,3 +117,8 @@ int ath_deinit(void);
int h5_init(void);
int h5_deinit(void);
#endif

#ifdef CONFIG_BT_HCIUART_IBS
int ibs_init(void);
int ibs_deinit(void);
#endif