Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: btusb: mediatek: add MT7922 subsystem reset

Add the support of MT7922 bluetooth subsystem reset that was called the
auto revert to self-recover from the fatal error in the controller like
the host encounters HCI cmd timeout or the controller crashes.

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Hao Qin <hao.qin@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Hao Qin and committed by
Luiz Augusto von Dentz
064aee50 ccfc8948

+13 -1
+13 -1
drivers/bluetooth/btusb.c
··· 3039 3039 u32 val; 3040 3040 int err; 3041 3041 3042 - if (dev_id == 0x7925) { 3042 + if (dev_id == 0x7922) { 3043 + btusb_mtk_uhw_reg_read(data, MTK_BT_SUBSYS_RST, &val); 3044 + val |= 0x00002020; 3045 + btusb_mtk_uhw_reg_write(data, MTK_BT_SUBSYS_RST, val); 3046 + btusb_mtk_uhw_reg_write(data, MTK_EP_RST_OPT, 0x00010001); 3047 + btusb_mtk_uhw_reg_read(data, MTK_BT_SUBSYS_RST, &val); 3048 + val |= BIT(0); 3049 + btusb_mtk_uhw_reg_write(data, MTK_BT_SUBSYS_RST, val); 3050 + msleep(100); 3051 + } else if (dev_id == 0x7925) { 3043 3052 btusb_mtk_uhw_reg_read(data, MTK_BT_RESET_REG_CONNV3, &val); 3044 3053 val |= (1 << 5); 3045 3054 btusb_mtk_uhw_reg_write(data, MTK_BT_RESET_REG_CONNV3, val); ··· 3087 3078 val & MTK_BT_RST_DONE, 20000, 1000000); 3088 3079 if (err < 0) 3089 3080 bt_dev_err(hdev, "Reset timeout"); 3081 + 3082 + if (dev_id == 0x7922) 3083 + btusb_mtk_uhw_reg_write(data, MTK_UDMA_INT_STA_BT, 0x000000FF); 3090 3084 3091 3085 btusb_mtk_id_get(data, 0x70010200, &val); 3092 3086 if (!val)