]> git.baikalelectronics.ru Git - kernel.git/commit
media: ov6650: Fix arbitrary selection of master clock rate
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Sun, 13 Oct 2019 12:50:50 +0000 (09:50 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 24 Oct 2019 21:41:07 +0000 (18:41 -0300)
commitd069ad920afc1b284a836978b88b74e265b3cb54
tree0e4d836747f291b46257bd134f47461dfa942793
parent5786140c3b1a11543499f3c8097d459a2768e3ee
media: ov6650: Fix arbitrary selection of master clock rate

A hardcoded 12 MHz master clock frequency has been assumed since
conversion of the driver from soc_camera sensor to a standalone V4L2
subdevice by commit aa6f497b94cc ("media: ov6650: convert to standalone
v4l2 subdevice").  Fix it.

Define a static table of supported master clock rates (fix misnamed
symbol while being at it), then use v4l2_clk_get/set_rate() to obtain
a clock rate matching one of those supported.  On success, apply
respective master clock hardware divisor provided by the matching
element of the table.

[Sakari Ailus: Initialize xclk to NULL.]

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov6650.c