You need to sign in or sign up before continuing.
提交 db2ad7c2 编写于 作者: L Lorenzo Bianconi 提交者: Kalle Valo

mt76: use mt76_poll_msec routine in mt76pci_load_firmware()

Use mt76_poll_msec() in mt76pci_load_firmware to check if the firmware
has been started instead of explicitly poll MCU running register
Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 b1c2d0f2
...@@ -187,7 +187,7 @@ mt76pci_load_firmware(struct mt76x2_dev *dev) ...@@ -187,7 +187,7 @@ mt76pci_load_firmware(struct mt76x2_dev *dev)
{ {
const struct firmware *fw; const struct firmware *fw;
const struct mt76x2_fw_header *hdr; const struct mt76x2_fw_header *hdr;
int i, len, ret; int len, ret;
__le32 *cur; __le32 *cur;
u32 offset, val; u32 offset, val;
...@@ -240,16 +240,7 @@ mt76pci_load_firmware(struct mt76x2_dev *dev) ...@@ -240,16 +240,7 @@ mt76pci_load_firmware(struct mt76x2_dev *dev)
/* trigger firmware */ /* trigger firmware */
mt76_wr(dev, MT_MCU_INT_LEVEL, 2); mt76_wr(dev, MT_MCU_INT_LEVEL, 2);
for (i = 200; i > 0; i--) { if (!mt76_poll_msec(dev, MT_MCU_COM_REG0, 1, 1, 200)) {
val = mt76_rr(dev, MT_MCU_COM_REG0);
if (val & 1)
break;
msleep(10);
}
if (!i) {
dev_err(dev->mt76.dev, "Firmware failed to start\n"); dev_err(dev->mt76.dev, "Firmware failed to start\n");
release_firmware(fw); release_firmware(fw);
return -ETIMEDOUT; return -ETIMEDOUT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册