Skip to content

Commit 32faa3f

Browse files
Ryan Hsukvalo
authored andcommitted
ath10k: add the PCI PM core suspend/resume ops
The actual PCI suspend/resume in ath10k has been handled in wow.c, but in the case of the device doesn't support remote wakeup, the .hif_suspend() and .hif_resume() will never be handled. ath10k_wow_op_suspend() { if (WARN_ON(!test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT, ar->running_fw->fw_file.fw_features))) { ret = 1; goto exit; } .... ret = ath10k_hif_suspend(ar); } So register the PCI PM core to support the suspend/resume if the device doesn't support remote wakeup. Signed-off-by: Ryan Hsu <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 69fecf5 commit 32faa3f

File tree

1 file changed

+42
-0
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+42
-0
lines changed

drivers/net/wireless/ath/ath10k/pci.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,11 +3396,53 @@ static void ath10k_pci_remove(struct pci_dev *pdev)
33963396

33973397
MODULE_DEVICE_TABLE(pci, ath10k_pci_id_table);
33983398

3399+
#ifdef CONFIG_PM
3400+
3401+
static int ath10k_pci_pm_suspend(struct device *dev)
3402+
{
3403+
struct ath10k *ar = dev_get_drvdata(dev);
3404+
int ret;
3405+
3406+
if (test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT,
3407+
ar->running_fw->fw_file.fw_features))
3408+
return 0;
3409+
3410+
ret = ath10k_hif_suspend(ar);
3411+
if (ret)
3412+
ath10k_warn(ar, "failed to suspend hif: %d\n", ret);
3413+
3414+
return ret;
3415+
}
3416+
3417+
static int ath10k_pci_pm_resume(struct device *dev)
3418+
{
3419+
struct ath10k *ar = dev_get_drvdata(dev);
3420+
int ret;
3421+
3422+
if (test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT,
3423+
ar->running_fw->fw_file.fw_features))
3424+
return 0;
3425+
3426+
ret = ath10k_hif_resume(ar);
3427+
if (ret)
3428+
ath10k_warn(ar, "failed to resume hif: %d\n", ret);
3429+
3430+
return ret;
3431+
}
3432+
3433+
static SIMPLE_DEV_PM_OPS(ath10k_pci_pm_ops,
3434+
ath10k_pci_pm_suspend,
3435+
ath10k_pci_pm_resume);
3436+
#endif
3437+
33993438
static struct pci_driver ath10k_pci_driver = {
34003439
.name = "ath10k_pci",
34013440
.id_table = ath10k_pci_id_table,
34023441
.probe = ath10k_pci_probe,
34033442
.remove = ath10k_pci_remove,
3443+
#ifdef CONFIG_PM
3444+
.driver.pm = &ath10k_pci_pm_ops,
3445+
#endif
34043446
};
34053447

34063448
static int __init ath10k_pci_init(void)

0 commit comments

Comments
 (0)