Skip to content

Commit c1a7416

Browse files
Venkata Lakshmi Narayana Gubbaholtmann
authored andcommitted
Bluetooth: hci_qca: Add device_may_wakeup support
Based on device may wakeup status, Bluez stack will enable/disable passive scanning with whitelist in BT controller while suspending. As interrupt from BT SoC is handled by UART driver,we need to use device handle of UART driver to get the status of device may wakeup Signed-off-by: Venkata Lakshmi Narayana Gubba <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 6d19628 commit c1a7416

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,20 @@ static void qca_cmd_timeout(struct hci_dev *hdev)
15711571
mutex_unlock(&qca->hci_memdump_lock);
15721572
}
15731573

1574+
static bool qca_prevent_wake(struct hci_dev *hdev)
1575+
{
1576+
struct hci_uart *hu = hci_get_drvdata(hdev);
1577+
bool wakeup;
1578+
1579+
/* UART driver handles the interrupt from BT SoC.So we need to use
1580+
* device handle of UART driver to get the status of device may wakeup.
1581+
*/
1582+
wakeup = device_may_wakeup(hu->serdev->ctrl->dev.parent);
1583+
bt_dev_dbg(hu->hdev, "wakeup status : %d", wakeup);
1584+
1585+
return !wakeup;
1586+
}
1587+
15741588
static int qca_wcn3990_init(struct hci_uart *hu)
15751589
{
15761590
struct qca_serdev *qcadev;
@@ -1721,6 +1735,7 @@ static int qca_setup(struct hci_uart *hu)
17211735
qca_debugfs_init(hdev);
17221736
hu->hdev->hw_error = qca_hw_error;
17231737
hu->hdev->cmd_timeout = qca_cmd_timeout;
1738+
hu->hdev->prevent_wake = qca_prevent_wake;
17241739
} else if (ret == -ENOENT) {
17251740
/* No patch/nvm-config found, run with original fw/config */
17261741
set_bit(QCA_ROM_FW, &qca->flags);

0 commit comments

Comments
 (0)