diff options
-rw-r--r-- | drivers/mmc/host/ricoh_mmc.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/mmc/host/ricoh_mmc.c b/drivers/mmc/host/ricoh_mmc.c index a16d7609e4ee..be9e7b32b34e 100644 --- a/drivers/mmc/host/ricoh_mmc.c +++ b/drivers/mmc/host/ricoh_mmc.c | |||
@@ -11,9 +11,10 @@ | |||
11 | 11 | ||
12 | /* | 12 | /* |
13 | * This is a conceptually ridiculous driver, but it is required by the way | 13 | * This is a conceptually ridiculous driver, but it is required by the way |
14 | * the Ricoh multi-function R5C832 works. This chip implements firewire | 14 | * the Ricoh multi-function chips (R5CXXX) work. These chips implement |
15 | * and four different memory card controllers. Two of those controllers are | 15 | * the four main memory card controllers (SD, MMC, MS, xD) and one or both |
16 | * an SDHCI controller and a proprietary MMC controller. The linux SDHCI | 16 | * of cardbus or firewire. It happens that they implement SD and MMC |
17 | * support as separate controllers (and PCI functions). The linux SDHCI | ||
17 | * driver supports MMC cards but the chip detects MMC cards in hardware | 18 | * driver supports MMC cards but the chip detects MMC cards in hardware |
18 | * and directs them to the MMC controller - so the SDHCI driver never sees | 19 | * and directs them to the MMC controller - so the SDHCI driver never sees |
19 | * them. To get around this, we must disable the useless MMC controller. | 20 | * them. To get around this, we must disable the useless MMC controller. |
@@ -21,8 +22,10 @@ | |||
21 | * a detection event occurs immediately, even if the MMC card is already | 22 | * a detection event occurs immediately, even if the MMC card is already |
22 | * in the reader. | 23 | * in the reader. |
23 | * | 24 | * |
24 | * The relevant registers live on the firewire function, so this is unavoidably | 25 | * It seems to be the case that the relevant PCI registers to deactivate the |
25 | * ugly. Such is life. | 26 | * MMC controller live on PCI function 0, which might be the cardbus controller |
27 | * or the firewire controller, depending on the particular chip in question. As | ||
28 | * such, it makes what this driver has to do unavoidably ugly. Such is life. | ||
26 | */ | 29 | */ |
27 | 30 | ||
28 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
@@ -143,6 +146,7 @@ static int __devinit ricoh_mmc_probe(struct pci_dev *pdev, | |||
143 | pci_get_device(PCI_VENDOR_ID_RICOH, | 146 | pci_get_device(PCI_VENDOR_ID_RICOH, |
144 | PCI_DEVICE_ID_RICOH_RL5C476, fw_dev))) { | 147 | PCI_DEVICE_ID_RICOH_RL5C476, fw_dev))) { |
145 | if (PCI_SLOT(pdev->devfn) == PCI_SLOT(fw_dev->devfn) && | 148 | if (PCI_SLOT(pdev->devfn) == PCI_SLOT(fw_dev->devfn) && |
149 | PCI_FUNC(fw_dev->devfn) == 0 && | ||
146 | pdev->bus == fw_dev->bus) { | 150 | pdev->bus == fw_dev->bus) { |
147 | if (ricoh_mmc_disable(fw_dev) != 0) | 151 | if (ricoh_mmc_disable(fw_dev) != 0) |
148 | return -ENODEV; | 152 | return -ENODEV; |
@@ -160,6 +164,7 @@ static int __devinit ricoh_mmc_probe(struct pci_dev *pdev, | |||
160 | (fw_dev = pci_get_device(PCI_VENDOR_ID_RICOH, | 164 | (fw_dev = pci_get_device(PCI_VENDOR_ID_RICOH, |
161 | PCI_DEVICE_ID_RICOH_R5C832, fw_dev))) { | 165 | PCI_DEVICE_ID_RICOH_R5C832, fw_dev))) { |
162 | if (PCI_SLOT(pdev->devfn) == PCI_SLOT(fw_dev->devfn) && | 166 | if (PCI_SLOT(pdev->devfn) == PCI_SLOT(fw_dev->devfn) && |
167 | PCI_FUNC(fw_dev->devfn) == 0 && | ||
163 | pdev->bus == fw_dev->bus) { | 168 | pdev->bus == fw_dev->bus) { |
164 | if (ricoh_mmc_disable(fw_dev) != 0) | 169 | if (ricoh_mmc_disable(fw_dev) != 0) |
165 | return -ENODEV; | 170 | return -ENODEV; |
@@ -172,7 +177,7 @@ static int __devinit ricoh_mmc_probe(struct pci_dev *pdev, | |||
172 | 177 | ||
173 | if (!ctrlfound) { | 178 | if (!ctrlfound) { |
174 | printk(KERN_WARNING DRIVER_NAME | 179 | printk(KERN_WARNING DRIVER_NAME |
175 | ": Main firewire function not found. Cannot disable controller.\n"); | 180 | ": Main Ricoh function not found. Cannot disable controller.\n"); |
176 | return -ENODEV; | 181 | return -ENODEV; |
177 | } | 182 | } |
178 | 183 | ||