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: btmtk: add the function to get the fw name

Include a shared function to get the firmware name, to prevent repeating
code for similar chipsets.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Sean Wang and committed by
Luiz Augusto von Dentz
00f993fd 0a3e2eca

+26
+18
drivers/bluetooth/btmtk.c
··· 103 103 } 104 104 } 105 105 106 + void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver, 107 + u32 fw_flavor) 108 + { 109 + if (dev_id == 0x7925) 110 + snprintf(buf, size, 111 + "mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin", 112 + dev_id & 0xffff, dev_id & 0xffff, (fw_ver & 0xff) + 1); 113 + else if (dev_id == 0x7961 && fw_flavor) 114 + snprintf(buf, size, 115 + "mediatek/BT_RAM_CODE_MT%04x_1a_%x_hdr.bin", 116 + dev_id & 0xffff, (fw_ver & 0xff) + 1); 117 + else 118 + snprintf(buf, size, 119 + "mediatek/BT_RAM_CODE_MT%04x_1_%x_hdr.bin", 120 + dev_id & 0xffff, (fw_ver & 0xff) + 1); 121 + } 122 + EXPORT_SYMBOL_GPL(btmtk_fw_get_filename); 123 + 106 124 int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, 107 125 wmt_cmd_sync_func_t wmt_cmd_sync) 108 126 {
+8
drivers/bluetooth/btmtk.h
··· 160 160 u32 fw_version); 161 161 162 162 int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb); 163 + 164 + void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver, 165 + u32 fw_flavor); 163 166 #else 164 167 165 168 static inline int btmtk_set_bdaddr(struct hci_dev *hdev, ··· 196 193 static int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb) 197 194 { 198 195 return -EOPNOTSUPP; 196 + } 197 + 198 + static void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, 199 + u32 fw_ver, u32 fw_flavor) 200 + { 199 201 } 200 202 #endif