Bluetooth: btusb: Add protocol support for MediaTek USB devices
Subsystems (2)
v6 cover Bluetooth: btusb: Add protocol support for MediaTek USB devices
From: Sean Wang <[email protected]>
v6:
* fix drivers/bluetooth/btusb.c:2683:2-3: Unneeded semicolon based reported by [1]
* update power-on sequence with adding neccesary tci sleep comand to set up low-power environmnet and a delay to wait the device to be stable.
* sort variables declarations in reverse xmas order.
[1]
http://lists.infradead.org/pipermail/linux-mediatek/2019-January/017017.html
v5:
* rebase to latest code base.
* change the subject prefix.
* change the place the firmware located at.
v4:
* use new BTUSB_TX_WAIT_VND_EVT instead of BTMTKUSB_TX_WAIT_VND_EVT to avoid definition conflict and to fix bulk data transfer fails.
* use the bluetooth-next as the base
v3:
add fixes and enhancements based on [1]
* reuse flags and evt_skb btusb already had
* add ctrl_anchor and the corresponding handling
* apply mtk specific recv function
* add more comments explaining wmt ctrl urbs behavior.
[1]
http://lists.infradead.org/pipermail/linux-mediatek/2018-August/014724.html
v2:
add fixes and enhancements based on [1]
* include /sys/kernel/debug/usb/devices portion in the commit message.
* turn default into n for config BT_HCIBTUSB_MTK in Kconfig
* only add MediaTek support to btusb.c
* drop cmd_sync callback usage
* use __hci_cmd_send to send WMT commands
* add wait event handling similar to what is being done in btmtkuart.c
* submit a control IN URB similar to interrupt IN URB on demand for the WMT commands during setup
* add cosmetic changes
[1]
http://lists.infradead.org/pipermail/linux-mediatek/2018-August/014650.html
http://lists.infradead.org/pipermail/linux-mediatek/2018-August/014656.html
v1:
This adds the support of enabling MT7668U and MT7663U Bluetooth function running on the top of btusb driver. The patch also adds a newly created file mtkbt.c able to be reused independently from the transport type such as UART, USB and SDIO.
Sean Wang (2):
Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB
devices
Bluetooth: btusb: Add protocol support for MediaTek MT7663U USB
devices
drivers/bluetooth/Kconfig | 11 + drivers/bluetooth/btusb.c | 581 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 592 insertions(+)
Signature · 1 line
2.18.0
PATCH v6 1/2 Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices
From: Sean Wang <[email protected]>
This adds the support of enabling MT7668U Bluetooth function running on the top of btusb driver.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below.
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=0e8d ProdID=7668 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=160mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms
--- drivers/bluetooth/Kconfig | 11 + drivers/bluetooth/btusb.c | 576 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 587 insertions(+)
drivers/bluetooth/Kconfig +11 -0
@@ -52,6 +52,17 @@ config BT_HCIBTUSB_BCM Say Y here to compile support for Broadcom protocol. +config BT_HCIBTUSB_MTK + bool "MediaTek protocol support" + depends on BT_HCIBTUSB + default n + help + The MediaTek protocol support enables firmware download + support and chip initialization for MediaTek Bluetooth + USB controllers. + + Say Y here to compile support for MediaTek protocol. + config BT_HCIBTUSB_RTL bool "Realtek protocol support" depends on BT_HCIBTUSB
drivers/bluetooth/btusb.c +576 -0
630 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH v6 2/2 Bluetooth: btusb: Add protocol support for MediaTek MT7663U USB devices
In reply to [email protected]From: Sean Wang <[email protected]>
This adds the support of enabling MT7663U Bluetooth function running on the top of btusb driver.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below.
T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=0e8d ProdID=7663 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=160mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms
--- drivers/bluetooth/btusb.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/bluetooth/btusb.c +5 -0
@@ -2408,6 +2408,7 @@ static int btusb_shutdown_intel(struct hci_dev *hdev)#ifdef CONFIG_BT_HCIBTUSB_MTK +#define FIRMWARE_MT7663 "mediatek/mt7663pr2h.bin"#define FIRMWARE_MT7668 "mediatek/mt7668pr2h.bin"#define HCI_WMT_MAX_EVENT_SIZE 64
@@ -2849,6 +2850,9 @@ static int btusb_mtk_setup(struct hci_dev *hdev) }switch (dev_id) { +case 0x7663 : + fwname =FIRMWARE_MT7663 ; +break ;case 0x7668 : fwname =FIRMWARE_MT7668 ;break ;
@@ -2960,6 +2964,7 @@ static int btusb_mtk_shutdown(struct hci_dev *hdev) return 0; } +MODULE_FIRMWARE (FIRMWARE_MT7663 );MODULE_FIRMWARE (FIRMWARE_MT7668 );#endif
Signature · 1 line
2.18.0
This is just a gentle ping of the series
Quoted 65 lines · On Fri, 2019-01-25 at 07:26 +0800, [email protected] wrote:
From: Sean Wang <[email protected]>
v6:
* fix drivers/bluetooth/btusb.c:2683:2-3: Unneeded semicolon based reported by [1]
* update power-on sequence with adding neccesary tci sleep comand to set up low-power environmnet and a delay to wait the device to be stable.
* sort variables declarations in reverse xmas order.[1]
http://lists.infradead.org/pipermail/linux-mediatek/2019-January/017017.htmlv5:
* rebase to latest code base.
* change the subject prefix.
* change the place the firmware located at.v4:
* use newBTUSB_TX_WAIT_VND_EVTinstead ofBTMTKUSB_TX_WAIT_VND_EVTto avoid definition conflict and to fix bulk data transfer fails.
* use the bluetooth-next as the basev3:
add fixes and enhancements based on [1]
* reuse flags andevt_skbbtusb already had
* addctrl_anchorand the corresponding handling
* apply mtk specific recv function
* add more comments explaining wmt ctrl urbs behavior.[1]
http://lists.infradead.org/pipermail/linux-mediatek/2018-August/014724.htmlv2:
add fixes and enhancements based on [1]
* include/sys/kernel/debug/usb/devicesportion in the commit message.
* turn default into n for configBT_HCIBTUSB_MTKinKconfig
* only add MediaTek support tobtusb.c
* dropcmd_synccallback usage
* use__hci_cmd_sendto send WMT commands
* add wait event handling similar to what is being done inbtmtkuart.c
* submit a control IN URB similar to interrupt IN URB on demand for the WMT commands during setup
* add cosmetic changes[1]
http://lists.infradead.org/pipermail/linux-mediatek/2018-August/014650.html
http://lists.infradead.org/pipermail/linux-mediatek/2018-August/014656.htmlv1:
This adds the support of enabling MT7668U and MT7663U Bluetooth function running on the top of btusb driver. The patch also adds a newly created file
mtkbt.cable to be reused independently from the transport type such as UART, USB and SDIO.Sean Wang (2):
Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB
devices
Bluetooth: btusb: Add protocol support for MediaTek MT7663U USB
devicesdrivers/bluetooth/Kconfig | 11 + drivers/bluetooth/btusb.c | 581 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 592 insertions(+)