diff options
author | kishore kadiyala <kishore.kadiyala@ti.com> | 2010-05-15 14:21:06 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-05-20 14:21:21 -0400 |
commit | 717c1fbf7c139c3c5d5920b29bdf196d07a40c8a (patch) | |
tree | 5e699518d6aacbd403498266fded1d3212a8aaee /arch/arm/mach-omap2/board-4430sdp.c | |
parent | 2c9d103e1e6b0970fd45c82de205415a2ad86c8d (diff) |
omap4: Adding hsmmc support to board file
Adding support for MMC1 & MMC2 controllers of OMAP4430 SDP
to board file.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-4430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 59 |
1 files changed, 52 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 921cde3d79e0..e4a5d66b83b8 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include <plat/control.h> | 33 | #include <plat/control.h> |
34 | #include <plat/timer-gp.h> | 34 | #include <plat/timer-gp.h> |
35 | #include <plat/usb.h> | 35 | #include <plat/usb.h> |
36 | #include <plat/mmc.h> | ||
37 | #include "hsmmc.h" | ||
36 | 38 | ||
37 | #define ETH_KS8851_IRQ 34 | 39 | #define ETH_KS8851_IRQ 34 |
38 | #define ETH_KS8851_POWER_ON 48 | 40 | #define ETH_KS8851_POWER_ON 48 |
@@ -137,24 +139,66 @@ static struct omap_musb_board_data musb_board_data = { | |||
137 | .mode = MUSB_PERIPHERAL, | 139 | .mode = MUSB_PERIPHERAL, |
138 | .power = 100, | 140 | .power = 100, |
139 | }; | 141 | }; |
140 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | 142 | |
141 | { | 143 | static struct omap2_hsmmc_info mmc[] = { |
142 | .supply = "vmmc", | ||
143 | }, | ||
144 | { | 144 | { |
145 | .supply = "vmmc", | 145 | .mmc = 1, |
146 | .wires = 8, | ||
147 | .gpio_wp = -EINVAL, | ||
146 | }, | 148 | }, |
147 | { | 149 | { |
148 | .supply = "vmmc", | 150 | .mmc = 2, |
151 | .wires = 8, | ||
152 | .gpio_cd = -EINVAL, | ||
153 | .gpio_wp = -EINVAL, | ||
154 | .nonremovable = true, | ||
149 | }, | 155 | }, |
156 | {} /* Terminator */ | ||
157 | }; | ||
158 | |||
159 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | ||
150 | { | 160 | { |
151 | .supply = "vmmc", | 161 | .supply = "vmmc", |
162 | .dev_name = "mmci-omap-hs.0", | ||
152 | }, | 163 | }, |
153 | { | 164 | { |
154 | .supply = "vmmc", | 165 | .supply = "vmmc", |
166 | .dev_name = "mmci-omap-hs.1", | ||
155 | }, | 167 | }, |
156 | }; | 168 | }; |
157 | 169 | ||
170 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | ||
171 | { | ||
172 | int ret = 0; | ||
173 | struct platform_device *pdev = container_of(dev, | ||
174 | struct platform_device, dev); | ||
175 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
176 | |||
177 | /* Setting MMC1 Card detect Irq */ | ||
178 | if (pdev->id == 0) | ||
179 | pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE + | ||
180 | MMCDETECT_INTR_OFFSET; | ||
181 | return ret; | ||
182 | } | ||
183 | |||
184 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) | ||
185 | { | ||
186 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
187 | |||
188 | pdata->init = omap4_twl6030_hsmmc_late_init; | ||
189 | } | ||
190 | |||
191 | static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
192 | { | ||
193 | struct omap2_hsmmc_info *c; | ||
194 | |||
195 | omap2_hsmmc_init(controllers); | ||
196 | for (c = controllers; c->mmc; c++) | ||
197 | omap4_twl6030_hsmmc_set_late_init(c->dev); | ||
198 | |||
199 | return 0; | ||
200 | } | ||
201 | |||
158 | static struct regulator_init_data sdp4430_vaux1 = { | 202 | static struct regulator_init_data sdp4430_vaux1 = { |
159 | .constraints = { | 203 | .constraints = { |
160 | .min_uV = 1000000, | 204 | .min_uV = 1000000, |
@@ -206,7 +250,7 @@ static struct regulator_init_data sdp4430_vmmc = { | |||
206 | | REGULATOR_CHANGE_MODE | 250 | | REGULATOR_CHANGE_MODE |
207 | | REGULATOR_CHANGE_STATUS, | 251 | | REGULATOR_CHANGE_STATUS, |
208 | }, | 252 | }, |
209 | .num_consumer_supplies = 5, | 253 | .num_consumer_supplies = 2, |
210 | .consumer_supplies = sdp4430_vmmc_supply, | 254 | .consumer_supplies = sdp4430_vmmc_supply, |
211 | }; | 255 | }; |
212 | 256 | ||
@@ -329,6 +373,7 @@ static void __init omap_4430sdp_init(void) | |||
329 | omap4_i2c_init(); | 373 | omap4_i2c_init(); |
330 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 374 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
331 | omap_serial_init(); | 375 | omap_serial_init(); |
376 | omap4_twl6030_hsmmc_init(mmc); | ||
332 | /* OMAP4 SDP uses internal transceiver so register nop transceiver */ | 377 | /* OMAP4 SDP uses internal transceiver so register nop transceiver */ |
333 | usb_nop_xceiv_register(); | 378 | usb_nop_xceiv_register(); |
334 | /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ | 379 | /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ |