Skip to content

Commit

Permalink
mt76x0: disable HW before probe
Browse files Browse the repository at this point in the history
Disable HW before probe, otherwise after reboot we will fail
to initialize MCU.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Stanislaw Gruszka authored and Kalle Valo committed Aug 2, 2018
1 parent 52abb14 commit 369bbec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt76x0/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mt76x0_set_wlan_state(struct mt76x0_dev *dev, u32 val, bool enable)
dev_err(dev->mt76.dev, "Error: PLL and XTAL check failed!\n");
}

static void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset)
void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset)
{
u32 val;

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ struct mt76x0_dev *mt76x0_alloc_device(struct device *dev);
int mt76x0_init_hardware(struct mt76x0_dev *dev);
int mt76x0_register_device(struct mt76x0_dev *dev);
void mt76x0_cleanup(struct mt76x0_dev *dev);
void mt76x0_chip_onoff(struct mt76x0_dev *dev, bool enable, bool reset);

int mt76x0_mac_start(struct mt76x0_dev *dev);
void mt76x0_mac_stop(struct mt76x0_dev *dev);
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ static int mt76x0_probe(struct usb_interface *usb_intf,
ret = mt76x0_assign_pipes(usb_intf, dev);
if (ret)
goto err;

/* Disable the HW, otherwise MCU fail to initalize on hot reboot */
mt76x0_chip_onoff(dev, false, false);

ret = mt76x0_wait_asic_ready(dev);
if (ret)
goto err;
Expand Down

0 comments on commit 369bbec

Please sign in to comment.