[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191226064554.16803-1-rjliao@codeaurora.org>
Date: Thu, 26 Dec 2019 14:45:51 +0800
From: Rocky Liao <rjliao@...eaurora.org>
To: marcel@...tmann.org, johan.hedberg@...il.com
Cc: linux-kernel@...r.kernel.org, linux-bluetooth@...r.kernel.org,
linux-arm-msm@...r.kernel.org, Rocky Liao <rjliao@...eaurora.org>
Subject: [PATCH v2 1/4] Bluetooth: hci_qca: Add QCA Rome power off support to the qca_power_off()
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@...eaurora.org>
---
Changes in v2: None
drivers/bluetooth/hci_qca.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index b602ed01505b..43fd84028786 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -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;
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Powered by blists - more mailing lists