misc: rtsx: modify en/disable aspm function
enable/disable device ASPM function: changed write ASPM configuration directly to use write register Signed-off-by: Ricky Wu <ricky_wu@realtek.com> Link: https://lore.kernel.org/r/20201202063124.18262-1-ricky_wu@realtek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
31dcb6c30a
commit
d928061c31
|
@ -89,9 +89,15 @@ static void rtsx_comm_set_aspm(struct rtsx_pcr *pcr, bool enable)
|
||||||
if (pcr->aspm_enabled == enable)
|
if (pcr->aspm_enabled == enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL,
|
if (pcr->aspm_en & 0x02)
|
||||||
PCI_EXP_LNKCTL_ASPMC,
|
rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, FORCE_ASPM_CTL0 |
|
||||||
enable ? pcr->aspm_en : 0);
|
FORCE_ASPM_CTL1, enable ? 0 : FORCE_ASPM_CTL0 | FORCE_ASPM_CTL1);
|
||||||
|
else
|
||||||
|
rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, FORCE_ASPM_CTL0 |
|
||||||
|
FORCE_ASPM_CTL1, FORCE_ASPM_CTL0 | FORCE_ASPM_CTL1);
|
||||||
|
|
||||||
|
if (!enable && (pcr->aspm_en & 0x02))
|
||||||
|
mdelay(10);
|
||||||
|
|
||||||
pcr->aspm_enabled = enable;
|
pcr->aspm_enabled = enable;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue