]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
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 c78403368e5bf20ce47d1310ea0ad20014fb6d53..c72789bae6ed0ece13c12becf4e5694a02a6b64a 100644 (file)
@@ -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);