mmc: sdhci: Enable preset for valid preset values
Pavan Kunapuli [Mon, 29 Oct 2012 13:45:16 +0000 (18:45 +0530)]
Do not enable preset if the preset values in the
host controller register are invalid.

Bug 1157930

Change-Id: I783543e28df516b60c12c1ff721d7c42159369fd
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/159561
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/mmc/host/sdhci.c
include/linux/mmc/sdhci.h

index 8ffd754..a5e6f50 100644 (file)
@@ -1943,13 +1943,10 @@ static void sdhci_do_enable_preset_value(struct sdhci_host *host, bool enable)
                return;
 
        /*
-        * Enabling preset value would make programming clock
-        * divider ineffective. The controller would use the
-        * values present in the preset value registers. In
-        * case of non-standard clock, let the platform driver
-        * decide whether to enable preset or not.
+        * Do not enable preset if the host preset registers have
+        * incorrect values.
         */
-       if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK)
+       if (host->quirks2 & SDHCI_QUIRK2_BROKEN_PRESET_VALUES)
                return;
 
        spin_lock_irqsave(&host->lock, flags);
index 4a2b061..4ca98a9 100644 (file)
@@ -97,6 +97,8 @@ struct sdhci_host {
        unsigned int quirks2;   /* More deviations from spec. */
 
 #define SDHCI_QUIRK2_HOST_OFF_CARD_ON                  (1<<0)
+/* Controller has incorrect preset values */
+#define SDHCI_QUIRK2_BROKEN_PRESET_VALUES              (1<<1)
 
        int irq;                /* Device IRQ */
        void __iomem *ioaddr;   /* Mapped address */