diff options
| -rw-r--r-- | drivers/mmc/host/sdhci-pltfm.c | 10 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-pltfm.h | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 4f126de5f492..730fdf54ecb0 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c | |||
| @@ -55,6 +55,7 @@ static int __devinit sdhci_pltfm_probe(struct platform_device *pdev) | |||
| 55 | struct sdhci_pltfm_data *pdata = pdev->dev.platform_data; | 55 | struct sdhci_pltfm_data *pdata = pdev->dev.platform_data; |
| 56 | const struct platform_device_id *platid = platform_get_device_id(pdev); | 56 | const struct platform_device_id *platid = platform_get_device_id(pdev); |
| 57 | struct sdhci_host *host; | 57 | struct sdhci_host *host; |
| 58 | struct sdhci_pltfm_host *pltfm_host; | ||
| 58 | struct resource *iomem; | 59 | struct resource *iomem; |
| 59 | int ret; | 60 | int ret; |
| 60 | 61 | ||
| @@ -71,16 +72,19 @@ static int __devinit sdhci_pltfm_probe(struct platform_device *pdev) | |||
| 71 | dev_err(&pdev->dev, "Invalid iomem size. You may " | 72 | dev_err(&pdev->dev, "Invalid iomem size. You may " |
| 72 | "experience problems.\n"); | 73 | "experience problems.\n"); |
| 73 | 74 | ||
| 74 | if (pdev->dev.parent) | 75 | /* Some PCI-based MFD need the parent here */ |
| 75 | host = sdhci_alloc_host(pdev->dev.parent, 0); | 76 | if (pdev->dev.parent != &platform_bus) |
| 77 | host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host)); | ||
| 76 | else | 78 | else |
| 77 | host = sdhci_alloc_host(&pdev->dev, 0); | 79 | host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host)); |
| 78 | 80 | ||
| 79 | if (IS_ERR(host)) { | 81 | if (IS_ERR(host)) { |
| 80 | ret = PTR_ERR(host); | 82 | ret = PTR_ERR(host); |
| 81 | goto err; | 83 | goto err; |
| 82 | } | 84 | } |
| 83 | 85 | ||
| 86 | pltfm_host = sdhci_priv(host); | ||
| 87 | |||
| 84 | host->hw_name = "platform"; | 88 | host->hw_name = "platform"; |
| 85 | if (pdata && pdata->ops) | 89 | if (pdata && pdata->ops) |
| 86 | host->ops = pdata->ops; | 90 | host->ops = pdata->ops; |
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h index 900f32902f73..93a031973f62 100644 --- a/drivers/mmc/host/sdhci-pltfm.h +++ b/drivers/mmc/host/sdhci-pltfm.h | |||
| @@ -11,8 +11,15 @@ | |||
| 11 | #ifndef _DRIVERS_MMC_SDHCI_PLTFM_H | 11 | #ifndef _DRIVERS_MMC_SDHCI_PLTFM_H |
| 12 | #define _DRIVERS_MMC_SDHCI_PLTFM_H | 12 | #define _DRIVERS_MMC_SDHCI_PLTFM_H |
| 13 | 13 | ||
| 14 | #include <linux/clk.h> | ||
| 15 | #include <linux/types.h> | ||
| 14 | #include <linux/sdhci-pltfm.h> | 16 | #include <linux/sdhci-pltfm.h> |
| 15 | 17 | ||
| 18 | struct sdhci_pltfm_host { | ||
| 19 | struct clk *clk; | ||
| 20 | u32 scratchpad; /* to handle quirks across io-accessor calls */ | ||
| 21 | }; | ||
| 22 | |||
| 16 | extern struct sdhci_pltfm_data sdhci_cns3xxx_pdata; | 23 | extern struct sdhci_pltfm_data sdhci_cns3xxx_pdata; |
| 17 | 24 | ||
| 18 | #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */ | 25 | #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */ |
