tegra2: mmc: Enable card-detect for all interfaces.
Subsystems (2)
PATCH 1/1 tegra2: mmc: Enable card-detect for all interfaces.
This commit drops the interface check for card-detection and leaves it up to the board whether or not a card-detect GPIO is connected. Also, the version field of struct mmc is only valid after the slot has been probed successfully, so depending on that information sort of defeats the purpose of card-detection.
--- drivers/mmc/tegra2_mmc.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
drivers/mmc/tegra2_mmc.c +4 -8
@@ -543,14 +543,10 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)debug ("board_mmc_getcd called\n" ); - *cd =1 ;/* Assume card is inserted, or eMMC */ - -if (IS_SD (mmc)) { -if (host->cd_gpio >=0 ) { -if (gpio_get_value (host->cd_gpio)) - *cd =0 ; - } - } +if (host->cd_gpio >=0 ) + *cd = !gpio_get_value (host->cd_gpio); +else + *cd =1 ;return 0 ; }
Signature · 1 line
1.7.7.3
PATCH 1/1 tegra2: mmc: Enable card-detect for all interfaces.
Quoted 7 lines · Thierry Reding
This commit drops the interface check for card-detection and leaves it up to the board whether or not a card-detect GPIO is connected. Also, the version field of struct mmc is only valid after the slot has been probed successfully, so depending on that information sort of defeats the purpose of card-detection.
Signed-off-by Thierry Reding <[email protected]>
BTW, in your earlier patch where you added a call to board_mmc_getcd() to mmc_init(), do you also need to modify drivers/mmc/fsl_esdhc.c's esdhc_init(), since the cd function has already been called?
BTW, you need to CC the MMC maintainers on these patches, or they probably won't see them and they won't get applied. See
http://www.denx.de/wiki/U-Boot/Custodians.
Signature · 1 line
nvpublic
PATCH 1/1 tegra2: mmc: Enable card-detect for all interfaces.
Quoted 7 lines · Stephen Warren
Quoted 6 lines · Thierry Reding
This commit drops the interface check for card-detection and leaves it up to the board whether or not a card-detect GPIO is connected. Also, the version field of struct mmc is only valid after the slot has been probed successfully, so depending on that information sort of defeats the purpose of card-detection.
Quoted 7 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>Acked-by Stephen Warren <[email protected]>BTW, in your earlier patch where you added a call to
board_mmc_getcd()tommc_init(), do you also need to modify drivers/mmc/fsl_esdhc.c'sesdhc_init(), since the cd function has already been called?
fsl_esdhc.c contains some fallback code if board_mmc_getcd() isn't implemented, and I'm not at all familiar with the code so I didn't want to touch it before getting any comments by the corresponding maintainer. My best guess, though, is that the code can remain as is, because if the CD check is done before the ->init() callback and the card isn't inserted, then the code in question won't be executed anyway. If the card is inserted, however, then board_mmc_getcd() will be called twice, which shouldn't harm either.
However, it seems like board_mmc_getcd() is used differently by fsl_esdhc in that it uses the cd parameter as "card absent" (inverted logic). That will of course have to be adjusted.
Perhaps I should've tagged the patch RFC because it really shouldn't be applied as-is.
Quoted 3 lines
BTW, you need to CC the MMC maintainers on these patches, or they probably won't see them and they won't get applied. See
http://www.denx.de/wiki/U-Boot/Custodians.
Actually I had put Andy Fleming on Cc, but apparently the list stripped that again. I'll try Cc'ing Andy again, perhaps it'll work this time.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111122/388547cf/attachment.pgp>