aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-09 14:12:15 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-09 14:12:15 -0500
commit5b39dba5029108800b94a5f4f96e3a05417103ac (patch)
tree7d5c59fd124a776508b3e2a58efb093cd97b29ea /drivers/mmc/host/sdhci.c
parent11eb3b0da3f8e4b9a6da6aba510471918239153d (diff)
parent882c49164d72c45f37d7fa1bb3de7c31cf1a5fab (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: mmc: extend ricoh_mmc to support Ricoh RL5c476 at91_mci: use generic GPIO calls sdhci: add num index for multi controllers case MAINTAINERS: remove non-existant URLs mmc: remove sdhci and mmc_spi experimental markers mmc: Handle suspend/resume in Ricoh MMC disabler
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 785bbdcf4a58..4b673aa2dc3c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -30,6 +30,10 @@
30 30
31static unsigned int debug_quirks = 0; 31static unsigned int debug_quirks = 0;
32 32
33/* For multi controllers in one platform case */
34static u16 chip_index = 0;
35static spinlock_t index_lock;
36
33/* 37/*
34 * Different quirks to handle when the hardware deviates from a strict 38 * Different quirks to handle when the hardware deviates from a strict
35 * interpretation of the SDHCI specification. 39 * interpretation of the SDHCI specification.
@@ -1320,7 +1324,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
1320 1324
1321 DBG("slot %d at 0x%08lx, irq %d\n", slot, host->addr, host->irq); 1325 DBG("slot %d at 0x%08lx, irq %d\n", slot, host->addr, host->irq);
1322 1326
1323 snprintf(host->slot_descr, 20, "sdhci:slot%d", slot); 1327 snprintf(host->slot_descr, 20, "sdhc%d:slot%d", chip->index, slot);
1324 1328
1325 ret = pci_request_region(pdev, host->bar, host->slot_descr); 1329 ret = pci_request_region(pdev, host->bar, host->slot_descr);
1326 if (ret) 1330 if (ret)
@@ -1585,6 +1589,11 @@ static int __devinit sdhci_probe(struct pci_dev *pdev,
1585 chip->num_slots = slots; 1589 chip->num_slots = slots;
1586 pci_set_drvdata(pdev, chip); 1590 pci_set_drvdata(pdev, chip);
1587 1591
1592 /* Add for multi controller case */
1593 spin_lock(&index_lock);
1594 chip->index = chip_index++;
1595 spin_unlock(&index_lock);
1596
1588 for (i = 0;i < slots;i++) { 1597 for (i = 0;i < slots;i++) {
1589 ret = sdhci_probe_slot(pdev, i); 1598 ret = sdhci_probe_slot(pdev, i);
1590 if (ret) { 1599 if (ret) {
@@ -1645,6 +1654,8 @@ static int __init sdhci_drv_init(void)
1645 ": Secure Digital Host Controller Interface driver\n"); 1654 ": Secure Digital Host Controller Interface driver\n");
1646 printk(KERN_INFO DRIVER_NAME ": Copyright(c) Pierre Ossman\n"); 1655 printk(KERN_INFO DRIVER_NAME ": Copyright(c) Pierre Ossman\n");
1647 1656
1657 spin_lock_init(&index_lock);
1658
1648 return pci_register_driver(&sdhci_driver); 1659 return pci_register_driver(&sdhci_driver);
1649} 1660}
1650 1661