From 48972d907a28de17c2a5108a3ee3d5f3eb434376 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 2 Jan 2012 01:15:37 +0000 Subject: mmc: Implement card detection. Check for card detect each time an MMC/SD device is initialized. If card detection is not implemented, this code behaves as before and continues assuming a card is present. If no card is detected, has_init is reset for the MMC/SD device (to force initialization next time) and an error is returned. Signed-off-by: Thierry Reding Tested-by: Jason Liu --- include/mmc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/mmc.h') diff --git a/include/mmc.h b/include/mmc.h index a850174..8744604 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -302,6 +302,7 @@ struct mmc { struct mmc_cmd *cmd, struct mmc_data *data); void (*set_ios)(struct mmc *mmc); int (*init)(struct mmc *mmc); + int (*getcd)(struct mmc *mmc); uint b_max; }; @@ -316,6 +317,7 @@ void print_mmc_devices(char separator); int get_mmc_num(void); int board_mmc_getcd(struct mmc *mmc); int mmc_switch_part(int dev_num, unsigned int part_num); +int mmc_getcd(struct mmc *mmc); #ifdef CONFIG_GENERIC_MMC int atmel_mci_init(void *regs); -- cgit v1.1