diff options
author | Leandro Dorileo <dorileo@ossystems.com.br> | 2007-07-25 17:47:04 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-07-25 19:53:09 -0400 |
commit | b8352260d28b30cb2bb2df99814fb9c360e38901 (patch) | |
tree | 008c36650fc15a3a7e0d3b6e5930f05b2b40fb42 /drivers/mmc | |
parent | 43b58b36b7e6554b8a96be6b9f63542c583c06e5 (diff) |
sdhci: add support to ENE-CB714
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 56de4c48ec80..dd4bfb594479 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -34,6 +34,7 @@ static unsigned int debug_quirks = 0; | |||
34 | /* Controller doesn't like some resets when there is no card inserted. */ | 34 | /* Controller doesn't like some resets when there is no card inserted. */ |
35 | #define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<2) | 35 | #define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<2) |
36 | #define SDHCI_QUIRK_SINGLE_POWER_WRITE (1<<3) | 36 | #define SDHCI_QUIRK_SINGLE_POWER_WRITE (1<<3) |
37 | #define SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS (1<<4) | ||
37 | 38 | ||
38 | static const struct pci_device_id pci_ids[] __devinitdata = { | 39 | static const struct pci_device_id pci_ids[] __devinitdata = { |
39 | { | 40 | { |
@@ -78,6 +79,24 @@ static const struct pci_device_id pci_ids[] __devinitdata = { | |||
78 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE, | 79 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE, |
79 | }, | 80 | }, |
80 | 81 | ||
82 | { | ||
83 | .vendor = PCI_VENDOR_ID_ENE, | ||
84 | .device = PCI_DEVICE_ID_ENE_CB714_SD, | ||
85 | .subvendor = PCI_ANY_ID, | ||
86 | .subdevice = PCI_ANY_ID, | ||
87 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | | ||
88 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS, | ||
89 | }, | ||
90 | |||
91 | { | ||
92 | .vendor = PCI_VENDOR_ID_ENE, | ||
93 | .device = PCI_DEVICE_ID_ENE_CB714_SD_2, | ||
94 | .subvendor = PCI_ANY_ID, | ||
95 | .subdevice = PCI_ANY_ID, | ||
96 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | | ||
97 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS, | ||
98 | }, | ||
99 | |||
81 | { /* Generic SD host controller */ | 100 | { /* Generic SD host controller */ |
82 | PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00) | 101 | PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00) |
83 | }, | 102 | }, |
@@ -759,6 +778,14 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
759 | 778 | ||
760 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); | 779 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); |
761 | 780 | ||
781 | /* | ||
782 | * Some (ENE) controllers go apeshit on some ios operation, | ||
783 | * signalling timeout and CRC errors even on CMD0. Resetting | ||
784 | * it on each ios seems to solve the problem. | ||
785 | */ | ||
786 | if(host->chip->quirks & SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS) | ||
787 | sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); | ||
788 | |||
762 | mmiowb(); | 789 | mmiowb(); |
763 | spin_unlock_irqrestore(&host->lock, flags); | 790 | spin_unlock_irqrestore(&host->lock, flags); |
764 | } | 791 | } |