Skip to contentSkip to conversation

Bluetooth: Add new serdev based driver for UART attached controllers

RFC New Marcel Holtmann 1 participant 1 message Mar 20, 2018 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

RFC v2 1/1 Bluetooth: Add new serdev based driver for UART attached controllers

This is a from scratch written driver to run H:4 on serdev based system with a Bluetooth controller attached via an UART. It is currently tested on RPi3 and it has Broadcom integration. It is DT only and is missing GPIO and runtime power management integration. Also Apple or ACPI support is currently not added.

To integrate with controllers from Intel and Qualcomm, similar handling like with btusb.c has to be done. A simple abstraction for that has been provided to make it similar to hci_uart.

The goal is to run individual drivers on serdev capable systems so that we can retire hci_uart on these system and continue with a lot simpler and easier to maintain driver. It seems that hci_uart has too many race conditions due to handling TTY and line disciplines. And fixes for that are not really related to serdev based drivers. In a serdev only world it makes sense to remove any of the complex code.

---
 drivers/bluetooth/Kconfig   |  11 +
 drivers/bluetooth/Makefile  |   1 +
 drivers/bluetooth/btuart.c  | 506 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/bluetooth/h4_recv.h | 158 ++++++++++++++
 4 files changed, 676 insertions(+)
 create mode 100644 drivers/bluetooth/btuart.c
 create mode 100644 drivers/bluetooth/h4_recv.h
drivers/bluetooth/Kconfig +11 -0
index 731ba229d5a3..1c9a2e990246 100644
@@ -74,6 +74,17 @@ config BT_HCIBTSDIO
 	  Say Y here to compile support for Bluetooth SDIO devices into the
 	  kernel or say M to compile it as module (btsdio).
 
+config BT_HCIBTUART
+	tristate "HCI UART driver"
+	depends on SERIAL_DEV_BUS
+	help
+	  Bluetooth HCI UART driver.
+	  This driver is required if you want to use Bluetooth device with
+	  UART interface.
+
+	  Say Y here to compile support for Bluetooth UART devices into the
+	  kernel or say M to compile it as module (btuart).
+
 config BT_HCIUART
 	tristate "HCI UART driver"
 	depends on SERIAL_DEV_BUS || !SERIAL_DEV_BUS
drivers/bluetooth/Makefile +1 -0
index e0c147129358..719a010853dd 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_BT_HCIBLUECARD)	+= bluecard_cs.o
 
 obj-$(CONFIG_BT_HCIBTUSB)	+= btusb.o
 obj-$(CONFIG_BT_HCIBTSDIO)	+= btsdio.o
+obj-$(CONFIG_BT_HCIBTUART)	+= btuart.o
 
 obj-$(CONFIG_BT_INTEL)		+= btintel.o
 obj-$(CONFIG_BT_ATH3K)		+= ath3k.o
drivers/bluetooth/btuart.c new file +506 -0

506 lines not on this page · raw message

drivers/bluetooth/h4_recv.h new file +158 -0

158 lines not on this page · raw message

Signature · 1 line
2.14.3