32 #include <linux/module.h>
35 #include <asm/machdep.h>
39 static struct sdhci_ops sdhci_pltfm_ops = {
43 static bool sdhci_of_wp_inverted(
struct device_node *np)
51 return machine_is(mpc837x_rdb) || machine_is(mpc837x_mds);
71 (of_property_read_u32(np,
"bus-width", &bus_width) == 0 &&
75 if (sdhci_of_wp_inverted(np))
90 if (clk && size ==
sizeof(*clk) && *clk)
114 if (resource_size(iomem) < 0x100)
128 pltfm_host = sdhci_priv(host);
131 if (pdata && pdata->
ops)
134 host->
ops = &sdhci_pltfm_ops;
141 dev_err(&pdev->
dev,
"cannot request region\n");
148 dev_err(&pdev->
dev,
"failed to remap registers\n");
157 if (host->
ops && host->
ops->platform_init)
158 host->
ops->platform_init(host);
160 platform_set_drvdata(pdev, host);
169 dev_err(&pdev->
dev,
"%s failed %d\n", __func__, ret);
176 struct sdhci_host *host = platform_get_drvdata(pdev);
182 platform_set_drvdata(pdev,
NULL);
194 return PTR_ERR(host);
208 struct sdhci_host *host = platform_get_drvdata(pdev);
219 static int sdhci_pltfm_suspend(
struct device *
dev)
223 return sdhci_suspend_host(host);
226 static int sdhci_pltfm_resume(
struct device *
dev)
230 return sdhci_resume_host(host);
234 .
suspend = sdhci_pltfm_suspend,
235 .resume = sdhci_pltfm_resume,
240 static int __init sdhci_pltfm_drv_init(
void)
242 pr_info(
"sdhci-pltfm: SDHCI platform and OF driver helper\n");
248 static void __exit sdhci_pltfm_drv_exit(
void)