Commit 4adb0a04 authored by Todor Tomov's avatar Todor Tomov Committed by Mauro Carvalho Chehab

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: default avatarTodor Tomov <todor.tomov@linaro.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 53cf3100
...@@ -510,8 +510,8 @@ static const struct reg_value ov5645_setting_full[] = { ...@@ -510,8 +510,8 @@ static const struct reg_value ov5645_setting_full[] = {
}; };
static const s64 link_freq[] = { static const s64 link_freq[] = {
222880000, 224000000,
334320000 336000000
}; };
static const struct ov5645_mode_info ov5645_mode_info_data[] = { static const struct ov5645_mode_info ov5645_mode_info_data[] = {
...@@ -520,7 +520,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = { ...@@ -520,7 +520,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = {
.height = 960, .height = 960,
.data = ov5645_setting_sxga, .data = ov5645_setting_sxga,
.data_size = ARRAY_SIZE(ov5645_setting_sxga), .data_size = ARRAY_SIZE(ov5645_setting_sxga),
.pixel_clock = 111440000, .pixel_clock = 112000000,
.link_freq = 0 /* an index in link_freq[] */ .link_freq = 0 /* an index in link_freq[] */
}, },
{ {
...@@ -528,7 +528,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = { ...@@ -528,7 +528,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = {
.height = 1080, .height = 1080,
.data = ov5645_setting_1080p, .data = ov5645_setting_1080p,
.data_size = ARRAY_SIZE(ov5645_setting_1080p), .data_size = ARRAY_SIZE(ov5645_setting_1080p),
.pixel_clock = 167160000, .pixel_clock = 168000000,
.link_freq = 1 /* an index in link_freq[] */ .link_freq = 1 /* an index in link_freq[] */
}, },
{ {
...@@ -536,7 +536,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = { ...@@ -536,7 +536,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = {
.height = 1944, .height = 1944,
.data = ov5645_setting_full, .data = ov5645_setting_full,
.data_size = ARRAY_SIZE(ov5645_setting_full), .data_size = ARRAY_SIZE(ov5645_setting_full),
.pixel_clock = 167160000, .pixel_clock = 168000000,
.link_freq = 1 /* an index in link_freq[] */ .link_freq = 1 /* an index in link_freq[] */
}, },
}; };
...@@ -1145,7 +1145,8 @@ static int ov5645_probe(struct i2c_client *client, ...@@ -1145,7 +1145,8 @@ static int ov5645_probe(struct i2c_client *client,
return ret; return ret;
} }
if (xclk_freq != 23880000) { /* external clock must be 24MHz, allow 1% tolerance */
if (xclk_freq < 23760000 || xclk_freq > 24240000) {
dev_err(dev, "external clock frequency %u is not supported\n", dev_err(dev, "external clock frequency %u is not supported\n",
xclk_freq); xclk_freq);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment