Skip to content

Commit 68b116a

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Johan Hedberg says: ==================== pull request: bluetooth 2018-02-26 Here are a two Bluetooth driver fixes for the 4.16 kernel. Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents b9d1717 + ab2f336 commit 68b116a

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

drivers/bluetooth/btusb.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
*/
2323

24+
#include <linux/dmi.h>
2425
#include <linux/module.h>
2526
#include <linux/usb.h>
2627
#include <linux/usb/quirks.h>
@@ -379,6 +380,21 @@ static const struct usb_device_id blacklist_table[] = {
379380
{ } /* Terminating entry */
380381
};
381382

383+
/* The Bluetooth USB module build into some devices needs to be reset on resume,
384+
* this is a problem with the platform (likely shutting off all power) not with
385+
* the module itself. So we use a DMI list to match known broken platforms.
386+
*/
387+
static const struct dmi_system_id btusb_needs_reset_resume_table[] = {
388+
{
389+
/* Lenovo Yoga 920 (QCA Rome device 0cf3:e300) */
390+
.matches = {
391+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
392+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 920"),
393+
},
394+
},
395+
{}
396+
};
397+
382398
#define BTUSB_MAX_ISOC_FRAMES 10
383399

384400
#define BTUSB_INTR_RUNNING 0
@@ -2945,6 +2961,9 @@ static int btusb_probe(struct usb_interface *intf,
29452961
hdev->send = btusb_send_frame;
29462962
hdev->notify = btusb_notify;
29472963

2964+
if (dmi_check_system(btusb_needs_reset_resume_table))
2965+
interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME;
2966+
29482967
#ifdef CONFIG_PM
29492968
err = btusb_config_oob_wake(hdev);
29502969
if (err)
@@ -3031,12 +3050,6 @@ static int btusb_probe(struct usb_interface *intf,
30313050
if (id->driver_info & BTUSB_QCA_ROME) {
30323051
data->setup_on_usb = btusb_setup_qca;
30333052
hdev->set_bdaddr = btusb_set_bdaddr_ath3012;
3034-
3035-
/* QCA Rome devices lose their updated firmware over suspend,
3036-
* but the USB hub doesn't notice any status change.
3037-
* explicitly request a device reset on resume.
3038-
*/
3039-
interface_to_usbdev(intf)->quirks |= USB_QUIRK_RESET_RESUME;
30403053
}
30413054

30423055
#ifdef CONFIG_BT_HCIBTUSB_RTL

drivers/bluetooth/hci_bcm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,13 @@ static int bcm_get_resources(struct bcm_device *dev)
922922

923923
dev->clk = devm_clk_get(dev->dev, NULL);
924924

925-
dev->device_wakeup = devm_gpiod_get(dev->dev, "device-wakeup",
926-
GPIOD_OUT_LOW);
925+
dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup",
926+
GPIOD_OUT_LOW);
927927
if (IS_ERR(dev->device_wakeup))
928928
return PTR_ERR(dev->device_wakeup);
929929

930-
dev->shutdown = devm_gpiod_get(dev->dev, "shutdown", GPIOD_OUT_LOW);
930+
dev->shutdown = devm_gpiod_get_optional(dev->dev, "shutdown",
931+
GPIOD_OUT_LOW);
931932
if (IS_ERR(dev->shutdown))
932933
return PTR_ERR(dev->shutdown);
933934

0 commit comments

Comments
 (0)