Hi,
We are trying to use and configure the OV5640 camera througth the MIPI interface on IMX6Q.SABRE SD board.
I got some promblem with the driver file of the ov5640(drivers/media/paltform/mxc/capture/ov5640_mipi.c) provided by imx_4.14.98_2.3.0. In the driver file, I find some ov5640 register addresses are not descirbed or the function description is not same as the ov5640 datasheet.
static void ov5640_set_virtual_channel(int channel)
{
u8 channel_id;
ov5640_read_reg(0x4814, &channel_id);
channel_id &= ~(3 << 6);
ov5640_write_reg(0x4814, channel_id | (channel << 6));
}
the register address 0x4814 is decripted as DEBUG_MODE in the datasheet, but in the driver file is to set virtual channel. I can not figure out what the really usage of the register and that confuses me. I wonder wheather there is another rule to set the register which not metion in the manual.
Besides, there are also many registers are not metioned in the ov5640 datasheet but the driver write data to them. e.g. the underlined register address would be initailized, and I don't know what the driver do to the ov5640.
//ov5640 init configuration
static struct reg_value ov5640_init_setting_30fps_VGA[] = {
{0x3103, 0x11, 0, 0}, {0x3008, 0x82, 0, 5}, {0x3008, 0x42, 0, 0},
{0x3103, 0x03, 0, 0}, {0x3017, 0x00, 0, 0}, {0x3018, 0x00, 0, 0},
{0x3034, 0x18, 0, 0}, {0x3035, 0x14, 0, 0}, {0x3036, 0x38, 0, 0},
{0x3037, 0x13, 0, 0}, {0x3108, 0x01, 0, 0}, {0x3630, 0x36, 0, 0},
{0x3631, 0x0e, 0, 0}, {0x3632, 0xe2, 0, 0}, {0x3633, 0x12, 0, 0},
{0x3621, 0xe0, 0, 0}, {0x3704, 0xa0, 0, 0}, {0x3703, 0x5a, 0, 0},
{0x3715, 0x78, 0, 0}, {0x3717, 0x01, 0, 0}, {0x370b, 0x60, 0, 0},
{0x3705, 0x1a, 0, 0}, {0x3905, 0x02, 0, 0}, {0x3906, 0x10, 0, 0},
{0x3901, 0x0a, 0, 0}, {0x3731, 0x12, 0, 0}, {0x3600, 0x08, 0, 0},
{0x3601, 0x33, 0, 0}, {0x302d, 0x60, 0, 0}, {0x3620, 0x52, 0, 0},
{0x371b, 0x20, 0, 0}, {0x471c, 0x50, 0, 0}, {0x3a13, 0x43, 0, 0},......
//ov5640 init code
static int ov5640_init_mode(enum ov5640_frame_rate frame_rate,
enum ov5640_mode mode, enum ov5640_mode orig_mode)
{
......
if (mode == ov5640_mode_INIT) {
pModeSetting = ov5640_init_setting_30fps_VGA;
ArySize = ARRAY_SIZE(ov5640_init_setting_30fps_VGA);
ov5640_data.pix.width = 640;
ov5640_data.pix.height = 480;
retval = ov5640_download_firmware(pModeSetting, ArySize);
......
ov5640_set_virtual_channel(ov5640_data.csi);
...
}
Wheather there are some other rules that I missed to configure the ov5640. Any information on this will be much appreciated.
Thanks in advance
for imx6 ov5640 mipi camera, I think you should refer to the driver as below:
Hi,joanxie
Thank you for your advise.
My OV5640 camera connects to the IMX6Q SABRESD board through J5 MIPI interface. It seems that if the driver is not ov5640_mipi.c the camera cannot be found. And besides, there are still some register addresses unmentioned in the ov5640 datesheet but they are inside the driver for ov5640.c just like I have talked about before. That still confuses me.
Anyway, it is much appreciated for your advise and time.
for mipi driver is drivers/media/platform/mxc/capture/ov5640.c, and imx6q can support parallel camera and mipi camera, if you just uses one camera, don't forget disable another one