From b95a24d6b10a70d88916e4c7c67f3a63772afb6a Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Fri, 18 Sep 2015 11:20:57 -0300 Subject: [media] s5p-jpeg: generalize clocks handling Allow jpeg codec variants declare clocks they need. Before this patch is applied jpeg-core gets jpeg->sclk "speculatively": if it is not there, we assume no problem. This patch eliminates this by explicitly declaring what clocks are needed for each variant. This is a preparation for adding Exynos 5433 variant support, which needs 4 clocks of names not compatible with any previous version of jpeg hw module. [Rebase and commit message] Signed-off-by: Marek Szyprowski Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Jacek Anaszewski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/s5p-jpeg/jpeg-core.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/media/platform/s5p-jpeg/jpeg-core.h') diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.h b/drivers/media/platform/s5p-jpeg/jpeg-core.h index 7d9a9ed19cea..d0076fe2843d 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.h +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.h @@ -20,6 +20,8 @@ #define S5P_JPEG_M2M_NAME "s5p-jpeg" +#define JPEG_MAX_CLOCKS 4 + /* JPEG compression quality setting */ #define S5P_JPEG_COMPR_QUAL_BEST 0 #define S5P_JPEG_COMPR_QUAL_WORST 3 @@ -100,8 +102,7 @@ enum exynos4_jpeg_img_quality_level { * @m2m_dev: v4l2 mem2mem device data * @regs: JPEG IP registers mapping * @irq: JPEG IP irq - * @clk: JPEG IP clock - * @sclk: Exynos3250 JPEG IP special clock + * @clocks: JPEG IP clock(s) * @dev: JPEG IP struct device * @alloc_ctx: videobuf2 memory allocator's context * @variant: driver variant to be used @@ -121,8 +122,7 @@ struct s5p_jpeg { void __iomem *regs; unsigned int irq; enum exynos4_jpeg_result irq_ret; - struct clk *clk; - struct clk *sclk; + struct clk *clocks[JPEG_MAX_CLOCKS]; struct device *dev; void *alloc_ctx; struct s5p_jpeg_variant *variant; @@ -136,6 +136,8 @@ struct s5p_jpeg_variant { unsigned int htbl_reinit:1; struct v4l2_m2m_ops *m2m_ops; irqreturn_t (*jpeg_irq)(int irq, void *priv); + const char *clk_names[JPEG_MAX_CLOCKS]; + int num_clocks; }; /** -- cgit v1.2.3