19 #include <linux/module.h>
24 #define VENDOR_V_22 0x12
53 int base = reg & ~0x3;
54 int shift = (reg & 0x2) * 8;
65 int base = reg & ~0x3;
66 int shift = (reg & 0x3) * 8;
98 sdhci_be32bs_writew(host, val, reg);
101 static void esdhc_writeb(
struct sdhci_host *host,
u8 val,
int reg)
121 sdhci_be32bs_writeb(host, val, reg);
124 static int esdhc_of_enable_dma(
struct sdhci_host *host)
130 static unsigned int esdhc_of_get_max_clock(
struct sdhci_host *host)
134 return pltfm_host->
clock;
137 static unsigned int esdhc_of_get_min_clock(
struct sdhci_host *host)
141 return pltfm_host->
clock / 256 / 16;
144 static void esdhc_of_set_clock(
struct sdhci_host *host,
unsigned int clock)
148 if (clock > 20000000)
150 if (clock > 40000000)
155 esdhc_set_clock(host, clock);
159 static u32 esdhc_proctl;
160 static void esdhc_of_suspend(
struct sdhci_host *host)
165 static void esdhc_of_resume(
struct sdhci_host *host)
167 esdhc_of_enable_dma(host);
172 static void esdhc_of_platform_init(
struct sdhci_host *host)
182 static struct sdhci_ops sdhci_esdhc_ops = {
183 .read_l = esdhc_readl,
184 .read_w = esdhc_readw,
185 .read_b = esdhc_readb,
186 .write_l = sdhci_be32bs_writel,
187 .write_w = esdhc_writew,
188 .write_b = esdhc_writeb,
189 .set_clock = esdhc_of_set_clock,
190 .enable_dma = esdhc_of_enable_dma,
191 .get_max_clock = esdhc_of_get_max_clock,
192 .get_min_clock = esdhc_of_get_min_clock,
193 .platform_init = esdhc_of_platform_init,
195 .platform_suspend = esdhc_of_suspend,
196 .platform_resume = esdhc_of_resume,
208 .ops = &sdhci_esdhc_ops,
221 static const struct of_device_id sdhci_esdhc_of_match[] = {
222 { .compatible =
"fsl,mpc8379-esdhc" },
223 { .compatible =
"fsl,mpc8536-esdhc" },
224 { .compatible =
"fsl,esdhc" },
231 .name =
"sdhci-esdhc",
233 .of_match_table = sdhci_esdhc_of_match,
236 .probe = sdhci_esdhc_probe,