diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-rx51-peripherals.c')
| -rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index acafdbc8aa16..4377a4cf36eb 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | #include <plat/gpmc-smc91x.h> | 34 | #include <plat/gpmc-smc91x.h> |
| 35 | 35 | ||
| 36 | #include "mux.h" | 36 | #include "mux.h" |
| 37 | #include "mmc-twl4030.h" | 37 | #include "hsmmc.h" |
| 38 | 38 | ||
| 39 | #define SYSTEM_REV_B_USES_VAUX3 0x1699 | 39 | #define SYSTEM_REV_B_USES_VAUX3 0x1699 |
| 40 | #define SYSTEM_REV_S_USES_VAUX3 0x8 | 40 | #define SYSTEM_REV_S_USES_VAUX3 0x8 |
| @@ -209,7 +209,47 @@ static struct twl4030_madc_platform_data rx51_madc_data = { | |||
| 209 | .irq_line = 1, | 209 | .irq_line = 1, |
| 210 | }; | 210 | }; |
| 211 | 211 | ||
| 212 | static struct twl4030_hsmmc_info mmc[] = { | 212 | /* Enable input logic and pull all lines up when eMMC is on. */ |
| 213 | static struct omap_board_mux rx51_mmc2_on_mux[] = { | ||
| 214 | OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 215 | OMAP3_MUX(SDMMC2_DAT0, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 216 | OMAP3_MUX(SDMMC2_DAT1, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 217 | OMAP3_MUX(SDMMC2_DAT2, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 218 | OMAP3_MUX(SDMMC2_DAT3, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 219 | OMAP3_MUX(SDMMC2_DAT4, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 220 | OMAP3_MUX(SDMMC2_DAT5, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 221 | OMAP3_MUX(SDMMC2_DAT6, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 222 | OMAP3_MUX(SDMMC2_DAT7, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
| 223 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
| 224 | }; | ||
| 225 | |||
| 226 | /* Disable input logic and pull all lines down when eMMC is off. */ | ||
| 227 | static struct omap_board_mux rx51_mmc2_off_mux[] = { | ||
| 228 | OMAP3_MUX(SDMMC2_CMD, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 229 | OMAP3_MUX(SDMMC2_DAT0, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 230 | OMAP3_MUX(SDMMC2_DAT1, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 231 | OMAP3_MUX(SDMMC2_DAT2, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 232 | OMAP3_MUX(SDMMC2_DAT3, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 233 | OMAP3_MUX(SDMMC2_DAT4, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 234 | OMAP3_MUX(SDMMC2_DAT5, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 235 | OMAP3_MUX(SDMMC2_DAT6, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 236 | OMAP3_MUX(SDMMC2_DAT7, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
| 237 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
| 238 | }; | ||
| 239 | |||
| 240 | /* | ||
| 241 | * Current flows to eMMC when eMMC is off and the data lines are pulled up, | ||
| 242 | * so pull them down. N.B. we pull 8 lines because we are using 8 lines. | ||
| 243 | */ | ||
| 244 | static void rx51_mmc2_remux(struct device *dev, int slot, int power_on) | ||
| 245 | { | ||
| 246 | if (power_on) | ||
| 247 | omap_mux_write_array(rx51_mmc2_on_mux); | ||
| 248 | else | ||
| 249 | omap_mux_write_array(rx51_mmc2_off_mux); | ||
| 250 | } | ||
| 251 | |||
| 252 | static struct omap2_hsmmc_info mmc[] __initdata = { | ||
| 213 | { | 253 | { |
| 214 | .name = "external", | 254 | .name = "external", |
| 215 | .mmc = 1, | 255 | .mmc = 1, |
| @@ -222,25 +262,29 @@ static struct twl4030_hsmmc_info mmc[] = { | |||
| 222 | { | 262 | { |
| 223 | .name = "internal", | 263 | .name = "internal", |
| 224 | .mmc = 2, | 264 | .mmc = 2, |
| 225 | .wires = 8, | 265 | .wires = 8, /* See also rx51_mmc2_remux */ |
| 226 | .gpio_cd = -EINVAL, | 266 | .gpio_cd = -EINVAL, |
| 227 | .gpio_wp = -EINVAL, | 267 | .gpio_wp = -EINVAL, |
| 228 | .nonremovable = true, | 268 | .nonremovable = true, |
| 229 | .power_saving = true, | 269 | .power_saving = true, |
| 270 | .remux = rx51_mmc2_remux, | ||
| 230 | }, | 271 | }, |
| 231 | {} /* Terminator */ | 272 | {} /* Terminator */ |
| 232 | }; | 273 | }; |
| 233 | 274 | ||
| 234 | static struct regulator_consumer_supply rx51_vmmc1_supply = { | 275 | static struct regulator_consumer_supply rx51_vmmc1_supply = { |
| 235 | .supply = "vmmc", | 276 | .supply = "vmmc", |
| 277 | .dev_name = "mmci-omap-hs.0", | ||
| 236 | }; | 278 | }; |
| 237 | 279 | ||
| 238 | static struct regulator_consumer_supply rx51_vmmc2_supply = { | 280 | static struct regulator_consumer_supply rx51_vmmc2_supply = { |
| 239 | .supply = "vmmc", | 281 | .supply = "vmmc", |
| 282 | .dev_name = "mmci-omap-hs.1", | ||
| 240 | }; | 283 | }; |
| 241 | 284 | ||
| 242 | static struct regulator_consumer_supply rx51_vsim_supply = { | 285 | static struct regulator_consumer_supply rx51_vsim_supply = { |
| 243 | .supply = "vmmc_aux", | 286 | .supply = "vmmc_aux", |
| 287 | .dev_name = "mmci-omap-hs.1", | ||
| 244 | }; | 288 | }; |
| 245 | 289 | ||
| 246 | static struct regulator_init_data rx51_vaux1 = { | 290 | static struct regulator_init_data rx51_vaux1 = { |
| @@ -375,12 +419,6 @@ static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) | |||
| 375 | gpio_request(gpio + 7, "speaker_en"); | 419 | gpio_request(gpio + 7, "speaker_en"); |
| 376 | gpio_direction_output(gpio + 7, 1); | 420 | gpio_direction_output(gpio + 7, 1); |
| 377 | 421 | ||
| 378 | /* set up MMC adapters, linking their regulators to them */ | ||
| 379 | twl4030_mmc_init(mmc); | ||
| 380 | rx51_vmmc1_supply.dev = mmc[0].dev; | ||
| 381 | rx51_vmmc2_supply.dev = mmc[1].dev; | ||
| 382 | rx51_vsim_supply.dev = mmc[1].dev; | ||
| 383 | |||
| 384 | return 0; | 422 | return 0; |
| 385 | } | 423 | } |
| 386 | 424 | ||
| @@ -751,5 +789,6 @@ void __init rx51_peripherals_init(void) | |||
| 751 | rx51_init_wl1251(); | 789 | rx51_init_wl1251(); |
| 752 | spi_register_board_info(rx51_peripherals_spi_board_info, | 790 | spi_register_board_info(rx51_peripherals_spi_board_info, |
| 753 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); | 791 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); |
| 792 | omap2_hsmmc_init(mmc); | ||
| 754 | } | 793 | } |
| 755 | 794 | ||
