Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: btmtksdio: Add in-band wakeup support

Commit ce64b3e94919 ("Bluetooth: mt7921s: Support wake on bluetooth")
adds the wake on bluethooth via a dedicated GPIO.

Extend the wake-on-bluetooth to use the SDIO DAT1 pin (in-band wakeup),
when supported by the SDIO host driver.

Co-developed-by: Yake Yang <yake.yang@mediatek.com>
Signed-off-by: Yake Yang <yake.yang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Sean Wang and committed by
Luiz Augusto von Dentz
df332800 d7b2fdfb

+15
+15
drivers/bluetooth/btmtksdio.c
··· 1282 1282 hci_reset_dev(hdev); 1283 1283 } 1284 1284 1285 + static bool btmtksdio_sdio_inband_wakeup(struct hci_dev *hdev) 1286 + { 1287 + struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); 1288 + 1289 + return device_may_wakeup(bdev->dev); 1290 + } 1291 + 1285 1292 static bool btmtksdio_sdio_wakeup(struct hci_dev *hdev) 1286 1293 { 1287 1294 struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); ··· 1356 1349 hdev->shutdown = btmtksdio_shutdown; 1357 1350 hdev->send = btmtksdio_send_frame; 1358 1351 hdev->wakeup = btmtksdio_sdio_wakeup; 1352 + /* 1353 + * If SDIO controller supports wake on Bluetooth, sending a wakeon 1354 + * command is not necessary. 1355 + */ 1356 + if (device_can_wakeup(func->card->host->parent)) 1357 + hdev->wakeup = btmtksdio_sdio_inband_wakeup; 1358 + else 1359 + hdev->wakeup = btmtksdio_sdio_wakeup; 1359 1360 hdev->set_bdaddr = btmtk_set_bdaddr; 1360 1361 1361 1362 SET_HCIDEV_DEV(hdev, &func->dev);