media: s5p-jpeg: Clear JPEG_CODEC_ON bits in sw reset function
authorTony K Nadackal <tony.kn@samsung.com>
Tue, 8 Aug 2017 11:27:06 +0000 (07:27 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 20 Aug 2017 12:01:45 +0000 (08:01 -0400)
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 <tony.kn@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c

index c784033..c72789b 100644 (file)
@@ -21,6 +21,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);
 
        udelay(100);