blob: a279bf4c90f2816865cbcac82da9a0af0dba3374 [file] [log] [blame]
From 591ec6b96393d789a79697f3998bfd87748bacff Mon Sep 17 00:00:00 2001
From: Zhengping Jiang <jiangzp@google.com>
Date: Fri, 27 Oct 2023 13:30:32 -0700
Subject: [PATCH] CHROMIUM: hci_qca: Add do_wakeup for floss
Add do_wakeup function for hci_qca driver. Floss uses the function to
increase wakeup count when there are incoming bluetooth packets during
system suspend.
BUG=b:308014734
TEST=manual test suspend and wakeup with mouse on trogdor
UPSTREAM-TASK=b:285956697
Disallow-Recycled-Builds: test-failures
Change-Id: Ic363bdffe039cb9e8db555cd0938cacb03528aa4
Signed-off-by: Zhengping Jiang <jiangzp@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5397906
Reviewed-by: Archie Pusaka <apusaka@chromium.org>
---
drivers/bluetooth/hci_qca.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 4773e7de5dc6fca13ddc59e1e4a269a33e8ed02c..546e7ec9576d479fc0e799fe1263afef4db195ac 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1687,6 +1687,14 @@ static bool qca_wakeup(struct hci_dev *hdev)
return wakeup;
}
+static void qca_do_wakeup(struct hci_dev *hdev)
+{
+ struct hci_uart *hu = hci_get_drvdata(hdev);
+
+ if (qca_wakeup(hdev))
+ pm_wakeup_event(&hu->serdev->ctrl->dev, 0);
+}
+
static int qca_port_reopen(struct hci_uart *hu)
{
int ret;
@@ -1986,6 +1994,7 @@ static int qca_setup(struct hci_uart *hu)
if (device_can_wakeup(hu->serdev->ctrl->dev.parent))
hu->hdev->wakeup = qca_wakeup;
}
+ hu->hdev->do_wakeup = qca_do_wakeup;
} else if (ret == -ENOENT) {
/* No patch/nvm-config found, run with original fw/config */
set_bit(QCA_ROM_FW, &qca->flags);
--
2.46.0.rc2.264.g509ed76dc8-goog