Skip to contentSkip to conversation

ARM: mx35_3ds: Add I2C support

PATCH New Fabio Estevam 4 participants 9 messages Mar 1, 2011 – Mar 2, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 ARM: mx35_3ds: Add I2C support

---
 arch/arm/mach-mx3/Kconfig         |    1 +
 arch/arm/mach-mx3/mach-mx35_3ds.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/Kconfig +1 -0
index 4f57f13..8b4b097 100644
@@ -183,6 +183,7 @@ config MACH_MX35_3DS
 	select MXC_DEBUG_BOARD
 	select IMX_HAVE_PLATFORM_FSL_USB2_UDC
 	select IMX_HAVE_PLATFORM_IMX2_WDT
+	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_MXC_EHCI
 	select IMX_HAVE_PLATFORM_MXC_NAND
arch/arm/mach-mx3/mach-mx35_3ds.c +8 -0
index be12ac1..5f35d5c 100644
@@ -118,6 +118,9 @@ static iomux_v3_cfg_t mx35pdk_pads[] = {
 	MX35_PAD_SD1_DATA1__ESDHC1_DAT1,
 	MX35_PAD_SD1_DATA2__ESDHC1_DAT2,
 	MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
+	/* I2C1 */
+	MX35_PAD_I2C1_CLK__I2C1_SCL,
+	MX35_PAD_I2C1_DAT__I2C1_SDA,
 };
 
 static int mx35_3ds_otg_init(struct platform_device *pdev)
@@ -163,6 +166,10 @@ static int __init mx35_3ds_otg_mode(char *options)
 }
 __setup("otg_mode=", mx35_3ds_otg_mode);
 
+static const struct imxi2c_platform_data mx35_3ds_i2c0_data __initconst = {
+	.bitrate = 100000,
+};
+
 /*
  * Board specific initialization.
  */
@@ -190,6 +197,7 @@ static void __init mx35_3ds_init(void)
 	if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT))
 		pr_warn("Init of the debugboard failed, all "
 				"devices on the debugboard are unusable.\n");
+	imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);
 }
 
 static void __init mx35pdk_timer_init(void)
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 2/5 ARM: mx31_3ds: Add I2C support

---
 arch/arm/mach-mx3/Kconfig         |    1 +
 arch/arm/mach-mx3/mach-mx31_3ds.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/Kconfig +1 -0
index 8b4b097..340809a 100644
@@ -94,6 +94,7 @@ config MACH_MX31_3DS
 	select MXC_DEBUG_BOARD
 	select IMX_HAVE_PLATFORM_FSL_USB2_UDC
 	select IMX_HAVE_PLATFORM_IMX2_WDT
+	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_KEYPAD
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_MXC_EHCI
arch/arm/mach-mx3/mach-mx31_3ds.c +8 -0
index b7d0953..35fdb2a 100644
@@ -96,6 +96,9 @@ static int mx31_3ds_pins[] = {
 	IOMUX_MODE(MX31_PIN_PC_RW_B, IOMUX_CONFIG_ALT1),
 	/* USB Host2 reset */
 	IOMUX_MODE(MX31_PIN_USB_BYP, IOMUX_CONFIG_GPIO),
+	/* I2C1 */
+	MX31_PIN_I2C_CLK__I2C1_SCL,
+	MX31_PIN_I2C_DAT__I2C1_SDA,
 };
 
 /*
@@ -323,6 +326,10 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
 	.flags = IMXUART_HAVE_RTSCTS,
 };
 
+static const struct imxi2c_platform_data mx31_3ds_i2c0_data __initconst = {
+	.bitrate = 100000,
+};
+
 static void __init mx31_3ds_init(void)
 {
 	mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins),
@@ -356,6 +363,7 @@ static void __init mx31_3ds_init(void)
 		printk(KERN_WARNING "Init of the debug board failed, all "
 				    "devices on the debug board are unusable.\n");
 	imx31_add_imx2_wdt(NULL);
+	imx31_add_imx_i2c0(&mx31_3ds_i2c0_data);
 }
 
 static void __init mx31_3ds_timer_init(void)
Signature · 1 line
1.6.0.4
#2 lore raw

PATCH 3/5 ARM: mx27_3ds: Add I2C support

---
 arch/arm/mach-imx/Kconfig         |    1 +
 arch/arm/mach-imx/mach-mx27_3ds.c |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-imx/Kconfig +1 -0
index c172418..01c6c72 100644
@@ -238,6 +238,7 @@ config MACH_MX27_3DS
 	select SOC_IMX27
 	select IMX_HAVE_PLATFORM_FSL_USB2_UDC
 	select IMX_HAVE_PLATFORM_IMX2_WDT
+	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_KEYPAD
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_MXC_EHCI
arch/arm/mach-imx/mach-mx27_3ds.c +7 -0
index ba88417..f4f2725 100644
@@ -98,6 +98,9 @@ static const int mx27pdk_pins[] __initconst = {
 	PD22_PF_CSPI2_SCLK,
 	PD23_PF_CSPI2_MISO,
 	PD24_PF_CSPI2_MOSI,
+	/* I2C1 */
+	PD17_PF_I2C_DATA,
+	PD18_PF_I2C_CLK,
 };
 
 static const struct imxuart_platform_data uart_pdata __initconst = {
@@ -257,6 +260,9 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
 	},
 };
 
