diff mbox series

[v2,2/3] Bluetooth: hci_qca: Move the power on from open() to setup() for QCA Rome

Message ID 20200108090804.22889-2-rjliao@codeaurora.org
State New
Headers show
Series [v4] Bluetooth: hci_qca: Add qca_power_on() API to support both wcn399x and Rome power up | expand

Commit Message

Rocky Liao Jan. 8, 2020, 9:08 a.m. UTC
This patch moves the btsoc power on from hdev->open() to hdev->setup() for
QCA Rome. And it calls the unified qca_power_on() API to perform the Rome
power on operation.

Signed-off-by: Rocky Liao <rjliao@codeaurora.org>
---

Changes in v2: Added this patch

 drivers/bluetooth/hci_qca.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index f6555bd1adbc..8fc8c9bce9ee 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -582,13 +582,8 @@  static int qca_open(struct hci_uart *hu)
 	hu->priv = qca;
 
 	if (hu->serdev) {
-
 		qcadev = serdev_device_get_drvdata(hu->serdev);
-		if (!qca_is_wcn399x(qcadev->btsoc_type)) {
-			gpiod_set_value_cansleep(qcadev->bt_en, 1);
-			/* Controller needs time to bootup. */
-			msleep(150);
-		} else {
+		if (qca_is_wcn399x(qcadev->btsoc_type)) {
 			hu->init_speed = qcadev->init_speed;
 			hu->oper_speed = qcadev->oper_speed;
 			ret = qca_regulator_enable(qcadev);
@@ -1593,6 +1588,9 @@  static int qca_setup(struct hci_uart *hu)
 			return ret;
 	} else {
 		bt_dev_info(hdev, "ROME setup");
+		ret = qca_power_on(hdev);
+		if (ret)
+			return ret;
 		qca_set_speed(hu, QCA_INIT_SPEED);
 	}