From patchwork Mon Dec 3 12:19:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,5/7] cm-t35: implement board specific card detect check Date: Mon, 03 Dec 2012 02:19:45 -0000 From: Nikita Kiryanov X-Patchwork-Id: 203335 Message-Id: <1354537187-26744-6-git-send-email-nikita@compulab.co.il> To: u-boot@lists.denx.de Cc: Tom Rini , Andy Fleming Implement a card detection check for cm-t35. Signed-off-by: Nikita Kiryanov Signed-off-by: Igor Grinberg --- board/cm_t35/cm_t35.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c index 87a18c0..50c0990 100644 --- a/board/cm_t35/cm_t35.c +++ b/board/cm_t35/cm_t35.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -344,6 +345,16 @@ void set_muxconf_regs(void) } #ifdef CONFIG_GENERIC_MMC +int board_mmc_getcd(struct mmc *mmc) +{ + u8 val; + + if (twl4030_i2c_read_u8(TWL4030_CHIP_GPIO, &val, TWL4030_BASEADD_GPIO)) + return -1; + + return !(val & 1); +} + int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1);