diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-06-20 15:08:16 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 11:01:45 -0600 |
commit | 86001e4054956e997fcdb2a459b362ba81634e3b (patch) | |
tree | b75301f18b17fa91cc86e9fb2e4df0698ccfca23 /include | |
parent | f5a95f6da77f624f714f1d2d56fe1c5768c52709 (diff) |
mmc: Allow setting slot index via devicetree alias
As with gpio, uart and others, allow specifying the name_idx via the
aliases-node in the devicetree.
On embedded devices, there is often a combination of removable (e.g.
SD card) and non-removable mmc devices (e.g. eMMC).
Therefore the name_idx might change depending on
- host of removable device
- removable card present or not
This makes it difficult to hard code the root device, if it is on the
non-removable device. E.g. if SD card is present eMMC will be mmcblk1,
if SD card is not present at boot, eMMC will be mmcblk0.
If the aliases-node is not found, the driver will act as before.
The original patch is from here:
https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html
The patch requires additional alias_id fix or it won't work.
Because according to function definition the max_idx parameter of idx_alloc
is exclusive, so need add 1 or it will be unable to find the proper idx
within an invalid range.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 35928d6c6a76a24a16edfa636f4c08293614a1e0)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mmc/core.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 258daf914c6d..48f765d10b2a 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -198,6 +198,9 @@ extern int mmc_flush_cache(struct mmc_card *); extern int mmc_detect_card_removed(struct mmc_host *host); +int mmc_first_nonreserved_index(void); +int mmc_get_reserved_index(struct mmc_host *host); + /** * mmc_claim_host - exclusively claim a host * @host: mmc host to claim |