]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: btintel_pcie: Define hdev->wakeup() callback
authorChandrashekar Devegowda <chandrashekar.devegowda@intel.com>
Thu, 31 Jul 2025 11:17:11 +0000 (16:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:33 +0000 (15:37 -0500)
[ Upstream commit 3e94262921990e2884ff7a49064c12fb6d3a0733 ]

Implement hdev->wakeup() callback to support Wake On BT feature.

Test steps:
1. echo enabled > /sys/bus/pci/devices/0000:00:14.7/power/wakeup
2. connect bluetooth hid device
3. put the system to suspend - rtcwake -m mem -s 300
4. press any key on hid to wake up the system

Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btintel_pcie.c

index c9fb824fb8e1db2451315fea45ef1168b0629a0e..becb471ffd4213447590b937ff597d2e7f46ecc1 100644 (file)
@@ -2342,6 +2342,13 @@ static void btintel_pcie_hw_error(struct hci_dev *hdev, u8 code)
        btintel_pcie_reset(hdev);
 }
 
+static bool btintel_pcie_wakeup(struct hci_dev *hdev)
+{
+       struct btintel_pcie_data *data = hci_get_drvdata(hdev);
+
+       return device_may_wakeup(&data->pdev->dev);
+}
+
 static int btintel_pcie_setup_hdev(struct btintel_pcie_data *data)
 {
        int err;
@@ -2367,6 +2374,7 @@ static int btintel_pcie_setup_hdev(struct btintel_pcie_data *data)
        hdev->set_diag = btintel_set_diag;
        hdev->set_bdaddr = btintel_set_bdaddr;
        hdev->reset = btintel_pcie_reset;
+       hdev->wakeup = btintel_pcie_wakeup;
 
        err = hci_register_dev(hdev);
        if (err < 0) {