diff options
author | Ian Molton <ian@mnementh.co.uk> | 2010-01-06 07:51:48 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-01-18 06:30:27 -0500 |
commit | 64e8867ba8098b69889c1af94997a5ba2348fb26 (patch) | |
tree | 3391806575ec3435a26043a22ba45c9d76f0b791 /drivers/mfd/t7l66xb.c | |
parent | 6f2af72a2451b7491fba820b1d1b0b91c6a84027 (diff) |
mfd: tmio_mmc hardware abstraction for CNF area
This patch abstracts out the CNF area code from tmio_mmc which
is not present in all hardware that can use this driver. This
is required so that we can support non-toshiba based hardware.
ASIC3 support by Philipp Zabel
Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/t7l66xb.c')
-rw-r--r-- | drivers/mfd/t7l66xb.c | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c index 0a255c1f1ce7..bcf4687d4af5 100644 --- a/drivers/mfd/t7l66xb.c +++ b/drivers/mfd/t7l66xb.c | |||
@@ -38,6 +38,19 @@ enum { | |||
38 | T7L66XB_CELL_MMC, | 38 | T7L66XB_CELL_MMC, |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static const struct resource t7l66xb_mmc_resources[] = { | ||
42 | { | ||
43 | .start = 0x800, | ||
44 | .end = 0x9ff, | ||
45 | .flags = IORESOURCE_MEM, | ||
46 | }, | ||
47 | { | ||
48 | .start = IRQ_T7L66XB_MMC, | ||
49 | .end = IRQ_T7L66XB_MMC, | ||
50 | .flags = IORESOURCE_IRQ, | ||
51 | }, | ||
52 | }; | ||
53 | |||
41 | #define SCR_REVID 0x08 /* b Revision ID */ | 54 | #define SCR_REVID 0x08 /* b Revision ID */ |
42 | #define SCR_IMR 0x42 /* b Interrupt Mask */ | 55 | #define SCR_IMR 0x42 /* b Interrupt Mask */ |
43 | #define SCR_DEV_CTL 0xe0 /* b Device control */ | 56 | #define SCR_DEV_CTL 0xe0 /* b Device control */ |
@@ -83,6 +96,9 @@ static int t7l66xb_mmc_enable(struct platform_device *mmc) | |||
83 | 96 | ||
84 | spin_unlock_irqrestore(&t7l66xb->lock, flags); | 97 | spin_unlock_irqrestore(&t7l66xb->lock, flags); |
85 | 98 | ||
99 | tmio_core_mmc_enable(t7l66xb->scr + 0x200, 0, | ||
100 | t7l66xb_mmc_resources[0].start & 0xfffe); | ||
101 | |||
86 | return 0; | 102 | return 0; |
87 | } | 103 | } |
88 | 104 | ||
@@ -106,28 +122,28 @@ static int t7l66xb_mmc_disable(struct platform_device *mmc) | |||
106 | return 0; | 122 | return 0; |
107 | } | 123 | } |
108 | 124 | ||
125 | static void t7l66xb_mmc_pwr(struct platform_device *mmc, int state) | ||
126 | { | ||
127 | struct platform_device *dev = to_platform_device(mmc->dev.parent); | ||
128 | struct t7l66xb *t7l66xb = platform_get_drvdata(dev); | ||
129 | |||
130 | tmio_core_mmc_pwr(t7l66xb->scr + 0x200, 0, state); | ||
131 | } | ||
132 | |||
133 | static void t7l66xb_mmc_clk_div(struct platform_device *mmc, int state) | ||
134 | { | ||
135 | struct platform_device *dev = to_platform_device(mmc->dev.parent); | ||
136 | struct t7l66xb *t7l66xb = platform_get_drvdata(dev); | ||
137 | |||
138 | tmio_core_mmc_clk_div(t7l66xb->scr + 0x200, 0, state); | ||
139 | } | ||
140 | |||
109 | /*--------------------------------------------------------------------------*/ | 141 | /*--------------------------------------------------------------------------*/ |
110 | 142 | ||
111 | static struct tmio_mmc_data t7166xb_mmc_data = { | 143 | static struct tmio_mmc_data t7166xb_mmc_data = { |
112 | .hclk = 24000000, | 144 | .hclk = 24000000, |
113 | }; | 145 | .set_pwr = t7l66xb_mmc_pwr, |
114 | 146 | .set_clk_div = t7l66xb_mmc_clk_div, | |
115 | static const struct resource t7l66xb_mmc_resources[] = { | ||
116 | { | ||
117 | .start = 0x800, | ||
118 | .end = 0x9ff, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, | ||
121 | { | ||
122 | .start = 0x200, | ||
123 | .end = 0x2ff, | ||
124 | .flags = IORESOURCE_MEM, | ||
125 | }, | ||
126 | { | ||
127 | .start = IRQ_T7L66XB_MMC, | ||
128 | .end = IRQ_T7L66XB_MMC, | ||
129 | .flags = IORESOURCE_IRQ, | ||
130 | }, | ||
131 | }; | 147 | }; |
132 | 148 | ||
133 | static const struct resource t7l66xb_nand_resources[] = { | 149 | static const struct resource t7l66xb_nand_resources[] = { |
@@ -282,6 +298,9 @@ static int t7l66xb_resume(struct platform_device *dev) | |||
282 | if (pdata && pdata->resume) | 298 | if (pdata && pdata->resume) |
283 | pdata->resume(dev); | 299 | pdata->resume(dev); |
284 | 300 | ||
301 | tmio_core_mmc_enable(t7l66xb->scr + 0x200, 0, | ||
302 | t7l66xb_mmc_resources[0].start & 0xfffe); | ||
303 | |||
285 | return 0; | 304 | return 0; |
286 | } | 305 | } |
287 | #else | 306 | #else |