You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Bluetooth: btbcm: Add firmware table for UART based devices
The Broadcom UART based devices seem to use a little bit different firmare naming prefix. So add a separate table for these devices. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
+43
-17
@@ -174,7 +174,15 @@ static struct sk_buff *btbcm_read_usb_product(struct hci_dev *hdev)
|
|||||||
static const struct {
|
static const struct {
|
||||||
u16 subver;
|
u16 subver;
|
||||||
const char *name;
|
const char *name;
|
||||||
} bcm_subver_table[] = {
|
} bcm_uart_subver_table[] = {
|
||||||
|
{ 0x410e, "BCM43341B0" }, /* 002.001.014 */
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct {
|
||||||
|
u16 subver;
|
||||||
|
const char *name;
|
||||||
|
} bcm_usb_subver_table[] = {
|
||||||
{ 0x210b, "BCM43142A0" }, /* 001.001.011 */
|
{ 0x210b, "BCM43142A0" }, /* 001.001.011 */
|
||||||
{ 0x2112, "BCM4314A0" }, /* 001.001.018 */
|
{ 0x2112, "BCM4314A0" }, /* 001.001.018 */
|
||||||
{ 0x2118, "BCM20702A0" }, /* 001.001.024 */
|
{ 0x2118, "BCM20702A0" }, /* 001.001.024 */
|
||||||
@@ -224,29 +232,47 @@ int btbcm_setup_patchram(struct hci_dev *hdev)
|
|||||||
BT_INFO("%s: BCM: chip id %u", hdev->name, skb->data[1]);
|
BT_INFO("%s: BCM: chip id %u", hdev->name, skb->data[1]);
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
|
||||||
/* Read USB Product Info */
|
switch ((rev & 0xf000) >> 12) {
|
||||||
skb = btbcm_read_usb_product(hdev);
|
case 0:
|
||||||
if (IS_ERR(skb))
|
for (i = 0; bcm_uart_subver_table[i].name; i++) {
|
||||||
return PTR_ERR(skb);
|
if (subver == bcm_uart_subver_table[i].subver) {
|
||||||
|
hw_name = bcm_uart_subver_table[i].name;
|
||||||
vid = get_unaligned_le16(skb->data + 1);
|
break;
|
||||||
pid = get_unaligned_le16(skb->data + 3);
|
}
|
||||||
kfree_skb(skb);
|
|
||||||
|
|
||||||
for (i = 0; bcm_subver_table[i].name; i++) {
|
|
||||||
if (subver == bcm_subver_table[i].subver) {
|
|
||||||
hw_name = bcm_subver_table[i].name;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(fw_name, sizeof(fw_name), "brcm/%s.hcd",
|
||||||
|
hw_name ? : "BCM");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
/* Read USB Product Info */
|
||||||
|
skb = btbcm_read_usb_product(hdev);
|
||||||
|
if (IS_ERR(skb))
|
||||||
|
return PTR_ERR(skb);
|
||||||
|
|
||||||
|
vid = get_unaligned_le16(skb->data + 1);
|
||||||
|
pid = get_unaligned_le16(skb->data + 3);
|
||||||
|
kfree_skb(skb);
|
||||||
|
|
||||||
|
for (i = 0; bcm_usb_subver_table[i].name; i++) {
|
||||||
|
if (subver == bcm_usb_subver_table[i].subver) {
|
||||||
|
hw_name = bcm_usb_subver_table[i].name;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
snprintf(fw_name, sizeof(fw_name), "brcm/%s-%4.4x-%4.4x.hcd",
|
||||||
|
hw_name ? : "BCM", vid, pid);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BT_INFO("%s: %s (%3.3u.%3.3u.%3.3u) build %4.4u", hdev->name,
|
BT_INFO("%s: %s (%3.3u.%3.3u.%3.3u) build %4.4u", hdev->name,
|
||||||
hw_name ? : "BCM", (subver & 0x7000) >> 13,
|
hw_name ? : "BCM", (subver & 0x7000) >> 13,
|
||||||
(subver & 0x1f00) >> 8, (subver & 0x00ff), rev & 0x0fff);
|
(subver & 0x1f00) >> 8, (subver & 0x00ff), rev & 0x0fff);
|
||||||
|
|
||||||
snprintf(fw_name, sizeof(fw_name), "brcm/%s-%4.4x-%4.4x.hcd",
|
|
||||||
hw_name ? : "BCM", vid, pid);
|
|
||||||
|
|
||||||
err = request_firmware(&fw, fw_name, &hdev->dev);
|
err = request_firmware(&fw, fw_name, &hdev->dev);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
BT_INFO("%s: BCM: patch %s not found", hdev->name, fw_name);
|
BT_INFO("%s: BCM: patch %s not found", hdev->name, fw_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user