add support for Bluetooth on MT7622 SoC
Subsystems (8)
[email protected]
maintainerv3 cover add support for Bluetooth on MT7622 SoC
From: Sean Wang <[email protected]>
v3 and changes since v2
* all changes happen on patch 6
- fix up SPDX license style for btmtkuart.h.
- change firmware download from in ACL data to in HCI commands and then remove unused mtk_acl_wmt_sync and related code.
- add a workaround replacing bad vendor event id 0xe4 with 0xff every vendor should use.
- add a sanity check for mtk_hci_wmt_sync to verifying if input parameters are valid.
- add an atomic_inc(&bdev->hdev->cmd_cnt) for __hci_cmd_sync_ev.
- be changed to use firmware with a header called mt7622pr2h.bin.
v2 and changes since v1
- Dropped patches already being applied
- Rewirte the whole driver using btuart [1], and add slight extension of btuart to fit into btmtkuart driver. Beware that [1] is also pulled into one part of the series for avoiding any breakage when the patchset is being compiled.
[1] btuart
https://www.spinics.net/lists/linux-bluetooth/msg74918.html
v1:
Hi,
This patchset introduces built-in Bluetooth support on MT7622 SoC. And, it should be simple to make an extension to support other MediaTek SoCs with adjusting a few of changes on the initialization sequence of the device.
Before the main driver is being introduced, a few of things about power-domain management should be re-worked for serdev core and MediaTek SCPSYS to allow the Bluetooth to properly power up.
Patch 2: add a generic way attaching power domain to serdev Patch 3 and 4: add cleanups with reuse APIs from Linux core Patch 5: fix a limitation about power enablement Bluetooth depends on Patch 1, 6 and 7: the major part of adding Bluetooth support to MT7622
Sean
Marcel Holtmann (1):
Bluetooth: Add new serdev based driver for UART attached controllers
Sean Wang (6):
dt-bindings: net: bluetooth: Add mediatek-bluetooth
serdev: add dev_pm_domain_attach|detach()
Bluetooth: Add new quirk for non-persistent setup settings
Bluetooth: Extend btuart driver for join more vendor devices
Bluetooth: mediatek: Add protocol support for MediaTek serial devices
MAINTAINERS: add an entry for MediaTek Bluetooth driver
.../devicetree/bindings/net/mediatek-bluetooth.txt | 35 ++ MAINTAINERS | 8 + drivers/bluetooth/Kconfig | 23 + drivers/bluetooth/Makefile | 3 + drivers/bluetooth/btmtkuart.c | 355 ++++++++++++++ drivers/bluetooth/btmtkuart.h | 119 +++++ drivers/bluetooth/btuart.c | 527 +++++++++++++++++++++ drivers/bluetooth/btuart.h | 30 ++ drivers/tty/serdev/core.c | 14 +- include/net/bluetooth/hci.h | 9 + net/bluetooth/hci_core.c | 3 +- 11 files changed, 1124 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/mediatek-bluetooth.txt create mode 100644 drivers/bluetooth/btmtkuart.c create mode 100644 drivers/bluetooth/btmtkuart.h create mode 100644 drivers/bluetooth/btuart.c create mode 100644 drivers/bluetooth/btuart.h
Signature · 1 line
2.7.4
[email protected]
maintainerPATCH v3 1/7 dt-bindings: net: bluetooth: Add mediatek-bluetooth
From: Sean Wang <[email protected]>
Add binding document for a SoC built-in device using MediaTek protocol. Which could be found on MT7622 SoC or other similar MediaTek SoCs.
--- .../devicetree/bindings/net/mediatek-bluetooth.txt | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/mediatek-bluetooth.txt
Documentation/devicetree/bindings/net/mediatek-bluetooth.txt new file +35 -0
@@ -0,0 +1,35 @@ +MediaTek SoC built-in Bluetooth Devices +================================== + +This device is a serial attached device to BTIF device and thus it must be a +child node of the serial node with BTIF. The dt-bindings details for BTIF +device can be known via Documentation/devicetree/bindings/serial/8250.txt. + +Required properties: + +- compatible: Must be one of + "mediatek,mt7622-bluetooth"": for MT7622 SoC +- clocks: Should be the clock specifiers corresponding to the entry in + clock-names property. +- clock-names: Should contain "ref" entries. +- power-domains: Phandle to the power domain that the device is part of + +Example: + + btif: serial at 1100c000 { + compatible = "mediatek,mt7622-btif", + "mediatek,mtk-btif"; + reg = <0 0x1100c000 0 0x1000>; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_LOW>; + clocks = <&pericfg CLK_PERI_BTIF_PD>; + clock-names = "main"; + reg-shift = <2>; + reg-io-width = <4>; + + bluetooth { + compatible = "mediatek,mt7622-bluetooth"; + power-domains = <&scpsys MT7622_POWER_DOMAIN_WB>; + clocks = <&clk25m>; + clock-names = "ref"; + }; + };
Signature · 1 line
2.7.4
[email protected]
maintainerPATCH v3 2/7 serdev: add dev_pm_domain_attach|detach()
In reply to [email protected]From: Sean Wang <[email protected]>
In order to open up the required power gate before any operation can be effectively performed over the serial bus between CPU and serdev, it's clearly essential to add common attach functions for PM domains to serdev at the probe phase.
Similarly, the relevant dettach function for the PM domains should be properly and reversely added at the remove phase.
--- drivers/tty/serdev/core.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/tty/serdev/core.c +13 -1
@@ -13,6 +13,7 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> +#include <linux/pm_domain.h> #include <linux/serdev.h> #include <linux/slab.h>
@@ -330,8 +331,16 @@ EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);static int serdev_drv_probe (struct device *dev) {const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver); +int ret; + + ret =dev_pm_domain_attach (dev, true); +if (ret != -EPROBE_DEFER ) { + ret = sdrv->probe (to_serdev_device (dev)); +if (ret) +dev_pm_domain_detach (dev, true); + } -return sdrv->probe (to_serdev_device (dev)); +return ret; }static int serdev_drv_remove (struct device *dev)
@@ -339,6 +348,9 @@ static int serdev_drv_remove(struct device *dev)const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver);if (sdrv->remove) sdrv->remove (to_serdev_device (dev)); + +dev_pm_domain_detach (dev, true); +return 0 ; }
Signature · 1 line
2.7.4
Re: [PATCH v3 2/7] serdev: add dev_pm_domain_attach|detach()
Quoted 42 lines · On Thu, 14 Jun 2018 at 09:14, <[email protected]> wrote:
From: Sean Wang <[email protected]>
In order to open up the required power gate before any operation can be effectively performed over the serial bus between CPU and serdev, it's clearly essential to add common attach functions for PM domains to serdev at the probe phase.
Similarly, the relevant dettach function for the PM domains should be properly and reversely added at the remove phase.
Signed-off-by Sean Wang <[email protected]>Cc Rob Herring <[email protected]>Cc Ulf Hansson <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Jiri Slaby <[email protected]>Cc linux-serial at vger.kernel.org--- drivers/tty/serdev/core.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)drivers/tty/serdev/core.c +5
-0@@ -13,6 +13,7 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> +#include <linux/pm_domain.h> #include <linux/serdev.h> #include <linux/slab.h> @@ -330,8 +331,16 @@ EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);static int serdev_drv_probe (struct device *dev) {const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver); +int ret; + + ret =dev_pm_domain_attach (dev, true); +if (ret != -EPROBE_DEFER ) {
Quoted 1 line
From 4.18 rc1 via commit
919b7308fcc4,dev_pm_domain_attach()will
return better error codes.
I suggest to change the above error path to:
if (ret)
return ret;
Then continue with the probing below.
Quoted 21 lines
drivers/tty/serdev/core.c +8
-2+ ret = sdrv->probe (to_serdev_device (dev)); +if (ret) +dev_pm_domain_detach (dev, true); + } -return sdrv->probe (to_serdev_device (dev)); +return ret; }static int serdev_drv_remove (struct device *dev)@@ -339,6 +348,9 @@ static int serdev_drv_remove(struct device *dev)const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver);if (sdrv->remove) sdrv->remove (to_serdev_device (dev)); + +dev_pm_domain_detach (dev, true); +return 0 ; } --
Quoted 2 lines
2.7.4
Otherwise, this makes sense to me!
Kind regards
Uffe
Sean Wang
maintainerRe: [PATCH v3 2/7] serdev: add dev_pm_domain_attach|detach()
Quoted 46 lines · Ulf Hansson
Quoted 34 lines · On Thu, 14 Jun 2018 at 09:14, <[email protected]> wrote:
From: Sean Wang <[email protected]>
In order to open up the required power gate before any operation can be effectively performed over the serial bus between CPU and serdev, it's clearly essential to add common attach functions for PM domains to serdev at the probe phase.
Similarly, the relevant dettach function for the PM domains should be properly and reversely added at the remove phase.
Signed-off-by Sean Wang <[email protected]>Cc Rob Herring <[email protected]>Cc Ulf Hansson <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Jiri Slaby <[email protected]>Cc linux-serial at vger.kernel.org--- drivers/tty/serdev/core.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)drivers/tty/serdev/core.c +1
-0@@ -13,6 +13,7 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> +#include <linux/pm_domain.h> #include <linux/serdev.h> #include <linux/slab.h> drivers/tty/serdev/core.c EXPORT_SYMBOL_GPL(serdev_device_set_tiocm); · line 337
Quoted 7 lines
drivers/tty/serdev/core.c +4
-0@@ -330,8 +331,16 @@ EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);static int serdev_drv_probe (struct device *dev) {const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver); +int ret; + + ret =dev_pm_domain_attach (dev, true); +if (ret != -EPROBE_DEFER ) {From 4.18 rc1 via commit
919b7308fcc4,dev_pm_domain_attach()will return better error codes.
Quoted 5 lines
I suggest to change the above error path to:
if (ret)return ret;Then continue with the probing below.
Thanks for sharing me the information. I'll happily respin using the patch because it makes the most sense.
Quoted 21 lines
Quoted 21 lines
drivers/tty/serdev/core.c +8
-1+ ret = sdrv->probe (to_serdev_device (dev)); +if (ret) +dev_pm_domain_detach (dev, true); + } -return sdrv->probe (to_serdev_device (dev)); +return ret; }static int serdev_drv_remove (struct device *dev)@@ -339,6 +348,9 @@ static int serdev_drv_remove(struct device *dev)const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver);if (sdrv->remove) sdrv->remove (to_serdev_device (dev)); + +dev_pm_domain_detach (dev, true); +return 0 ; }
Quoted 6 lines
Quoted 3 lines
--
2.7.4Otherwise, this makes sense to me!
really thanks for your review!
Quoted 2 lines
Kind regards
Uffe
[email protected]
maintainerPATCH v3 3/7 Bluetooth: Add new serdev based driver for UART attached controllers
In reply to [email protected]From: Marcel Holtmann <[email protected]>
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 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 518 insertions(+) create mode 100644 drivers/bluetooth/btuart.c
drivers/bluetooth/Kconfig +11 -0
@@ -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
@@ -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
Signature · 1 line
2.7.4
[email protected]
maintainerPATCH v3 4/7 Bluetooth: Add new quirk for non-persistent setup settings
In reply to [email protected]From: Sean Wang <[email protected]>
Add a new quirk HCI_QUIRK_NON_PERSISTENT_SETUP allowing that a quirk that runs setup() after every open() and not just after the first open().
--- include/net/bluetooth/hci.h | 9 +++++++++ net/bluetooth/hci_core.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-)
include/net/bluetooth/hci.h +9 -0
@@ -183,6 +183,15 @@ enum {* during the hdev->setup vendor callback. */ HCI_QUIRK_NON_PERSISTENT_DIAG , + +/* When this quirk is set, setup() would be run after every +* open() and not just after the first open(). +* +* This quirk can be set before hci_register_dev is called or +* during the hdev->setup vendor callback. +* +*/ + HCI_QUIRK_NON_PERSISTENT_SETUP, };/* HCI device flags */
net/bluetooth/hci_core.c +2 -1
@@ -1368,7 +1368,8 @@ static int hci_dev_do_open(struct hci_dev *hdev)atomic_set (&hdev->cmd_cnt,1 );set_bit (HCI_INIT , &hdev->flags); -if (hci_dev_test_flag (hdev,HCI_SETUP )) { +if (hci_dev_test_flag (hdev,HCI_SETUP ) || +test_bit (HCI_QUIRK_NON_PERSISTENT_SETUP , &hdev->quirks)) {hci_sock_dev_event (hdev,HCI_DEV_SETUP );if (hdev->setup)
Signature · 1 line
2.7.4
[email protected]
maintainerPATCH v3 5/7 Bluetooth: Extend btuart driver for join more vendor devices
In reply to [email protected]From: Sean Wang <[email protected]>
Adding an independent btuart.h header allows these essential definitions can be reused in vendor driver. Also, struct btuart_vnd is extended with additional callbacks such as .init initializing vendor data, .shtudown, .recv and .send supporting SoC specific framing for that btuart can simply adapt to various Bluetooth uart-based devices.
--- drivers/bluetooth/btuart.c | 73 ++++++++++++++++++++++++---------------------- drivers/bluetooth/btuart.h | 30 +++++++++++++++++++ 2 files changed, 68 insertions(+), 35 deletions(-) create mode 100644 drivers/bluetooth/btuart.h
drivers/bluetooth/btuart.c +38 -35
@@ -33,35 +33,11 @@#include <net/bluetooth/hci_core.h> #include "h4_recv.h" +#include "btuart.h" #include "btbcm.h" #define VERSION "1.0" -struct btuart_vnd { -const struct h4_recv_pkt *recv_pkts; -int recv_pkts_cnt; -unsigned int manufacturer; -int (*open)(struct hci_dev *hdev); -int (*close)(struct hci_dev *hdev); -int (*setup)(struct hci_dev *hdev); -}; - -struct btuart_dev { -struct hci_dev *hdev; -struct serdev_device *serdev; - -struct work_struct tx_work; -unsigned long tx_state; -struct sk_buff_head txq; - -struct sk_buff *rx_skb; - -const struct btuart_vnd *vnd; -}; - -#define BTUART_TX_STATE_ACTIVE 1 -#define BTUART_TX_STATE_WAKEUP 2 -static void btuart_tx_work (struct work_struct *work) { struct btuart_dev *bdev = container_of(work, struct btuart_dev,
@@ -187,13 +163,27 @@ static int btuart_setup(struct hci_dev *hdev)return 0 ; } +static int btuart_shutdown (struct hci_dev *hdev) +{ +struct btuart_dev *bdev =hci_get_drvdata (hdev); + +if (bdev->vnd->shutdown) +return bdev->vnd->shutdown (hdev); + +return 0 ; +} +static int btuart_send_frame (struct hci_dev *hdev,struct sk_buff *skb) {struct btuart_dev *bdev =hci_get_drvdata (hdev); -/* Prepend skb with frame type */ -memcpy (skb_push (skb,1 ), &hci_skb_pkt_type (skb),1 ); -skb_queue_tail (&bdev->txq, skb); +if (bdev->vnd->send) { + bdev->vnd->send (hdev, skb); + }else { +/* Prepend skb with frame type */ +memcpy (skb_push (skb,1 ), &hci_skb_pkt_type (skb),1 ); +skb_queue_tail (&bdev->txq, skb); + }btuart_tx_wakeup (bdev);return 0 ;
@@ -204,14 +194,23 @@ static int btuart_receive_buf(struct serdev_device *serdev, const u8 *data, {struct btuart_dev *bdev =serdev_device_get_drvdata (serdev);const struct btuart_vnd *vnd = bdev->vnd; +int err; - bdev->rx_skb =h4_recv_buf (bdev->hdev, bdev->rx_skb, data, count, - vnd->recv_pkts, vnd->recv_pkts_cnt); -if (IS_ERR (bdev->rx_skb)) { -int err =PTR_ERR (bdev->rx_skb); -bt_dev_err (bdev->hdev,"Frame reassembly failed (%d)" , err); - bdev->rx_skb =NULL ; -return err; +if (bdev->vnd->recv) { + err = bdev->vnd->recv (bdev->hdev, data, count); +if (err <0 ) +return err; + }else { + bdev->rx_skb =h4_recv_buf (bdev->hdev, bdev->rx_skb, + data, count, vnd->recv_pkts, + vnd->recv_pkts_cnt); +if (IS_ERR (bdev->rx_skb)) { + err =PTR_ERR (bdev->rx_skb); +bt_dev_err (bdev->hdev, +"Frame reassembly failed (%d)" , err); + bdev->rx_skb =NULL ; +return err; + } } bdev->hdev->stat.byte_rx += count;
@@ -429,6 +428,9 @@ static int btuart_probe(struct serdev_device *serdev)if (!bdev->vnd) bdev->vnd = &default_vnd; +if (bdev->vnd->init) + bdev->data = bdev->vnd->init (&serdev->dev); + bdev->serdev = serdev;serdev_device_set_drvdata (serdev, bdev);
@@ -460,6 +462,7 @@ static int btuart_probe(struct serdev_device *serdev) hdev->close = btuart_close; hdev->flush = btuart_flush; hdev->setup = btuart_setup; + hdev->shutdown = btuart_shutdown; hdev->send = btuart_send_frame;SET_HCIDEV_DEV (hdev, &serdev->dev);
drivers/bluetooth/btuart.h new file +30 -0
@@ -0,0 +1,30 @@ +struct btuart_vnd { +const struct h4_recv_pkt *recv_pkts; +int recv_pkts_cnt; +unsigned int manufacturer; +void *(*init)(struct device *dev); + +int (*open)(struct hci_dev *hdev); +int (*close)(struct hci_dev *hdev); +int (*setup)(struct hci_dev *hdev); +int (*shutdown)(struct hci_dev *hdev); +int (*send)(struct hci_dev *hdev,struct sk_buff *skb); +int (*recv)(struct hci_dev *hdev,const u8 *data,size_t count); +}; + +struct btuart_dev { +struct hci_dev *hdev; +struct serdev_device *serdev; + +struct work_struct tx_work; +unsigned long tx_state; +struct sk_buff_head txq; + +struct sk_buff *rx_skb; + +const struct btuart_vnd *vnd; +void *data; +}; + +#define BTUART_TX_STATE_ACTIVE 1 +#define BTUART_TX_STATE_WAKEUP 2
Signature · 1 line
2.7.4
[email protected]
maintainerPATCH v3 6/7 Bluetooth: mediatek: Add protocol support for MediaTek serial devices
In reply to [email protected]From: Sean Wang <[email protected]>
This adds a driver to run on the top of btuart driver for the MediaTek serial protocol based on running H:4, which can enable the built-in Bluetooth device inside MT7622 SoC.
--- drivers/bluetooth/Kconfig | 12 ++ drivers/bluetooth/Makefile | 2 + drivers/bluetooth/btmtkuart.c | 355 ++++++++++++++++++++++++++++++++++++++++++ drivers/bluetooth/btmtkuart.h | 119 ++++++++++++++ drivers/bluetooth/btuart.c | 18 +++ 5 files changed, 506 insertions(+) create mode 100644 drivers/bluetooth/btmtkuart.c create mode 100644 drivers/bluetooth/btmtkuart.h
drivers/bluetooth/Kconfig +12 -0
@@ -85,6 +85,18 @@ config BT_HCIBTUART Say Y here to compile support for Bluetooth UART devices into the kernel or say M to compile it as module (btuart). +config BT_HCIBTUART_MTK + tristate "MediaTek HCI UART driver" + depends on BT_HCIBTUART + default y + help + MediaTek Bluetooth HCI UART driver. + This driver is required if you want to use MediaTek Bluetooth + with serial interface. + + Say Y here to compile support for MediaTek Bluetooth UART devices + into the kernel or say M to compile it as module (btmtkuart). + config BT_HCIUART tristate "HCI UART driver" depends on SERIAL_DEV_BUS || !SERIAL_DEV_BUS
drivers/bluetooth/Makefile +2 -0
@@ -26,6 +26,8 @@ obj-$(CONFIG_BT_BCM) += btbcm.o obj-$(CONFIG_BT_RTL) += btrtl.o obj-$(CONFIG_BT_QCA) += btqca.o +obj-$(CONFIG_BT_HCIBTUART_MTK) += btmtkuart.o + obj-$(CONFIG_BT_HCIUART_NOKIA) += hci_nokia.o obj-$(CONFIG_BT_HCIRSI) += btrsi.o
drivers/bluetooth/btmtkuart.c new file +355 -0
355 lines not on this page · raw message
drivers/bluetooth/btmtkuart.h new file +119 -0
119 lines not on this page · raw message
drivers/bluetooth/btuart.c +18 -0
@@ -35,6 +35,7 @@#include "h4_recv.h" #include "btuart.h" #include "btbcm.h" +#include "btmtkuart.h" #define VERSION "1.0"
@@ -396,6 +397,12 @@ static const struct h4_recv_pkt bcm_recv_pkts[] = { { BCM_RECV_NULL, .recv = hci_recv_diag }, }; +static const struct h4_recv_pkt mtk_recv_pkts[] = { + {H4_RECV_ACL , .recv = hci_recv_frame }, + {H4_RECV_SCO , .recv = hci_recv_frame }, + {H4_RECV_EVENT , .recv = mtk_btuart_hci_frame }, +}; +static const struct btuart_vnd bcm_vnd = { .recv_pkts = bcm_recv_pkts, .recv_pkts_cnt = ARRAY_SIZE(bcm_recv_pkts),
@@ -403,6 +410,16 @@ static const struct btuart_vnd bcm_vnd = { .setup = bcm_setup, }; +static const struct btuart_vnd mtk_vnd = { + .recv_pkts = mtk_recv_pkts, + .recv_pkts_cnt =ARRAY_SIZE (mtk_recv_pkts), + .init = mtk_btuart_init, + .setup = mtk_btuart_setup, + .shutdown = mtk_btuart_shutdown, + .send = mtk_btuart_send, + .recv = mtk_btuart_recv, +}; +static const struct h4_recv_pkt default_recv_pkts[] = { {H4_RECV_ACL , .recv = hci_recv_frame }, {H4_RECV_SCO , .recv = hci_recv_frame },
@@ -487,6 +504,7 @@ static void btuart_remove(struct serdev_device *serdev)#ifdef CONFIG_OF static const struct of_device_id btuart_of_match_table[] = { { .compatible ="brcm,bcm43438-bt" , .data = &bcm_vnd }, + { .compatible ="mediatek,mt7622-bluetooth" , .data = &mtk_vnd }, { } };MODULE_DEVICE_TABLE (of, btuart_of_match_table);
Signature · 1 line
2.7.4
[email protected]
maintainerPATCH v3 7/7 MAINTAINERS: add an entry for MediaTek Bluetooth driver
In reply to [email protected]From: Sean Wang <[email protected]>
Add an entry for the MediaTek Bluetooth driver.
--- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
@@ -8988,6 +8988,14 @@ F: include/uapi/linux/meye.h F: include/uapi/linux/ivtv* F: include/uapi/linux/uvcvideo.h +MEDIATEK BLUETOOTH DRIVER +M: Sean Wang <[email protected]> +L: linux-bluetooth at vger.kernel.org +L: linux-mediatek at lists.infradead.org (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/net/mediatek-bluetooth.txt +F: drivers/bluetooth/btmtkuart.c + MEDIATEK CIR DRIVER M: Sean Wang <[email protected]> S: Maintained
Signature · 1 line
2.7.4