Skip to content

Commit 4adb0a0

Browse files
todortomovmchehab
authored andcommitted
media: ov5645: Supported external clock is 24MHz
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]>
1 parent 53cf310 commit 4adb0a0

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
};
@@ -1145,7 +1145,8 @@ static int ov5645_probe(struct i2c_client *client,
11451145
return ret;
11461146
}
11471147

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

0 commit comments

Comments
 (0)