~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/mmc/host/sdhci-of-esdhc.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include <linux/io.h>
17
17
#include <linux/delay.h>
18
18
#include <linux/mmc/host.h>
19
 
#include "sdhci-pltfm.h"
 
19
#include "sdhci-of.h"
 
20
#include "sdhci.h"
20
21
#include "sdhci-esdhc.h"
21
22
 
22
23
static u16 esdhc_readw(struct sdhci_host *host, int reg)
59
60
 
60
61
static unsigned int esdhc_of_get_max_clock(struct sdhci_host *host)
61
62
{
62
 
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 
63
        struct sdhci_of_host *of_host = sdhci_priv(host);
63
64
 
64
 
        return pltfm_host->clock;
 
65
        return of_host->clock;
65
66
}
66
67
 
67
68
static unsigned int esdhc_of_get_min_clock(struct sdhci_host *host)
68
69
{
69
 
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
70
 
 
71
 
        return pltfm_host->clock / 256 / 16;
72
 
}
73
 
 
74
 
static unsigned int esdhc_of_get_max_blk_size(struct sdhci_host *host)
75
 
{
76
 
        /* Force 2048 bytes, which is the maximum supported size in SDHCI. */
77
 
        return 2;
78
 
}
79
 
 
80
 
static struct sdhci_ops sdhci_esdhc_ops = {
81
 
        .read_l = sdhci_be32bs_readl,
82
 
        .read_w = esdhc_readw,
83
 
        .read_b = sdhci_be32bs_readb,
84
 
        .write_l = sdhci_be32bs_writel,
85
 
        .write_w = esdhc_writew,
86
 
        .write_b = esdhc_writeb,
87
 
        .set_clock = esdhc_set_clock,
88
 
        .enable_dma = esdhc_of_enable_dma,
89
 
        .get_max_clock = esdhc_of_get_max_clock,
90
 
        .get_min_clock = esdhc_of_get_min_clock,
91
 
        .get_max_blk_size = esdhc_of_get_max_blk_size,
92
 
};
93
 
 
94
 
static struct sdhci_pltfm_data sdhci_esdhc_pdata = {
 
70
        struct sdhci_of_host *of_host = sdhci_priv(host);
 
71
 
 
72
        return of_host->clock / 256 / 16;
 
73
}
 
74
 
 
75
struct sdhci_of_data sdhci_esdhc = {
95
76
        /* card detection could be handled via GPIO */
96
77
        .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
97
78
                | SDHCI_QUIRK_NO_CARD_NO_RESET,
98
 
        .ops = &sdhci_esdhc_ops,
99
 
};
100
 
 
101
 
static int __devinit sdhci_esdhc_probe(struct platform_device *pdev)
102
 
{
103
 
        return sdhci_pltfm_register(pdev, &sdhci_esdhc_pdata);
104
 
}
105
 
 
106
 
static int __devexit sdhci_esdhc_remove(struct platform_device *pdev)
107
 
{
108
 
        return sdhci_pltfm_unregister(pdev);
109
 
}
110
 
 
111
 
static const struct of_device_id sdhci_esdhc_of_match[] = {
112
 
        { .compatible = "fsl,mpc8379-esdhc" },
113
 
        { .compatible = "fsl,mpc8536-esdhc" },
114
 
        { .compatible = "fsl,esdhc" },
115
 
        { }
116
 
};
117
 
MODULE_DEVICE_TABLE(of, sdhci_esdhc_of_match);
118
 
 
119
 
static struct platform_driver sdhci_esdhc_driver = {
120
 
        .driver = {
121
 
                .name = "sdhci-esdhc",
122
 
                .owner = THIS_MODULE,
123
 
                .of_match_table = sdhci_esdhc_of_match,
 
79
        .ops = {
 
80
                .read_l = sdhci_be32bs_readl,
 
81
                .read_w = esdhc_readw,
 
82
                .read_b = sdhci_be32bs_readb,
 
83
                .write_l = sdhci_be32bs_writel,
 
84
                .write_w = esdhc_writew,
 
85
                .write_b = esdhc_writeb,
 
86
                .set_clock = esdhc_set_clock,
 
87
                .enable_dma = esdhc_of_enable_dma,
 
88
                .get_max_clock = esdhc_of_get_max_clock,
 
89
                .get_min_clock = esdhc_of_get_min_clock,
124
90
        },
125
 
        .probe = sdhci_esdhc_probe,
126
 
        .remove = __devexit_p(sdhci_esdhc_remove),
127
 
#ifdef CONFIG_PM
128
 
        .suspend = sdhci_pltfm_suspend,
129
 
        .resume = sdhci_pltfm_resume,
130
 
#endif
131
91
};
132
 
 
133
 
static int __init sdhci_esdhc_init(void)
134
 
{
135
 
        return platform_driver_register(&sdhci_esdhc_driver);
136
 
}
137
 
module_init(sdhci_esdhc_init);
138
 
 
139
 
static void __exit sdhci_esdhc_exit(void)
140
 
{
141
 
        platform_driver_unregister(&sdhci_esdhc_driver);
142
 
}
143
 
module_exit(sdhci_esdhc_exit);
144
 
 
145
 
MODULE_DESCRIPTION("SDHCI OF driver for Freescale MPC eSDHC");
146
 
MODULE_AUTHOR("Xiaobo Xie <X.Xie@freescale.com>, "
147
 
              "Anton Vorontsov <avorontsov@ru.mvista.com>");
148
 
MODULE_LICENSE("GPL v2");