diff options
Diffstat (limited to 'drivers/mmc/host/sdhci-of-hlwd.c')
-rw-r--r-- | drivers/mmc/host/sdhci-of-hlwd.c | 67 |
1 files changed, 57 insertions, 10 deletions
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c index 68ddb7546ae2..735be131dca9 100644 --- a/drivers/mmc/host/sdhci-of-hlwd.c +++ b/drivers/mmc/host/sdhci-of-hlwd.c | |||
@@ -21,8 +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" | ||
26 | 25 | ||
27 | /* | 26 | /* |
28 | * Ops and quirks for the Nintendo Wii SDHCI controllers. | 27 | * Ops and quirks for the Nintendo Wii SDHCI controllers. |
@@ -51,15 +50,63 @@ static void sdhci_hlwd_writeb(struct sdhci_host *host, u8 val, int reg) | |||
51 | udelay(SDHCI_HLWD_WRITE_DELAY); | 50 | udelay(SDHCI_HLWD_WRITE_DELAY); |
52 | } | 51 | } |
53 | 52 | ||
54 | struct sdhci_of_data sdhci_hlwd = { | 53 | static struct sdhci_ops sdhci_hlwd_ops = { |
54 | .read_l = sdhci_be32bs_readl, | ||
55 | .read_w = sdhci_be32bs_readw, | ||
56 | .read_b = sdhci_be32bs_readb, | ||
57 | .write_l = sdhci_hlwd_writel, | ||
58 | .write_w = sdhci_hlwd_writew, | ||
59 | .write_b = sdhci_hlwd_writeb, | ||
60 | }; | ||
61 | |||
62 | static struct sdhci_pltfm_data sdhci_hlwd_pdata = { | ||
55 | .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | | 63 | .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | |
56 | SDHCI_QUIRK_32BIT_DMA_SIZE, | 64 | SDHCI_QUIRK_32BIT_DMA_SIZE, |
57 | .ops = { | 65 | .ops = &sdhci_hlwd_ops, |
58 | .read_l = sdhci_be32bs_readl, | 66 | }; |
59 | .read_w = sdhci_be32bs_readw, | 67 | |
60 | .read_b = sdhci_be32bs_readb, | 68 | static int __devinit sdhci_hlwd_probe(struct platform_device *pdev) |
61 | .write_l = sdhci_hlwd_writel, | 69 | { |
62 | .write_w = sdhci_hlwd_writew, | 70 | return sdhci_pltfm_register(pdev, &sdhci_hlwd_pdata); |
63 | .write_b = sdhci_hlwd_writeb, | 71 | } |
72 | |||
73 | static int __devexit sdhci_hlwd_remove(struct platform_device *pdev) | ||
74 | { | ||
75 | return sdhci_pltfm_unregister(pdev); | ||
76 | } | ||
77 | |||
78 | static const struct of_device_id sdhci_hlwd_of_match[] = { | ||
79 | { .compatible = "nintendo,hollywood-sdhci" }, | ||
80 | { } | ||
81 | }; | ||
82 | MODULE_DEVICE_TABLE(of, sdhci_hlwd_of_match); | ||
83 | |||
84 | static struct platform_driver sdhci_hlwd_driver = { | ||
85 | .driver = { | ||
86 | .name = "sdhci-hlwd", | ||
87 | .owner = THIS_MODULE, | ||
88 | .of_match_table = sdhci_hlwd_of_match, | ||
64 | }, | 89 | }, |
90 | .probe = sdhci_hlwd_probe, | ||
91 | .remove = __devexit_p(sdhci_hlwd_remove), | ||
92 | #ifdef CONFIG_PM | ||
93 | .suspend = sdhci_pltfm_suspend, | ||
94 | .resume = sdhci_pltfm_resume, | ||
95 | #endif | ||
65 | }; | 96 | }; |
97 | |||
98 | static int __init sdhci_hlwd_init(void) | ||
99 | { | ||
100 | return platform_driver_register(&sdhci_hlwd_driver); | ||
101 | } | ||
102 | module_init(sdhci_hlwd_init); | ||
103 | |||
104 | static void __exit sdhci_hlwd_exit(void) | ||
105 | { | ||
106 | platform_driver_unregister(&sdhci_hlwd_driver); | ||
107 | } | ||
108 | module_exit(sdhci_hlwd_exit); | ||
109 | |||
110 | MODULE_DESCRIPTION("Nintendo Wii SDHCI OF driver"); | ||
111 | MODULE_AUTHOR("The GameCube Linux Team, Albert Herranz"); | ||
112 | MODULE_LICENSE("GPL v2"); | ||