AnsweredAssumed Answered

IMX6 with OV5640 MIPI camera

Question asked by Vasan V S on Sep 27, 2013

Hi all

 

When we use iMX6Q with OV5640 MIPI camera, we find that the camera device seems to be getting released as soon as it is opened. Here is the debug log that we are getting after enabling DEBUG:

 

In MVC: mxc_v4l_open                                                      
   device name is Mxc Camera                                              
End of mxc_v4l_open: v2f pix widthxheight 288 x 352                       
End of mxc_v4l_open: crop_bounds widthxheight 640 x 480                   
End of mxc_v4l_open: crop_defrect widthxheight 640 x 480                  
End of mxc_v4l_open: crop_current widthxheight 640 x 480                  
On Open: Input to ipu size is 640 x 480                                   
In MVC:mxc_v4l_ioctl                                                      
In MVC: mxc_v4l_do_ioctl 80685600                                         
   case VIDIOC_QUERYCAP                                                   
In MVC:mxc_v4l_ioctl                                                      
In MVC: mxc_v4l_do_ioctl c02c5651                                         
In MVC:mxc_v4l_close                                                      
mxc_v4l_close: release resource                                           
MVC: In mxc_free_frame_buf                                                

In MVC:mxc_free_frames

 

The following are the changes made by us in the Android 4 code base:

 

- Changed .csi field in ov5640_mipi_data structure from 0 to 1 in mx6q_sabrelite.c

 

static struct fsl_mxc_camera_platform_data ov5640_mipi_data = {

    .mclk = 22000000,

    .csi = 1,

    .io_init = mx6_mipi_sensor_io_init,

    .pwdn = ov5640_mipi_camera_powerdown,

};

 

- Changed csi_id in mipi_csi2_pdata from 0 to 1

 

 

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",

};

 

- Commented the first capture interface in board_init (Since we are using only one camera - MIPI Camera - alone)

 

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,

    },

};

 

imx6q_add_v4l2_output(0);

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

    imx6q_add_v4l2_capture(1, &capture_data[1]);

 

- In mxc_v4l2_capture.c, changed CAPTURE_NUM_INPUTS to 1 from 2 since we have only one capture interface now.

 

Can someone throw some inputs on why the camera seems to be stopping and not working as expected?

 

Thanks in advance for your inputs and help.

Outcomes