Skip to content

Commit 51876e2

Browse files
bjorn-helgaasgregkh
authored andcommitted
misc: rtsx: Removed unused dev_aspm_mode
The struct rtsx_cr_option.dev_aspm_mode member is never set to anything other than DEV_ASPM_DYNAMIC (0). Remove it and code that tests it. No functional change intended. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/20200521180545.1159896-3-helgaas@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8786eda commit 51876e2

5 files changed

Lines changed: 18 additions & 83 deletions

File tree

‎drivers/misc/cardreader/rts5249.c‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -349,25 +349,15 @@ static int rtsx_base_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
349349

350350
static void rts5249_set_aspm(struct rtsx_pcr *pcr, bool enable)
351351
{
352-
struct rtsx_cr_option *option = &pcr->option;
353352
u8 val = 0;
354353

355354
if (pcr->aspm_enabled == enable)
356355
return;
357356

358-
if (option->dev_aspm_mode == DEV_ASPM_DYNAMIC) {
359-
if (enable)
360-
val = pcr->aspm_en;
361-
rtsx_pci_update_cfg_byte(pcr,
362-
pcr->pcie_cap + PCI_EXP_LNKCTL,
363-
ASPM_MASK_NEG, val);
364-
} else if (option->dev_aspm_mode == DEV_ASPM_BACKDOOR) {
365-
u8 mask = FORCE_ASPM_VAL_MASK | FORCE_ASPM_CTL0;
366-
367-
if (!enable)
368-
val = FORCE_ASPM_CTL0;
369-
rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, mask, val);
370-
}
357+
if (enable)
358+
val = pcr->aspm_en;
359+
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
360+
ASPM_MASK_NEG, val);
371361

372362
pcr->aspm_enabled = enable;
373363
}
@@ -471,7 +461,6 @@ void rts5249_init_params(struct rtsx_pcr *pcr)
471461
option->ltr_active_latency = LTR_ACTIVE_LATENCY_DEF;
472462
option->ltr_idle_latency = LTR_IDLE_LATENCY_DEF;
473463
option->ltr_l1off_latency = LTR_L1OFF_LATENCY_DEF;
474-
option->dev_aspm_mode = DEV_ASPM_DYNAMIC;
475464
option->l1_snooze_delay = L1_SNOOZE_DELAY_DEF;
476465
option->ltr_l1off_sspwrgate = LTR_L1OFF_SSPWRGATE_5249_DEF;
477466
option->ltr_l1off_snooze_sspwrgate =

‎drivers/misc/cardreader/rts5260.c‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -572,24 +572,15 @@ static int rts5260_extra_init_hw(struct rtsx_pcr *pcr)
572572

573573
static void rts5260_set_aspm(struct rtsx_pcr *pcr, bool enable)
574574
{
575-
struct rtsx_cr_option *option = &pcr->option;
576575
u8 val = 0;
577576

578577
if (pcr->aspm_enabled == enable)
579578
return;
580579

581-
if (option->dev_aspm_mode == DEV_ASPM_DYNAMIC) {
582-
if (enable)
583-
val = pcr->aspm_en;
584-
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
585-
ASPM_MASK_NEG, val);
586-
} else if (option->dev_aspm_mode == DEV_ASPM_BACKDOOR) {
587-
u8 mask = FORCE_ASPM_VAL_MASK | FORCE_ASPM_CTL0;
588-
589-
if (!enable)
590-
val = FORCE_ASPM_CTL0;
591-
rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, mask, val);
592-
}
580+
if (enable)
581+
val = pcr->aspm_en;
582+
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
583+
ASPM_MASK_NEG, val);
593584

594585
pcr->aspm_enabled = enable;
595586
}
@@ -683,7 +674,6 @@ void rts5260_init_params(struct rtsx_pcr *pcr)
683674
option->ltr_active_latency = LTR_ACTIVE_LATENCY_DEF;
684675
option->ltr_idle_latency = LTR_IDLE_LATENCY_DEF;
685676
option->ltr_l1off_latency = LTR_L1OFF_LATENCY_DEF;
686-
option->dev_aspm_mode = DEV_ASPM_DYNAMIC;
687677
option->l1_snooze_delay = L1_SNOOZE_DELAY_DEF;
688678
option->ltr_l1off_sspwrgate = LTR_L1OFF_SSPWRGATE_5250_DEF;
689679
option->ltr_l1off_snooze_sspwrgate =

‎drivers/misc/cardreader/rts5261.c‎

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -518,51 +518,28 @@ static int rts5261_extra_init_hw(struct rtsx_pcr *pcr)
518518

519519
static void rts5261_enable_aspm(struct rtsx_pcr *pcr, bool enable)
520520
{
521-
struct rtsx_cr_option *option = &pcr->option;
522521
u8 val = 0;
523522

524523
if (pcr->aspm_enabled == enable)
525524
return;
526525

527-
if (option->dev_aspm_mode == DEV_ASPM_DYNAMIC) {
528-
val = pcr->aspm_en;
529-
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
530-
ASPM_MASK_NEG, val);
531-
} else if (option->dev_aspm_mode == DEV_ASPM_BACKDOOR) {
532-
u8 mask = FORCE_ASPM_VAL_MASK | FORCE_ASPM_CTL0;
533-
534-
val = FORCE_ASPM_CTL0;
535-
val |= (pcr->aspm_en & 0x02);
536-
rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, mask, val);
537-
val = pcr->aspm_en;
538-
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
539-
ASPM_MASK_NEG, val);
540-
}
526+
val = pcr->aspm_en;
527+
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
528+
ASPM_MASK_NEG, val);
541529
pcr->aspm_enabled = enable;
542530

