diff options
Diffstat (limited to 'drivers/media/video/mxc/capture/ov5640_mipi.c')
-rw-r--r-- | drivers/media/video/mxc/capture/ov5640_mipi.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/video/mxc/capture/ov5640_mipi.c b/drivers/media/video/mxc/capture/ov5640_mipi.c index 2d9d83b7b139..9ffca952cc29 100644 --- a/drivers/media/video/mxc/capture/ov5640_mipi.c +++ b/drivers/media/video/mxc/capture/ov5640_mipi.c @@ -195,7 +195,7 @@ static struct reg_value ov5640_setting_30fps_VGA_640_480[] = { }; static struct reg_value ov5640_setting_15fps_VGA_640_480[] = { - {0x3035, 0x24, 0, 0}, {0x3036, 0x38, 0, 0}, {0x3c07, 0x08, 0, 0}, + {0x3035, 0x22, 0, 0}, {0x3036, 0x38, 0, 0}, {0x3c07, 0x08, 0, 0}, {0x3c09, 0x1c, 0, 0}, {0x3c0a, 0x9c, 0, 0}, {0x3c0b, 0x40, 0, 0}, {0x3820, 0x41, 0, 0}, {0x3821, 0x07, 0, 0}, {0x3814, 0x31, 0, 0}, {0x3815, 0x31, 0, 0}, {0x3800, 0x00, 0, 0}, {0x3801, 0x00, 0, 0}, @@ -237,7 +237,7 @@ static struct reg_value ov5640_setting_30fps_QVGA_320_240[] = { }; static struct reg_value ov5640_setting_15fps_QVGA_320_240[] = { - {0x3035, 0x24, 0, 0}, {0x3036, 0x38, 0, 0}, {0x3c07, 0x08, 0, 0}, + {0x3035, 0x22, 0, 0}, {0x3036, 0x38, 0, 0}, {0x3c07, 0x08, 0, 0}, {0x3c09, 0x1c, 0, 0}, {0x3c0a, 0x9c, 0, 0}, {0x3c0b, 0x40, 0, 0}, {0x3820, 0x41, 0, 0}, {0x3821, 0x07, 0, 0}, {0x3814, 0x31, 0, 0}, {0x3815, 0x31, 0, 0}, {0x3800, 0x00, 0, 0}, {0x3801, 0x00, 0, 0}, @@ -909,6 +909,15 @@ bool binning_on(void) return false; } +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)); +} + static int ov5640_init_mode(enum ov5640_frame_rate frame_rate, enum ov5640_mode mode) { @@ -1164,6 +1173,7 @@ static int ov5640_init_mode(enum ov5640_frame_rate frame_rate, OV5640_set_AE_target(AE_Target); OV5640_get_light_frequency(); OV5640_set_bandingfilter(); + ov5640_set_virtual_channel(ov5640_data.csi); if (mipi_csi2_info) { unsigned int i; @@ -1604,7 +1614,7 @@ static int ioctl_dev_init(struct v4l2_int_device *s) ov5640_data.mclk = tgt_xclk; pr_debug(" Setting mclk to %d MHz\n", tgt_xclk / 1000000); - set_mclk_rate(&ov5640_data.mclk, ov5640_data.csi); + set_mclk_rate(&ov5640_data.mclk, ov5640_data.mclk_source); /* Default camera frame rate is set in probe */ tgt_fps = sensor->streamcap.timeperframe.denominator / @@ -1712,6 +1722,7 @@ static int ov5640_probe(struct i2c_client *client, memset(&ov5640_data, 0, sizeof(ov5640_data)); ov5640_data.mclk = 24000000; /* 6 - 54 MHz, typical 24MHz */ ov5640_data.mclk = plat_data->mclk; + ov5640_data.mclk_source = plat_data->mclk_source; ov5640_data.csi = plat_data->csi; ov5640_data.io_init = plat_data->io_init; |