Skip to contentSkip to conversation

plarform-mx2-camera: fix missing header dma-mapping.h

PATCH New Michael Grzeschik 2 participants 3 messages Aug 26, 2011

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

PATCH 1/2 plarform-mx2-camera: fix missing header dma-mapping.h

---
 arch/arm/plat-mxc/devices/platform-mx2-camera.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/devices/platform-mx2-camera.c +1 -0
index b3f4828..a6199d7 100644
@@ -6,6 +6,7 @@
  * the terms of the GNU General Public License version 2 as published by the
  * Free Software Foundation.
  */
+#include <linux/dma-mapping.h>
 #include <mach/hardware.h>
 #include <mach/devices-common.h>
 
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 2/2 ARM: i.MX27 pca100: Add camera support for mt9m111

This glue code for the pca100 implements support for the mt9m111 LVDS connected camera.

---
 arch/arm/mach-imx/Kconfig       |    1 +
 arch/arm/mach-imx/mach-pca100.c |   59 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 0 deletions(-)
arch/arm/mach-imx/Kconfig +1 -0
index 0519dd7..4697ed3 100644
@@ -328,6 +328,7 @@ config MACH_PCA100
 	select IMX_HAVE_PLATFORM_MXC_NAND
 	select IMX_HAVE_PLATFORM_MXC_W1
 	select IMX_HAVE_PLATFORM_SPI_IMX
+	select IMX_HAVE_PLATFORM_MX2_CAMERA
 	select MXC_ULPI if USB_ULPI
 	help
 	  Include support for phyCARD-s (aka pca100) platform. This
arch/arm/mach-imx/mach-pca100.c +59 -0

97 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/2 ARM: i.MX27 pca100: Add camera support for mt9m111

Halli Michael,

Quoted 14 lines · Michael Grzeschik

This glue code for the pca100 implements support for the mt9m111 LVDS connected camera.

---
 arch/arm/mach-imx/Kconfig       |    1 +
 arch/arm/mach-imx/mach-pca100.c |   59 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 0 deletions(-)
arch/arm/mach-imx/Kconfig +0 -0
index 0519dd7..4697ed3 100644

arch/arm/mach-imx/Kconfig config MACH_PCA100 · line 331

Quoted 4 lines
arch/arm/mach-imx/Kconfig +1 -0
@@ -328,6 +328,7 @@ config MACH_PCA100
 	select IMX_HAVE_PLATFORM_MXC_NAND
 	select IMX_HAVE_PLATFORM_MXC_W1
 	select IMX_HAVE_PLATFORM_SPI_IMX
+	select IMX_HAVE_PLATFORM_MX2_CAMERA

Please keep this list sorted alphabetically

Quoted 37 lines
arch/arm/mach-imx/Kconfig +0 -0
 	select MXC_ULPI if USB_ULPI
 	help
 	  Include support for phyCARD-s (aka pca100) platform. This
arch/arm/mach-imx/mach-pca100.c +15 -0
index 71083aa..e67a41b 100644
@@ -30,6 +30,8 @@
 #include <linux/usb/otg.h>
 #include <linux/usb/ulpi.h>
 
