提交 11fdade2 编写于 作者: S Stefano Babic 提交者: Tom Rix

MMC: add weak function to detect MMC/SD card

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: NStefano Babic <sbabic@denx.de>
上级 250de12b
...@@ -36,6 +36,13 @@ ...@@ -36,6 +36,13 @@
static struct list_head mmc_devices; static struct list_head mmc_devices;
static int cur_dev_num = -1; 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) int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
{ {
return mmc->send_cmd(mmc, cmd, data); return mmc->send_cmd(mmc, cmd, data);
......
...@@ -272,6 +272,7 @@ int mmc_init(struct mmc *mmc); ...@@ -272,6 +272,7 @@ int mmc_init(struct mmc *mmc);
int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size); int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
struct mmc *find_mmc_device(int dev_num); struct mmc *find_mmc_device(int dev_num);
void print_mmc_devices(char separator); void print_mmc_devices(char separator);
int board_mmc_getcd(u8 *cd, struct mmc *mmc);
#ifndef CONFIG_GENERIC_MMC #ifndef CONFIG_GENERIC_MMC
int mmc_legacy_init(int verbose); int mmc_legacy_init(int verbose);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册