@@ -1413,13 +1413,26 @@ static void qca_power_shutdown(struct hci_uart *hu)
static int qca_power_off(struct hci_dev *hdev)
{
struct hci_uart *hu = hci_get_drvdata(hdev);
+ struct qca_serdev *qcadev;
+ enum qca_btsoc_type soc_type = qca_soc_type(hu);
+
+ if (qca_is_wcn399x(soc_type)) {
+ /* Perform pre shutdown command */
+ qca_send_pre_shutdown_cmd(hdev);
+
+ usleep_range(8000, 10000);
- /* Perform pre shutdown command */
- qca_send_pre_shutdown_cmd(hdev);
+ qca_power_shutdown(hu);
+ } else {
+ if (hu->serdev) {
+ qcadev = serdev_device_get_drvdata(hu->serdev);
+
+ gpiod_set_value_cansleep(qcadev->bt_en, 0);
- usleep_range(8000, 10000);
+ usleep_range(8000, 10000);
+ }
+ }
- qca_power_shutdown(hu);
return 0;
}
We will need to call the qca_power_off() API to power off Rome, add the support into it. QCA Rome is using bt_en GPIO for power off, so we just need to pull down this bt_en GPIO to power off it. Signed-off-by: Rocky Liao <rjliao@codeaurora.org> --- Changes in v2: None Changes in v3: None drivers/bluetooth/hci_qca.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)