543531
}
544532

545533
static void rts5261_disable_aspm(struct rtsx_pcr *pcr, bool enable)
546534
{
547-
struct rtsx_cr_option *option = &pcr->option;
548535
u8 val = 0;
549536

550537
if (pcr->aspm_enabled == enable)
551538
return;
552539

553-
if (option->dev_aspm_mode == DEV_ASPM_DYNAMIC) {
554-
val = 0;
555-
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
556-
ASPM_MASK_NEG, val);
557-
} else if (option->dev_aspm_mode == DEV_ASPM_BACKDOOR) {
558-
u8 mask = FORCE_ASPM_VAL_MASK | FORCE_ASPM_CTL0;
559-
560-
val = 0;
561-
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
562-
ASPM_MASK_NEG, val);
563-
val = FORCE_ASPM_CTL0;
564-
rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, mask, val);
565-
}
540+
val = 0;
541+
rtsx_pci_update_cfg_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL,
542+
ASPM_MASK_NEG, val);
566543
rtsx_pci_write_register(pcr, SD_CFG1, SD_ASYNC_FIFO_NOT_RST, 0);
567544
udelay(10);
568545
pcr->aspm_enabled = enable;
@@ -789,7 +766,6 @@ void rts5261_init_params(struct rtsx_pcr *pcr)
789766
option->l1_snooze_delay = L1_SNOOZE_DELAY_DEF;
790767
option->ltr_l1off_sspwrgate = 0x7F;
791768
option->ltr_l1off_snooze_sspwrgate = 0x78;
792-
option->dev_aspm_mode = DEV_ASPM_DYNAMIC;
793769

794770
option->ocp_en = 1;
795771
hw_param->interrupt_en |= SD_OC_INT_EN;

‎drivers/misc/cardreader/rtsx_pcr.c‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,13 @@ int rtsx_set_ltr_latency(struct rtsx_pcr *pcr, u32 latency)
9090

9191
static void rtsx_comm_set_aspm(struct rtsx_pcr *pcr, bool enable)
9292
{
93-
struct rtsx_cr_option *option = &pcr->option;
94-
9593
if (pcr->aspm_enabled == enable)
9694
return;
9795

98-
if (option->dev_aspm_mode == DEV_ASPM_DYNAMIC) {
99-
if (enable)
100-
rtsx_pci_enable_aspm(pcr);
101-
else
102-
rtsx_pci_disable_aspm(pcr);
103-
} else if (option->dev_aspm_mode == DEV_ASPM_BACKDOOR) {
104-
u8 mask = FORCE_ASPM_VAL_MASK;
105-
u8 val = 0;
106-
107-
if (enable)
108-
val = pcr->aspm_en;
109-
rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, mask, val);
110-
}
96+
if (enable)
97+
rtsx_pci_enable_aspm(pcr);
98+
else
99+
rtsx_pci_disable_aspm(pcr);
111100

112101
pcr->aspm_enabled = enable;
113102
}

‎include/linux/rtsx_pci.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,13 +1104,6 @@ enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
11041104
#define L1_SNOOZE_TEST_EN BIT(5)
11051105
#define LTR_L1SS_PWR_GATE_CHECK_CARD_EN BIT(6)
11061106

1107-
enum dev_aspm_mode {
1108-
DEV_ASPM_DYNAMIC,
1109-
DEV_ASPM_BACKDOOR,
1110-
DEV_ASPM_STATIC,
1111-
DEV_ASPM_DISABLE,
1112-
};
1113-
11141107
/*
11151108
* struct rtsx_cr_option - card reader option
11161109
* @dev_flags: device flags
@@ -1121,7 +1114,6 @@ enum dev_aspm_mode {
11211114
* @ltr_active_latency: ltr mode active latency
11221115
* @ltr_idle_latency: ltr mode idle latency
11231116
* @ltr_l1off_latency: ltr mode l1off latency
1124-
* @dev_aspm_mode: device aspm mode
11251117
* @l1_snooze_delay: l1 snooze delay
11261118
* @ltr_l1off_sspwrgate: ltr l1off sspwrgate
11271119
* @ltr_l1off_snooze_sspwrgate: ltr l1off snooze sspwrgate
@@ -1138,7 +1130,6 @@ struct rtsx_cr_option {
11381130
u32 ltr_active_latency;
11391131
u32 ltr_idle_latency;
11401132
u32 ltr_l1off_latency;
1141-
enum dev_aspm_mode dev_aspm_mode;
11421133
u32 l1_snooze_delay;
11431134
u8 ltr_l1off_sspwrgate;
11441135
u8 ltr_l1off_snooze_sspwrgate;

0 commit comments

Comments
 (0)