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

Commit 2e57bbe2 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Ulf Hansson
Browse files

sdhci-pci: refactor intel_mrfld_mmc_probe_slot()



Refactor intel_mrfld_mmc_probe_slot() to use switch case. The change allows to
add a support for SD and SDIO interfaces without any pain.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 3203a827
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -422,14 +422,19 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {

static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
{
	if ((PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_0) &&
	    (PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_1))
		/* SD support is not ready yet */
		return -ENODEV;
	unsigned int func = PCI_FUNC(slot->chip->pdev->devfn);

	slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
	switch (func) {
	case INTEL_MRFLD_EMMC_0:
	case INTEL_MRFLD_EMMC_1:
		slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
					 MMC_CAP_8_BIT_DATA |
					 MMC_CAP_1_8V_DDR;

		break;
	default:
		/* SD support is not ready yet */
		return -ENODEV;
	}
	return 0;
}