+static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
+	.bitrate = 100000,
+};
 
 static void __init mx27pdk_init(void)
 {
@@ -286,6 +292,7 @@ static void __init mx27pdk_init(void)
 
 	if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT))
 		pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
+	imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
 }
 
 static void __init mx27pdk_timer_init(void)
Signature · 1 line
1.6.0.4
#3 lore raw

PATCH 4/5 ARM: mx25_3ds: Add I2C support

---
 arch/arm/mach-imx/Kconfig         |    1 +
 arch/arm/mach-imx/mach-mx25_3ds.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-imx/Kconfig +1 -0
index 01c6c72..e3f62b5 100644
@@ -100,6 +100,7 @@ config MACH_MX25_3DS
 	select IMX_HAVE_PLATFORM_FSL_USB2_UDC
 	select IMX_HAVE_PLATFORM_IMX2_WDT
 	select IMX_HAVE_PLATFORM_IMXDI_RTC
+	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_FB
 	select IMX_HAVE_PLATFORM_IMX_KEYPAD
 	select IMX_HAVE_PLATFORM_IMX_UART
arch/arm/mach-imx/mach-mx25_3ds.c +8 -0
index 561f07f..da00b3c 100644
@@ -106,6 +106,9 @@ static iomux_v3_cfg_t mx25pdk_pads[] = {
 	MX25_PAD_SD1_DATA3__SD1_DATA3,
 	MX25_PAD_A14__GPIO_2_0, /* WriteProtect */
 	MX25_PAD_A15__GPIO_2_1, /* CardDetect */
+	/* I2C1 */
+	MX25_PAD_I2C1_CLK__I2C1_CLK,
+	MX25_PAD_I2C1_DAT__I2C1_DAT,
 };
 
 static const struct fec_platform_data mx25_fec_pdata __initconst = {
@@ -211,6 +214,10 @@ static const struct esdhc_platform_data mx25pdk_esdhc_pdata __initconst = {
 	.cd_gpio = SD1_GPIO_CD,
 };
 
+static const struct imxi2c_platform_data mx25_3ds_i2c0_data __initconst = {
+	.bitrate = 100000,
+};
+
 static void __init mx25pdk_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
@@ -229,6 +236,7 @@ static void __init mx25pdk_init(void)
 	imx25_add_imx_keypad(&mx25pdk_keymap_data);
 
 	imx25_add_sdhci_esdhc_imx(0, &mx25pdk_esdhc_pdata);
+	imx25_add_imx_i2c0(&mx25_3ds_i2c0_data);
 }
 
 static void __init mx25pdk_timer_init(void)
Signature · 1 line
1.6.0.4
#4 lore raw

PATCH 5/5 ARM: mx53_smd: Add I2C support

---
 arch/arm/mach-mx5/Kconfig          |    1 +
 arch/arm/mach-mx5/board-mx53_smd.c |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index f065a0d..b916d0d 100644
@@ -151,6 +151,7 @@ config MACH_MX53_SMD
 	bool "Support MX53 SMD platforms"
 	select SOC_IMX53
 	select IMX_HAVE_PLATFORM_IMX2_WDT
+	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
 	help
 	  Include support for MX53 SMD platform. This includes specific
