mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* I2C support to PCM-038 board
@ 2011-08-11 10:37 Alexander Shiyan
  2011-08-12  9:06 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Shiyan @ 2011-08-11 10:37 UTC (permalink / raw)
  To: barebox

[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]

Hello.

Please review and apply this simple patch.
Thanks!

diff -urN barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c
--- barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c	2011-08-04 16:42:13.000000000 +0400
+++ barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c	2011-08-11 11:10:16.000000000 +0400
@@ -40,6 +40,7 @@
 #include <mach/imx-pll.h>
 #include <mach/imxfb.h>
 #include <asm/mmu.h>
+#include <i2c/i2c.h>
 #include <usb/isp1504.h>
 #include <mach/spi.h>
 #include <mach/iomux-mx27.h>
@@ -261,6 +262,14 @@
 		PD23_AF_USBH2_DATA2,
 		PD24_AF_USBH2_DATA1,
 		PD26_AF_USBH2_DATA5,
+#ifdef CONFIG_I2C
+		/* I2C1 */
+		PD17_PF_I2C_DATA | GPIO_PUEN,
+		PD18_PF_I2C_CLK,
+		/* I2C2 */
+		PC5_PF_I2C2_SDA,
+		PC6_PF_I2C2_SCL,
+#endif
 	};

 	pcm038_mmu_init();
@@ -298,6 +307,12 @@
 	register_device(&sram_dev);
 	imx27_add_fb(&pcm038_fb_data);

+#ifdef CONFIG_I2C
+	PCCR0 |= PCCR0_I2C1_EN | PCCR0_I2C2_EN;
+	imx27_add_i2c0(NULL);
+	imx27_add_i2c1(NULL);
+#endif
+
 #ifdef CONFIG_USB
 	pcm038_usbh_init();
 	register_device(&usbh2_dev);
diff -urN barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h
--- barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-04 16:42:13.000000000 +0400
+++ barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-11 11:20:26.000000000 +0400
@@ -11,6 +11,11 @@
 	return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata);
 }

+static inline struct device_d *imx27_add_i2c1(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)IMX_I2C2_BASE, 1, pdata);
+}
+
 static inline struct device_d *imx27_add_uart0(void)
 {
 	return imx_add_uart((void *)IMX_UART1_BASE, 0);

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I2C support to PCM-038 board
  2011-08-11 10:37 I2C support to PCM-038 board Alexander Shiyan
@ 2011-08-12  9:06 ` Sascha Hauer
  2011-08-12  9:21   ` shc
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2011-08-12  9:06 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Thu, Aug 11, 2011 at 02:37:05PM +0400, Alexander Shiyan wrote:
> Hello.
> 
> Please review and apply this simple patch.
> Thanks!
> 
> diff -urN barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c
> --- barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c	2011-08-04 16:42:13.000000000 +0400
> +++ barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c	2011-08-11 11:10:16.000000000 +0400
> @@ -40,6 +40,7 @@
>  #include <mach/imx-pll.h>
>  #include <mach/imxfb.h>
>  #include <asm/mmu.h>
> +#include <i2c/i2c.h>
>  #include <usb/isp1504.h>
>  #include <mach/spi.h>
>  #include <mach/iomux-mx27.h>
> @@ -261,6 +262,14 @@
>  		PD23_AF_USBH2_DATA2,
>  		PD24_AF_USBH2_DATA1,
>  		PD26_AF_USBH2_DATA5,
> +#ifdef CONFIG_I2C
> +		/* I2C1 */
> +		PD17_PF_I2C_DATA | GPIO_PUEN,
> +		PD18_PF_I2C_CLK,
> +		/* I2C2 */
> +		PC5_PF_I2C2_SDA,
> +		PC6_PF_I2C2_SCL,
> +#endif
>  	};
> 
>  	pcm038_mmu_init();
> @@ -298,6 +307,12 @@
>  	register_device(&sram_dev);
>  	imx27_add_fb(&pcm038_fb_data);
> 
> +#ifdef CONFIG_I2C
> +	PCCR0 |= PCCR0_I2C1_EN | PCCR0_I2C2_EN;
> +	imx27_add_i2c0(NULL);
> +	imx27_add_i2c1(NULL);
> +#endif

Please remove the #ifdef CONFIG_I2C

Sascha

