diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-06-20 15:08:16 +0800 |
---|---|---|
committer | Dong Aisheng <b29396@freescale.com> | 2014-06-23 15:21:22 +0800 |
commit | e443bb4ad14f79f69dc3f8878b0c3671a3fbd61e (patch) | |
tree | 0fb05978af4b28bb7e2171b45ea682b6b98fbd8e /include | |
parent | 18ae7362e9822993436c1a544e49cfd58fa175b2 (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>
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 39613b9a6fc5..c3d6e7073e1d 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -192,6 +192,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 |