提交 3a63833e 编写于 作者: S Sukumar Ghorai 提交者: Tony Lindgren

omap: mmc: extended to pass host capabilities from board file

wires variable is renamed, extended and this single variable to be used to
pass the platform capabilities, e.g DDR mode. Also removed the hardcoded
value was using as bus-width.
Signed-off-by: NSukumar Ghorai <s-ghorai@ti.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 7193559a
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/mmc/host.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
#include <linux/err.h> #include <linux/err.h>
...@@ -190,7 +191,7 @@ static int __init omap2430_i2c_init(void) ...@@ -190,7 +191,7 @@ static int __init omap2430_i2c_init(void)
static struct omap2_hsmmc_info mmc[] __initdata = { static struct omap2_hsmmc_info mmc[] __initdata = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.ext_clock = 1, .ext_clock = 1,
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/mmc/host.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -353,12 +354,12 @@ static struct omap2_hsmmc_info mmc[] = { ...@@ -353,12 +354,12 @@ static struct omap2_hsmmc_info mmc[] = {
/* 8 bits (default) requires S6.3 == ON, /* 8 bits (default) requires S6.3 == ON,
* so the SIM card isn't used; else 4 bits. * so the SIM card isn't used; else 4 bits.
*/ */
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = 4, .gpio_wp = 4,
}, },
{ {
.mmc = 2, .mmc = 2,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = 7, .gpio_wp = 7,
}, },
{} /* Terminator */ {} /* Terminator */
......
...@@ -193,12 +193,12 @@ static struct omap_musb_board_data musb_board_data = { ...@@ -193,12 +193,12 @@ static struct omap_musb_board_data musb_board_data = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
}, },
{ {
.mmc = 2, .mmc = 2,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.nonremovable = true, .nonremovable = true,
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/i2c/at24.h> #include <linux/i2c/at24.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/mmc/host.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/tdo24m.h> #include <linux/spi/tdo24m.h>
...@@ -579,14 +580,14 @@ static struct twl4030_keypad_data cm_t35_kp_data = { ...@@ -579,14 +580,14 @@ static struct twl4030_keypad_data cm_t35_kp_data = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
}, },
{ {
.mmc = 2, .mmc = 2,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.transceiver = 1, .transceiver = 1,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
#include <linux/mmc/host.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
...@@ -105,7 +106,7 @@ static struct omap_nand_platform_data devkit8000_nand_data = { ...@@ -105,7 +106,7 @@ static struct omap_nand_platform_data devkit8000_nand_data = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = 29, .gpio_wp = 29,
}, },
{} /* Terminator */ {} /* Terminator */
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
#include <linux/mmc/host.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -248,13 +249,13 @@ static struct regulator_init_data igep2_vmmc2 = { ...@@ -248,13 +249,13 @@ static struct regulator_init_data igep2_vmmc2 = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
}, },
{ {
.mmc = 2, .mmc = 2,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
}, },
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/mmc/host.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -362,7 +363,7 @@ static int __init omap_i2c_init(void) ...@@ -362,7 +363,7 @@ static int __init omap_i2c_init(void)
static struct omap2_hsmmc_info mmc[] __initdata = { static struct omap2_hsmmc_info mmc[] __initdata = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
}, },
......
...@@ -488,7 +488,7 @@ static struct omap_mmc_platform_data mmc1_data = { ...@@ -488,7 +488,7 @@ static struct omap_mmc_platform_data mmc1_data = {
.max_freq = 24000000, .max_freq = 24000000,
.dma_mask = 0xffffffff, .dma_mask = 0xffffffff,
.slots[0] = { .slots[0] = {
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.set_power = n8x0_mmc_set_power, .set_power = n8x0_mmc_set_power,
.set_bus_mode = n8x0_mmc_set_bus_mode, .set_bus_mode = n8x0_mmc_set_bus_mode,
.get_cover_state = n8x0_mmc_get_cover_state, .get_cover_state = n8x0_mmc_get_cover_state,
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
#include <linux/mmc/host.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
...@@ -166,7 +167,7 @@ static void __init beagle_display_init(void) ...@@ -166,7 +167,7 @@ static void __init beagle_display_init(void)
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = 29, .gpio_wp = 29,
}, },
{} /* Terminator */ {} /* Terminator */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/mmc/host.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -370,7 +371,7 @@ static struct regulator_init_data omap3evm_vsim = { ...@@ -370,7 +371,7 @@ static struct regulator_init_data omap3evm_vsim = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = 63, .gpio_wp = 63,
}, },
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/input/matrix_keypad.h> #include <linux/input/matrix_keypad.h>
#include <linux/gpio_keys.h> #include <linux/gpio_keys.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h> #include <linux/mmc/card.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -276,14 +277,14 @@ static void pandora_wl1251_init_card(struct mmc_card *card) ...@@ -276,14 +277,14 @@ static void pandora_wl1251_init_card(struct mmc_card *card)
static struct omap2_hsmmc_info omap3pandora_mmc[] = { static struct omap2_hsmmc_info omap3pandora_mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = 126, .gpio_wp = 126,
.ext_clock = 0, .ext_clock = 0,
}, },
{ {
.mmc = 2, .mmc = 2,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = 127, .gpio_wp = 127,
.ext_clock = 1, .ext_clock = 1,
...@@ -291,7 +292,7 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = { ...@@ -291,7 +292,7 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = {
}, },
{ {
.mmc = 3, .mmc = 3,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.init_card = pandora_wl1251_init_card, .init_card = pandora_wl1251_init_card,
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
#include <linux/mmc/host.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -275,7 +276,7 @@ static struct regulator_init_data omap3stalker_vsim = { ...@@ -275,7 +276,7 @@ static struct regulator_init_data omap3stalker_vsim = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = 23, .gpio_wp = 23,
}, },
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
#include <linux/mmc/host.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
...@@ -108,7 +109,7 @@ static struct omap_nand_platform_data omap3touchbook_nand_data = { ...@@ -108,7 +109,7 @@ static struct omap_nand_platform_data omap3touchbook_nand_data = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = 29, .gpio_wp = 29,
}, },
{} /* Terminator */ {} /* Terminator */
......
...@@ -56,7 +56,7 @@ static struct omap_musb_board_data musb_board_data = { ...@@ -56,7 +56,7 @@ static struct omap_musb_board_data musb_board_data = {
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
}, },
{} /* Terminator */ {} /* Terminator */
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/mmc/host.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -303,13 +304,13 @@ static void __init overo_flash_init(void) ...@@ -303,13 +304,13 @@ static void __init overo_flash_init(void)
static struct omap2_hsmmc_info mmc[] = { static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
}, },
{ {
.mmc = 2, .mmc = 2,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.transceiver = true, .transceiver = true,
......
...@@ -302,7 +302,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = { ...@@ -302,7 +302,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
{ {
.name = "external", .name = "external",
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.cover_only = true, .cover_only = true,
.gpio_cd = 160, .gpio_cd = 160,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
...@@ -311,7 +311,8 @@ static struct omap2_hsmmc_info mmc[] __initdata = { ...@@ -311,7 +311,8 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
{ {
.name = "internal", .name = "internal",
.mmc = 2, .mmc = 2,
.wires = 8, /* See also rx51_mmc2_remux */ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
/* See also rx51_mmc2_remux */
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.nonremovable = true, .nonremovable = true,
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/i2c/twl.h> #include <linux/i2c/twl.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/mmc/host.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -155,14 +156,14 @@ static struct omap2_hsmmc_info mmc[] __initdata = { ...@@ -155,14 +156,14 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
{ {
.name = "external", .name = "external",
.mmc = 1, .mmc = 1,
.wires = 4, .caps = MMC_CAP_4_BIT_DATA,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.power_saving = true, .power_saving = true,
}, },
{ {
.name = "internal", .name = "internal",
.mmc = 2, .mmc = 2,
.wires = 8, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.nonremovable = true, .nonremovable = true,
......
...@@ -694,7 +694,7 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, ...@@ -694,7 +694,7 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
omap_mux_init_signal("sdmmc_dat0", 0); omap_mux_init_signal("sdmmc_dat0", 0);
omap_mux_init_signal("sdmmc_dat_dir0", 0); omap_mux_init_signal("sdmmc_dat_dir0", 0);
omap_mux_init_signal("sdmmc_cmd_dir", 0); omap_mux_init_signal("sdmmc_cmd_dir", 0);
if (mmc_controller->slots[0].wires == 4) { if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) {
omap_mux_init_signal("sdmmc_dat1", 0); omap_mux_init_signal("sdmmc_dat1", 0);
omap_mux_init_signal("sdmmc_dat2", 0); omap_mux_init_signal("sdmmc_dat2", 0);
omap_mux_init_signal("sdmmc_dat3", 0); omap_mux_init_signal("sdmmc_dat3", 0);
...@@ -722,8 +722,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, ...@@ -722,8 +722,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc1_dat0", omap_mux_init_signal("sdmmc1_dat0",
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
if (mmc_controller->slots[0].wires == 4 || if (mmc_controller->slots[0].caps &
mmc_controller->slots[0].wires == 8) { (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
omap_mux_init_signal("sdmmc1_dat1", omap_mux_init_signal("sdmmc1_dat1",
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc1_dat2", omap_mux_init_signal("sdmmc1_dat2",
...@@ -731,7 +731,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, ...@@ -731,7 +731,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
omap_mux_init_signal("sdmmc1_dat3", omap_mux_init_signal("sdmmc1_dat3",
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
} }
if (mmc_controller->slots[0].wires == 8) { if (mmc_controller->slots[0].caps &
MMC_CAP_8_BIT_DATA) {
omap_mux_init_signal("sdmmc1_dat4", omap_mux_init_signal("sdmmc1_dat4",
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc1_dat5", omap_mux_init_signal("sdmmc1_dat5",
...@@ -755,8 +756,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, ...@@ -755,8 +756,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
* For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed
* in the board-*.c files * in the board-*.c files
*/ */
if (mmc_controller->slots[0].wires == 4 || if (mmc_controller->slots[0].caps &
mmc_controller->slots[0].wires == 8) { (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
omap_mux_init_signal("sdmmc2_dat1", omap_mux_init_signal("sdmmc2_dat1",
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc2_dat2", omap_mux_init_signal("sdmmc2_dat2",
...@@ -764,7 +765,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, ...@@ -764,7 +765,8 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
omap_mux_init_signal("sdmmc2_dat3", omap_mux_init_signal("sdmmc2_dat3",
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
} }
if (mmc_controller->slots[0].wires == 8) { if (mmc_controller->slots[0].caps &
MMC_CAP_8_BIT_DATA) {
omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4",
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5",
......
...@@ -258,7 +258,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) ...@@ -258,7 +258,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
"mmc%islot%i", c->mmc, 1); "mmc%islot%i", c->mmc, 1);
mmc->slots[0].name = hc->name; mmc->slots[0].name = hc->name;
mmc->nr_slots = 1; mmc->nr_slots = 1;
mmc->slots[0].wires = c->wires; mmc->slots[0].caps = c->caps;
mmc->slots[0].internal_clock = !c->ext_clock; mmc->slots[0].internal_clock = !c->ext_clock;
mmc->dma_mask = 0xffffffff; mmc->dma_mask = 0xffffffff;
...@@ -316,16 +316,20 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) ...@@ -316,16 +316,20 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
} }
/* Omap3630 HSMMC1 supports only 4-bit */ /* Omap3630 HSMMC1 supports only 4-bit */
if (cpu_is_omap3630() && c->wires > 4) { if (cpu_is_omap3630() &&
c->wires = 4; (c->caps & MMC_CAP_8_BIT_DATA)) {
mmc->slots[0].wires = c->wires; c->caps &= ~MMC_CAP_8_BIT_DATA;
c->caps |= MMC_CAP_4_BIT_DATA;
mmc->slots[0].caps = c->caps;
} }
break; break;
case 2: case 2:
if (c->ext_clock) if (c->ext_clock)
c->transceiver = 1; c->transceiver = 1;
if (c->transceiver && c->wires > 4) if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {
c->wires = 4; c->caps &= ~MMC_CAP_8_BIT_DATA;
c->caps |= MMC_CAP_4_BIT_DATA;
}
/* FALLTHROUGH */ /* FALLTHROUGH */
case 3: case 3:
if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
......
...@@ -10,7 +10,8 @@ struct mmc_card; ...@@ -10,7 +10,8 @@ struct mmc_card;
struct omap2_hsmmc_info { struct omap2_hsmmc_info {
u8 mmc; /* controller 1/2/3 */ u8 mmc; /* controller 1/2/3 */
u8 wires; /* 1/4/8 wires */ u32 caps; /* 4/8 wires and any additional host
* capabilities OR'd (ref. linux/mmc/host.h) */
bool transceiver; /* MMC-2 option */ bool transceiver; /* MMC-2 option */
bool ext_clock; /* use external pin for input clock */ bool ext_clock; /* use external pin for input clock */
bool cover_only; /* No card detect - just cover switch */ bool cover_only; /* No card detect - just cover switch */
......
...@@ -73,10 +73,9 @@ struct omap_mmc_platform_data { ...@@ -73,10 +73,9 @@ struct omap_mmc_platform_data {
struct omap_mmc_slot_data { struct omap_mmc_slot_data {
/* 4 wire signaling is optional, and is used for SD/SDIO/HSMMC; /* 4/8 wires and any additional host capabilities
* 8 wire signaling is also optional, and is used with HSMMC * need to OR'd all capabilities (ref. linux/mmc/host.h) */
*/ u32 caps;
u8 wires;
/* /*
* nomux means "standard" muxing is wrong on this board, and * nomux means "standard" muxing is wrong on this board, and
......
...@@ -1317,7 +1317,7 @@ static int __init mmc_omap_new_slot(struct mmc_omap_host *host, int id) ...@@ -1317,7 +1317,7 @@ static int __init mmc_omap_new_slot(struct mmc_omap_host *host, int id)
host->slots[id] = slot; host->slots[id] = slot;
mmc->caps = 0; mmc->caps = 0;
if (host->pdata->slots[id].wires >= 4) if (host->pdata->slots[id].caps & MMC_CAP_8_BIT_DATA)
mmc->caps |= MMC_CAP_4_BIT_DATA; mmc->caps |= MMC_CAP_4_BIT_DATA;
mmc->ops = &mmc_omap_ops; mmc->ops = &mmc_omap_ops;
......
...@@ -2116,23 +2116,9 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) ...@@ -2116,23 +2116,9 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE; MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE;
switch (mmc_slot(host).wires) { mmc->caps |= mmc_slot(host).caps;
case 8: if (mmc->caps & MMC_CAP_8_BIT_DATA)
mmc->caps |= MMC_CAP_8_BIT_DATA;
/* Fall through */
case 4:
mmc->caps |= MMC_CAP_4_BIT_DATA; mmc->caps |= MMC_CAP_4_BIT_DATA;
break;
case 1:
/* Nothing to crib here */
case 0:
/* Assuming nothing was given by board, Core use's 1-Bit */
break;
default:
/* Completely unexpected.. Core goes with 1-Bit Width */
dev_crit(mmc_dev(host->mmc), "Invalid width %d\n used!"
"using 1 instead\n", mmc_slot(host).wires);
}
if (mmc_slot(host).nonremovable) if (mmc_slot(host).nonremovable)
mmc->caps |= MMC_CAP_NONREMOVABLE; mmc->caps |= MMC_CAP_NONREMOVABLE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册