media: i2c: imx258: get clock from device properties and enable it via runtime PM
authorKrzysztof Kozlowski <krzk@kernel.org>
Wed, 27 Jan 2021 17:46:35 +0000 (18:46 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 6 Feb 2021 08:36:55 +0000 (09:36 +0100)
commit9fda25332c4b9e193f11f34130b6f3fdbafc11dc
tree1521e21aa2f441970720b907a04a8414cba8bac8
parent2b585242b8619799fab2d0840f35cc936ed88749
media: i2c: imx258: get clock from device properties and enable it via runtime PM

The IMX258 sensor driver checked in device properties for a
clock-frequency property which actually does not mean that the clock is
really running such frequency or is it even enabled.

Get the provided clock and check it frequency.  If none is provided,
fall back to old property.

Enable the clock when accessing the IMX258 registers and when streaming
starts with runtime PM.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/imx258.c