From 787d8620912a42b32a72ef241b48466e63d3d266 Mon Sep 17 00:00:00 2001 From: Tony K Nadackal Date: Tue, 8 Aug 2017 07:27:06 -0400 Subject: [PATCH] media: s5p-jpeg: Clear JPEG_CODEC_ON bits in sw reset function Bits EXYNOS4_DEC_MODE and EXYNOS4_ENC_MODE do not get cleared on software reset. These bits need to be cleared explicitly. Even though the bits in question are already cleared in interrupt service routine, the reset should also clear them in case when e.g. bootloader uses the codec and leaves it in a bad state. [Updated commit message] Signed-off-by: Tony K Nadackal Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c index c78403368e5b..c72789bae6ed 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c @@ -20,6 +20,10 @@ void exynos4_jpeg_sw_reset(void __iomem *base) { unsigned int reg; + reg = readl(base + EXYNOS4_JPEG_CNTL_REG); + writel(reg & ~(EXYNOS4_DEC_MODE | EXYNOS4_ENC_MODE), + base + EXYNOS4_JPEG_CNTL_REG); + reg = readl(base + EXYNOS4_JPEG_CNTL_REG); writel(reg & ~EXYNOS4_SOFT_RESET_HI, base + EXYNOS4_JPEG_CNTL_REG); -- 2.45.2