Skip to content

Commit f86f6eb

Browse files
todortomovgregkh
authored andcommitted
media: ov5645: Supported external clock is 24MHz
[ Upstream commit 4adb0a0 ] The external clock frequency was set to 23.88MHz by mistake because of a platform which cannot get closer to 24MHz. The supported by the driver external clock is 24MHz so set it correctly and also fix the values of the pixel clock and link clock. However allow 1% tolerance to the external clock as this difference is small enough to be insignificant. Signed-off-by: Todor Tomov <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 28b6561 commit f86f6eb

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/media/i2c/ov5645.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ static const struct reg_value ov5645_setting_full[] = {
510510
};
511511

512512
static const s64 link_freq[] = {
513-
222880000,
514-
334320000
513+
224000000,
514+
336000000
515515
};
516516

517517
static const struct ov5645_mode_info ov5645_mode_info_data[] = {
@@ -520,23 +520,23 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = {
520520
.height = 960,
521521
.data = ov5645_setting_sxga,
522522
.data_size = ARRAY_SIZE(ov5645_setting_sxga),
523-
.pixel_clock = 111440000,
523+
.pixel_clock = 112000000,
524524
.link_freq = 0 /* an index in link_freq[] */
525525
},
526526
{
527527
.width = 1920,
528528
.height = 1080,
529529
.data = ov5645_setting_1080p,
530530
.data_size = ARRAY_SIZE(ov5645_setting_1080p),
531-
.pixel_clock = 167160000,
531+
.pixel_clock = 168000000,
532532
.link_freq = 1 /* an index in link_freq[] */
533533
},
534534
{
535535
.width = 2592,
536536
.height = 1944,
537537
.data = ov5645_setting_full,
538538
.data_size = ARRAY_SIZE(ov5645_setting_full),
539-
.pixel_clock = 167160000,
539+
.pixel_clock = 168000000,
540540
.link_freq = 1 /* an index in link_freq[] */
541541
},
542542
};
@@ -1157,7 +1157,8 @@ static int ov5645_probe(struct i2c_client *client,
11571157
return ret;
11581158
}
11591159

1160-
if (xclk_freq != 23880000) {
1160+
/* external clock must be 24MHz, allow 1% tolerance */
1161+
if (xclk_freq < 23760000 || xclk_freq > 24240000) {
11611162
dev_err(dev, "external clock frequency %u is not supported\n",
11621163
xclk_freq);
11631164
return -EINVAL;

0 commit comments

Comments
 (0)