From patchwork Wed Mar 16 23:15:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 552650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34013C433F5 for ; Wed, 16 Mar 2022 23:15:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239629AbiCPXQ4 (ORCPT ); Wed, 16 Mar 2022 19:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238175AbiCPXQy (ORCPT ); Wed, 16 Mar 2022 19:16:54 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F6BF25F0; Wed, 16 Mar 2022 16:15:34 -0700 (PDT) X-UUID: 5c96fb7c084e46ababa923be6c4b354e-20220317 X-UUID: 5c96fb7c084e46ababa923be6c4b354e-20220317 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2029643742; Thu, 17 Mar 2022 07:15:29 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 17 Mar 2022 07:15:27 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 17 Mar 2022 07:15:27 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , Yake Yang Subject: [PATCH v5 3/5] Bluetooth: mt7921s: Add .get_data_path_id Date: Thu, 17 Mar 2022 07:15:21 +0800 Message-ID: <31997a82354ed4bebf849e07f04b663a1a898a70.1647472087.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Yake Yang Add .get_data_path_id to fetch data_path_id for MT7921 to support HFP offload use case. This is a preliminary patch to add the WBS support to the MT7921 driver. Reviewed-by: Mark Chen Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang --- v4->v5: no change --- drivers/bluetooth/btmtksdio.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 034e55278c56..4000a994fe2c 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -936,6 +936,13 @@ static int btmtksdio_mtk_reg_write(struct hci_dev *hdev, u32 reg, u32 val, u32 m return err; } +static int btmtksdio_get_data_path_id(struct hci_dev *hdev, __u8 *data_path_id) +{ + /* uses 1 as data path id for all the usecases */ + *data_path_id = 1; + return 0; +} + static int btmtksdio_sco_setting(struct hci_dev *hdev) { const struct btmtk_sco sco_setting = { @@ -968,7 +975,13 @@ static int btmtksdio_sco_setting(struct hci_dev *hdev) return err; val |= 0x00000101; - return btmtksdio_mtk_reg_write(hdev, MT7921_PINMUX_1, val, ~0); + err = btmtksdio_mtk_reg_write(hdev, MT7921_PINMUX_1, val, ~0); + if (err < 0) + return err; + + hdev->get_data_path_id = btmtksdio_get_data_path_id; + + return err; } static int btmtksdio_reset_setting(struct hci_dev *hdev)