]> git.itanic.dy.fi Git - linux-stable/commitdiff
mmc: sdhci-pci: Replace SDHCI_QUIRK_MISSING_CAPS for Ricoh controller
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 13 Jan 2023 11:00:06 +0000 (13:00 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Jan 2023 14:51:38 +0000 (15:51 +0100)
SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be
called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace
SDHCI_QUIRK_MISSING_CAPS with __sdhci_read_caps() for Ricoh SDHCI
controller.

__sdhci_read_caps() is also called from sdhci_setup_host() via
sdhci_read_caps(), however only the first call to __sdhci_read_caps() does
anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a
reset, so calling __sdhci_read_caps() earlier could have unforeseen
side-effects. However the code flow has been reviewed with that in mind.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230113110011.129835-2-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-pci-core.c

index c359f867df0aa7710c3358672da8b5d4215cc887..01975d145200663777df2093b522e646f52dade1 100644 (file)
@@ -251,13 +251,16 @@ static int ricoh_probe(struct sdhci_pci_chip *chip)
 
 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot)
 {
-       slot->host->caps =
+       u32 caps =
                FIELD_PREP(SDHCI_TIMEOUT_CLK_MASK, 0x21) |
                FIELD_PREP(SDHCI_CLOCK_BASE_MASK, 0x21) |
                SDHCI_TIMEOUT_CLK_UNIT |
                SDHCI_CAN_VDD_330 |
                SDHCI_CAN_DO_HISPD |
                SDHCI_CAN_DO_SDMA;
+       u32 caps1 = 0;
+
+       __sdhci_read_caps(slot->host, NULL, &caps, &caps1);
        return 0;
 }
 
@@ -286,8 +289,7 @@ static const struct sdhci_pci_fixes sdhci_ricoh_mmc = {
 #endif
        .quirks         = SDHCI_QUIRK_32BIT_DMA_ADDR |
                          SDHCI_QUIRK_CLOCK_BEFORE_RESET |
-                         SDHCI_QUIRK_NO_CARD_NO_RESET |
-                         SDHCI_QUIRK_MISSING_CAPS
+                         SDHCI_QUIRK_NO_CARD_NO_RESET,
 };
 
 static void ene_714_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)