Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125507
b: refs/heads/master
c: 0527a60
h: refs/heads/master
i:
  125505: 91b1fc7
  125503: 94d7f84
v: v3
  • Loading branch information
philipl@overt.org authored and Pierre Ossman committed Dec 31, 2008
1 parent 0d64791 commit 1a1a544
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b30f8af3358b5c66be223e3a9f3d11b3d02b4a8f
refs/heads/master: 0527a60c2b6bd7ab20e82cc5e488659e20eaaacd
17 changes: 11 additions & 6 deletions trunk/drivers/mmc/host/ricoh_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@

/*
* This is a conceptually ridiculous driver, but it is required by the way
* the Ricoh multi-function R5C832 works. This chip implements firewire
* and four different memory card controllers. Two of those controllers are
* an SDHCI controller and a proprietary MMC controller. The linux SDHCI
* the Ricoh multi-function chips (R5CXXX) work. These chips implement
* the four main memory card controllers (SD, MMC, MS, xD) and one or both
* of cardbus or firewire. It happens that they implement SD and MMC
* support as separate controllers (and PCI functions). The linux SDHCI
* driver supports MMC cards but the chip detects MMC cards in hardware
* and directs them to the MMC controller - so the SDHCI driver never sees
* them. To get around this, we must disable the useless MMC controller.
* At that point, the SDHCI controller will start seeing them. As a bonus,
* a detection event occurs immediately, even if the MMC card is already
* in the reader.
*
* The relevant registers live on the firewire function, so this is unavoidably
* ugly. Such is life.
* It seems to be the case that the relevant PCI registers to deactivate the
* MMC controller live on PCI function 0, which might be the cardbus controller
* or the firewire controller, depending on the particular chip in question. As
* such, it makes what this driver has to do unavoidably ugly. Such is life.
*/

#include <linux/pci.h>
Expand Down Expand Up @@ -143,6 +146,7 @@ static int __devinit ricoh_mmc_probe(struct pci_dev *pdev,
pci_get_device(PCI_VENDOR_ID_RICOH,
PCI_DEVICE_ID_RICOH_RL5C476, fw_dev))) {
if (PCI_SLOT(pdev->devfn) == PCI_SLOT(fw_dev->devfn) &&
PCI_FUNC(fw_dev->devfn) == 0 &&
pdev->bus == fw_dev->bus) {
if (ricoh_mmc_disable(fw_dev) != 0)
return -ENODEV;
Expand All @@ -160,6 +164,7 @@ static int __devinit ricoh_mmc_probe(struct pci_dev *pdev,
(fw_dev = pci_get_device(PCI_VENDOR_ID_RICOH,
PCI_DEVICE_ID_RICOH_R5C832, fw_dev))) {
if (PCI_SLOT(pdev->devfn) == PCI_SLOT(fw_dev->devfn) &&
PCI_FUNC(fw_dev->devfn) == 0 &&
pdev->bus == fw_dev->bus) {
if (ricoh_mmc_disable(fw_dev) != 0)
return -ENODEV;
Expand All @@ -172,7 +177,7 @@ static int __devinit ricoh_mmc_probe(struct pci_dev *pdev,

if (!ctrlfound) {
printk(KERN_WARNING DRIVER_NAME
": Main firewire function not found. Cannot disable controller.\n");
": Main Ricoh function not found. Cannot disable controller.\n");
return -ENODEV;
}

Expand Down

0 comments on commit 1a1a544

Please sign in to comment.