1
2
3
4
5
6
7
8
9#include <linux/export.h>
10#include <linux/mfd/tmio.h>
11
12int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base)
13{
14
15 sd_config_write16(cnf, shift, CNF_CMD, SDCREN);
16 sd_config_write32(cnf, shift, CNF_CTL_BASE, base & 0xfffe);
17
18
19 sd_config_write8(cnf, shift, CNF_PWR_CTL_3, 0x01);
20
21
22 sd_config_write8(cnf, shift, CNF_STOP_CLK_CTL, 0x1f);
23
24
25 sd_config_write8(cnf, shift, CNF_PWR_CTL_2, 0x00);
26
27 return 0;
28}
29EXPORT_SYMBOL(tmio_core_mmc_enable);
30
31int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base)
32{
33
34
35 sd_config_write16(cnf, shift, CNF_CMD, SDCREN);
36 sd_config_write32(cnf, shift, CNF_CTL_BASE, base & 0xfffe);
37
38 return 0;
39}
40EXPORT_SYMBOL(tmio_core_mmc_resume);
41
42void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state)
43{
44 sd_config_write8(cnf, shift, CNF_PWR_CTL_2, state ? 0x02 : 0x00);
45}
46EXPORT_SYMBOL(tmio_core_mmc_pwr);
47
48void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state)
49{
50 sd_config_write8(cnf, shift, CNF_SD_CLK_MODE, state ? 1 : 0);
51}
52EXPORT_SYMBOL(tmio_core_mmc_clk_div);
53
54