From patchwork Wed Aug 7 12:53:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar K X-Patchwork-Id: 2840286 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 92846BF535 for ; Wed, 7 Aug 2013 12:53:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BF662027F for ; Wed, 7 Aug 2013 12:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31E432028D for ; Wed, 7 Aug 2013 12:52:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932896Ab3HGMw4 (ORCPT ); Wed, 7 Aug 2013 08:52:56 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:46191 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932738Ab3HGMwz (ORCPT ); Wed, 7 Aug 2013 08:52:55 -0400 Received: by mail-pa0-f45.google.com with SMTP id bg4so2123247pad.4 for ; Wed, 07 Aug 2013 05:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=CjXni3wwqeM4qhUeS7oYqcbvlmvKVmgCjxuCBJvQ/4o=; b=baHY9/TmPGsQ1Ojty+kPY7/JYJ+bO6YhyGNZRq0C55Ti7v/q3KSFHlfuDSVy2QWaYz 83eaGIRDfvYOp0688pHU/v9eZ7RfCnUTiAPUb2hmZknVC0EpvnAnMjzRS5TqLUj9PMUS /eQr+9hqbDfe0r5yRdlHQiui1eWweVvqzZudM2NwBQD2CgLWbMxs4l7oZ+1FE4G9d43D tTtSgDpdJVq+UegzB1cJQFqrb8OR1IJm5gwx1juZiMkQFm3M0ol24siRQww9/QIDnoDB wZ8fejHjoTCscmgih1GaOgSMoyKmpZKREOkRtE3dt4uw45aYi4KOFL54V2cUdob46nqg c26Q== X-Received: by 10.68.111.34 with SMTP id if2mr482490pbb.83.1375879974607; Wed, 07 Aug 2013 05:52:54 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id r7sm10298914pao.18.2013.08.07.05.52.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Aug 2013 05:52:53 -0700 (PDT) From: Arun Kumar K To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: s.nawrocki@samsung.com, prathyush.k@samsung.com, arun.m@samsung.com, arunkk.samsung@gmail.com Subject: [PATCH] [media] exynos-gsc: fix s2r functionality Date: Wed, 7 Aug 2013 18:23:04 +0530 Message-Id: <1375879984-19052-1-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Prathyush K When gsc is in runtime suspended state, there is no need to call m2m_suspend during suspend and similarily, there is no need to call m2m_resume during resume if already in runtime suspended state. This patch adds the necessary conditions to achieve this. Signed-off-by: Prathyush K Signed-off-by: Arun Mankuzhi Signed-off-by: Arun Kumar K --- drivers/media/platform/exynos-gsc/gsc-core.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 559fab2..fe69eae 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1210,12 +1210,12 @@ static int gsc_resume(struct device *dev) spin_unlock_irqrestore(&gsc->slock, flags); return 0; } - gsc_hw_set_sw_reset(gsc); - gsc_wait_reset(gsc); - spin_unlock_irqrestore(&gsc->slock, flags); - return gsc_m2m_resume(gsc); + if (!pm_runtime_suspended(dev)) + return gsc_runtime_resume(dev); + + return 0; } static int gsc_suspend(struct device *dev) @@ -1227,7 +1227,10 @@ static int gsc_suspend(struct device *dev) if (test_and_set_bit(ST_SUSPEND, &gsc->state)) return 0; - return gsc_m2m_suspend(gsc); + if (!pm_runtime_suspended(dev)) + return gsc_runtime_suspend(dev); + + return 0; } static const struct dev_pm_ops gsc_pm_ops = {