diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-05-07 09:32:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-05-07 09:34:07 +0200 |
commit | 6ccb3eb306022f7334a086f46d03a189e0abd937 (patch) | |
tree | 49b28b1a722846f10bba314ac97ab253625b3bcf | |
parent | da4e9ddc29c4b4092dc1db0d1cb7fa08c1a86621 (diff) | |
download | barebox-6ccb3eb306022f7334a086f46d03a189e0abd937.tar.gz barebox-6ccb3eb306022f7334a086f46d03a189e0abd937.tar.xz |
mmc: mxs: implement detect callback
Needed to automatically detect the SD card when it contains the barebox
environment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/mci/mxs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c index afd6a56397..5e9f17def8 100644 --- a/drivers/mci/mxs.c +++ b/drivers/mci/mxs.c @@ -542,6 +542,13 @@ static void mxs_mci_info(struct device_d *hw_dev) printf("\n"); } +static int mxs_mmc_detect(struct device_d *dev) +{ + struct mxs_mci_host *mxs_mci = dev->priv; + + return mci_detect_card(&mxs_mci->host); +} + static int mxs_mci_probe(struct device_d *hw_dev) { struct resource *iores; @@ -577,6 +584,8 @@ static int mxs_mci_probe(struct device_d *hw_dev) mci_of_parse(host); } + hw_dev->detect = mxs_mmc_detect; + mxs_mci->clk = clk_get(hw_dev, NULL); if (IS_ERR(mxs_mci->clk)) return PTR_ERR(mxs_mci->clk); |