mmc: mmci: Add support for probing bus voltage level translator
authorMarek Vasut <marex@denx.de>
Sun, 24 Jan 2021 17:02:56 +0000 (18:02 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Feb 2021 11:02:34 +0000 (12:02 +0100)
commit6351cac92a8c598115d74a700f1720861d57ef20
tree6380c4fb77b04f7b4806c43f76c0c37e2a8e6260
parentbbaa298f57cbcd214a4bffc4d877579686ee709e
mmc: mmci: Add support for probing bus voltage level translator

Add support for testing whether bus voltage level translator is present
and operational. This is useful on systems where the bus voltage level
translator is optional, as the translator can be auto-detected by the
driver and the feedback clock functionality can be disabled if it is
not present.

This requires additional pinmux state, "init", where the CMD, CK, CKIN
lines are not configured, so they can be claimed as GPIOs early on in
probe(). The translator test sets CMD high to avoid interfering with a
card, and then verifies whether signal set on CK is detected on CKIN.
If the signal is detected, translator is present, otherwise the CKIN
feedback clock are disabled.

Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Ludovic Barre <ludovic.barre@st.com>
Tested-by: Yann Gautier <yann.gautier@foss.st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20210124170258.32862-2-marex@denx.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci.c