Commit 2d25f8b462f3b849d8913d02978657ef06e67dd8

Authored by Steven.Li
Committed by Gustavo F. Padovan
1 parent e1447d8d8d

Bluetooth: Add Atheros AR3012 one PID/VID supported

The new Ath3k needs to download patch and radio table,
and it keeps same PID/VID even after downloading the patch and radio
table. This patch is to use the bcdDevice (Device Release Number) to
judge whether the chip has been patched or not. The init bcdDevice
value of the chip is 0x0001, this value increases after patch and
radio table downloading.

Signed-off-by: Steven.Li <yongli@qca.qualcomm.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>

Showing 2 changed files with 16 additions and 1 deletions Side-by-side Diff

drivers/bluetooth/ath3k.c
... ... @@ -375,6 +375,11 @@
375 375  
376 376 /* load patch and sysconfig files for AR3012 */
377 377 if (id->driver_info & BTUSB_ATH3012) {
  378 +
  379 + /* New firmware with patch and sysconfig files already loaded */
  380 + if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x0001)
  381 + return -ENODEV;
  382 +
378 383 ret = ath3k_load_patch(udev);
379 384 if (ret < 0) {
380 385 BT_ERR("Loading patch file failed");
drivers/bluetooth/btusb.c
... ... @@ -54,6 +54,7 @@
54 54 #define BTUSB_BCM92035 0x10
55 55 #define BTUSB_BROKEN_ISOC 0x20
56 56 #define BTUSB_WRONG_SCO_MTU 0x40
  57 +#define BTUSB_ATH3012 0x80
57 58  
58 59 static struct usb_device_id btusb_table[] = {
59 60 /* Generic Bluetooth USB device */
... ... @@ -110,7 +111,7 @@
110 111 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
111 112  
112 113 /* Atheros 3012 with sflash firmware */
113   - { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_IGNORE },
  114 + { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
114 115  
115 116 /* Atheros AR5BBU12 with sflash firmware */
116 117 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
... ... @@ -913,6 +914,15 @@
913 914  
914 915 if (ignore_sniffer && id->driver_info & BTUSB_SNIFFER)
915 916 return -ENODEV;
  917 +
  918 + if (id->driver_info & BTUSB_ATH3012) {
  919 + struct usb_device *udev = interface_to_usbdev(intf);
  920 +
  921 + /* Old firmware would otherwise let ath3k driver load
  922 + * patch and sysconfig files */
  923 + if (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x0001)
  924 + return -ENODEV;
  925 + }
916 926  
917 927 data = kzalloc(sizeof(*data), GFP_KERNEL);
918 928 if (!data)