]>
Commit | Line | Data |
---|---|---|
a0aa785a GKH |
1 | From 3e309cdf07c930f29a4e0f233e47d399bea34c68 Mon Sep 17 00:00:00 2001 |
2 | From: Josh Boyer <jwboyer@redhat.com> | |
3 | Date: Wed, 5 Oct 2011 11:44:50 -0400 | |
4 | Subject: PCI quirk: mmc: Always check for lower base frequency quirk for Ricoh 1180:e823 | |
5 | ||
6 | From: Josh Boyer <jwboyer@redhat.com> | |
7 | ||
8 | commit 3e309cdf07c930f29a4e0f233e47d399bea34c68 upstream. | |
9 | ||
10 | Commit 15bed0f2f added a quirk for the e823 Ricoh card reader to lower the | |
11 | base frequency. However, the quirk first checks to see if the proprietary | |
12 | MMC controller is disabled, and returns if so. On some devices, such as the | |
13 | Lenovo X220, the MMC controller is already disabled by firmware it seems, | |
14 | but the frequency change is still needed so sdhci-pci can talk to the cards. | |
15 | Since the MMC controller is disabled, the frequency fixup was never being run | |
16 | on these machines. | |
17 | ||
18 | This moves the e823 check above the MMC controller check so that it always | |
19 | gets run. | |
20 | ||
21 | This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509 | |
22 | ||
23 | Signed-off-by: Josh Boyer <jwboyer@redhat.com> | |
24 | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> | |
25 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
26 | ||
27 | --- | |
28 | drivers/pci/quirks.c | 28 ++++++++++++++-------------- | |
29 | 1 file changed, 14 insertions(+), 14 deletions(-) | |
30 | ||
31 | --- a/drivers/pci/quirks.c | |
32 | +++ b/drivers/pci/quirks.c | |
33 | @@ -2745,20 +2745,6 @@ static void ricoh_mmc_fixup_r5c832(struc | |
34 | /* disable must be done via function #0 */ | |
35 | if (PCI_FUNC(dev->devfn)) | |
36 | return; | |
37 | - | |
38 | - pci_read_config_byte(dev, 0xCB, &disable); | |
39 | - | |
40 | - if (disable & 0x02) | |
41 | - return; | |
42 | - | |
43 | - pci_read_config_byte(dev, 0xCA, &write_enable); | |
44 | - pci_write_config_byte(dev, 0xCA, 0x57); | |
45 | - pci_write_config_byte(dev, 0xCB, disable | 0x02); | |
46 | - pci_write_config_byte(dev, 0xCA, write_enable); | |
47 | - | |
48 | - dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n"); | |
49 | - dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n"); | |
50 | - | |
51 | /* | |
52 | * RICOH 0xe823 SD/MMC card reader fails to recognize | |
53 | * certain types of SD/MMC cards. Lowering the SD base | |
54 | @@ -2781,6 +2767,20 @@ static void ricoh_mmc_fixup_r5c832(struc | |
55 | ||
56 | dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.\n"); | |
57 | } | |
58 | + | |
59 | + pci_read_config_byte(dev, 0xCB, &disable); | |
60 | + | |
61 | + if (disable & 0x02) | |
62 | + return; | |
63 | + | |
64 | + pci_read_config_byte(dev, 0xCA, &write_enable); | |
65 | + pci_write_config_byte(dev, 0xCA, 0x57); | |
66 | + pci_write_config_byte(dev, 0xCB, disable | 0x02); | |
67 | + pci_write_config_byte(dev, 0xCA, write_enable); | |
68 | + | |
69 | + dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)\n"); | |
70 | + dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller\n"); | |
71 | + | |
72 | } | |
73 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); | |
74 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); |