For anyone interested, I attached a patch that adds dual CSI support and TVP5150 support for kernel 2.6.35.3 with latest Freescale patches (from http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_11.09.01). All credit for TVP5150 part goes to Adam Sutton, though I have made some little modifications.
Apparently there is a bug that sometimes causes a crash when using gstreamer, but I'm not using that so I have not bothered to debug it much. Feel free to point out any bugs you notice in this patch.
After applying this patch, two camera and v4l2 input devices need to be defined in arch/arm/mach-mx5/<board>.c. For example my platform description code looks like this:
static struct mxc_camera_platform_data camera0_data = {
.csi = 0,
};
static struct mxc_camera_platform_data camera1_data = {
.csi = 1,
};
static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
{
.type = "tvp5150",
.addr = 0x5c,
.platform_data = (void *)&camera0_data,
},
{
.type = "tvp5150",
.addr = 0x5d,
.platform_data = (void *)&camera1_data,
},
};
static void __init mxc_board_init(void)
{
...
i2c_register_board_info(0, mxc_i2c0_board_info,
ARRAY_SIZE(mxc_i2c0_board_info));
mxc_register_device(&mxc_v4l2out_device, NULL);
mxc_register_device(&mxc_v4l2_device, NULL);
mxc_register_device(&mxc_v4l2_device1, NULL);
...
}
In devices.c:
struct platform_device mxc_v4l2_device = {
.name = "mxc_v4l2_capture",
.id = 0,
};
struct platform_device mxc_v4l2_device1 = {
.name = "mxc_v4l2_capture",
.id = 1,
};
struct platform_device mxc_v4l2out_device = {
.name = "mxc_v4l2_output",
.id = 0,
};
The camera selection is based on using a device node either with minor number 1 (= csi0) or 2 (= csi1), with major number 81 (video4linux).