]> git.baikalelectronics.ru Git - uboot.git/commit
mmc: am654_sdhci: Implement workaround for card detect
authorFaiz Abbas <faiz_abbas@ti.com>
Wed, 26 Feb 2020 08:14:34 +0000 (13:44 +0530)
committerPeng Fan <peng.fan@nxp.com>
Mon, 9 Mar 2020 00:33:16 +0000 (08:33 +0800)
commit8ce44e46dc9a83e343da2169d33c9877fd625da1
tree167dd48c999a37c6468712fe6b31291e142704e6
parentc6fa202d38cc6d54f728eae5c2fe480efb5f7664
mmc: am654_sdhci: Implement workaround for card detect

The 4 bit MMC controllers have an internal debounce for the SDCD line
with a debounce delay of 1 second. Therefore, after clocks to the IP are
enabled, software has to wait for this time before it can power on the
controller.

Add a deferred_probe() callback which polls on sdcd for a maximum of 2 seconds
before switching on power to the controller or (in the case of no card)
returning a ENOMEDIUM. This pushes the 1 second wait time to when the
card is actually needed rather than at every probe() making sure that
users who don't insert an SD card in the slot don't have to wait such a
long time.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
drivers/mmc/am654_sdhci.c