X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmmc%2Fhost%2Fsdhci-pci.c;h=deb607c52c0d8ebbee60751e7a120692a22ddd9f;hb=e9f76354ce83a20c7768ad37caa033f6506b4f96;hp=8554466e0f4e3200620313fd3f9d72a64544a3ac;hpb=1e72859e3ae16346d4007024b20d2d4ef387dcc3;p=linux-2.6 diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 8554466e0f..deb607c52c 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c @@ -91,6 +91,7 @@ static int ricoh_probe(struct sdhci_pci_chip *chip) static const struct sdhci_pci_fixes sdhci_ricoh = { .probe = ricoh_probe, + .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR, }; static const struct sdhci_pci_fixes sdhci_ene_712 = { @@ -138,6 +139,13 @@ static int jmicron_probe(struct sdhci_pci_chip *chip) { int ret; + if (chip->pdev->revision == 0) { + chip->quirks |= SDHCI_QUIRK_32BIT_DMA_ADDR | + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_32BIT_ADMA_SIZE | + SDHCI_QUIRK_RESET_AFTER_REQUEST; + } + /* * JMicron chips can have two interfaces to the same hardware * in order to work around limitations in Microsoft's driver. @@ -199,6 +207,22 @@ static void jmicron_enable_mmc(struct sdhci_host *host, int on) static int jmicron_probe_slot(struct sdhci_pci_slot *slot) { + if (slot->chip->pdev->revision == 0) { + u16 version; + + version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION); + version = (version & SDHCI_VENDOR_VER_MASK) >> + SDHCI_VENDOR_VER_SHIFT; + + /* + * Older versions of the chip have lots of nasty glitches + * in the ADMA engine. It's best just to avoid it + * completely. + */ + if (version < 0xAC) + slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; + } + /* * The secondary interface requires a bit set to get the * interrupts. @@ -249,10 +273,6 @@ static int jmicron_resume(struct sdhci_pci_chip *chip) } static const struct sdhci_pci_fixes sdhci_jmicron = { - .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | - SDHCI_QUIRK_32BIT_DMA_SIZE | - SDHCI_QUIRK_RESET_AFTER_REQUEST, - .probe = jmicron_probe, .probe_slot = jmicron_probe_slot,