Patch "Bluetooth: Add default wakeup callback for HCI UART driver" has been added to the 5.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Bluetooth: Add default wakeup callback for HCI UART driver

to the 5.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bluetooth-add-default-wakeup-callback-for-hci-uart-d.patch
and it can be found in the queue-5.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6533b5e0fc17e1d4fe8310f64846c61ae317220f
Author: Ying Hsu <yinghsu@xxxxxxxxxxxx>
Date:   Mon Jul 4 18:33:24 2022 +0800

    Bluetooth: Add default wakeup callback for HCI UART driver
    
    [ Upstream commit bee5395ced44c5a312348557eb2dfb0c2a7bfaa2 ]
    
    Bluetooth HCI devices indicate if they are able to wakeup in the wakeup
    callback since 'commit 4539ca67fe8e ("Bluetooth: Rename driver
    .prevent_wake to .wakeup")'. This patch adds a default wakeup callback
    for Bluetooth HCI UAR devices. It assumes Bluetooth HCI UART devices are
    wakeable for backward compatibility. For those who need a customized
    behavior, one can override it before calling hci_uart_register_device().
    
    Fixes: 4539ca67fe8e ("Bluetooth: Rename driver .prevent_wake to .wakeup")
    Signed-off-by: Ying Hsu <yinghsu@xxxxxxxxxxxx>
    Reviewed-by: Alain Michaud <alainm@xxxxxxxxxxxx>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c
index 4cda890ce647..c0e5f42ec6b7 100644
--- a/drivers/bluetooth/hci_serdev.c
+++ b/drivers/bluetooth/hci_serdev.c
@@ -231,6 +231,15 @@ static int hci_uart_setup(struct hci_dev *hdev)
 	return 0;
 }
 
+/* Check if the device is wakeable */
+static bool hci_uart_wakeup(struct hci_dev *hdev)
+{
+	/* HCI UART devices are assumed to be wakeable by default.
+	 * Implement wakeup callback to override this behavior.
+	 */
+	return true;
+}
+
 /** hci_uart_write_wakeup - transmit buffer wakeup
  * @serdev: serial device
  *
@@ -342,6 +351,8 @@ int hci_uart_register_device(struct hci_uart *hu,
 	hdev->flush = hci_uart_flush;
 	hdev->send  = hci_uart_send_frame;
 	hdev->setup = hci_uart_setup;
+	if (!hdev->wakeup)
+		hdev->wakeup = hci_uart_wakeup;
 	SET_HCIDEV_DEV(hdev, &hu->serdev->dev);
 
 	if (test_bit(HCI_UART_NO_SUSPEND_NOTIFIER, &hu->flags))



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux