From: Lorenzo Bianconi <lorenzo@kernel.org> To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, ryder.lee@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 4/9] mt76: mt7615: introduce __mt7663_load_firmware routine Date: Thu, 2 Apr 2020 20:18:51 +0200 [thread overview] Message-ID: <e3e930b199235f8aa628c437862647c5197569b9.1585851049.git.lorenzo@kernel.org> (raw) In-Reply-To: <cover.1585851049.git.lorenzo@kernel.org> Introduce __mt7663_load_firmware routine to load firmware for usb devices. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 22 ++++++++++++++----- .../wireless/mediatek/mt76/mt7615/mt7615.h | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 12759158e69a..dcd97606e827 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -2078,12 +2078,10 @@ static int mt7663_load_n9(struct mt7615_dev *dev, const char *name) return ret; } -static int mt7663_load_firmware(struct mt7615_dev *dev) +int __mt7663_load_firmware(struct mt7615_dev *dev) { int ret; - mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); - ret = mt76_get_field(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_N9_RDY); if (ret) { dev_dbg(dev->mt76.dev, "Firmware is already download\n"); @@ -2109,12 +2107,26 @@ static int mt7663_load_firmware(struct mt7615_dev *dev) return -EIO; } - mt76_clear(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); - dev_dbg(dev->mt76.dev, "Firmware init done\n"); return 0; } +EXPORT_SYMBOL_GPL(__mt7663_load_firmware); + +static int mt7663_load_firmware(struct mt7615_dev *dev) +{ + int ret; + + mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); + + ret = __mt7663_load_firmware(dev); + if (ret) + return ret; + + mt76_clear(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); + + return 0; +} int mt7615_mcu_init(struct mt7615_dev *dev) { diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h index 35bfab58490e..c0bc4913eec4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h @@ -460,5 +460,6 @@ int mt7615_mcu_set_sku_en(struct mt7615_phy *phy, bool enable); int mt7615_dfs_init_radar_detector(struct mt7615_phy *phy); int mt7615_init_debugfs(struct mt7615_dev *dev); +int __mt7663_load_firmware(struct mt7615_dev *dev); #endif -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Lorenzo Bianconi <lorenzo@kernel.org> To: nbd@nbd.name Cc: linux-mediatek@lists.infradead.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com Subject: [PATCH 4/9] mt76: mt7615: introduce __mt7663_load_firmware routine Date: Thu, 2 Apr 2020 20:18:51 +0200 [thread overview] Message-ID: <e3e930b199235f8aa628c437862647c5197569b9.1585851049.git.lorenzo@kernel.org> (raw) In-Reply-To: <cover.1585851049.git.lorenzo@kernel.org> Introduce __mt7663_load_firmware routine to load firmware for usb devices. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 22 ++++++++++++++----- .../wireless/mediatek/mt76/mt7615/mt7615.h | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 12759158e69a..dcd97606e827 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -2078,12 +2078,10 @@ static int mt7663_load_n9(struct mt7615_dev *dev, const char *name) return ret; } -static int mt7663_load_firmware(struct mt7615_dev *dev) +int __mt7663_load_firmware(struct mt7615_dev *dev) { int ret; - mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); - ret = mt76_get_field(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_N9_RDY); if (ret) { dev_dbg(dev->mt76.dev, "Firmware is already download\n"); @@ -2109,12 +2107,26 @@ static int mt7663_load_firmware(struct mt7615_dev *dev) return -EIO; } - mt76_clear(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); - dev_dbg(dev->mt76.dev, "Firmware init done\n"); return 0; } +EXPORT_SYMBOL_GPL(__mt7663_load_firmware); + +static int mt7663_load_firmware(struct mt7615_dev *dev) +{ + int ret; + + mt76_set(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); + + ret = __mt7663_load_firmware(dev); + if (ret) + return ret; + + mt76_clear(dev, MT_WPDMA_GLO_CFG, MT_WPDMA_GLO_CFG_BYPASS_TX_SCH); + + return 0; +} int mt7615_mcu_init(struct mt7615_dev *dev) { diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h index 35bfab58490e..c0bc4913eec4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h @@ -460,5 +460,6 @@ int mt7615_mcu_set_sku_en(struct mt7615_phy *phy, bool enable); int mt7615_dfs_init_radar_detector(struct mt7615_phy *phy); int mt7615_init_debugfs(struct mt7615_dev *dev); +int __mt7663_load_firmware(struct mt7615_dev *dev); #endif -- 2.25.1 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2020-04-02 18:19 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-02 18:18 [PATCH 0/9] add preliminary usb support to mt7615 driver Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 1/9] mt76: add headroom and tailroom to mt76_mcu_ops data structure Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 2/9] mt76: mt7615: introduce mt7663u support to mt7615_write_txwi Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 3/9] mt76: mt7615: introduce mt7615_mac_update_rate_desc routine Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi [this message] 2020-04-02 18:18 ` [PATCH 4/9] mt76: mt7615: introduce __mt7663_load_firmware routine Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 5/9] mt76: mt7615: move mt7615_mac_wtbl_addr in mac.h Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 6/9] mt76: mt76u: rely on mt7622 queue scheme for mt7663u Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 7/9] mt76: mt7615: rework wtbl key configuration Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 8/9] mt76: mt7615: introduce mt7615_wtbl_desc data structure Lorenzo Bianconi 2020-04-02 18:18 ` Lorenzo Bianconi 2020-04-02 18:18 ` [PATCH 9/9] mt76: mt7615: add address parameter to mt7615_eeprom_init Lorenzo Bianconi 2020-04-02 18:18 ` 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=e3e930b199235f8aa628c437862647c5197569b9.1585851049.git.lorenzo@kernel.org \ --to=lorenzo@kernel.org \ --cc=linux-mediatek@lists.infradead.org \ --cc=linux-wireless@vger.kernel.org \ --cc=lorenzo.bianconi@redhat.com \ --cc=nbd@nbd.name \ --cc=ryder.lee@mediatek.com \ --cc=sean.wang@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.