Hi igorpadykov !
I follow the "Re: i.MX6Q : Parallel CSI#2 not working" said, But still the registration is not successful , the reason I judge: should be IPU and CSI channel selection error causes,
code :
camera 1 :mt9d112
Parallel 0 : ipu 0 csi 0
static void mx6q_csi0_io_init(void)
{
........
/* For MX6Q:
* GPR1 bit19 and bit20 meaning:
* Bit19: 0 - Enable mipi to IPU1 CSI0
* virtual channel is fixed to 0
* 1 - Enable parallel interface to IPU1 CSI0
* Bit20: 0 - Enable mipi to IPU2 CSI1
* virtual channel is fixed to 3
* 1 - Enable parallel interface to IPU2 CSI1
* IPU1 CSI1 directly connect to mipi csi2,
* virtual channel is fixed to 1
* IPU2 CSI0 directly connect to mipi csi2,
* virtual channel is fixed to 2
*
* For MX6DL:
* GPR13 bit 0-2 IPU_CSI0_MUX
* 000 MIPI_CSI0
* 100 IPU CSI0
*/
if (cpu_is_mx6q())
mxc_iomux_set_gpr_register(1, 19, 1, 1);
else if (cpu_is_mx6dl())
mxc_iomux_set_gpr_register(13, 0, 3, 4);
}
static struct fsl_mxc_camera_platform_data camera_data = {
.mclk = 24000000,
.mclk_source = 0,
.ipu = 0,
.csi = 0,
.io_init = mx6q_csi0_io_init,
.pwdn = mx6q_csi0_cam_powerdown,
};
camera 2 : ov5640_mipi
mipi csi2 : ipu 0, csi1 , v_channel -> 1
static void mx6q_mipi_sensor_io_init(void)
{
......
mxc_iomux_set_gpr_register(1, 19, 1,1);
}
static struct fsl_mxc_camera_platform_data mipi_csi2_data = {
.mclk = 24000000,
.mclk_source = 0,
.ipu = 0,
.csi = 1,
.io_init = mx6q_mipi_sensor_io_init,
.pwdn = mx6q_mipi_powerdown,
};
static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.ipu_id = 0,
.csi_id = 1,
.v_channel = 1,
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
.pixel_clk = "emi_clk",
};
static int ov5640_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
.......
sensor->mipi_camera =1;
......
ov5640_data.csi = plat_data->csi;
ov5640_data.ipu = plat_data->ipu;
// sensor->virtual_channel =sensor->csi | (sensor->ipu << 1);
ov5640_int_device.priv = &ov5640_data;
retval = v4l2_int_device_register(&ov5640_int_device);
............
printk("ov5640_probe ok\n");
............
}
camera3 : adv7180
Parallel 1 : ipu 1 csi 1
static void mx6q_csi1_io_init(void)
{
.........
if (cpu_is_mx6q()){
//printk("==== mx6q_csi1_io_init cpu_is_mx6q ====\n");
mxc_iomux_set_gpr_register(1, 20, 1, 1);
}else if (cpu_is_mx6dl()){
//printk("==== mx6q_csi1_io_init cpu_is_mx6dl ====\n");
mxc_iomux_set_gpr_register(13, 0, 3, 4);
}
}
static struct fsl_mxc_tvin_platform_data adv7180_data = {
//.dvddio_reg = NULL,
//.dvdd_reg = NULL,
//.avdd_reg = NULL,
//.pvdd_reg = NULL,
.pwdn = adv7180_pwdn,
.reset = adv7180_reset,
.cvbs = true,
.ipu = 1,
.csi = 1,
.io_init = mx6q_csi1_io_init,
};
static int adv7180_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int rev_id;
int ret = 0;
.........
adv7180_data.sen.csi = 1;//tvin_plat->csi;
adv7180_data.sen.ipu = 1;
//adv7180_data.sen.mclk = 28000000;
............
/* This function attaches this structure to the /dev/video0 device.
* The pointer in priv points to the mt9v111_data structure here.*/
adv7180_int_device.priv = &adv7180_data;
ret = v4l2_int_device_register(&adv7180_int_device);
return ret;
}
imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_v4l2_capture(2, &capture_data[2]);
imx6q_add_mipi_csi2(&mipi_csi2_pdata);
But cant't find ov5640_mipi
logcat |grep HAL
I/FslCameraHAL( 2395): Face Back Camera is ov5640_mipi,adv7180_decoder,uvc, orient is 90
I/FslCameraHAL( 2395): Face Front Camera is mt9d112, orient is 90
I/FslCameraHAL( 2395): Checking the camera ov5640_mipi
I/FslCameraHAL( 2395): Checking the camera adv7180_decoder
I/FslCameraHAL( 2395): Get sensor adv7180_decoder's dev path /dev/video2
I/FslCameraHAL( 2395): Camera ID 0: name adv7180_decoder, Facing 0, orientation 90, dev path /dev/video2
I/FslCameraHAL( 2395): Checking the camera mt9d112
I/FslCameraHAL( 2395): Get sensor mt9d112's dev path /dev/video0
I/FslCameraHAL( 2395): Camera ID 1: name mt9d112, Facing 1, orientation 90, dev path /dev/video0
I/SWITCHPROFILE( 2705): Switchprofile thread received GOV_INTERACTIVE from Power HAL
These two cameras can be captured images.
But I modify the code to
static int adv7180_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int rev_id;
int ret = 0;
.........
// adv7180_data.sen.csi = 1;//tvin_plat->csi;
// adv7180_data.sen.ipu = 1;
............
/* This function attaches this structure to the /dev/video0 device.
* The pointer in priv points to the mt9v111_data structure here.*/
adv7180_int_device.priv = &adv7180_data;
ret = v4l2_int_device_register(&adv7180_int_device);
return ret;
}
root@android:/ # logcat |grep HAL
I/FslCameraHAL( 2395): Face Back Camera is ov5640_mipi,adv7180_decoder,uvc, orient is 90
I/FslCameraHAL( 2395): Face Front Camera is mt9d112, orient is 90
I/FslCameraHAL( 2395): Checking the camera ov5640_mipi
I/SWITCHPROFILE( 2705): Switchprofile thread received GOV_INTERACTIVE from Power HAL
I/FslCameraHAL( 2395): Get sensor ov5640_mipi's dev path /dev/video2
I/FslCameraHAL( 2395): Camera ID 0: name ov5640_mipi, Facing 0, orientation 90, dev path /dev/video2
I/FslCameraHAL( 2395): Checking the camera mt9d112
It can find ov5640_mipi .
Not only can not find the other two cameras ,Butov5640 can't get image !
I just comment out :
// adv7180_data.sen.csi = 1;//tvin_plat->csi;
// adv7180_data.sen.ipu = 1;
Therefore I judge registration is not successful reason, is because the IPU and CSI channel selection error.
But how to modify the code !
Thanks !