From: <sean.wang@mediatek.com>
To: <nbd@nbd.name>, <lorenzo.bianconi@redhat.com>
Cc: <sean.wang@mediatek.com>, <Soul.Huang@mediatek.com>,
<YN.Chen@mediatek.com>, <Leon.Yen@mediatek.com>,
<Eric-SY.Chang@mediatek.com>, <Deren.Wu@mediatek.com>,
<km.lin@mediatek.com>, <robin.chiu@mediatek.com>,
<Eddie.Chen@mediatek.com>, <ch.yeh@mediatek.com>,
<posh.sun@mediatek.com>, <ted.huang@mediatek.com>,
<Eric.Liang@mediatek.com>, <Stella.Chang@mediatek.com>,
<steve.lee@mediatek.com>, <jsiuda@google.com>,
<frankgor@google.com>, <jemele@google.com>, <shawnku@google.com>,
<linux-wireless@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>
Subject: [PATCH v2 07/16] mt76: mt7663s: rely on mcu reg access utility
Date: Sat, 18 Sep 2021 07:59:23 +0800 [thread overview]
Message-ID: <0c52f915f72815098a4941d01e8ad14a8db402d7.1631918993.git.objelf@gmail.com> (raw)
In-Reply-To: <cover.1631918993.git.objelf@gmail.com>
From: Sean Wang <sean.wang@mediatek.com>
rely on mcu reg access utility and drop the duplicated code.
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
.../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 684240e4624c..583cf815a696 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -2759,31 +2759,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 77e6a57b2dc0..84d459ad751f 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
next prev parent reply other threads:[~2021-09-18 0:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 23:59 [PATCH v2 00/16] Add MT7921 SDIO support sean.wang
2021-09-17 23:59 ` [PATCH v2 01/16] mt76: mt7921: refactor mac.c to be bus independent sean.wang
2021-09-17 23:59 ` [PATCH v2 02/16] mt76: mt7921: refactor dma.c to be pcie specific sean.wang
2021-09-17 23:59 ` [PATCH v2 03/16] mt76: mt7921: refactor mcu.c to be bus independent sean.wang
2021-09-17 23:59 ` [PATCH v2 04/16] mt76: mt7921: refactor init.c " sean.wang
2021-09-17 23:59 ` [PATCH v2 05/16] mt76: mt7921: add MT7921_COMMON module sean.wang
2021-09-18 10:12 ` Lorenzo Bianconi
2021-09-17 23:59 ` [PATCH v2 06/16] mt76: connac: move mcu reg access utility routines in mt76_connac_lib module sean.wang
2021-09-18 10:15 ` Lorenzo Bianconi
2021-09-17 23:59 ` sean.wang [this message]
2021-09-17 23:59 ` [PATCH v2 08/16] mt76: mt7921: make all event parser reusable between mt7921s and mt7921e sean.wang
2021-09-18 10:16 ` Lorenzo Bianconi
2021-09-17 23:59 ` [PATCH v2 09/16] mt76: mt7921: use physical addr to unify register access sean.wang
2021-09-17 23:59 ` [PATCH v2 10/16] mt76: sdio: move common code in mt76_sdio module sean.wang
2021-09-17 23:59 ` [PATCH v2 11/16] mt76: sdio: extend sdio module to support CONNAC2 sean.wang
2021-09-17 23:59 ` [PATCH v2 12/16] mt76: connac: extend mcu_get_nic_capability sean.wang
2021-09-17 23:59 ` [PATCH v2 13/16] mt76: mt7921: rely on mcu_get_nic_capability sean.wang
2021-09-17 23:59 ` [PATCH v2 14/16] mt76: mt7921: refactor mt7921_mcu_send_message sean.wang
2021-09-17 23:59 ` [PATCH v2 15/16] mt76: mt7921: introduce mt7921s support sean.wang
2021-09-17 23:59 ` [PATCH v2 16/16] mt76: mt7921s: add reset support sean.wang
2021-09-18 10:29 ` [PATCH v2 00/16] Add MT7921 SDIO support Lorenzo Bianconi
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=0c52f915f72815098a4941d01e8ad14a8db402d7.1631918993.git.objelf@gmail.com \
--to=sean.wang@mediatek.com \
--cc=Deren.Wu@mediatek.com \
--cc=Eddie.Chen@mediatek.com \
--cc=Eric-SY.Chang@mediatek.com \
--cc=Eric.Liang@mediatek.com \
--cc=Leon.Yen@mediatek.com \
--cc=Soul.Huang@mediatek.com \
--cc=Stella.Chang@mediatek.com \
--cc=YN.Chen@mediatek.com \
--cc=ch.yeh@mediatek.com \
--cc=frankgor@google.com \
--cc=jemele@google.com \
--cc=jsiuda@google.com \
--cc=km.lin@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
--cc=posh.sun@mediatek.com \
--cc=robin.chiu@mediatek.com \
--cc=shawnku@google.com \
--cc=steve.lee@mediatek.com \
--cc=ted.huang@mediatek.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).