Commit bafb7142 authored by Adrian Hunter's avatar Adrian Hunter Committed by Greg Kroah-Hartman

mmc: sdhci: Allow override of mmc host operations

commit bf60e592 upstream.

In the past, fixes for specific hardware devices were implemented
in sdhci using quirks.  That approach is no longer accepted because
the growing number of quirks was starting to make the code difficult
to understand and maintain.

One alternative to quirks, is to allow drivers to override the default
mmc host operations.  This patch makes it easy to do that, and it is
needed for a subsequent bug fix, for which separate patches are
provided.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dfca1918
...@@ -2864,6 +2864,8 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, ...@@ -2864,6 +2864,8 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
host = mmc_priv(mmc); host = mmc_priv(mmc);
host->mmc = mmc; host->mmc = mmc;
host->mmc_host_ops = sdhci_ops;
mmc->ops = &host->mmc_host_ops;
return host; return host;
} }
...@@ -3060,7 +3062,6 @@ int sdhci_add_host(struct sdhci_host *host) ...@@ -3060,7 +3062,6 @@ int sdhci_add_host(struct sdhci_host *host)
/* /*
* Set host parameters. * Set host parameters.
*/ */
mmc->ops = &sdhci_ops;
max_clk = host->max_clk; max_clk = host->max_clk;
if (host->ops->get_min_clock) if (host->ops->get_min_clock)
......
...@@ -425,6 +425,7 @@ struct sdhci_host { ...@@ -425,6 +425,7 @@ struct sdhci_host {
/* Internal data */ /* Internal data */
struct mmc_host *mmc; /* MMC structure */ struct mmc_host *mmc; /* MMC structure */
struct mmc_host_ops mmc_host_ops; /* MMC host ops */
u64 dma_mask; /* custom DMA mask */ u64 dma_mask; /* custom DMA mask */
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment