pinctrl: add bcm2835 driver
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / mmc / host / sdhci-of-hlwd.c
blob0ce088ae02289ecf743e00c120a210e7de550d45
1 /*
2 * drivers/mmc/host/sdhci-of-hlwd.c
4 * Nintendo Wii Secure Digital Host Controller Interface.
5 * Copyright (C) 2009 The GameCube Linux Team
6 * Copyright (C) 2009 Albert Herranz
8 * Based on sdhci-of-esdhc.c
10 * Copyright (c) 2007 Freescale Semiconductor, Inc.
11 * Copyright (c) 2009 MontaVista Software, Inc.
13 * Authors: Xiaobo Xie <X.Xie@freescale.com>
14 * Anton Vorontsov <avorontsov@ru.mvista.com>
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or (at
19 * your option) any later version.
22 #include <linux/delay.h>
23 #include <linux/module.h>
24 #include <linux/mmc/host.h>
25 #include "sdhci-pltfm.h"
28 * Ops and quirks for the Nintendo Wii SDHCI controllers.
32 * We need a small delay after each write, or things go horribly wrong.
34 #define SDHCI_HLWD_WRITE_DELAY 5 /* usecs */
36 static void sdhci_hlwd_writel(struct sdhci_host *host, u32 val, int reg)
38 sdhci_be32bs_writel(host, val, reg);
39 udelay(SDHCI_HLWD_WRITE_DELAY);
42 static void sdhci_hlwd_writew(struct sdhci_host *host, u16 val, int reg)
44 sdhci_be32bs_writew(host, val, reg);
45 udelay(SDHCI_HLWD_WRITE_DELAY);
48 static void sdhci_hlwd_writeb(struct sdhci_host *host, u8 val, int reg)
50 sdhci_be32bs_writeb(host, val, reg);
51 udelay(SDHCI_HLWD_WRITE_DELAY);
54 static struct sdhci_ops sdhci_hlwd_ops = {
55 .read_l = sdhci_be32bs_readl,
56 .read_w = sdhci_be32bs_readw,
57 .read_b = sdhci_be32bs_readb,
58 .write_l = sdhci_hlwd_writel,
59 .write_w = sdhci_hlwd_writew,
60 .write_b = sdhci_hlwd_writeb,
63 static struct sdhci_pltfm_data sdhci_hlwd_pdata = {
64 .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR |
65 SDHCI_QUIRK_32BIT_DMA_SIZE,
66 .ops = &sdhci_hlwd_ops,
69 static int __devinit sdhci_hlwd_probe(struct platform_device *pdev)
71 return sdhci_pltfm_register(pdev, &sdhci_hlwd_pdata);
74 static int __devexit sdhci_hlwd_remove(struct platform_device *pdev)
76 return sdhci_pltfm_unregister(pdev);
79 static const struct of_device_id sdhci_hlwd_of_match[] = {
80 { .compatible = "nintendo,hollywood-sdhci" },
81 { }
83 MODULE_DEVICE_TABLE(of, sdhci_hlwd_of_match);
85 static 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 .pm = SDHCI_PLTFM_PMOPS,
92 .probe = sdhci_hlwd_probe,
93 .remove = __devexit_p(sdhci_hlwd_remove),
96 module_platform_driver(sdhci_hlwd_driver);
98 MODULE_DESCRIPTION("Nintendo Wii SDHCI OF driver");
99 MODULE_AUTHOR("The GameCube Linux Team, Albert Herranz");
100 MODULE_LICENSE("GPL v2");