Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1935423rdf; Sun, 5 Nov 2023 22:20:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyzr2TzWqAhT2ST1TQqMPzIftuD6GXhgueZJIjMvPUjDo/fxuzhHDYigEnl4z7OZP/YRaz X-Received: by 2002:a0d:d64e:0:b0:59b:c6a4:15c7 with SMTP id y75-20020a0dd64e000000b0059bc6a415c7mr9636633ywd.46.1699251607107; Sun, 05 Nov 2023 22:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699251607; cv=none; d=google.com; s=arc-20160816; b=wVJGDJvJIFznO38E1MV7Ji0SW7legXkTiUATRJCX1z19g5HXM8XTC+B+jeEQsBghxg 3gWhoFxNNs8TWK3ZJYdvRc22doEMsUhksX7xCP6s9jlUfuD0x6w3C2Vr/3je/Uul5FiA 91+EomOrA7BXwnCVIsV4wAAsrxwLtYIob/GlsCGJS1/gWNQMOLI35orlWHhYSLW4AvcD vck1N/zO/ROrFkoW2nMnjr0OUyDw76CTqaUKmHoGABqrtQiabixdxFfTUk+XvKc+va4B 3YIQLS/hFcW2YCGtCBD4/oLr3rQL9qunpXvrR/0U3Nrm7WrNSHtkVyHRA1D1nVNn3HOU QgqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=13+4W0mP2syXnotM3JGgG55WjDNmDtDoFjjtXNYIuNk=; fh=Kr3IN6esmjNREfkbiMm8bL6RvF40RecC5yDEPfmNSiw=; b=Jee5Uz36AMTA9Q/teiTx5p32Da38jZG3wcb1tLWFh3B4IeBiJJQqLr51Lb2J/orUp4 +l2ZWu3LVtWyESW2lTcv67XI0IzlDIy5yRvTReNF5+JiZvcePckixkCz5ziObzvNCYis XtQYzDk9aCkaVvY2Rt9mqjiEnhGQ0eafvq+f9++6bIuGovXrc1MalH3uwux6k4GHzElx HKSSxJFZPkjsQPSaqSMV23OIsslvFaK26890lC8mj2kI7EwVw5llGJtGoeknHvvTG7ah 9VWNMO1yp0UXED0DC3kj5m9Dw/MaqJ4Ev+us2yTAgiWZMEuKTaksNcNSGSb9Qus5Rre2 boQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=epQWC2+y; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id j190-20020a638bc7000000b005b8ac0af52csi6927199pge.1.2023.11.05.22.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 22:20:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=epQWC2+y; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9205D809C910; Sun, 5 Nov 2023 22:20:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbjKFGUD (ORCPT + 99 others); Mon, 6 Nov 2023 01:20:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbjKFGUC (ORCPT ); Mon, 6 Nov 2023 01:20:02 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4453E1 for ; Sun, 5 Nov 2023 22:19:59 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A65DAGQ011286; Mon, 6 Nov 2023 06:19:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=13+4W0mP2syXnotM3JGgG55WjDNmDtDoFjjtXNYIuNk=; b=epQWC2+ys8sOy5wtWucjqAr0kTAO9QcDbPKRpflm6QsgYSaNj+VvdKhCxnc9LtLq9zJ/ SZ37x8AVjgk5PV7OpKfyg0ln2I5fFwB61WJkFqN4JxhrCdvOzHXqFqw2EsabUgxS8MhH pz6vsnKemuHzq67A0FP55pOsEUjAmvNLF3cy36R0GcQYgusq/qEOkQndOwER+JQF8GmS 87qjoaRvkPDm++LqjrfFmp88FzrKKwK/BmLEqEcmKfm9sA81/+3mAtTHkmL//j3CwYN9 3bKiLkMFPQt9GFctaQt2fRCagY0qyV5qksqAkH4jJpfZwyj1WaaI/T6la5+U5q/t/pMa 4g== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u5eqn36k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Nov 2023 06:19:56 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3A66JtPO025935 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 6 Nov 2023 06:19:56 GMT Received: from zijuhu-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Sun, 5 Nov 2023 22:19:53 -0800 From: Zijun Hu To: , , CC: , Subject: [PATCH v1 2/2] Bluetooth: qca: Support SCO offload for QCA2066 Date: Mon, 6 Nov 2023 14:19:25 +0800 Message-ID: <1699251565-28759-3-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1699251565-28759-1-git-send-email-quic_zijuhu@quicinc.com> References: <1699251565-28759-1-git-send-email-quic_zijuhu@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: B9doJvGXM09DMZ5hETVw8FPDGbs2bR1X X-Proofpoint-ORIG-GUID: B9doJvGXM09DMZ5hETVw8FPDGbs2bR1X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-06_04,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 malwarescore=0 clxscore=1015 adultscore=0 impostorscore=0 mlxlogscore=950 priorityscore=1501 phishscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311060054 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 05 Nov 2023 22:20:02 -0800 (PST) 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 --- 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