Thread (5 messages) 5 messages, 2 authors, 2018-03-13

Re: [PATCH 3/3] Bluetooth: hci_qca: Add serdev support

From: Loic Poulain <hidden>
Date: 2018-03-13 18:19:40
Also in: linux-arm-msm, linux-devicetree, lkml

On 13 March 2018 at 17:03, Thierry Escande [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Thierry Escande <redacted>

Add support for Qualcomm serial slave devices. Probe the serial device,
retrieve its maximum speed and register a new hci uart device.

Signed-off-by: Thierry Escande <redacted>
---
 drivers/bluetooth/Kconfig   |   2 +-
 drivers/bluetooth/hci_qca.c | 102 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 101 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 07e55cd8f8c8..c2a6a7ebd14b 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -195,7 +195,7 @@ config BT_HCIUART_BCM

 config BT_HCIUART_QCA
        bool "Qualcomm Atheros protocol support"
-       depends on BT_HCIUART
+       depends on BT_HCIUART_SERDEV
Driver depends on both BT_HCIUART and BT_HCIUART_SERDEV.
quoted hunk ↗ jump to hunk
@@ -386,6 +399,7 @@ static void hci_ibs_wake_retrans_timeout(struct timer_list *t)
 /* Initialize protocol */
 static int qca_open(struct hci_uart *hu)
 {
+       struct qca_serdev *qcadev;
        struct qca_data *qca;

        BT_DBG("hu %p qca_open", hu);
@@ -444,6 +458,13 @@ static int qca_open(struct hci_uart *hu)
        timer_setup(&qca->tx_idle_timer, hci_ibs_tx_idle_timeout, 0);
        qca->tx_idle_delay = IBS_TX_IDLE_TIMEOUT_MS;

+       if (hu->serdev) {
+               serdev_device_open(hu->serdev);
+
+               qcadev = serdev_device_get_drvdata(hu->serdev);
+               gpiod_set_value(qcadev->bt_en, 1);
I suggest to replace gpiod_set_value calls with the _cansleep version.
You always set gpio value from sleepable context and this should avoid
any further issue with different gpio controller.

Regards,
Loic
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help