diff options
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
| -rw-r--r-- | drivers/mmc/host/sdhci.c | 13 |
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 | ||
| 31 | static unsigned int debug_quirks = 0; | 31 | static unsigned int debug_quirks = 0; |
| 32 | 32 | ||
| 33 | /* For multi controllers in one platform case */ | ||
| 34 | static u16 chip_index = 0; | ||
| 35 | static 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 | ||
