Skip to content

Commit ae56318

Browse files
rjliao-qcaholtmann
authored andcommitted
Bluetooth: hci_qca: Enable power off/on support during hci down/up for QCA Rome
This patch registers hdev->shutdown() callback and also sets HCI_QUIRK_NON_PERSISTENT_SETUP for QCA Rome. It will power-off the BT chip during hci down and power-on/initialize the chip again during hci up. As wcn399x already enabled this, this patch also removed the callback register and QUIRK setting in qca_setup() for wcn399x and uniformly do this in the probe() routine. Signed-off-by: Rocky Liao <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent bb2500a commit ae56318

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,12 +1569,7 @@ static int qca_setup(struct hci_uart *hu)
15691569
return ret;
15701570

15711571
if (qca_is_wcn399x(soc_type)) {
1572-
/* Enable NON_PERSISTENT_SETUP QUIRK to ensure to execute
1573-
* setup for every hci up.
1574-
*/
1575-
set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
15761572
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
1577-
hu->hdev->shutdown = qca_power_off;
15781573

15791574
ret = qca_read_soc_version(hdev, &soc_ver, soc_type);
15801575
if (ret)
@@ -1813,6 +1808,7 @@ static int qca_init_regulators(struct qca_power *qca,
18131808
static int qca_serdev_probe(struct serdev_device *serdev)
18141809
{
18151810
struct qca_serdev *qcadev;
1811+
struct hci_dev *hdev;
18161812
const struct qca_vreg_data *data;
18171813
int err;
18181814

@@ -1838,7 +1834,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
18381834
data->num_vregs);
18391835
if (err) {
18401836
BT_ERR("Failed to init regulators:%d", err);
1841-
goto out;
1837+
return err;
18421838
}
18431839

18441840
qcadev->bt_power->vregs_on = false;
@@ -1851,7 +1847,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
18511847
err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto);
18521848
if (err) {
18531849
BT_ERR("wcn3990 serdev registration failed");
1854-
goto out;
1850+
return err;
18551851
}
18561852
} else {
18571853
qcadev->btsoc_type = QCA_ROME;
@@ -1877,12 +1873,18 @@ static int qca_serdev_probe(struct serdev_device *serdev)
18771873
return err;
18781874

18791875
err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto);
1880-
if (err)
1876+
if (err) {
1877+
BT_ERR("Rome serdev registration failed");
18811878
clk_disable_unprepare(qcadev->susclk);
1879+
return err;
1880+
}
18821881
}
18831882

1884-
out: return err;
1883+
hdev = qcadev->serdev_hu.hdev;
1884+
set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
1885+
hdev->shutdown = qca_power_off;
18851886

1887+
return 0;
18861888
}
18871889

18881890
static void qca_serdev_remove(struct serdev_device *serdev)

0 commit comments

Comments
 (0)