Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2887716pxb; Tue, 12 Oct 2021 15:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjOPmX3M5P2QyHsCTPXiaplclLycOOM8n7uDS9AZpTxYrBJMbaiFOtq/0o5F8kwWgrJvWX X-Received: by 2002:a05:6a00:1a8e:b0:44c:f3cb:2a77 with SMTP id e14-20020a056a001a8e00b0044cf3cb2a77mr21206712pfv.53.1634079179781; Tue, 12 Oct 2021 15:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634079179; cv=none; d=google.com; s=arc-20160816; b=0z2VvawxyzQ7hH3A7yq++2Efl7k94DZzqNIossXnlN0G3ltMUJyEahuyxTban5mO89 SFyaxwoURV+0Tr+Y9DLhiLRSm9jUtTm0Gr6zN36SIodUxUCNMUgXRgn+IayrNfGopaQj bwAnZTmz0DF2kvI6Jdgbk9JbyoEmOdjtWTS4o46qdaCZjEhyFP/9rcbPkI7NxT6U1D9f KUQuWYqeaTf4riBUhwYMoZ8gwquQDzsIK1CDpPqIHhl5ij0ziyMIqd6pDYuPvnDM47ra 6QfjjStIVZ9YBgdpIBPlcAU8Xh6TkP/SxOPZipHS2b3fCRlQvFWqwPPxn+IQShcSKlAa 7xuQ== 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; bh=xoC3eT4ICk33uUPyf2FNRm8llIja41h+1ons2SvAJLE=; b=td/QpPY5gzkexdffjfVAT99sfExwJIxIIcWhznfSaS7K5fqrgBvH0TvcCjjv5HAVDL iD3MdgjiJLg1PuBoQHVcIs63gzhciGItFSG/SyORd6UlSd18gbwzalkowt6buRsn+lm5 fAQLVEnzIE86X6Ec3PnBNA1M2P39If/6w3UOYYmbyn6h96cs86CzjmVdhoKlAFyU3TjC 1I95PIwfmQdR426JIPXldynmdIGgAEK7g1PPjsollq/SAVUVqwhVGkK+8t4wfekHJiZ+ d+QEy+U9Q/1ZQ3GYNsCVgRoDNeWFJkgJrA4sL+vzzR2TObzTDkF71laQTCAK5r14CUUq W2ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si14457629plb.86.2021.10.12.15.52.51; Tue, 12 Oct 2021 15:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235640AbhJLWyo (ORCPT + 63 others); Tue, 12 Oct 2021 18:54:44 -0400 Received: from mailgw02.mediatek.com ([216.200.240.185]:42080 "EHLO mailgw02.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233192AbhJLWym (ORCPT ); Tue, 12 Oct 2021 18:54:42 -0400 X-UUID: f85cd97ca13c4ba0b4e5a013bbf9ccd4-20211012 X-UUID: f85cd97ca13c4ba0b4e5a013bbf9ccd4-20211012 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 307440769; Tue, 12 Oct 2021 15:52:39 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 12 Oct 2021 15:52:37 -0700 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, 13 Oct 2021 06:52:36 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 07/16] mt76: mt7663s: rely on mcu reg access utility Date: Wed, 13 Oct 2021 06:52:00 +0800 Message-ID: <2dc1961473d2965b7334056725d669cac7b1c412.1634077769.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang rely on mcu reg access utility and drop the duplicated code. Acked-by: Lorenzo Bianconi Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 28 ------------------- .../wireless/mediatek/mt76/mt7615/mt7615.h | 2 -- .../wireless/mediatek/mt76/mt7615/sdio_mcu.c | 4 +-- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 2ba730808f3b..2cb3969e6432 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -2769,31 +2769,3 @@ int mt7615_mcu_set_roc(struct mt7615_phy *phy, struct ieee80211_vif *vif, return mt76_mcu_send_msg(&dev->mt76, MCU_CMD_SET_ROC, &req, sizeof(req), false); } - -u32 mt7615_mcu_reg_rr(struct mt76_dev *dev, u32 offset) -{ - struct { - __le32 addr; - __le32 val; - } __packed req = { - .addr = cpu_to_le32(offset), - }; - - return mt76_mcu_send_msg(dev, MCU_CMD_REG_READ, &req, sizeof(req), - true); -} -EXPORT_SYMBOL_GPL(mt7615_mcu_reg_rr); - -void mt7615_mcu_reg_wr(struct mt76_dev *dev, u32 offset, u32 val) -{ - struct { - __le32 addr; - __le32 val; - } __packed req = { - .addr = cpu_to_le32(offset), - .val = cpu_to_le32(val), - }; - - mt76_mcu_send_msg(dev, MCU_CMD_REG_WRITE, &req, sizeof(req), false); -} -EXPORT_SYMBOL_GPL(mt7615_mcu_reg_wr); diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h index 58a98b5c0cbc..437f14f06e63 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h @@ -553,8 +553,6 @@ int mt7615_mac_set_beacon_filter(struct mt7615_phy *phy, int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif, bool enable); int __mt7663_load_firmware(struct mt7615_dev *dev); -u32 mt7615_mcu_reg_rr(struct mt76_dev *dev, u32 offset); -void mt7615_mcu_reg_wr(struct mt76_dev *dev, u32 offset, u32 val); void mt7615_coredump_work(struct work_struct *work); void mt7622_trigger_hif_int(struct mt7615_dev *dev, bool en); diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c index 45c1cd3b9f49..517419bb7772 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c @@ -137,8 +137,8 @@ int mt7663s_mcu_init(struct mt7615_dev *dev) .mcu_skb_send_msg = mt7663s_mcu_send_message, .mcu_parse_response = mt7615_mcu_parse_response, .mcu_restart = mt7615_mcu_restart, - .mcu_rr = mt7615_mcu_reg_rr, - .mcu_wr = mt7615_mcu_reg_wr, + .mcu_rr = mt76_connac_mcu_reg_rr, + .mcu_wr = mt76_connac_mcu_reg_wr, }; struct mt7615_mcu_ops *mcu_ops; int ret; -- 2.25.1