From patchwork Tue Mar 15 17:54:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 551471 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 5E391C433EF for ; Tue, 15 Mar 2022 17:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350788AbiCORzq (ORCPT ); Tue, 15 Mar 2022 13:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350772AbiCORzo (ORCPT ); Tue, 15 Mar 2022 13:55:44 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B471659380; Tue, 15 Mar 2022 10:54:31 -0700 (PDT) X-UUID: a358b94e767d44d4b41fd987a3bc5c0b-20220316 X-UUID: a358b94e767d44d4b41fd987a3bc5c0b-20220316 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 379274700; Wed, 16 Mar 2022 01:54:24 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Mar 2022 01:54:23 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 16 Mar 2022 01:54:23 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , Yake Yang Subject: [PATCH v4 3/5] Bluetooth: mt7921s: Add .get_data_path_id Date: Wed, 16 Mar 2022 01:54:06 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <7b4627d5017be2c26ded9daf7fd297bed6614852.1647366404.git.objelf@gmail.com> References: <7b4627d5017be2c26ded9daf7fd297bed6614852.1647366404.git.objelf@gmail.com> 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 --- 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)