Patchwork [v2,1/1] efika: Configure esdhc cd/wp on efika mx/sb

login
register
mail settings
Submitter Arnaud Patard (Rtp)
Date Aug. 26, 2011, 12:45 p.m.
Message ID <20110826124602.561024162@rtp-net.org>
Download mbox | patch
Permalink /patch/111776/
State New
Headers show

Comments

Arnaud Patard (Rtp) - Aug. 26, 2011, 12:45 p.m.
Update sdhc support on efika to make use of the latest mmc fixes.


Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Arnaud Patard (Rtp) - Aug. 26, 2011, 1:13 p.m.
Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> writes:

Please, ignore. Will redo. I made the patch with yesterday's tree but
with today's imx-features branch of imx tree, it doesn't build anymore.

Arnaud

Patch

Index: linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c
===================================================================
--- linux-2.6-submit.orig/arch/arm/mach-mx5/board-mx51_efikamx.c	2011-08-25 17:09:47.000000000 +0200
+++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c	2011-08-25 17:20:02.000000000 +0200
@@ -163,6 +163,11 @@  static const struct gpio_led_platform_da
 	.num_leds = ARRAY_SIZE(mx51_efikamx_leds),
 };
 
+static struct esdhc_platform_data sd_pdata = {
+	.cd_type = ESDHC_CD_CONTROLLER,
+	.wp_type = ESDHC_WP_CONTROLLER,
+};
+
 static struct gpio_keys_button mx51_efikamx_powerkey[] = {
 	{
 		.code = KEY_POWER,
@@ -239,9 +244,11 @@  static void __init mx51_efikamx_init(voi
 
 	/* on < 1.2 boards both SD controllers are used */
 	if (system_rev < 0x12) {
-		imx51_add_sdhci_esdhc_imx(1, NULL);
+		imx51_add_sdhci_esdhc_imx(0, NULL);
+		imx51_add_sdhci_esdhc_imx(1, &sd_pdata);
 		mx51_efikamx_leds[2].default_trigger = "mmc1";
-	}
+	} else
+		imx51_add_sdhci_esdhc_imx(0, &sd_pdata);
 
 	gpio_led_register_device(-1, &mx51_efikamx_leds_data);
 	imx_add_gpio_keys(&mx51_efikamx_powerkey_data);
Index: linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikasb.c
===================================================================
--- linux-2.6-submit.orig/arch/arm/mach-mx5/board-mx51_efikasb.c	2011-08-25 17:09:52.000000000 +0200
+++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikasb.c	2011-08-25 17:20:02.000000000 +0200
@@ -97,6 +97,8 @@  static iomux_v3_cfg_t mx51efikasb_pads[]
 
 	/* BT */
 	MX51_PAD_EIM_A17__GPIO2_11,
+
+	_MX51_PAD_EIM_CS2__GPIO2_27 | MUX_PAD_CTRL(MX51_ESDHC_PAD_CTRL),
 };
 
 static int initialize_usbh2_port(struct platform_device *pdev)
@@ -182,6 +184,18 @@  static const struct gpio_keys_platform_d
 	.nbuttons = ARRAY_SIZE(mx51_efikasb_keys),
 };
 
+static struct esdhc_platform_data sd0_pdata = {
+#define EFIKASB_SD1_CD	IMX_GPIO_NR(2, 27)
+	.cd_gpio = EFIKASB_SD1_CD,
+	.cd_type = ESDHC_CD_GPIO,
+	.wp_type = ESDHC_WP_CONTROLLER,
+};
+
+static struct esdhc_platform_data sd1_pdata = {
+	.cd_type = ESDHC_CD_CONTROLLER,
+	.wp_type = ESDHC_WP_CONTROLLER,
+};
+
 static struct regulator *pwgt1, *pwgt2;
 
 static void mx51_efikasb_power_off(void)
@@ -250,7 +264,8 @@  static void __init efikasb_board_init(vo
 
 	mx51_efikasb_board_id();
 	mx51_efikasb_usb();
-	imx51_add_sdhci_esdhc_imx(1, NULL);
+	imx51_add_sdhci_esdhc_imx(0, &sd0_pdata);
+	imx51_add_sdhci_esdhc_imx(1, &sd1_pdata);
 
 	gpio_led_register_device(-1, &mx51_efikasb_leds_data);
 	imx_add_gpio_keys(&mx51_efikasb_keys_data);
Index: linux-2.6-submit/arch/arm/mach-mx5/mx51_efika.c
===================================================================
--- linux-2.6-submit.orig/arch/arm/mach-mx5/mx51_efika.c	2011-08-25 17:09:59.000000000 +0200
+++ linux-2.6-submit/arch/arm/mach-mx5/mx51_efika.c	2011-08-25 17:20:02.000000000 +0200
@@ -609,7 +609,6 @@  void __init efika_board_common_init(void
 					ARRAY_SIZE(mx51efika_pads));
 	imx51_add_imx_uart(0, &uart_pdata);
 	mx51_efika_usb();
-	imx51_add_sdhci_esdhc_imx(0, NULL);
 
 	/* FIXME: comes from original code. check this. */
 	if (mx51_revision() < IMX_CHIP_REVISION_2_0)