diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/card/block.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 34 | ||||
-rw-r--r-- | drivers/mmc/host/wbsd.c | 21 |
3 files changed, 43 insertions, 14 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 91ded3e82401..f9ad960d7c1a 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #define MMC_SHIFT 3 | 46 | #define MMC_SHIFT 3 |
47 | #define MMC_NUM_MINORS (256 >> MMC_SHIFT) | 47 | #define MMC_NUM_MINORS (256 >> MMC_SHIFT) |
48 | 48 | ||
49 | static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))]; | 49 | static DECLARE_BITMAP(dev_use, MMC_NUM_MINORS); |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * There is one mmc_blk_data per slot. | 52 | * There is one mmc_blk_data per slot. |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 07c2048b230b..b413aa6c246b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -55,6 +55,10 @@ static unsigned int debug_quirks = 0; | |||
55 | #define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<7) | 55 | #define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<7) |
56 | /* Controller needs to be reset after each request to stay stable */ | 56 | /* Controller needs to be reset after each request to stay stable */ |
57 | #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8) | 57 | #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8) |
58 | /* Controller needs voltage and power writes to happen separately */ | ||
59 | #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<9) | ||
60 | /* Controller has an off-by-one issue with timeout value */ | ||
61 | #define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<10) | ||
58 | 62 | ||
59 | static const struct pci_device_id pci_ids[] __devinitdata = { | 63 | static const struct pci_device_id pci_ids[] __devinitdata = { |
60 | { | 64 | { |
@@ -115,7 +119,8 @@ static const struct pci_device_id pci_ids[] __devinitdata = { | |||
115 | .subvendor = PCI_ANY_ID, | 119 | .subvendor = PCI_ANY_ID, |
116 | .subdevice = PCI_ANY_ID, | 120 | .subdevice = PCI_ANY_ID, |
117 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | | 121 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | |
118 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS, | 122 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS | |
123 | SDHCI_QUIRK_BROKEN_DMA, | ||
119 | }, | 124 | }, |
120 | 125 | ||
121 | { | 126 | { |
@@ -124,7 +129,17 @@ static const struct pci_device_id pci_ids[] __devinitdata = { | |||
124 | .subvendor = PCI_ANY_ID, | 129 | .subvendor = PCI_ANY_ID, |
125 | .subdevice = PCI_ANY_ID, | 130 | .subdevice = PCI_ANY_ID, |
126 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | | 131 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | |
127 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS, | 132 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS | |
133 | SDHCI_QUIRK_BROKEN_DMA, | ||
134 | }, | ||
135 | |||
136 | { | ||
137 | .vendor = PCI_VENDOR_ID_MARVELL, | ||
138 | .device = PCI_DEVICE_ID_MARVELL_CAFE_SD, | ||
139 | .subvendor = PCI_ANY_ID, | ||
140 | .subdevice = PCI_ANY_ID, | ||
141 | .driver_data = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | | ||
142 | SDHCI_QUIRK_INCR_TIMEOUT_CONTROL, | ||
128 | }, | 143 | }, |
129 | 144 | ||
130 | { | 145 | { |
@@ -469,6 +484,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) | |||
469 | break; | 484 | break; |
470 | } | 485 | } |
471 | 486 | ||
487 | /* | ||
488 | * Compensate for an off-by-one error in the CaFe hardware; otherwise, | ||
489 | * a too-small count gives us interrupt timeouts. | ||
490 | */ | ||
491 | if ((host->chip->quirks & SDHCI_QUIRK_INCR_TIMEOUT_CONTROL)) | ||
492 | count++; | ||
493 | |||
472 | if (count >= 0xF) { | 494 | if (count >= 0xF) { |
473 | printk(KERN_WARNING "%s: Too large timeout requested!\n", | 495 | printk(KERN_WARNING "%s: Too large timeout requested!\n", |
474 | mmc_hostname(host->mmc)); | 496 | mmc_hostname(host->mmc)); |
@@ -774,6 +796,14 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) | |||
774 | BUG(); | 796 | BUG(); |
775 | } | 797 | } |
776 | 798 | ||
799 | /* | ||
800 | * At least the CaFe chip gets confused if we set the voltage | ||
801 | * and set turn on power at the same time, so set the voltage first. | ||
802 | */ | ||
803 | if ((host->chip->quirks & SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER)) | ||
804 | writeb(pwr & ~SDHCI_POWER_ON, | ||
805 | host->ioaddr + SDHCI_POWER_CONTROL); | ||
806 | |||
777 | writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); | 807 | writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); |
778 | 808 | ||
779 | out: | 809 | out: |
diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c index be624a049c67..c303e7f57ab4 100644 --- a/drivers/mmc/host/wbsd.c +++ b/drivers/mmc/host/wbsd.c | |||
@@ -1457,17 +1457,7 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq) | |||
1457 | int ret; | 1457 | int ret; |
1458 | 1458 | ||
1459 | /* | 1459 | /* |
1460 | * Allocate interrupt. | 1460 | * Set up tasklets. Must be done before requesting interrupt. |
1461 | */ | ||
1462 | |||
1463 | ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host); | ||
1464 | if (ret) | ||
1465 | return ret; | ||
1466 | |||
1467 | host->irq = irq; | ||
1468 | |||
1469 | /* | ||
1470 | * Set up tasklets. | ||
1471 | */ | 1461 | */ |
1472 | tasklet_init(&host->card_tasklet, wbsd_tasklet_card, | 1462 | tasklet_init(&host->card_tasklet, wbsd_tasklet_card, |
1473 | (unsigned long)host); | 1463 | (unsigned long)host); |
@@ -1480,6 +1470,15 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq) | |||
1480 | tasklet_init(&host->finish_tasklet, wbsd_tasklet_finish, | 1470 | tasklet_init(&host->finish_tasklet, wbsd_tasklet_finish, |
1481 | (unsigned long)host); | 1471 | (unsigned long)host); |
1482 | 1472 | ||
1473 | /* | ||
1474 | * Allocate interrupt. | ||
1475 | */ | ||
1476 | ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host); | ||
1477 | if (ret) | ||
1478 | return ret; | ||
1479 | |||
1480 | host->irq = irq; | ||
1481 | |||
1483 | return 0; | 1482 | return 0; |
1484 | } | 1483 | } |
1485 | 1484 | ||