summary refs log tree commit diff
diff options
context:
space:
mode:
authorPierre-Loup A. Griffais <pgriffais@valvesoftware.com>2023-11-13 23:09:55 +0000
committerPierre-Loup A. Griffais <pgriffais@valvesoftware.com>2023-11-13 23:09:55 +0000
commit06bd73d8d986fd7f75310b184fbf09d4977e8eee (patch)
tree6e2367fe3ef92e3202402ccca23ffffcb2293065
parent58dc35e5b1636353d8be27c1a30eaf3c584bf917 (diff)
parentfb38084dad1c3af2776da3ae66c9cf9e0bcebeee (diff)
downloadlinux-06bd73d8d986fd7f75310b184fbf09d4977e8eee.tar.gz
Merge branch 'christianm/btwake' into 'galilypad/6.1.52'
Brings in BT wake kernel changes needed for release

See merge request valve/galileo/linux-integration!24
-rw-r--r--drivers/bluetooth/hci_qca.c3
-rw-r--r--net/bluetooth/hci_sync.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index a345cb5318ba..e7361dfe858a 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1770,7 +1770,8 @@ retry:
 		qca_debugfs_init(hdev);
 		hu->hdev->hw_error = qca_hw_error;
 		hu->hdev->cmd_timeout = qca_cmd_timeout;
-		hu->hdev->wakeup = qca_wakeup;
+		if (device_can_wakeup(hu->serdev->ctrl->dev.parent))
+			hu->hdev->wakeup = qca_wakeup;
 	} else if (ret == -ENOENT) {
 		/* No patch/nvm-config found, run with original fw/config */
 		set_bit(QCA_ROM_FW, &qca->flags);
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 2ae038dfc39f..049ccb743b41 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3785,12 +3785,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
 	if (lmp_bredr_capable(hdev)) {
 		events[4] |= 0x01; /* Flow Specification Complete */
 
-		/* Don't set Disconnect Complete when suspended as that
-		 * would wakeup the host when disconnecting due to
+		/* Don't set Disconnect Complete and mode change when suspended 
+		 * as that would wakeup the host when disconnecting due to
 		 * suspend.
 		 */
-		if (hdev->suspended)
+		if (hdev->suspended){
 			events[0] &= 0xef;
+			events[2] &= 0xf7;
+		}
 	} else {
 		/* Use a different default for LE-only devices */
 		memset(events, 0, sizeof(events));
@@ -5784,7 +5786,7 @@ int hci_suspend_sync(struct hci_dev *hdev)
 
 	if (hci_conn_count(hdev)) {
 		/* Soft disconnect everything (power off) */
-		err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_POWER_OFF);
+		err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_USER_TERM);
 		if (err) {
 			/* Set state to BT_RUNNING so resume doesn't notify */
 			hdev->suspend_state = BT_RUNNING;