mmc: mtk-sd: enable internal card-detect logic.
authorNeilBrown <neil@brown.name>
Sat, 4 May 2019 10:24:57 +0000 (20:24 +1000)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 6 May 2019 10:33:03 +0000 (12:33 +0200)
commitd087bde516053bd8dab4f79665586200b6a98c77
tree6a4f28d614a05975b5a47c5d2bc2fc18e0e2068f
parentafb7c7910bf3c42b56f99c9d6bb82099d0a0794d
mmc: mtk-sd: enable internal card-detect logic.

The mtk-sd silicon has integrated card-detect logic that is
enabled on the MT7621.  The circuit is phased out on newer hardware so
we should be careful to only enabled it on hardware known to support
it.  This a new "use_internal_cd" flag in struct mtk_mmc_compatible.

If the sdhci isn't marked non-removable and doesn't have a
cd-gpio configured, and if use_internal_cd is set, then assume the
internal cd logic should be used as recommended by
 Documentation/devicetree/bindings/mmc/mmc.txt

Signed-off-by: NeilBrown <neil@brown.name>
Reviewed-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mtk-sd.c