diff options
author | 2012-10-22 10:43:00 -0300 | |
---|---|---|
committer | 2013-04-14 20:21:12 -0300 | |
commit | 9b28ee3c9122cea62f2db02f5bb1e1606bb343a6 (patch) | |
tree | 7092c63fa14f7e5162400ee5a571f92532bcab5c /drivers/media/platform/omap3isp/isp.h | |
parent | [media] MAINTAINERS: Mark the SH VOU driver as Odd Fixes (diff) | |
download | linux-dev-9b28ee3c9122cea62f2db02f5bb1e1606bb343a6.tar.xz linux-dev-9b28ee3c9122cea62f2db02f5bb1e1606bb343a6.zip |
[media] omap3isp: Use the common clock framework
Expose the two ISP external clocks XCLKA and XCLKB as common clocks for
subdev drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/omap3isp/isp.h')
-rw-r--r-- | drivers/media/platform/omap3isp/isp.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h index c77e1f2ae5ca..cd3eff45ae7d 100644 --- a/drivers/media/platform/omap3isp/isp.h +++ b/drivers/media/platform/omap3isp/isp.h @@ -29,6 +29,7 @@ #include <media/omap3isp.h> #include <media/v4l2-device.h> +#include <linux/clk-provider.h> #include <linux/device.h> #include <linux/io.h> #include <linux/iommu.h> @@ -125,8 +126,20 @@ struct isp_reg { u32 val; }; -struct isp_platform_callback { - u32 (*set_xclk)(struct isp_device *isp, u32 xclk, u8 xclksel); +enum isp_xclk_id { + ISP_XCLK_A, + ISP_XCLK_B, +}; + +struct isp_xclk { + struct isp_device *isp; + struct clk_hw hw; + struct clk_lookup *lookup; + enum isp_xclk_id id; + + spinlock_t lock; /* Protects enabled and divider */ + bool enabled; + unsigned int divider; }; /* @@ -149,6 +162,7 @@ struct isp_platform_callback { * @cam_mclk: Pointer to camera functional clock structure. * @csi2_fck: Pointer to camera CSI2 complexIO clock structure. * @l3_ick: Pointer to OMAP3 L3 bus interface clock. + * @xclks: External clocks provided by the ISP * @irq: Currently attached ISP ISR callbacks information structure. * @isp_af: Pointer to current settings for ISP AutoFocus SCM. * @isp_hist: Pointer to current settings for ISP Histogram SCM. @@ -185,12 +199,12 @@ struct isp_device { int has_context; int ref_count; unsigned int autoidle; - u32 xclk_divisor[2]; /* Two clocks, a and b. */ #define ISP_CLK_CAM_ICK 0 #define ISP_CLK_CAM_MCLK 1 #define ISP_CLK_CSI2_FCK 2 #define ISP_CLK_L3_ICK 3 struct clk *clock[4]; + struct isp_xclk xclks[2]; /* ISP modules */ struct ispstat isp_af; @@ -209,8 +223,6 @@ struct isp_device { unsigned int subclk_resources; struct iommu_domain *domain; - - struct isp_platform_callback platform_cb; }; #define v4l2_dev_to_isp_device(dev) \ |