Root/
1 | /* |
2 | * Copyright(c) 2009 Ian Molton <spyro@f2s.com> |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as |
6 | * published by the Free Software Foundation. |
7 | */ |
8 | |
9 | #include <linux/export.h> |
10 | #include <linux/mfd/tmio.h> |
11 | |
12 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base) |
13 | { |
14 | /* Enable the MMC/SD Control registers */ |
15 | sd_config_write16(cnf, shift, CNF_CMD, SDCREN); |
16 | sd_config_write32(cnf, shift, CNF_CTL_BASE, base & 0xfffe); |
17 | |
18 | /* Disable SD power during suspend */ |
19 | sd_config_write8(cnf, shift, CNF_PWR_CTL_3, 0x01); |
20 | |
21 | /* The below is required but why? FIXME */ |
22 | sd_config_write8(cnf, shift, CNF_STOP_CLK_CTL, 0x1f); |
23 | |
24 | /* Power down SD bus */ |
25 | sd_config_write8(cnf, shift, CNF_PWR_CTL_2, 0x00); |
26 | |
27 | return 0; |
28 | } |
29 | EXPORT_SYMBOL(tmio_core_mmc_enable); |
30 | |
31 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base) |
32 | { |
33 | |
34 | /* Enable the MMC/SD Control registers */ |
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 | } |
40 | EXPORT_SYMBOL(tmio_core_mmc_resume); |
41 | |
42 | void 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 | } |
46 | EXPORT_SYMBOL(tmio_core_mmc_pwr); |
47 | |
48 | void 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 | } |
52 | EXPORT_SYMBOL(tmio_core_mmc_clk_div); |
53 | |
54 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9