diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-06-20 03:08:16 -0400 |
---|---|---|
committer | Dong Aisheng <b29396@freescale.com> | 2014-06-24 02:11:53 -0400 |
commit | 5f9447e5d97060207c4742d5a06e5548de45972d (patch) | |
tree | 6b2457e7e18719fb121d1388d2b8f4d19d6a82c1 /include | |
parent | c819acf447205b1040d21606271899e19f9ade05 (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 *); | |||
192 | 192 | ||
193 | extern int mmc_detect_card_removed(struct mmc_host *host); | 193 | extern int mmc_detect_card_removed(struct mmc_host *host); |
194 | 194 | ||
195 | int mmc_first_nonreserved_index(void); | ||
196 | int mmc_get_reserved_index(struct mmc_host *host); | ||
197 | |||
195 | /** | 198 | /** |
196 | * mmc_claim_host - exclusively claim a host | 199 | * mmc_claim_host - exclusively claim a host |
197 | * @host: mmc host to claim | 200 | * @host: mmc host to claim |