aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@redhat.com>2011-10-05 11:44:50 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-10-14 12:05:30 -0400
commit3e309cdf07c930f29a4e0f233e47d399bea34c68 (patch)
treeeac1fa4719329cab93a0dc646b1c4c11e6711518 /drivers/pci
parente24442733ee486c99d03fe2ecd98924d1bc14c51 (diff)
PCI quirk: mmc: Always check for lower base frequency quirk for Ricoh 1180:e823
Commit 15bed0f2f added a quirk for the e823 Ricoh card reader to lower the base frequency. However, the quirk first checks to see if the proprietary MMC controller is disabled, and returns if so. On some devices, such as the Lenovo X220, the MMC controller is already disabled by firmware it seems, but the frequency change is still needed so sdhci-pci can talk to the cards. Since the MMC controller is disabled, the frequency fixup was never being run on these machines. This moves the e823 check above the MMC controller check so that it always gets run. This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509 Signed-off-by: Josh Boyer <jwboyer@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/quirks.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index f70c36f9b1f3..e5aadf357ae7 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2745,20 +2745,6 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
2745 /* disable must be done via function #0 */ 2745 /* disable must be done via function #0 */
2746 if (PCI_FUNC(dev->devfn)) 2746 if (PCI_FUNC(dev->devfn))
2747 return; 2747 return;
2748
2749 pci_read_config_byte(dev, 0xCB, &disable);
2750
2751 if (disable & 0x02)
2752 return;
2753
2754 pci_read_config_byte(dev, 0xCA, &write_enable);
2755 pci_write_config_byte(dev, 0xCA, 0x57);
2756 pci_write_config_byte(dev, 0xCB, disable | 0x02);
2757 pci_write_config_byte(dev, 0xCA, write_enable);
2758
2759 dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n");
2760 dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n");
2761
2762 /* 2748 /*
2763 * RICOH 0xe823 SD/MMC card reader fails to recognize 2749 * RICOH 0xe823 SD/MMC card reader fails to recognize
2764 * certain types of SD/MMC cards. Lowering the SD base 2750 * certain types of SD/MMC cards. Lowering the SD base
@@ -2781,6 +2767,20 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
2781 2767
2782 dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.\n"); 2768 dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.\n");
2783 } 2769 }
2770
2771 pci_read_config_byte(dev, 0xCB, &disable);
2772
2773 if (disable & 0x02)
2774 return;
2775
2776 pci_read_config_byte(dev, 0xCA, &write_enable);
2777 pci_write_config_byte(dev, 0xCA, 0x57);
2778 pci_write_config_byte(dev, 0xCB, disable | 0x02);
2779 pci_write_config_byte(dev, 0xCA, write_enable);
2780
2781 dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n");
2782 dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n");
2783
2784} 2784}
2785DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); 2785DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
2786DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); 2786DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);