From patchwork Wed Nov 16 09:04:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 82456 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp56544obn; Wed, 16 Nov 2016 01:05:44 -0800 (PST) X-Received: by 10.99.66.198 with SMTP id p189mr6027444pga.30.1479287144282; Wed, 16 Nov 2016 01:05:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si30921326pfg.259.2016.11.16.01.05.44; Wed, 16 Nov 2016 01:05:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934958AbcKPJFk (ORCPT + 4 others); Wed, 16 Nov 2016 04:05:40 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:64098 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934006AbcKPJFY (ORCPT ); Wed, 16 Nov 2016 04:05:24 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGQ00GMB98W7P80@mailout2.w1.samsung.com>; Wed, 16 Nov 2016 09:05:20 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161116090520eucas1p228f123339d16a01adda51ae99fa0af9b~He8xhVAeY0301103011eucas1p2W; Wed, 16 Nov 2016 09:05:20 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 55.A5.28332.0512C285; Wed, 16 Nov 2016 09:05:20 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161116090519eucas1p1021f0aab03499906974608d33aeac4eb~He8w1lRKj2676426764eucas1p1P; Wed, 16 Nov 2016 09:05:19 +0000 (GMT) X-AuditID: cbfec7f4-f791c6d000006eac-58-582c21500131 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DB.4A.07726.5512C285; Wed, 16 Nov 2016 09:05:25 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGQ00GDL98JU960@eusync2.samsung.com>; Wed, 16 Nov 2016 09:05:19 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Javier Martinez Canillas , Andrzej Hajda , Inki Dae Subject: [PATCH 4/9] s5p-mfc: Ensure that clock is disabled before turning power off Date: Wed, 16 Nov 2016 10:04:53 +0100 Message-id: <1479287098-30493-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1479287098-30493-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsWy7djP87oBijoRBisnslncWneO1WLjjPWs FpPuT2CxePN2DZPF+fMb2C16NmxltZhxfh+Txdojd9ktDr9pB3Inv2Rz4PLYtKqTzWNL/112 j74tqxg9Pm+SC2CJ4rJJSc3JLEst0rdL4Mr4NOs9Y8E9jopva3IbGBezdzFyckgImEh0vtvP AmGLS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5HWDreAU8JO79v8oCsU5O4uSxyawgNqeAp8STma+A4hxA2zwklh81 ncDIu4CRYRWjSGppcW56brGhXnFibnFpXrpecn7uJkZgeG879nPzDsZLG4MPMQpwMCrx8C5Q 144QYk0sK67MPcQowcGsJMJ7XVAnQog3JbGyKrUoP76oNCe1+BCjKdBNE5mlRJPzgbGXVxJv aGJobmloZGxhYW5kpCTOW/LhSriQQHpiSWp2ampBahFMHxMHp1QDY55A3g1ZQxOut8Fb/qvK 1s01vHde2yOhb3GzszRP5dPur1p8S1PTLvyqPJUd8vbQmSX518/8U1/na1VxyvO7xQnG6dO2 857N2fRlw5unkw87WrLkeifNWHTgIt/LnDdb/i1lUYo+/+butPPeRxYxtW5607MxZTXPCbfw jYbS+2c9j7Ob2/RJdY8SS3FGoqEWc1FxIgAaLN4ZhQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161116090519eucas1p1021f0aab03499906974608d33aeac4eb X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161116090519eucas1p1021f0aab03499906974608d33aeac4eb X-RootMTR: 20161116090519eucas1p1021f0aab03499906974608d33aeac4eb References: <1479287098-30493-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Move clock disabling before turning power off. This will enable later to add calls to clk_prepare/unprepare in the s5p_mfc_power_off() function to avoid keeping clocks prepared all the time when driver is bound. Signed-off-by: Marek Szyprowski --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index a0a29194ccd1..30ceae7eabc5 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -963,11 +963,13 @@ static int s5p_mfc_release(struct file *file) mfc_debug(2, "Last instance\n"); s5p_mfc_deinit_hw(dev); del_timer_sync(&dev->watchdog_timer); + s5p_mfc_clock_off(); if (s5p_mfc_power_off() < 0) mfc_err("Power off failed\n"); + } else { + mfc_debug(2, "Shutting down clock\n"); + s5p_mfc_clock_off(); } - mfc_debug(2, "Shutting down clock\n"); - s5p_mfc_clock_off(); } if (dev) dev->ctx[ctx->num] = NULL;