aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2021-01-12 20:49:14 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-02-06 09:37:14 +0100
commita52e17361987782ecea7cc6ed0dc1f37a11949a8 (patch)
tree2317f087e45562e1cd966f780cf983106e993981 /arch/arm/mach-pxa
parentmedia: i2c: imx258: get clock from device properties and enable it via runtime PM (diff)
downloadlinux-dev-a52e17361987782ecea7cc6ed0dc1f37a11949a8.tar.xz
linux-dev-a52e17361987782ecea7cc6ed0dc1f37a11949a8.zip
media: mach-pxa: Register the camera sensor fixed-rate clock
The pxa-camera capture driver currently registers a v4l2-clk clock, named "mclk", to represent the mt9m111 sensor clock. Register a proper fixed-rate clock using the generic clock framework, which will allow to remove the v4l2-clk clock in the pxa-camera driver in a follow-up commit. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Acked-by: Arnd Bergmann <arnd@arndb.de> (for arch/arm/mach-*/) Acked-by: Petr Cvek <petrcvekcz@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/devices.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 524d6093e0c7..09b8495f3fd9 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -4,6 +4,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/spi/pxa2xx_spi.h>
@@ -634,6 +635,13 @@ static struct platform_device pxa27x_device_camera = {
void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
{
+ struct clk *mclk;
+
+ /* Register a fixed-rate clock for camera sensors. */
+ mclk = clk_register_fixed_rate(NULL, "pxa_camera_clk", NULL, 0,
+ info->mclk_10khz * 10000);
+ if (!IS_ERR(mclk))
+ clkdev_create(mclk, "mclk", NULL);
pxa_register_device(&pxa27x_device_camera, info);
}