]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sdhci: add support to ENE-CB714
authorLeandro Dorileo <dorileo@ossystems.com.br>
Wed, 25 Jul 2007 21:47:04 +0000 (23:47 +0200)
committerPierre Ossman <drzeus@drzeus.cx>
Wed, 25 Jul 2007 23:53:09 +0000 (01:53 +0200)
Added its pci_id and implemented a quirk for it because this
controller needs to reset cmd and data when setting ios.

Signed-off-by: Leandro Dorileo <dorileo@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/host/sdhci.c
include/linux/pci_ids.h

index 56de4c48ec80337e523be74a5609367a39e751bc..dd4bfb594479656057d1577119e48bf6fbfe2393 100644 (file)
@@ -34,6 +34,7 @@ static unsigned int debug_quirks = 0;
 /* Controller doesn't like some resets when there is no card inserted. */
 #define SDHCI_QUIRK_NO_CARD_NO_RESET                   (1<<2)
 #define SDHCI_QUIRK_SINGLE_POWER_WRITE                 (1<<3)
+#define SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS              (1<<4)
 
 static const struct pci_device_id pci_ids[] __devinitdata = {
        {
@@ -78,6 +79,24 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
                .driver_data    = SDHCI_QUIRK_SINGLE_POWER_WRITE,
        },
 
+       {
+               .vendor         = PCI_VENDOR_ID_ENE,
+               .device         = PCI_DEVICE_ID_ENE_CB714_SD,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .driver_data    = SDHCI_QUIRK_SINGLE_POWER_WRITE |
+                                 SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS,
+       },
+
+       {
+               .vendor         = PCI_VENDOR_ID_ENE,
+               .device         = PCI_DEVICE_ID_ENE_CB714_SD_2,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .driver_data    = SDHCI_QUIRK_SINGLE_POWER_WRITE |
+                                 SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS,
+       },
+
        {       /* Generic SD host controller */
                PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)
        },
@@ -759,6 +778,14 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
        writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL);
 
+       /*
+        * Some (ENE) controllers go apeshit on some ios operation,
+        * signalling timeout and CRC errors even on CMD0. Resetting
+        * it on each ios seems to solve the problem.
+        */
+       if(host->chip->quirks & SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS)
+               sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
+
        mmiowb();
        spin_unlock_irqrestore(&host->lock, flags);
 }
index cbabb9c675c9489eaf86cf5b705aa2db91639c69..0befd9513f854b23464a6730ed024cb2e137e114 100644 (file)
 #define PCI_VENDOR_ID_ENE              0x1524
 #define PCI_DEVICE_ID_ENE_CB712_SD     0x0550
 #define PCI_DEVICE_ID_ENE_CB712_SD_2   0x0551
+#define PCI_DEVICE_ID_ENE_CB714_SD     0x0750
+#define PCI_DEVICE_ID_ENE_CB714_SD_2   0x0751
 #define PCI_DEVICE_ID_ENE_1211         0x1211
 #define PCI_DEVICE_ID_ENE_1225         0x1225
 #define PCI_DEVICE_ID_ENE_1410         0x1410