From patchwork Tue Aug 8 11:27:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 9887581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DA92601EB for ; Tue, 8 Aug 2017 11:27:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 604CC287A0 for ; Tue, 8 Aug 2017 11:27:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55390287AB; Tue, 8 Aug 2017 11:27:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F17E7287A0 for ; Tue, 8 Aug 2017 11:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373AbdHHL1c (ORCPT ); Tue, 8 Aug 2017 07:27:32 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:38116 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbdHHL1V (ORCPT ); Tue, 8 Aug 2017 07:27:21 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OUD0014F6HHNV70@mailout3.w1.samsung.com>; Tue, 08 Aug 2017 12:27:17 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170808112717eucas1p200e8cb862e2afdd5e86d00f28b45d30c~Y21W8Osbh1819518195eucas1p2a; Tue, 8 Aug 2017 11:27:17 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 4B.24.12907.410A9895; Tue, 8 Aug 2017 12:27:16 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170808112716eucas1p27388118c826671edd88e79e68ceb7821~Y21WTfVxO2121221212eucas1p2d; Tue, 8 Aug 2017 11:27:16 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-db-5989a014030e Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 32.51.20118.410A9895; Tue, 8 Aug 2017 12:27:16 +0100 (BST) Received: from AMDC831.digital.local ([106.116.147.122]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OUD002SM6H90300@eusync1.samsung.com>; Tue, 08 Aug 2017 12:27:16 +0100 (BST) From: Andrzej Pietrasiewicz To: linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Andrzej Pietrasiewicz , Jacek Anaszewski , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Mauro Carvalho Chehab , Thierry Escande , Krzysztof Kozlowski Subject: [PATCH 3/5] media: platform: s5p-jpeg: Clear JPEG_CODEC_ON bits in sw reset function Date: Tue, 08 Aug 2017 13:27:06 +0200 Message-id: <1502191628-11958-3-git-send-email-andrzej.p@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1502191628-11958-1-git-send-email-andrzej.p@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsWy7djPc7oiCzojDQ4f1rWY9bKdxWLjj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UFPIS c1NtlSJ0fUOClBTKEnNKgTwjAzTg4BzgHqykb5fglrFs8nHGgiecFW93trE3MK7g6GLk5JAQ MJFY/f4AE4QtJnHh3no2EFtIYAmjxIbpWV2MXEB2E5NE15Et7CAJNgFjib0HOxhBbBGBLInD 82cxgxQxC9xgkjj6cSLYJGGBeInT216ygtgsAqoSG/9OAGvmFXCVuPlyCjPENjmJk8cmg9Vw CrhJfLw3gx1iWyOjxJ1FNxgnMPIuYGRYxSiSWlqcm55bbKRXnJhbXJqXrpecn7uJERj82479 3LKDsetd8CFGAQ5GJR7eFWkdkUKsiWXFlbmHGCU4mJVEePvmdUYK8aYkVlalFuXHF5XmpBYf YjQFumois5Rocj4wMvNK4g1NDM0tDY2MLSzMjYyUxHnVLzdFCgmkJ5akZqemFqQWwfQxcXBK NTCW3dxUeU52tk5DfZgpe+YBFvMrW9J+VWUsOf1v7cGAj8fzlnK6P0y/YXf2ZfN7+2eGn0Jz /H4yPY2OEE7n3sqQnMLkmpvebFq2flrtRB7TFy6RebYpXrPNuddqcOc+4XsosqChdmUMO4NY uqqjJYNg3Czeh13cgs/On8hrP/jgp8ED+zD5L0osxRmJhlrMRcWJAPX8ZsaUAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170808112716eucas1p27388118c826671edd88e79e68ceb7821 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBQaWV0cmFzaWV3aWN6G1NSUE9MLUtlcm5lbCAo?= =?UTF-8?B?VFApG+yCvOyEseyghOyekBtTZW5pb3IgU29mdHdhcmUgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBUb21hc3ogUGlldHJhc2lld2ljehtTUlBPTC1L?= =?UTF-8?B?ZXJuZWwgKFRQKRtTYW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2Fy?= =?UTF-8?B?ZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170808112716eucas1p27388118c826671edd88e79e68ceb7821 X-RootMTR: 20170808112716eucas1p27388118c826671edd88e79e68ceb7821 References: <1502191352-11595-1-git-send-email-andrzej.p@samsung.com> <1502191628-11958-1-git-send-email-andrzej.p@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tony K Nadackal 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 e.g. bootloader uses the codec and leaves it in a bad state. Signed-off-by: Tony K Nadackal [Updated commit message] Signed-off-by: Andrzej Pietrasiewicz --- 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 c784033..c72789b 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c @@ -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);