arch/arm/mach-mx5/board-mx53_smd.c +8 -0
index 8a8694c..5eb1638 100644
@@ -51,6 +51,9 @@ static iomux_v3_cfg_t mx53_smd_pads[] = {
 	MX53_PAD_PATA_CS_1__UART3_RXD_MUX,
 	MX53_PAD_PATA_DA_1__UART3_CTS,
 	MX53_PAD_PATA_DA_2__UART3_RTS,
+	/* I2C1 */
+	MX53_PAD_CSI0_DAT8__I2C1_SDA,
+	MX53_PAD_CSI0_DAT9__I2C1_SCL,
 };
 
 static const struct imxuart_platform_data mx53_smd_uart_data __initconst = {
@@ -83,6 +86,10 @@ static struct fec_platform_data mx53_smd_fec_data = {
 	.phy = PHY_INTERFACE_MODE_RMII,
 };
 
+static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
+	.bitrate = 100000,
+};
+
 static void __init mx53_smd_board_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
@@ -91,6 +98,7 @@ static void __init mx53_smd_board_init(void)
 	mx53_smd_fec_reset();
 	imx53_add_fec(&mx53_smd_fec_data);
 	imx53_add_imx2_wdt(0, NULL);
+	imx53_add_imx_i2c(0, &mx53_smd_i2c_data);
 }
 
 static void __init mx53_smd_timer_init(void)
Signature · 1 line
1.6.0.4
#5 lore raw

PATCH 1/5 ARM: mx35_3ds: Add I2C support

In reply to Fabio Estevam

Hello,

arch/arm/mach-mx3/mach-mx35_3ds.c static void __init mx35_3ds_init(void) · line 200

Quoted 1 line · Fabio Estevam
arch/arm/mach-mx3/mach-mx35_3ds.c +1 -0
+	imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);

I'd slightly prefer using

	imx35_add_imx_i2c(0, ...)

because I intend to remove the imx35_add_imx_i2c0-like macros soon. But if nothing else pops up there is no need to respin the series because of that.

Other than that all 5 patches look good;

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#6 lore raw

PATCH 1/5 ARM: mx35_3ds: Add I2C support

Hi, Uwe,

2011/3/2 Uwe Kleine-K?nig <[email protected]>:

Quoted 9 lines

Hello,

Quoted 1 line · Fabio Estevam

+ ? ? imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);

I'd slightly prefer using

? ? ? ?imx35_add_imx_i2c(0, ...)

because I intend to remove the imx35_add_imx_i2c0-like macros soon. ?But

Could you please explain why you intend to remove
imx35_add_imx_i2c0-like macros?
What you would like to do instead? Thanks,

Quoted 18 lines

if nothing else pops up there is no need to respin the series because of that.

Other than that all 5 patches look good;
? ? ? ?Acked-by: Uwe Kleine-K?nig <[email protected]>

Best regards
Uwe

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | Uwe Kleine-K?nig ? ? ? ? ? ?|
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#7 lore raw

PATCH 1/5 ARM: mx35_3ds: Add I2C support

Quoted 9 lines · Jason Liu

Hi, Uwe,

2011/3/2 Uwe Kleine-K?nig <[email protected]>:

Quoted 6 lines

Hello,

Quoted 1 line · Fabio Estevam

+ ? ? imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);

I'd slightly prefer using

Quoted 7 lines
Quoted 3 lines

? ? ? ?imx35_add_imx_i2c(0, ...)

because I intend to remove the imx35_add_imx_i2c0-like macros soon. ?But

Could you please explain why you intend to remove
imx35_add_imx_i2c0-like macros?
What you would like to do instead? Thanks,

These just produce additional macros without value.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#8 lore raw

PATCH 1/5 ARM: mx35_3ds: Add I2C support

Hi, Sascha,

2011/3/2 Sascha Hauer <[email protected]>:

Quoted 12 lines · Jason Liu
Quoted 11 lines

Hi, Uwe,

2011/3/2 Uwe Kleine-K?nig <[email protected]>:

Quoted 8 lines

Hello,

Quoted 1 line · Fabio Estevam

+ ? ? imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);

I'd slightly prefer using

? ? ? ?imx35_add_imx_i2c(0, ...)

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

because I intend to remove the imx35_add_imx_i2c0-like macros soon. ?But

Could you please explain why you intend to remove
imx35_add_imx_i2c0-like macros?
What you would like to do instead? Thanks,

These just produce additional macros without value.

Get it. Thanks,

Quoted 10 lines

Sascha

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |