summaryrefslogtreecommitdiff
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorVenkat Gopalakrishnan <venkatg@codeaurora.org>2013-03-11 12:17:57 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-27 10:28:31 -0700
commitc071dd5ae5fd4d69e4d73edc034a77f5af8c7355 (patch)
tree914ea77fbde5983c289331ed0c9355c03695f1b5 /drivers/mmc/host
parent97bdc9cac7be74f770c8a7da5f2491e551a85194 (diff)
mmc: sdhci-msm: Disable SDHC slots at bootup if required
Add support to disable available SDHC slots at bootup controlled via a module param with a bit mask of slots to disable. QDSS is one use case where SDHC slot is disabled for trace output. Example Usage: Passing sdhci_msm.disable_slots=1 as kernel command line argument would disable SDHC slot 1, whereas passing sdhci_msm.disable_slots=3 would disable both slots 1 and 2. Change-Id: I97bc517adfe4a1a81a97a2789d77404b0f22b124 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/sdhci-msm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index a21dde2d694e..8c077135d1c2 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -101,6 +101,10 @@ static const u32 tuning_block_128[] = {
0xFFFFBBBB, 0xFFFF77FF, 0xFF7777FF, 0xEEDDBB77
};
+static int disable_slots;
+/* root can write, others read */
+module_param(disable_slots, int, S_IRUGO|S_IWUSR);
+
/* This structure keeps information per regulator */
struct sdhci_msm_reg_data {
/* voltage regulator handle */
@@ -2029,6 +2033,19 @@ static int sdhci_msm_probe(struct platform_device *pdev)
/* Extract platform data */
if (pdev->dev.of_node) {
+ ret = of_alias_get_id(pdev->dev.of_node, "sdhc");
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Failed to get slot index %d\n",
+ ret);
+ goto pltfm_free;
+ }
+ if (disable_slots & (1 << (ret - 1))) {
+ dev_info(&pdev->dev, "%s: Slot %d disabled\n", __func__,
+ ret);
+ ret = -ENODEV;
+ goto pltfm_free;
+ }
+
msm_host->pdata = sdhci_msm_populate_pdata(&pdev->dev);
if (!msm_host->pdata) {
dev_err(&pdev->dev, "DT parsing error\n");