mmc: sdhci: Force probe of shdc1 based on boolean property

Force probing the sdhc1 bus even if it is not the boot device
by reading the device tree property qcom,force-sdhc1-probe.
Enables using the primary port for other use cases even when
the board is not using eMMC for boot.

Change-Id: I2a2b9d6a51037641720bdfd3107b2fadf385d7b5
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
This commit is contained in:
Gustavo Solaira 2017-08-18 11:18:00 -07:00
parent cffd215486
commit eb4ef163c5
2 changed files with 8 additions and 1 deletions

View file

@ -80,6 +80,7 @@ Optional Properties:
register dumps on CRC errors and also downgrade bus speed mode to
SDR50/DDR50 in case of continuous CRC errors. Set this flag to enable
this workaround.
- qcom,force-sdhc1-probe: Force probing sdhc1 even if it is not the boot device.
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.

View file

@ -4249,6 +4249,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
struct resource *tlmm_memres = NULL;
void __iomem *tlmm_mem;
unsigned long flags;
bool force_probe;
pr_debug("%s: Enter %s\n", dev_name(&pdev->dev), __func__);
msm_host = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_msm_host),
@ -4312,8 +4313,13 @@ static int sdhci_msm_probe(struct platform_device *pdev)
goto pltfm_free;
}
/* Read property to determine if the probe is forced */
force_probe = of_find_property(pdev->dev.of_node,
"qcom,force-sdhc1-probe", NULL);
/* skip the probe if eMMC isn't a boot device */
if ((ret == 1) && !sdhci_msm_is_bootdevice(&pdev->dev)) {
if ((ret == 1) && !sdhci_msm_is_bootdevice(&pdev->dev)
&& !force_probe) {
ret = -ENODEV;
goto pltfm_free;
}