[PATCH v2 3/4] mmc: sdhci-pltfm: add function in sdhci_ops to parse dt property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For sdhci based drivers, it's better to parse their host specific
device tree properties in their host's driver (sdhci-xxx.c) rather
than in the shared sdhci platform driver (sdhci-pltfm.c).
Otherwise function sdhci_get_of_property need to parse every host's
private dt property and will be bigger and bigger.

This patch add a function of_get_property in sdhci_ops to parse host
specific device tree property.

Signed-off-by: Kevin Liu <kliu5@xxxxxxxxxxx>
---
 drivers/mmc/host/sdhci-pltfm.c |    3 +++
 drivers/mmc/host/sdhci.h       |    1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pltfm.c
b/drivers/mmc/host/sdhci-pltfm.c index 0c5eb6a..6bbbff7 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -108,6 +108,9 @@ void sdhci_get_of_property(struct platform_device *pdev)

 	if (of_find_property(np, "enable-sdio-wakeup", NULL))
 		host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
+
+	if (host->ops->get_of_property)
+		host->ops->get_of_property(host);
 }
 #else
 void sdhci_get_of_property(struct platform_device *pdev) {} diff
--git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index
379e09d..48562bc 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -294,6 +294,7 @@ struct sdhci_ops {
 	void	(*platform_resume)(struct sdhci_host *host);
 	void    (*adma_workaround)(struct sdhci_host *host, u32 intmask);
 	void	(*platform_init)(struct sdhci_host *host);
+	void    (*get_of_property)(struct sdhci_host *host);
 };

 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux