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: reset the controller before downloading the fw

Reset the controller before downloading the firmware to improve its
reliability. This includes situations like cold or warm reboots, ensuring
the controller is in its initial state before starting the firmware
download.

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@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
ccfc8948 4c0c28f2

+10
+10
drivers/bluetooth/btusb.c
··· 3175 3175 case 0x7922: 3176 3176 case 0x7961: 3177 3177 case 0x7925: 3178 + /* Reset the device to ensure it's in the initial state before 3179 + * downloading the firmware to ensure. 3180 + */ 3181 + 3182 + if (!test_bit(BTUSB_FIRMWARE_LOADED, &data->flags)) 3183 + btusb_mtk_subsys_reset(hdev, dev_id); 3184 + 3178 3185 btmtk_fw_get_filename(fw_bin_name, sizeof(fw_bin_name), dev_id, 3179 3186 fw_version, fw_flavor); 3180 3187 ··· 3189 3182 btusb_mtk_hci_wmt_sync); 3190 3183 if (err < 0) { 3191 3184 bt_dev_err(hdev, "Failed to set up firmware (%d)", err); 3185 + clear_bit(BTUSB_FIRMWARE_LOADED, &data->flags); 3192 3186 return err; 3193 3187 } 3188 + 3189 + set_bit(BTUSB_FIRMWARE_LOADED, &data->flags); 3194 3190 3195 3191 /* It's Device EndPoint Reset Option Register */ 3196 3192 btusb_mtk_uhw_reg_write(data, MTK_EP_RST_OPT, MTK_EP_RST_IN_OUT_OPT);