Skip to content

Commit

Permalink
misc: rtsx: Use standard PCI definitions
Browse files Browse the repository at this point in the history
When reading registers defined by the PCIe spec, use the names already
defined by the PCI core.  This makes maintenance of the PCI core and
drivers easier.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200721212336.1159079-6-helgaas@kernel.org
[ additional replacements due to changes in my tree - gregkh ]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Bjorn Helgaas authored and Greg Kroah-Hartman committed Jul 22, 2020
1 parent ed86a98 commit 7a4462a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
8 changes: 4 additions & 4 deletions drivers/misc/cardreader/rts5228.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,22 +395,22 @@ static void rts5228_init_from_cfg(struct rtsx_pcr *pcr)
else
rtsx_pci_disable_oobs_polling(pcr);

if (lval & ASPM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_1)
rtsx_set_dev_flag(pcr, ASPM_L1_1_EN);
else
rtsx_clear_dev_flag(pcr, ASPM_L1_1_EN);

if (lval & ASPM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_2)
rtsx_set_dev_flag(pcr, ASPM_L1_2_EN);
else
rtsx_clear_dev_flag(pcr, ASPM_L1_2_EN);

if (lval & PM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_1)
rtsx_set_dev_flag(pcr, PM_L1_1_EN);
else
rtsx_clear_dev_flag(pcr, PM_L1_1_EN);

if (lval & PM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_2)
rtsx_set_dev_flag(pcr, PM_L1_2_EN);
else
rtsx_clear_dev_flag(pcr, PM_L1_2_EN);
Expand Down
8 changes: 4 additions & 4 deletions drivers/misc/cardreader/rts5249.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ static void rts5249_init_from_cfg(struct rtsx_pcr *pcr)

pci_read_config_dword(pdev, l1ss + PCI_L1SS_CTL1, &lval);

if (lval & ASPM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_1)
rtsx_set_dev_flag(pcr, ASPM_L1_1_EN);

if (lval & ASPM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_2)
rtsx_set_dev_flag(pcr, ASPM_L1_2_EN);

if (lval & PM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_1)
rtsx_set_dev_flag(pcr, PM_L1_1_EN);

if (lval & PM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_2)
rtsx_set_dev_flag(pcr, PM_L1_2_EN);

if (option->ltr_en) {
Expand Down
8 changes: 4 additions & 4 deletions drivers/misc/cardreader/rts5260.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,16 @@ static void rts5260_init_from_cfg(struct rtsx_pcr *pcr)

pci_read_config_dword(pdev, l1ss + PCI_L1SS_CTL1, &lval);

if (lval & ASPM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_1)
rtsx_set_dev_flag(pcr, ASPM_L1_1_EN);

if (lval & ASPM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_2)
rtsx_set_dev_flag(pcr, ASPM_L1_2_EN);

if (lval & PM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_1)
rtsx_set_dev_flag(pcr, PM_L1_1_EN);

if (lval & PM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_2)
rtsx_set_dev_flag(pcr, PM_L1_2_EN);

rts5260_pwr_saving_setting(pcr);
Expand Down
8 changes: 4 additions & 4 deletions drivers/misc/cardreader/rts5261.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,22 +423,22 @@ static void rts5261_init_from_cfg(struct rtsx_pcr *pcr)

pci_read_config_dword(pdev, l1ss + PCI_L1SS_CTL1, &lval);

if (lval & ASPM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_1)
rtsx_set_dev_flag(pcr, ASPM_L1_1_EN);
else
rtsx_clear_dev_flag(pcr, ASPM_L1_1_EN);

if (lval & ASPM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_ASPM_L1_2)
rtsx_set_dev_flag(pcr, ASPM_L1_2_EN);
else
rtsx_clear_dev_flag(pcr, ASPM_L1_2_EN);

if (lval & PM_L1_1_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_1)
rtsx_set_dev_flag(pcr, PM_L1_1_EN);
else
rtsx_clear_dev_flag(pcr, PM_L1_1_EN);

if (lval & PM_L1_2_EN_MASK)
if (lval & PCI_L1SS_CTL1_PCIPM_L1_2)
rtsx_set_dev_flag(pcr, PM_L1_2_EN);
else
rtsx_clear_dev_flag(pcr, PM_L1_2_EN);
Expand Down
5 changes: 0 additions & 5 deletions include/linux/rtsx_pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1083,11 +1083,6 @@ struct pcr_ops {

enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};

#define ASPM_L1_1_EN_MASK BIT(3)
#define ASPM_L1_2_EN_MASK BIT(2)
#define PM_L1_1_EN_MASK BIT(1)
#define PM_L1_2_EN_MASK BIT(0)

#define ASPM_L1_1_EN BIT(0)
#define ASPM_L1_2_EN BIT(1)
#define PM_L1_1_EN BIT(2)
Expand Down

0 comments on commit 7a4462a

Please sign in to comment.