> +
>  #ifdef CONFIG_USB
>  	pcm038_usbh_init();
>  	register_device(&usbh2_dev);
> diff -urN barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h
> --- barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-04 16:42:13.000000000 +0400
> +++ barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-11 11:20:26.000000000 +0400
> @@ -11,6 +11,11 @@
>  	return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata);
>  }
> 
> +static inline struct device_d *imx27_add_i2c1(struct i2c_platform_data *pdata)
> +{
> +	return imx_add_i2c((void *)IMX_I2C2_BASE, 1, pdata);
> +}
> +
>  static inline struct device_d *imx27_add_uart0(void)
>  {
>  	return imx_add_uart((void *)IMX_UART1_BASE, 0);

> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I2C support to PCM-038 board
  2011-08-12  9:06 ` Sascha Hauer
@ 2011-08-12  9:21   ` shc
  2011-08-17  7:39     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: shc @ 2011-08-12  9:21 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

[-- Attachment #1: Type: text/plain, Size: 1905 bytes --]

Sascha Hauer <s.hauer@pengutronix.de> wrote ..
> On Thu, Aug 11, 2011 at 02:37:05PM +0400, Alexander Shiyan wrote:
> > Hello.
> > 
> > Please review and apply this simple patch.
...
> Please remove the #ifdef CONFIG_I2C
OK.

diff -urN barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c
--- barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c	2011-08-04 16:42:13.000000000 +0400
+++ barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c	2011-08-12 13:11:20.000000000 +0400
@@ -40,6 +40,7 @@
 #include <mach/imx-pll.h>
 #include <mach/imxfb.h>
 #include <asm/mmu.h>
+#include <i2c/i2c.h>
 #include <usb/isp1504.h>
 #include <mach/spi.h>
 #include <mach/iomux-mx27.h>
@@ -261,6 +262,12 @@
 		PD23_AF_USBH2_DATA2,
 		PD24_AF_USBH2_DATA1,
 		PD26_AF_USBH2_DATA5,
+		/* I2C1 */
+		PD17_PF_I2C_DATA | GPIO_PUEN,
+		PD18_PF_I2C_CLK,
+		/* I2C2 */
+		PC5_PF_I2C2_SDA,
+		PC6_PF_I2C2_SCL,
 	};

 	pcm038_mmu_init();
@@ -298,6 +305,10 @@
 	register_device(&sram_dev);
 	imx27_add_fb(&pcm038_fb_data);

+	PCCR0 |= PCCR0_I2C1_EN | PCCR0_I2C2_EN;
+	imx27_add_i2c0(NULL);
+	imx27_add_i2c1(NULL);
+
 #ifdef CONFIG_USB
 	pcm038_usbh_init();
 	register_device(&usbh2_dev);
diff -urN barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h
--- barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-04 16:42:13.000000000 +0400
+++ barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-11 11:20:26.000000000 +0400
@@ -11,6 +11,11 @@
 	return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata);
 }

+static inline struct device_d *imx27_add_i2c1(struct i2c_platform_data *pdata)
+{
+	return imx_add_i2c((void *)IMX_I2C2_BASE, 1, pdata);
+}
+
 static inline struct device_d *imx27_add_uart0(void)
 {
 	return imx_add_uart((void *)IMX_UART1_BASE, 0);


[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I2C support to PCM-038 board
  2011-08-12  9:21   ` shc
@ 2011-08-17  7:39     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2011-08-17  7:39 UTC (permalink / raw)
  To: shc; +Cc: barebox

On Fri, Aug 12, 2011 at 01:21:56PM +0400, shc@milas.spb.ru wrote:
> Sascha Hauer <s.hauer@pengutronix.de> wrote ..
> > On Thu, Aug 11, 2011 at 02:37:05PM +0400, Alexander Shiyan wrote:
> > > Hello.
> > > 
> > > Please review and apply this simple patch.
> ...
> > Please remove the #ifdef CONFIG_I2C
> OK.

Applied, thanks
 Sascha

> 
> diff -urN barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c
> --- barebox-v2011.08.0.orig/arch/arm/boards/pcm038/pcm038.c	2011-08-04 16:42:13.000000000 +0400
> +++ barebox-v2011.08.0/arch/arm/boards/pcm038/pcm038.c	2011-08-12 13:11:20.000000000 +0400
> @@ -40,6 +40,7 @@
>  #include <mach/imx-pll.h>
>  #include <mach/imxfb.h>
>  #include <asm/mmu.h>
> +#include <i2c/i2c.h>
>  #include <usb/isp1504.h>
>  #include <mach/spi.h>
>  #include <mach/iomux-mx27.h>
> @@ -261,6 +262,12 @@
>  		PD23_AF_USBH2_DATA2,
>  		PD24_AF_USBH2_DATA1,
>  		PD26_AF_USBH2_DATA5,
> +		/* I2C1 */
> +		PD17_PF_I2C_DATA | GPIO_PUEN,
> +		PD18_PF_I2C_CLK,
> +		/* I2C2 */
> +		PC5_PF_I2C2_SDA,
> +		PC6_PF_I2C2_SCL,
>  	};
> 
>  	pcm038_mmu_init();
> @@ -298,6 +305,10 @@
>  	register_device(&sram_dev);
>  	imx27_add_fb(&pcm038_fb_data);
> 
> +	PCCR0 |= PCCR0_I2C1_EN | PCCR0_I2C2_EN;
> +	imx27_add_i2c0(NULL);
> +	imx27_add_i2c1(NULL);
> +
>  #ifdef CONFIG_USB
>  	pcm038_usbh_init();
>  	register_device(&usbh2_dev);
> diff -urN barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h
> --- barebox-v2011.08.0.orig/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-04 16:42:13.000000000 +0400
> +++ barebox-v2011.08.0/arch/arm/mach-imx/include/mach/devices-imx27.h	2011-08-11 11:20:26.000000000 +0400
> @@ -11,6 +11,11 @@
>  	return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata);
>  }
> 
> +static inline struct device_d *imx27_add_i2c1(struct i2c_platform_data *pdata)
> +{
> +	return imx_add_i2c((void *)IMX_I2C2_BASE, 1, pdata);
> +}
> +
>  static inline struct device_d *imx27_add_uart0(void)
>  {
>  	return imx_add_uart((void *)IMX_UART1_BASE, 0);
> 


-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-17  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-11 10:37 I2C support to PCM-038 board Alexander Shiyan
2011-08-12  9:06 ` Sascha Hauer
2011-08-12  9:21   ` shc
2011-08-17  7:39     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox