linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zijun Hu <quic_zijuhu@quicinc.com>
To: <luiz.dentz@gmail.com>, <marcel@holtmann.org>, <johan.hedberg@gmail.com>
Cc: <linux-bluetooth@vger.kernel.org>, <quic_zijuhu@quicinc.com>,
	Zijun Hu <zijuhu@qti.qualcomm.com>
Subject: [PATCH v2 2/2] Bluetooth: qca: Support SCO offload for QCA2066
Date: Wed, 29 Nov 2023 16:07:35 +0800	[thread overview]
Message-ID: <1701245255-12409-3-git-send-email-quic_zijuhu@quicinc.com> (raw)
In-Reply-To: <1701245255-12409-1-git-send-email-quic_zijuhu@quicinc.com>

In order to support SCO offload for QCA2066, ALL BTHOST needs to do
is specifying both Input_Data_Path and Output_Data_Path as 0x01 for
HCI_Enhanced_Setup_Synchronous_Connection, and it is implemented by
this change.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 drivers/bluetooth/hci_qca.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 35f74f209d1f..68347b2a204a 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1815,6 +1815,21 @@ static void hci_coredump_qca(struct hci_dev *hdev)
 	kfree_skb(skb);
 }
 
+static int qca_get_data_path_id(struct hci_dev *hdev, __u8 *data_path_id)
+{
+	/* QCA uses 1 as data path id for SCO offload */
+	*data_path_id = 1;
+	return 0;
+}
+
+static int qca_configure_sco_offload(struct hci_dev *hdev)
+{
+	bt_dev_info(hdev, "SCO offload is supported");
+	hdev->get_data_path_id = qca_get_data_path_id;
+	hdev->get_codec_config_data = NULL;
+	return 0;
+}
+
 static int qca_setup(struct hci_uart *hu)
 {
 	struct hci_dev *hdev = hu->hdev;
@@ -1969,6 +1984,10 @@ static int qca_setup(struct hci_uart *hu)
 		hu->hdev->set_bdaddr = qca_set_bdaddr_rome;
 	else
 		hu->hdev->set_bdaddr = qca_set_bdaddr;
+
+	if (soc_type == QCA_QCA2066)
+		qca_configure_sco_offload(hdev);
+
 	qca->fw_version = le16_to_cpu(ver.patch_ver);
 	qca->controller_id = le16_to_cpu(ver.rom_ver);
 	hci_devcd_register(hdev, hci_coredump_qca, qca_dmp_hdr, NULL);
-- 
The Qualcomm Innovation Center


  parent reply	other threads:[~2023-11-29  8:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06  6:19 [PATCH v1 0/2] Bluetooth: Support SCO offload for QCA2066 Zijun Hu
2023-11-06  6:19 ` [PATCH v1 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-06  7:00   ` Bluetooth: Support SCO offload for QCA2066 bluez.test.bot
2023-11-06  6:19 ` [PATCH v1 2/2] Bluetooth: qca: " Zijun Hu
2023-11-29  7:07   ` [PATCH v2 " Zijun Hu
2023-11-06 16:16 ` [PATCH v1 0/2] Bluetooth: " Luiz Augusto von Dentz
2023-11-07  2:46   ` quic_zijuhu
2023-11-17 16:02     ` Luiz Augusto von Dentz
2023-11-29  3:29       ` quic_zijuhu
2023-12-07 21:59         ` quic_zijuhu
2023-11-29  8:07 ` [PATCH v2 " Zijun Hu
2023-11-29  8:07   ` [PATCH v2 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-29  8:35     ` Bluetooth: Support SCO offload for QCA2066 bluez.test.bot
2023-11-29  8:07   ` Zijun Hu [this message]
2023-11-29  8:18 ` [PATCH v2 0/2] " Zijun Hu
2023-11-29  8:18   ` [PATCH v2 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-29  8:58     ` [v2,1/2] " bluez.test.bot
2023-11-29  8:18   ` [PATCH v2 2/2] Bluetooth: qca: Support SCO offload for QCA2066 Zijun Hu
2023-11-29  8:29   ` [PATCH v3 0/2] Bluetooth: " Zijun Hu
2023-11-29  8:29     ` [PATCH v3 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Zijun Hu
2023-11-29  8:57       ` Bluetooth: Support SCO offload for QCA2066 bluez.test.bot
2023-11-29  8:29     ` [PATCH v3 2/2] Bluetooth: qca: " Zijun Hu
2023-12-08  1:51     ` [PATCH v4 0/2] Bluetooth: " Zijun Hu
2023-12-08  1:51       ` [PATCH v4 1/2] Bluetooth: hci_conn: Check non NULL function before calling for HFP offload Zijun Hu
2023-12-08  2:47         ` Bluetooth: Support SCO offload for QCA2066 bluez.test.bot
2023-12-08  1:51       ` [PATCH v4 2/2] Bluetooth: qca: Support HFP " Zijun Hu
2023-12-08 15:10       ` [PATCH v4 0/2] Bluetooth: Support SCO " patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1701245255-12409-3-git-send-email-quic_zijuhu@quicinc.com \
    --to=quic_zijuhu@quicinc.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=zijuhu@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).