Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261129
b: refs/heads/master
c: 913413c
h: refs/heads/master
i:
  261127: 029b812
v: v3
  • Loading branch information
Shawn Guo committed Jul 27, 2011
1 parent 04ebd7f commit 8211e90
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 64 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca2cc333920690db87a03c2ee3bd6f43adb3e7fb
refs/heads/master: 913413c307c919f8b21edccea23a9fd9d9d49a64
3 changes: 2 additions & 1 deletion trunk/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = {

static struct esdhc_platform_data sd1_pdata = {
.cd_gpio = GPIO_SD1CD,
.wp_gpio = -EINVAL,
.cd_type = ESDHC_CD_GPIO,
.wp_type = ESDHC_WP_NONE,
};

/*
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = {

static struct esdhc_platform_data sd1_pdata = {
.cd_gpio = GPIO_SD1CD,
.wp_gpio = -EINVAL,
.cd_type = ESDHC_CD_GPIO,
.wp_type = ESDHC_WP_NONE,
};

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-imx/mach-mx25_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ static const struct imxi2c_platform_data mx25_3ds_i2c0_data __initconst = {
static const struct esdhc_platform_data mx25pdk_esdhc_pdata __initconst = {
.wp_gpio = SD1_GPIO_WP,
.cd_gpio = SD1_GPIO_CD,
.wp_type = ESDHC_WP_GPIO,
.cd_type = ESDHC_CD_GPIO,
};

static void __init mx25pdk_init(void)
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-imx/mach-pcm043.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ __setup("otg_mode=", pcm043_otg_mode);
static struct esdhc_platform_data sd1_pdata = {
.wp_gpio = SD1_GPIO_WP,
.cd_gpio = SD1_GPIO_CD,
.wp_type = ESDHC_WP_GPIO,
.cd_type = ESDHC_CD_GPIO,
};

/*
Expand Down
14 changes: 8 additions & 6 deletions trunk/arch/arm/mach-mx5/board-mx51_babbage.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
#define BABBAGE_POWER_KEY IMX_GPIO_NR(2, 21)
#define BABBAGE_ECSPI1_CS0 IMX_GPIO_NR(4, 24)
#define BABBAGE_ECSPI1_CS1 IMX_GPIO_NR(4, 25)
#define BABBAGE_SD1_CD IMX_GPIO_NR(1, 0)
#define BABBAGE_SD1_WP IMX_GPIO_NR(1, 1)
#define BABBAGE_SD2_CD IMX_GPIO_NR(1, 6)
#define BABBAGE_SD2_WP IMX_GPIO_NR(1, 5)

Expand Down Expand Up @@ -146,8 +144,9 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
MX51_PAD_SD1_DATA1__SD1_DATA1,
MX51_PAD_SD1_DATA2__SD1_DATA2,
MX51_PAD_SD1_DATA3__SD1_DATA3,
MX51_PAD_GPIO1_0__GPIO1_0,
MX51_PAD_GPIO1_1__GPIO1_1,
/* CD/WP from controller */
MX51_PAD_GPIO1_0__SD1_CD,
MX51_PAD_GPIO1_1__SD1_WP,

/* SD 2 */
MX51_PAD_SD2_CMD__SD2_CMD,
Expand All @@ -156,6 +155,7 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
MX51_PAD_SD2_DATA1__SD2_DATA1,
MX51_PAD_SD2_DATA2__SD2_DATA2,
MX51_PAD_SD2_DATA3__SD2_DATA3,
/* CD/WP gpio */
MX51_PAD_GPIO1_6__GPIO1_6,
MX51_PAD_GPIO1_5__GPIO1_5,

Expand Down Expand Up @@ -340,13 +340,15 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
};

static const struct esdhc_platform_data mx51_babbage_sd1_data __initconst = {
.cd_gpio = BABBAGE_SD1_CD,
.wp_gpio = BABBAGE_SD1_WP,
.cd_type = ESDHC_CD_CONTROLLER,
.wp_type = ESDHC_WP_CONTROLLER,
};

