mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 04:09:18 -04:00
mt76: mt7921: introduce mt7921_run_firmware utility routine.
This is a preliminary patch to introduce chip reset for mt7921 devices. Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
committed by
Felix Fietkau
parent
acf337c33d
commit
d32464e68f
@@ -927,6 +927,24 @@ int mt7921_mcu_fw_log_2_host(struct mt7921_dev *dev, u8 ctrl)
|
||||
sizeof(data), false);
|
||||
}
|
||||
|
||||
int mt7921_run_firmware(struct mt7921_dev *dev)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mt7921_driver_own(dev);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = mt7921_load_firmware(dev);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
|
||||
mt7921_mcu_fw_log_2_host(dev, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mt7921_mcu_init(struct mt7921_dev *dev)
|
||||
{
|
||||
static const struct mt76_mcu_ops mt7921_mcu_ops = {
|
||||
@@ -935,22 +953,10 @@ int mt7921_mcu_init(struct mt7921_dev *dev)
|
||||
.mcu_parse_response = mt7921_mcu_parse_response,
|
||||
.mcu_restart = mt7921_mcu_restart,
|
||||
};
|
||||
int ret;
|
||||
|
||||
dev->mt76.mcu_ops = &mt7921_mcu_ops;
|
||||
|
||||
ret = mt7921_driver_own(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = mt7921_load_firmware(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
|
||||
mt7921_mcu_fw_log_2_host(dev, 1);
|
||||
|
||||
return 0;
|
||||
return mt7921_run_firmware(dev);
|
||||
}
|
||||
|
||||
void mt7921_mcu_exit(struct mt7921_dev *dev)
|
||||
|
||||
@@ -220,6 +220,7 @@ void mt7921_eeprom_init_sku(struct mt7921_dev *dev);
|
||||
int mt7921_dma_init(struct mt7921_dev *dev);
|
||||
void mt7921_dma_prefetch(struct mt7921_dev *dev);
|
||||
void mt7921_dma_cleanup(struct mt7921_dev *dev);
|
||||
int mt7921_run_firmware(struct mt7921_dev *dev);
|
||||
int mt7921_mcu_init(struct mt7921_dev *dev);
|
||||
int mt7921_mcu_add_bss_info(struct mt7921_phy *phy,
|
||||
struct ieee80211_vif *vif, int enable);
|
||||
|
||||
Reference in New Issue
Block a user