aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-of-hlwd.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-05-27 11:48:14 -0400
committerChris Ball <cjb@laptop.org>2011-07-20 17:20:47 -0400
commit38576af1f8cad48446df47dcf404b197c9206dba (patch)
tree2e35c4fe4588b95febfb4430bbf784b5634b216d /drivers/mmc/host/sdhci-of-hlwd.c
parente307148fd4f971cecfaebb516ee28e164948a24b (diff)
mmc: sdhci: make sdhci-of device drivers self registered
The patch turns the sdhci-of-core common stuff into helper functions added into sdhci-pltfm.c, and makes sdhci-of device drviers self registered using the same pair of .probe and .remove used by sdhci-pltfm device drivers. As a result, sdhci-of-core.c and sdhci-of.h can be eliminated with those common things merged into sdhci-pltfm.c and sdhci-pltfm.h respectively. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-of-hlwd.c')
-rw-r--r--drivers/mmc/host/sdhci-of-hlwd.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c
index 380e896864b..faedfcec776 100644
--- a/drivers/mmc/host/sdhci-of-hlwd.c
+++ b/drivers/mmc/host/sdhci-of-hlwd.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/mmc/host.h> 23#include <linux/mmc/host.h>
24#include "sdhci-of.h" 24#include "sdhci-pltfm.h"
25#include "sdhci.h" 25#include "sdhci.h"
26 26
27/* 27/*
@@ -60,8 +60,54 @@ static struct sdhci_ops sdhci_hlwd_ops = {
60 .write_b = sdhci_hlwd_writeb, 60 .write_b = sdhci_hlwd_writeb,
61}; 61};
62 62
63struct sdhci_pltfm_data sdhci_hlwd_pdata = { 63static struct sdhci_pltfm_data sdhci_hlwd_pdata = {
64 .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | 64 .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR |
65 SDHCI_QUIRK_32BIT_DMA_SIZE, 65 SDHCI_QUIRK_32BIT_DMA_SIZE,
66 .ops = &sdhci_hlwd_ops, 66 .ops = &sdhci_hlwd_ops,
67}; 67};
68
69static int __devinit sdhci_hlwd_probe(struct platform_device *pdev)
70{
71 return sdhci_pltfm_register(pdev, &sdhci_hlwd_pdata);
72}
73
74static int __devexit sdhci_hlwd_remove(struct platform_device *pdev)
75{
76 return sdhci_pltfm_unregister(pdev);
77}
78
79static const struct of_device_id sdhci_hlwd_of_match[] = {
80 { .compatible = "nintendo,hollywood-sdhci" },
81 { }
82};
83MODULE_DEVICE_TABLE(of, sdhci_hlwd_of_match);
84
85static struct platform_driver sdhci_hlwd_driver = {
86 .driver = {
87 .name = "sdhci-hlwd",
88 .owner = THIS_MODULE,
89 .of_match_table = sdhci_hlwd_of_match,
90 },
91 .probe = sdhci_hlwd_probe,
92 .remove = __devexit_p(sdhci_hlwd_remove),
93#ifdef CONFIG_PM
94 .suspend = sdhci_pltfm_suspend,
95 .resume = sdhci_pltfm_resume,
96#endif
97};
98
99static int __init sdhci_hlwd_init(void)
100{
101 return platform_driver_register(&sdhci_hlwd_driver);
102}
103module_init(sdhci_hlwd_init);
104
105static void __exit sdhci_hlwd_exit(void)
106{
107 platform_driver_unregister(&sdhci_hlwd_driver);
108}
109module_exit(sdhci_hlwd_exit);
110
111MODULE_DESCRIPTION("Nintendo Wii SDHCI OF driver");
112MODULE_AUTHOR("The GameCube Linux Team, Albert Herranz");
113MODULE_LICENSE("GPL v2");