]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
MMC: add weak function to detect MMC/SD card
authorStefano Babic <sbabic@denx.de>
Fri, 5 Feb 2010 14:04:43 +0000 (15:04 +0100)
committerTom Rix <Tom.Rix@windriver.com>
Sun, 7 Mar 2010 18:36:36 +0000 (12:36 -0600)
Most controllers can check if there is a card in the slot.
However, they require pins that could be not available because
required by other functions and the detection of a card must
be performed in another way. This patch adds a weak function
that a board can implement to add its internal custom way
to check the presence of a MMC/SD card.

Signed-off-by: Stefano Babic <sbabic@denx.de>
drivers/mmc/mmc.c
include/mmc.h

index d91b9b7f3a3d9d659027c45c2f2e1825d59286af..367922579cb1731c604ed65300e5d303e02beac2 100644 (file)
 static struct list_head mmc_devices;
 static int cur_dev_num = -1;
 
+int __board_mmc_getcd(u8 *cd, struct mmc *mmc) {
+       return -1;
+}
+
+int board_mmc_getcd(u8 *cd, struct mmc *mmc)__attribute__((weak,
+       alias("__board_mmc_getcd")));
+
 int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 {
        return mmc->send_cmd(mmc, cmd, data);
index 2dc69abb68e9fc3c1909cbfceb894055947cd24c..8973bc76583ad5affaacfb4259c7b7f194a7f76e 100644 (file)
@@ -272,6 +272,7 @@ int mmc_init(struct mmc *mmc);
 int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
 struct mmc *find_mmc_device(int dev_num);
 void print_mmc_devices(char separator);
+int board_mmc_getcd(u8 *cd, struct mmc *mmc);
 
 #ifndef CONFIG_GENERIC_MMC
 int mmc_legacy_init(int verbose);