diff options
author | Abhishek Pandit-Subedi <abhishekpandit@chromium.org> | 2020-06-11 03:53:54 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-06-12 08:38:52 +0200 |
commit | 76d4c130ea44404ce6d6b1008f4729a6547c22c9 (patch) | |
tree | ba5a57c1b73f159bbc0ef59649eda8f40ea55df4 /drivers/bluetooth | |
parent | Bluetooth: btmrvl_sdio: Set parent dev to hdev (diff) | |
download | linux-76d4c130ea44404ce6d6b1008f4729a6547c22c9.tar.xz linux-76d4c130ea44404ce6d6b1008f4729a6547c22c9.zip |
Bluetooth: btmrvl_sdio: Implement prevent_wake
Use the parent device's power/wakeup to control whether we support
remote wake. If remote wakeup is disabled, Bluetooth will not enable
scanning for incoming connections.
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/btmrvl_main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index 47e450903af4..8b9d78ce6bb2 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c @@ -587,6 +587,14 @@ static int btmrvl_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) return 0; } +static bool btmrvl_prevent_wake(struct hci_dev *hdev) +{ + struct btmrvl_private *priv = hci_get_drvdata(hdev); + struct btmrvl_sdio_card *card = priv->btmrvl_dev.card; + + return !device_may_wakeup(&card->func->dev); +} + /* * This function handles the event generated by firmware, rx data * received from firmware, and tx data sent from kernel. @@ -688,6 +696,7 @@ int btmrvl_register_hdev(struct btmrvl_private *priv) hdev->send = btmrvl_send_frame; hdev->setup = btmrvl_setup; hdev->set_bdaddr = btmrvl_set_bdaddr; + hdev->prevent_wake = btmrvl_prevent_wake; SET_HCIDEV_DEV(hdev, &card->func->dev); hdev->dev_type = priv->btmrvl_dev.dev_type; |