+#include <media/soc_camera.h>
+
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 #include <mach/common.h>
@@ -153,6 +155,19 @@ static const int pca100_pins[] __initconst = {
 	GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN, /* GPIO0_IRQ */
 	GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN, /* GPIO1_IRQ */
 	GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN, /* GPIO2_IRQ */
+	/* Camera */
+	PB10_PF_CSI_D0,
+	PB11_PF_CSI_D1,
+	PB12_PF_CSI_D2,
+	PB13_PF_CSI_D3,
+	PB14_PF_CSI_D4,
+	PB15_PF_CSI_MCLK,
+	PB16_PF_CSI_PIXCLK,
+	PB17_PF_CSI_D5,
+	PB18_PF_CSI_D6,
+	PB19_PF_CSI_D7,
+	PB20_PF_CSI_VSYNC,
+	PB21_PF_CSI_HSYNC,
 };
 
 static const struct imxuart_platform_data uart_pdata __initconst = {

arch/arm/mach-imx/mach-pca100.c static struct at24_platform_data board_eeprom = { · line 196

Quoted 7 lines
arch/arm/mach-imx/mach-pca100.c +4 -0
@@ -175,6 +190,17 @@ static struct at24_platform_data board_eeprom = {
 	.flags = AT24_FLAG_ADDR16,
 };
 
+static unsigned long pbaa01_camera_query_bus_param(struct soc_camera_link *icl)
+{
+	return SOCAM_DATAWIDTH_8;
+}

What is pbaa01? The machine's name is pca100.

Quoted 11 lines
arch/arm/mach-imx/mach-pca100.c +7 -0
+
+static int pbaa01_camera_set_bus_param(struct soc_camera_link *icl,
+		unsigned long flags)
+{
+	return 0;
+}
+
 static struct i2c_board_info pca100_i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */

arch/arm/mach-imx/mach-pca100.c static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { · line 330

Quoted 4 lines
arch/arm/mach-imx/mach-pca100.c +1 -0
@@ -301,6 +327,34 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
 
 static int otg_mode_host;
 
+static struct i2c_board_info __initdata pbaa01_camera_mt9m131 = {

__initdata should go directly before the =.

arch/arm/mach-imx/mach-pca100.c static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { · line 332

Quoted 2 lines
arch/arm/mach-imx/mach-pca100.c +2 -0
+		I2C_BOARD_INFO("mt9m111", 0x48),
+		.type = "mt9m111",

this is broken. I2C_BOARD_INFO already provides the .type assignment.

arch/arm/mach-imx/mach-pca100.c static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { · line 337

Quoted 5 lines
arch/arm/mach-imx/mach-pca100.c +5 -0
+};
+
+static struct soc_camera_link iclink_mt9m131 = {
+	.bus_id		= 0,		/* Must match with the camera ID */
+	.board_info	= &pbaa01_camera_mt9m131,

Here is a section mismatch. Is that OK?

arch/arm/mach-imx/mach-pca100.c static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { · line 350

Quoted 13 lines
arch/arm/mach-imx/mach-pca100.c +13 -0
+	.i2c_adapter_id	= 0,
+	.module_name	= "mt9m111",
+	.query_bus_param = pbaa01_camera_query_bus_param,
+	.set_bus_param	= pbaa01_camera_set_bus_param,
+};
+
+static struct platform_device pca100_mt9m131 = {
+	.name	= "soc-camera-pdrv",
+	.id	= 0,
+	.dev	= {
+		.platform_data = &iclink_mt9m131,
+	},
+};

Better allocate this dynamically. Then iclink_mt9m131 can be const + __initconst, too.

arch/arm/mach-imx/mach-pca100.c static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { · line 352

Quoted 1 line
arch/arm/mach-imx/mach-pca100.c +1 -0
+struct mx2_camera_platform_data pca100_camera = {

This should be const + __initconst.

Quoted 9 lines
arch/arm/mach-imx/mach-pca100.c +5 -0
+	.clk  = 26600000,
+	.flags = MX2_CAMERA_HSYNC_HIGH | MX2_CAMERA_GATED_CLOCK |
+		MX2_CAMERA_PACK_DIR_MSB,
+};
+
 static int __init pca100_otg_mode(char *options)
 {
 	if (!strcmp(options, "host"))

arch/arm/mach-imx/mach-pca100.c static void __init pca100_init(void) · line 446

Quoted 5 lines
arch/arm/mach-imx/mach-pca100.c +1 -0
@@ -388,8 +442,11 @@ static void __init pca100_init(void)
 	i2c_register_board_info(1, pca100_i2c_devices,
 				ARRAY_SIZE(pca100_i2c_devices));
 
+	imx27_add_imx_i2c(0, &pca100_i2c1_data);
 	imx27_add_imx_i2c(1, &pca100_i2c1_data);

maybe drop the 1 from pca100_i2c1_data as it is used for i2c0 now, too?

Quoted 7 lines
arch/arm/mach-imx/mach-pca100.c +2 -0
+	platform_device_register(&pca100_mt9m131);
+
 	mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN);
 	mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN);
 	spi_register_board_info(pca100_spi_board_info,

arch/arm/mach-imx/mach-pca100.c static void __init pca100_init(void) · line 487

Quoted 8 lines
arch/arm/mach-imx/mach-pca100.c +2 -0
@@ -423,6 +480,8 @@ static void __init pca100_init(void)
 	imx27_add_fec(NULL);
 	imx27_add_imx2_wdt(NULL);
 	imx27_add_mxc_w1(NULL);
+
+	imx27_add_mx2_camera(&pca100_camera);
 }
 
 static void __init pca100_timer_init(void)

Best regards
Uwe

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