Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 270580a6 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan Committed by Xiaonian Wang
Browse files

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: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 22dd3368
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -100,6 +100,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 */
@@ -1791,6 +1795,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");