staging: wfx: apply the necessary SDIO quirks for the Silabs WF200
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Wed, 16 Feb 2022 09:31:12 +0000 (10:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Feb 2022 14:58:48 +0000 (15:58 +0100)
Until now, the SDIO quirks are applied directly from the driver.
However, it is better to apply the quirks before driver probing. So,
this patch relocate the quirks in the MMC framework.

Note that the WF200 has no valid SDIO VID/PID. Therefore, we match DT
rather than on the SDIO VID/PID.

Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220216093112.92469-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/core/quirks.h
drivers/staging/wfx/bus_sdio.c

index 20f568727277857e4c44fb1d1138395f773a285c..f879dc63d93646cb58643a26e8458960a52147cb 100644 (file)
@@ -149,6 +149,11 @@ static const struct mmc_fixup __maybe_unused sdio_fixup_methods[] = {
 static const struct mmc_fixup __maybe_unused sdio_card_init_methods[] = {
        SDIO_FIXUP_COMPATIBLE("ti,wl1251", wl1251_quirk, 0),
 
+       SDIO_FIXUP_COMPATIBLE("silabs,wf200", add_quirk,
+                             MMC_QUIRK_BROKEN_BYTE_MODE_512 |
+                             MMC_QUIRK_LENIENT_FN0 |
+                             MMC_QUIRK_BLKSZ_FOR_BYTE_MODE),
+
        END_FIXUP
 };
 
index 312d2d391a24e825da4ba0799108acb3eb29a8d9..51a0d58a9070f230b23a1c5ab3c3a23bb85707f1 100644 (file)
@@ -216,9 +216,6 @@ static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *i
        bus->func = func;
        bus->of_irq = irq_of_parse_and_map(np, 0);
        sdio_set_drvdata(func, bus);
-       func->card->quirks |= MMC_QUIRK_LENIENT_FN0 |
-                             MMC_QUIRK_BLKSZ_FOR_BYTE_MODE |
-                             MMC_QUIRK_BROKEN_BYTE_MODE_512;
 
        sdio_claim_host(func);
        ret = sdio_enable_func(func);