AnsweredAssumed Answered

how to let kernel(3.0.35) support csi0(parallel camera) + csi1(parallel tvin) +mipi csi2 three camera

Question asked by li yu on Oct 17, 2014
Latest reply on Apr 14, 2017 by May Queen

Dear :

     All !

  

  my platform is:

 imx6Q

   OS: android 4.2.2 jb_1.1.0


   I want to open csi0(parallel camera) + csi1(parallel tvin) + mipi three camera functions in the following ways:


 static struct fsl_mxc_camera_platform_data camera_data = {

    .mclk = 24000000,

    .mclk_source = 0,

   .csi = 0,

    .io_init = mx6q_csi0_io_init,

    .pwdn = mx6q_csi0_cam_powerdown,

};

 

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,

    .io_init    = mx6q_csi1_io_init,

};

 

  adv7180 driver probe is as follows:

 

memset(&adv7180_data, 0, sizeof(adv7180_data));

    adv7180_data.sen.i2c_client = client;

    adv7180_data.sen.streamcap.timeperframe.denominator = 30;

    adv7180_data.sen.streamcap.timeperframe.numerator = 1;

    adv7180_data.std_id = V4L2_STD_ALL;

    video_idx = ADV7180_NOT_LOCKED;

    adv7180_data.sen.pix.width = video_fmts[video_idx].raw_width;

    adv7180_data.sen.pix.height = video_fmts[video_idx].raw_height;

    adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_UYVY;  /* YUV422 */

    adv7180_data.sen.pix.priv = 1;  /* 1 is used to indicate TV in */

    adv7180_data.sen.on = true;

    adv7180_data.sen.csi = 1;

 

 

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {

    .mclk = 24000000,

    .mclk_source = 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 = 0,

    .lanes = 2,

    .dphy_clk = "mipi_pllref_clk",

    .pixel_clk = "emi_clk",

};

 

static struct fsl_mxc_capture_platform_data capture_data[] = {

    {

        .csi = 0,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 0,

    }, {

        .csi = 1,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 1,

    },{

        .csi = 1,

        .ipu = 1,

        .mclk_source = 0,

        .is_mipi = 0,

    },

};

//register

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

 

  ls /dev/video*                                   

  video0  video1  video16 video17 video18 video19 video2

 

 

 init.freescale.rc prop setting is as follows:

 

    setprop back_camera_name ov5640_mipi,adv7180_decoder

    setprop back_camera_orient 90

    setprop front_camera_name mt9d112

    setprop front_camera_orient 90

 

   When registering using the above methods, I found mipi cameracan not be used

 

 

 

 

 Because the camera is not detected,log is as follows:
root@android:/ # logcat |grep aHAL
I/FslCameraHAL( 2389): Face Back Camera is ov5640_mipi,adv7180_decoder, orient is 90
 

I/FslCameraHAL( 2389): Face Front Camera is mt9d112, orient is 90

I/FslCameraHAL( 2389): Checking the camera ov5640_mipi

I/FslCameraHAL( 2389): Checking the camera adv7180_decoder

I/FslCameraHAL( 2389): Get sensor adv7180_decoder's dev path /dev/video2

I/FslCameraHAL( 2389): Camera ID 0: name adv7180_decoder, Facing 0, orientation 90, dev path /dev/video2

I/FslCameraHAL( 2389): Checking the camera mt9d112

I/FslCameraHAL( 2389): Get sensor mt9d112's dev path /dev/video0

I/FslCameraHAL( 2389): Camera ID 1: name mt9d112, Facing 1, orientation 90, dev path /dev/video0


 

/dev/video1 is ov5640_mipi Not been detected !

 

 

 But when I commented :

 

   //imx6q_add_v4l2_capture(2, &capture_data[2]);

 /*{

        I2C_BOARD_INFO("adv7180", 0x21),

        .platform_data = (void *)&adv7180_data,

    },*/

 

root@android:/ # logcat |grep aHAL

I/FslCameraHAL( 2384): Face Back Camera is ov5640_mipi,adv7180_decoder, orient is 90

I/FslCameraHAL( 2384): Face Front Camera is mt9d112, orient is 90

I/FslCameraHAL( 2384): Checking the camera ov5640_mipi

I/FslCameraHAL( 2384): Get sensor ov5640_mipi's dev path /dev/video1

I/FslCameraHAL( 2384): Camera ID 0: name ov5640_mipi, Facing 0, orientation 90, dev path /dev/video1

I/FslCameraHAL( 2384): Checking the camera mt9d112

I/FslCameraHAL( 2384): Get sensor mt9d112's dev path /dev/video0

I/FslCameraHAL( 2384): Camera ID 1: name mt9d112, Facing 1, orientation 90, dev path /dev/video0

 

mipi camera and mt9d112 work fine !

 

  Please help me !

  how to let kernel(3.0.35) support csi0(parallel camera) + csi1(parallel tvin) +mipi csi2 three camera in kernel ?

 

 

 

 

Abstraction layer has been completed  !
 

 

 

I have achieved csi0 (parallel camera) +  mipi + uvc switch  between three camera .

 

 

 

But our projects have to support  csi0 (parallel camera) + csi1 (parallel tvin) + mipi csi2 three camera!

I feel android 4.2.2 mipi camera and csi1 (parallel tvin) can not be registered at the same time

Please help me !


 

 

 

 

  

 

 

 

Outcomes