Commit 9d00278d authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Sascha Hauer

mx3: add support for the mt9v022 camera sensor to pcm037 platform

Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent 2243b649
...@@ -322,16 +322,25 @@ static int pcm037_camera_power(struct device *dev, int on) ...@@ -322,16 +322,25 @@ static int pcm037_camera_power(struct device *dev, int on)
return 0; return 0;
} }
static struct i2c_board_info pcm037_i2c_2_devices[] = { static struct i2c_board_info pcm037_i2c_camera[] = {
{ {
I2C_BOARD_INFO("mt9t031", 0x5d), I2C_BOARD_INFO("mt9t031", 0x5d),
}, {
I2C_BOARD_INFO("mt9v022", 0x48),
}, },
}; };
static struct soc_camera_link iclink = { static struct soc_camera_link iclink_mt9v022 = {
.bus_id = 0, /* Must match with the camera ID */
.board_info = &pcm037_i2c_camera[1],
.i2c_adapter_id = 2,
.module_name = "mt9v022",
};
static struct soc_camera_link iclink_mt9t031 = {
.bus_id = 0, /* Must match with the camera ID */ .bus_id = 0, /* Must match with the camera ID */
.power = pcm037_camera_power, .power = pcm037_camera_power,
.board_info = &pcm037_i2c_2_devices[0], .board_info = &pcm037_i2c_camera[0],
.i2c_adapter_id = 2, .i2c_adapter_id = 2,
.module_name = "mt9t031", .module_name = "mt9t031",
}; };
...@@ -345,11 +354,19 @@ static struct i2c_board_info pcm037_i2c_devices[] = { ...@@ -345,11 +354,19 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
} }
}; };
static struct platform_device pcm037_camera = { static struct platform_device pcm037_mt9t031 = {
.name = "soc-camera-pdrv", .name = "soc-camera-pdrv",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &iclink, .platform_data = &iclink_mt9t031,
},
};
static struct platform_device pcm037_mt9v022 = {
.name = "soc-camera-pdrv",
.id = 1,
.dev = {
.platform_data = &iclink_mt9v022,
}, },
}; };
...@@ -449,7 +466,8 @@ static int __init pcm037_camera_alloc_dma(const size_t buf_size) ...@@ -449,7 +466,8 @@ static int __init pcm037_camera_alloc_dma(const size_t buf_size)
static struct platform_device *devices[] __initdata = { static struct platform_device *devices[] __initdata = {
&pcm037_flash, &pcm037_flash,
&pcm037_sram_device, &pcm037_sram_device,
&pcm037_camera, &pcm037_mt9t031,
&pcm037_mt9v022,
}; };
static struct ipu_platform_data mx3_ipu_data = { static struct ipu_platform_data mx3_ipu_data = {
...@@ -599,7 +617,7 @@ static void __init mxc_board_init(void) ...@@ -599,7 +617,7 @@ static void __init mxc_board_init(void)
if (!ret) if (!ret)
gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1); gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
else else
iclink.power = NULL; iclink_mt9t031.power = NULL;
if (!pcm037_camera_alloc_dma(4 * 1024 * 1024)) if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
mxc_register_device(&mx3_camera, &camera_pdata); mxc_register_device(&mx3_camera, &camera_pdata);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment