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

Commit 18c55ccb authored by Pavan Anamula's avatar Pavan Anamula
Browse files

mmc: sdhci-msm: add the ability to fake 3.0v support for SDIO devices



As SDIO spec doesn't allow advertisement of 1.8v support, some SDIO
devices advertise support of only 3.0v even though they support 1.8v
as well.
sdhc3 host controller only supports 1.8v and rejects the initialization
of SDIO devices that advertise 3.0v support.
This change adds fake support for 3.0v to sdhc host controller.
This will allow initialization of SDIO devices that supports 1.8v but
advertise 3.0v support.

Change-Id: I5a98c54ad4998e6439f83081628c9c083e95bbf0
Signed-off-by: default avatarPavan Anamula <pavana@codeaurora.org>
parent e35fdbfe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@ Optional Properties:
	  when load is high (performance mode) and the second is for low loads
	  (power saving mode). These values will be used for cpu group voting for
	  command-queueing mode or legacy respectively.
	- qcom,core_3_0v_support: an optional property that is used to fake
	  3.0V support for SDIO devices.

In the following, <supply> can be vdd (flash core voltage) or vdd-io (I/O voltage).
	- qcom,<supply>-always-on - specifies whether supply should be kept "on" always.
+11 −0
Original line number Diff line number Diff line
@@ -1738,6 +1738,9 @@ struct sdhci_msm_pltfm_data *sdhci_msm_populate_pdata(struct device *dev,

	sdhci_msm_pm_qos_parse(dev, pdata);

	if (of_get_property(np, "qcom,core_3_0v_support", NULL))
		pdata->core_3_0v_support = true;

	return pdata;
out:
	return NULL;
@@ -3720,6 +3723,14 @@ static void sdhci_set_default_hw_caps(struct sdhci_msm_host *msm_host,
				(minor == 0x49)))
		msm_host->use_14lpp_dll = true;

	/* Fake 3.0V support for SDIO devices which requires such voltage */
	if (msm_host->pdata->core_3_0v_support) {
		caps |= CORE_3_0V_SUPPORT;
			writel_relaxed(
			(readl_relaxed(host->ioaddr + SDHCI_CAPABILITIES) |
			caps), host->ioaddr + CORE_VENDOR_SPEC_CAPABILITIES0);
	}

	if ((major == 1) && (minor >= 0x49))
		msm_host->rclk_delay_fix = true;
	/*
+1 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ struct sdhci_msm_pltfm_data {
	u32 ice_clk_max;
	u32 ice_clk_min;
	struct sdhci_msm_pm_qos_data pm_qos_data;
	bool core_3_0v_support;
};

struct sdhci_msm_bus_vote {