diff options
author | Kishore Kadiyala <kishore.kadiyala@ti.com> | 2011-02-28 10:18:03 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-03-01 16:13:24 -0500 |
commit | d8d0a61c658e252de3077f6076f13423642caf67 (patch) | |
tree | 62d6ba1e1d7b43d65fa5b5562c7b828e2bb2e087 /arch | |
parent | 6ab8946f672497a55625d2106250d2923125fdfb (diff) |
OMAP: hsmmc: Move mux configuration to hsmmc.c
Moving the definition of mux setting API from devices.c to hsmmc.c
and renaming it from "omap2_mmc_mux" to "omap_hsmmc_mux".
Also calling "omap_hsmmc_mux" from omap2_hsmmc_init.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Cc: Chris Ball <cjb@laptop.org
Cc: Tony Lindgren <tony@atomide.com
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 83 | ||||
-rw-r--r-- | arch/arm/mach-omap2/hsmmc.c | 84 |
2 files changed, 84 insertions, 83 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 100bb425e9c3..2f4a598ba67e 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -708,87 +708,6 @@ void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) | |||
708 | 708 | ||
709 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | 709 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) |
710 | 710 | ||
711 | static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, | ||
712 | int controller_nr) | ||
713 | { | ||
714 | if ((mmc_controller->slots[0].switch_pin > 0) && \ | ||
715 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) | ||
716 | omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, | ||
717 | OMAP_PIN_INPUT_PULLUP); | ||
718 | if ((mmc_controller->slots[0].gpio_wp > 0) && \ | ||
719 | (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) | ||
720 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, | ||
721 | OMAP_PIN_INPUT_PULLUP); | ||
722 | if (cpu_is_omap34xx()) { | ||
723 | if (controller_nr == 0) { | ||
724 | omap_mux_init_signal("sdmmc1_clk", | ||
725 | OMAP_PIN_INPUT_PULLUP); | ||
726 | omap_mux_init_signal("sdmmc1_cmd", | ||
727 | OMAP_PIN_INPUT_PULLUP); | ||
728 | omap_mux_init_signal("sdmmc1_dat0", | ||
729 | OMAP_PIN_INPUT_PULLUP); | ||
730 | if (mmc_controller->slots[0].caps & | ||
731 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
732 | omap_mux_init_signal("sdmmc1_dat1", | ||
733 | OMAP_PIN_INPUT_PULLUP); | ||
734 | omap_mux_init_signal("sdmmc1_dat2", | ||
735 | OMAP_PIN_INPUT_PULLUP); | ||
736 | omap_mux_init_signal("sdmmc1_dat3", | ||
737 | OMAP_PIN_INPUT_PULLUP); | ||
738 | } | ||
739 | if (mmc_controller->slots[0].caps & | ||
740 | MMC_CAP_8_BIT_DATA) { | ||
741 | omap_mux_init_signal("sdmmc1_dat4", | ||
742 | OMAP_PIN_INPUT_PULLUP); | ||
743 | omap_mux_init_signal("sdmmc1_dat5", | ||
744 | OMAP_PIN_INPUT_PULLUP); | ||
745 | omap_mux_init_signal("sdmmc1_dat6", | ||
746 | OMAP_PIN_INPUT_PULLUP); | ||
747 | omap_mux_init_signal("sdmmc1_dat7", | ||
748 | OMAP_PIN_INPUT_PULLUP); | ||
749 | } | ||
750 | } | ||
751 | if (controller_nr == 1) { | ||
752 | /* MMC2 */ | ||
753 | omap_mux_init_signal("sdmmc2_clk", | ||
754 | OMAP_PIN_INPUT_PULLUP); | ||
755 | omap_mux_init_signal("sdmmc2_cmd", | ||
756 | OMAP_PIN_INPUT_PULLUP); | ||
757 | omap_mux_init_signal("sdmmc2_dat0", | ||
758 | OMAP_PIN_INPUT_PULLUP); | ||
759 | |||
760 | /* | ||
761 | * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed | ||
762 | * in the board-*.c files | ||
763 | */ | ||
764 | if (mmc_controller->slots[0].caps & | ||
765 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
766 | omap_mux_init_signal("sdmmc2_dat1", | ||
767 | OMAP_PIN_INPUT_PULLUP); | ||
768 | omap_mux_init_signal("sdmmc2_dat2", | ||
769 | OMAP_PIN_INPUT_PULLUP); | ||
770 | omap_mux_init_signal("sdmmc2_dat3", | ||
771 | OMAP_PIN_INPUT_PULLUP); | ||
772 | } | ||
773 | if (mmc_controller->slots[0].caps & | ||
774 | MMC_CAP_8_BIT_DATA) { | ||
775 | omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", | ||
776 | OMAP_PIN_INPUT_PULLUP); | ||
777 | omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", | ||
778 | OMAP_PIN_INPUT_PULLUP); | ||
779 | omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6", | ||
780 | OMAP_PIN_INPUT_PULLUP); | ||
781 | omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7", | ||
782 | OMAP_PIN_INPUT_PULLUP); | ||
783 | } | ||
784 | } | ||
785 | |||
786 | /* | ||
787 | * For MMC3 the pins need to be muxed in the board-*.c files | ||
788 | */ | ||
789 | } | ||
790 | } | ||
791 | |||
792 | void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | 711 | void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, |
793 | int nr_controllers) | 712 | int nr_controllers) |
794 | { | 713 | { |
@@ -802,8 +721,6 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
802 | if (!mmc_data[i]) | 721 | if (!mmc_data[i]) |
803 | continue; | 722 | continue; |
804 | 723 | ||
805 | omap2_mmc_mux(mmc_data[i], i); | ||
806 | |||
807 | switch (i) { | 724 | switch (i) { |
808 | case 0: | 725 | case 0: |
809 | base = OMAP2_MMC1_BASE; | 726 | base = OMAP2_MMC1_BASE; |
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 5496bc7d40ad..1348ac3d60e3 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
@@ -16,7 +16,9 @@ | |||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | #include <plat/mmc.h> | 17 | #include <plat/mmc.h> |
18 | #include <plat/omap-pm.h> | 18 | #include <plat/omap-pm.h> |
19 | #include <plat/mux.h> | ||
19 | 20 | ||
21 | #include "mux.h" | ||
20 | #include "hsmmc.h" | 22 | #include "hsmmc.h" |
21 | #include "control.h" | 23 | #include "control.h" |
22 | 24 | ||
@@ -204,6 +206,87 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on, | |||
204 | return 0; | 206 | return 0; |
205 | } | 207 | } |
206 | 208 | ||
209 | static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller, | ||
210 | int controller_nr) | ||
211 | { | ||
212 | if ((mmc_controller->slots[0].switch_pin > 0) && \ | ||
213 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) | ||
214 | omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, | ||
215 | OMAP_PIN_INPUT_PULLUP); | ||
216 | if ((mmc_controller->slots[0].gpio_wp > 0) && \ | ||
217 | (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) | ||
218 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, | ||
219 | OMAP_PIN_INPUT_PULLUP); | ||
220 | if (cpu_is_omap34xx()) { | ||
221 | if (controller_nr == 0) { | ||
222 | omap_mux_init_signal("sdmmc1_clk", | ||
223 | OMAP_PIN_INPUT_PULLUP); | ||
224 | omap_mux_init_signal("sdmmc1_cmd", | ||
225 | OMAP_PIN_INPUT_PULLUP); | ||
226 | omap_mux_init_signal("sdmmc1_dat0", | ||
227 | OMAP_PIN_INPUT_PULLUP); | ||
228 | if (mmc_controller->slots[0].caps & | ||
229 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
230 | omap_mux_init_signal("sdmmc1_dat1", | ||
231 | OMAP_PIN_INPUT_PULLUP); | ||
232 | omap_mux_init_signal("sdmmc1_dat2", | ||
233 | OMAP_PIN_INPUT_PULLUP); | ||
234 | omap_mux_init_signal("sdmmc1_dat3", | ||
235 | OMAP_PIN_INPUT_PULLUP); | ||
236 | } | ||
237 | if (mmc_controller->slots[0].caps & | ||
238 | MMC_CAP_8_BIT_DATA) { | ||
239 | omap_mux_init_signal("sdmmc1_dat4", | ||
240 | OMAP_PIN_INPUT_PULLUP); | ||
241 | omap_mux_init_signal("sdmmc1_dat5", | ||
242 | OMAP_PIN_INPUT_PULLUP); | ||
243 | omap_mux_init_signal("sdmmc1_dat6", | ||
244 | OMAP_PIN_INPUT_PULLUP); | ||
245 | omap_mux_init_signal("sdmmc1_dat7", | ||
246 | OMAP_PIN_INPUT_PULLUP); | ||
247 | } | ||
248 | } | ||
249 | if (controller_nr == 1) { | ||
250 | /* MMC2 */ | ||
251 | omap_mux_init_signal("sdmmc2_clk", | ||
252 | OMAP_PIN_INPUT_PULLUP); | ||
253 | omap_mux_init_signal("sdmmc2_cmd", | ||
254 | OMAP_PIN_INPUT_PULLUP); | ||
255 | omap_mux_init_signal("sdmmc2_dat0", | ||
256 | OMAP_PIN_INPUT_PULLUP); | ||
257 | |||
258 | /* | ||
259 | * For 8 wire configurations, Lines DAT4, 5, 6 and 7 | ||
260 | * need to be muxed in the board-*.c files | ||
261 | */ | ||
262 | if (mmc_controller->slots[0].caps & | ||
263 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
264 | omap_mux_init_signal("sdmmc2_dat1", | ||
265 | OMAP_PIN_INPUT_PULLUP); | ||
266 | omap_mux_init_signal("sdmmc2_dat2", | ||
267 | OMAP_PIN_INPUT_PULLUP); | ||
268 | omap_mux_init_signal("sdmmc2_dat3", | ||
269 | OMAP_PIN_INPUT_PULLUP); | ||
270 | } | ||
271 | if (mmc_controller->slots[0].caps & | ||
272 | MMC_CAP_8_BIT_DATA) { | ||
273 | omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", | ||
274 | OMAP_PIN_INPUT_PULLUP); | ||
275 | omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", | ||
276 | OMAP_PIN_INPUT_PULLUP); | ||
277 | omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6", | ||
278 | OMAP_PIN_INPUT_PULLUP); | ||
279 | omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7", | ||
280 | OMAP_PIN_INPUT_PULLUP); | ||
281 | } | ||
282 | } | ||
283 | |||
284 | /* | ||
285 | * For MMC3 the pins need to be muxed in the board-*.c files | ||
286 | */ | ||
287 | } | ||
288 | } | ||
289 | |||
207 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; | 290 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; |
208 | 291 | ||
209 | void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) | 292 | void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) |
@@ -361,6 +444,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) | |||
361 | continue; | 444 | continue; |
362 | } | 445 | } |
363 | hsmmc_data[c->mmc - 1] = mmc; | 446 | hsmmc_data[c->mmc - 1] = mmc; |
447 | omap_hsmmc_mux(hsmmc_data[c->mmc - 1], (c->mmc - 1)); | ||
364 | } | 448 | } |
365 | 449 | ||
366 | omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); | 450 | omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); |