diff options
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 49 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap4-common.c | 58 |
4 files changed, 61 insertions, 93 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 130ab00c09a..6dc18484189 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -489,50 +489,6 @@ static struct platform_device omap_vwlan_device = { | |||
489 | }, | 489 | }, |
490 | }; | 490 | }; |
491 | 491 | ||
492 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | ||
493 | { | ||
494 | int irq = 0; | ||
495 | struct platform_device *pdev = container_of(dev, | ||
496 | struct platform_device, dev); | ||
497 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
498 | |||
499 | /* Setting MMC1 Card detect Irq */ | ||
500 | if (pdev->id == 0) { | ||
501 | irq = twl6030_mmc_card_detect_config(); | ||
502 | if (irq < 0) { | ||
503 | pr_err("Failed configuring MMC1 card detect\n"); | ||
504 | return irq; | ||
505 | } | ||
506 | pdata->slots[0].card_detect_irq = irq; | ||
507 | pdata->slots[0].card_detect = twl6030_mmc_card_detect; | ||
508 | } | ||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) | ||
513 | { | ||
514 | struct omap_mmc_platform_data *pdata; | ||
515 | |||
516 | /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ | ||
517 | if (!dev) { | ||
518 | pr_err("Failed %s\n", __func__); | ||
519 | return; | ||
520 | } | ||
521 | pdata = dev->platform_data; | ||
522 | pdata->init = omap4_twl6030_hsmmc_late_init; | ||
523 | } | ||
524 | |||
525 | static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
526 | { | ||
527 | struct omap2_hsmmc_info *c; | ||
528 | |||
529 | omap_hsmmc_init(controllers); | ||
530 | for (c = controllers; c->mmc; c++) | ||
531 | omap4_twl6030_hsmmc_set_late_init(&c->pdev->dev); | ||
532 | |||
533 | return 0; | ||
534 | } | ||
535 | |||
536 | static struct regulator_init_data sdp4430_vaux1 = { | 492 | static struct regulator_init_data sdp4430_vaux1 = { |
537 | .constraints = { | 493 | .constraints = { |
538 | .min_uV = 1000000, | 494 | .min_uV = 1000000, |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 1b782ba5343..c148472a79b 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -236,55 +236,6 @@ struct wl12xx_platform_data omap_panda_wlan_data __initdata = { | |||
236 | .board_ref_clock = 2, | 236 | .board_ref_clock = 2, |
237 | }; | 237 | }; |
238 | 238 | ||
239 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | ||
240 | { | ||
241 | int irq = 0; | ||
242 | struct platform_device *pdev = container_of(dev, | ||
243 | struct platform_device, dev); | ||
244 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
245 | |||
246 | if (!pdata) { | ||
247 | dev_err(dev, "%s: NULL platform data\n", __func__); | ||
248 | return -EINVAL; | ||
249 | } | ||
250 | /* Setting MMC1 Card detect Irq */ | ||
251 | if (pdev->id == 0) { | ||
252 | irq = twl6030_mmc_card_detect_config(); | ||
253 | if (irq < 0) { | ||
254 | dev_err(dev, "%s: Error card detect config(%d)\n", | ||
255 | __func__, irq); | ||
256 | return irq; | ||
257 | } | ||
258 | pdata->slots[0].card_detect = twl6030_mmc_card_detect; | ||
259 | } | ||
260 | return 0; | ||
261 | } | ||
262 | |||
263 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) | ||
264 | { | ||
265 | struct omap_mmc_platform_data *pdata; | ||
266 | |||
267 | /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ | ||
268 | if (!dev) { | ||
269 | pr_err("Failed omap4_twl6030_hsmmc_set_late_init\n"); | ||
270 | return; | ||
271 | } | ||
272 | pdata = dev->platform_data; | ||
273 | |||
274 | pdata->init = omap4_twl6030_hsmmc_late_init; | ||
275 | } | ||
276 | |||
277 | static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
278 | { | ||
279 | struct omap2_hsmmc_info *c; | ||
280 | |||
281 | omap_hsmmc_init(controllers); | ||
282 | for (c = controllers; c->mmc; c++) | ||
283 | omap4_twl6030_hsmmc_set_late_init(&c->pdev->dev); | ||
284 | |||
285 | return 0; | ||
286 | } | ||
287 | |||
288 | static struct twl6040_codec_data twl6040_codec = { | 239 | static struct twl6040_codec_data twl6040_codec = { |
289 | /* single-step ramp for headset and handsfree */ | 240 | /* single-step ramp for headset and handsfree */ |
290 | .hs_left_step = 0x0f, | 241 | .hs_left_step = 0x0f, |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 57da7f406e2..c09ca63b8ac 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #ifndef __ASSEMBLER__ | 27 | #ifndef __ASSEMBLER__ |
28 | 28 | ||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/i2c/twl.h> | ||
30 | #include <plat/common.h> | 31 | #include <plat/common.h> |
31 | #include <asm/proc-fns.h> | 32 | #include <asm/proc-fns.h> |
32 | 33 | ||
@@ -254,6 +255,8 @@ static inline u32 omap4_mpuss_read_prev_context_state(void) | |||
254 | struct omap_sdrc_params; | 255 | struct omap_sdrc_params; |
255 | extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | 256 | extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, |
256 | struct omap_sdrc_params *sdrc_cs1); | 257 | struct omap_sdrc_params *sdrc_cs1); |
258 | struct omap2_hsmmc_info; | ||
259 | extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers); | ||
257 | 260 | ||
258 | #endif /* __ASSEMBLER__ */ | 261 | #endif /* __ASSEMBLER__ */ |
259 | #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ | 262 | #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ |
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 70de277f5c1..a8161e5f320 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -25,11 +25,13 @@ | |||
25 | #include <plat/irqs.h> | 25 | #include <plat/irqs.h> |
26 | #include <plat/sram.h> | 26 | #include <plat/sram.h> |
27 | #include <plat/omap-secure.h> | 27 | #include <plat/omap-secure.h> |
28 | #include <plat/mmc.h> | ||
28 | 29 | ||
29 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
30 | #include <mach/omap-wakeupgen.h> | 31 | #include <mach/omap-wakeupgen.h> |
31 | 32 | ||
32 | #include "common.h" | 33 | #include "common.h" |
34 | #include "hsmmc.h" | ||
33 | #include "omap4-sar-layout.h" | 35 | #include "omap4-sar-layout.h" |
34 | #include <linux/export.h> | 36 | #include <linux/export.h> |
35 | 37 | ||
@@ -207,3 +209,59 @@ static int __init omap4_sar_ram_init(void) | |||
207 | return 0; | 209 | return 0; |
208 | } | 210 | } |
209 | early_initcall(omap4_sar_ram_init); | 211 | early_initcall(omap4_sar_ram_init); |
212 | |||
213 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | ||
214 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | ||
215 | { | ||
216 | int irq = 0; | ||
217 | struct platform_device *pdev = container_of(dev, | ||
218 | struct platform_device, dev); | ||
219 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
220 | |||
221 | /* Setting MMC1 Card detect Irq */ | ||
222 | if (pdev->id == 0) { | ||
223 | irq = twl6030_mmc_card_detect_config(); | ||
224 | if (irq < 0) { | ||
225 | dev_err(dev, "%s: Error card detect config(%d)\n", | ||
226 | __func__, irq); | ||
227 | return irq; | ||
228 | } | ||
229 | pdata->slots[0].card_detect_irq = irq; | ||
230 | pdata->slots[0].card_detect = twl6030_mmc_card_detect; | ||
231 | } | ||
232 | return 0; | ||
233 | } | ||
234 | |||
235 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) | ||
236 | { | ||
237 | struct omap_mmc_platform_data *pdata; | ||
238 | |||
239 | /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ | ||
240 | if (!dev) { | ||
241 | pr_err("Failed %s\n", __func__); | ||
242 | return; | ||
243 | } | ||
244 | pdata = dev->platform_data; | ||
245 | pdata->init = omap4_twl6030_hsmmc_late_init; | ||
246 | } | ||
247 | |||
248 | int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
249 | { | ||
250 | struct omap2_hsmmc_info *c; | ||
251 | |||
252 | omap_hsmmc_init(controllers); | ||
253 | for (c = controllers; c->mmc; c++) { | ||
254 | /* pdev can be null if CONFIG_MMC_OMAP_HS is not set */ | ||
255 | if (!c->pdev) | ||
256 | continue; | ||
257 | omap4_twl6030_hsmmc_set_late_init(&c->pdev->dev); | ||
258 | } | ||
259 | |||
260 | return 0; | ||
261 | } | ||
262 | #else | ||
263 | int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
264 | { | ||
265 | return 0; | ||
266 | } | ||
267 | #endif | ||