static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = {
.cd_gpio = BABBAGE_SD2_CD,
.wp_gpio = BABBAGE_SD2_WP,
.cd_type = ESDHC_CD_GPIO,
.wp_type = ESDHC_WP_GPIO,
};

/*
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/mach-mx5/board-mx53_loco.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,15 @@ static const struct gpio_keys_platform_data loco_button_data __initconst = {

static const struct esdhc_platform_data mx53_loco_sd1_data __initconst = {
.cd_gpio = LOCO_SD1_CD,
.cd_type = ESDHC_CD_GPIO,
.wp_type = ESDHC_WP_NONE,
};

static const struct esdhc_platform_data mx53_loco_sd3_data __initconst = {
.cd_gpio = LOCO_SD3_CD,
.wp_gpio = LOCO_SD3_WP,
.cd_type = ESDHC_CD_GPIO,
.wp_type = ESDHC_WP_GPIO,
};

static inline void mx53_loco_fec_reset(void)
Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ imx53_sdhci_esdhc_imx_data[] __initconst = {
};
#endif /* ifdef CONFIG_SOC_IMX53 */

static const struct esdhc_platform_data default_esdhc_pdata __initconst = {
.wp_type = ESDHC_WP_NONE,
.cd_type = ESDHC_CD_NONE,
};

struct platform_device *__init imx_add_sdhci_esdhc_imx(
const struct imx_sdhci_esdhc_imx_data *data,
const struct esdhc_platform_data *pdata)
Expand All @@ -81,6 +86,13 @@ struct platform_device *__init imx_add_sdhci_esdhc_imx(
},
};

/*
* If machine does not provide pdata, use the default one
* which means no WP/CD support
*/
if (!pdata)
pdata = &default_esdhc_pdata;

return imx_add_platform_device("sdhci-esdhc-imx", data->id, res,
ARRAY_SIZE(res), pdata, sizeof(*pdata));
}
25 changes: 21 additions & 4 deletions trunk/arch/arm/plat-mxc/include/mach/esdhc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,34 @@
#ifndef __ASM_ARCH_IMX_ESDHC_H
#define __ASM_ARCH_IMX_ESDHC_H

enum wp_types {
ESDHC_WP_NONE, /* no WP, neither controller nor gpio */
ESDHC_WP_CONTROLLER, /* mmc controller internal WP */
ESDHC_WP_GPIO, /* external gpio pin for WP */
};

enum cd_types {
ESDHC_CD_NONE, /* no CD, neither controller nor gpio */
ESDHC_CD_CONTROLLER, /* mmc controller internal CD */
ESDHC_CD_GPIO, /* external gpio pin for CD */
ESDHC_CD_PERMANENT, /* no CD, card permanently wired to host */
};

/**
* struct esdhc_platform_data - optional platform data for esdhc on i.MX
* struct esdhc_platform_data - platform data for esdhc on i.MX
*
* strongly recommended for i.MX25/35, not needed for other variants
* ESDHC_WP(CD)_CONTROLLER type is not available on i.MX25/35.
*
* @wp_gpio: gpio for write_protect (-EINVAL if unused)
* @cd_gpio: gpio for card_detect interrupt (-EINVAL if unused)
* @wp_gpio: gpio for write_protect
* @cd_gpio: gpio for card_detect interrupt
* @wp_type: type of write_protect method (see wp_types enum above)
* @cd_type: type of card_detect method (see cd_types enum above)
*/

struct esdhc_platform_data {
unsigned int wp_gpio;
unsigned int cd_gpio;
enum wp_types wp_type;
enum cd_types cd_type;
};
#endif /* __ASM_ARCH_IMX_ESDHC_H */
Loading

0 comments on commit 8211e90

Please sign in to comment.