From patchwork Wed Nov 27 15:35:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21817 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 40CF423FE8 for ; Wed, 27 Nov 2013 15:35:46 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id md12sf18683007pbc.8 for ; Wed, 27 Nov 2013 07:35:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=CSJfy5ToIckyxg4E7fLpPtRpdBlTsAgxktH3hJHy40I=; b=UuoxRntWyawxxxgWUy0XOBObqb9LCwGzmO8xhr4OWyzrFwUyWEsQVldztviUZF0a0+ PF3uXRSurwlPUhVphgqLUdvdKJCJ68/cFdKYdKlsvAIzROTe1Ny2Vt+z7C4VM1kr1LLm ISpuyUlyEFWLCmHBtk9NNGAKJKyP426aZPHDEYz9qCuJxzchfpMikg61sUc3jOps4/CN yU/4pVU7VALZP3fYhj2HLTYOdPuEK1jHSPwlvD8f/oTqsbkXR6SuISmUblJuCSLGwYPH YYjbCjI3TCdbQRc19vqCWPpM+xB9BCdMkN5PLLwiAwbvQy+gJ6/AWHiCRCjkQtK8SRl/ qFJA== X-Gm-Message-State: ALoCoQnUbXMLNweHV02TOaVhYSY0rTIoM9oCCiw5gx2aj+0EC3vgWMS4/LjWHbTrApSiDmfwZcAq X-Received: by 10.66.250.200 with SMTP id ze8mr1855597pac.29.1385566545512; Wed, 27 Nov 2013 07:35:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.49 with SMTP id f17ls2403307qey.54.gmail; Wed, 27 Nov 2013 07:35:45 -0800 (PST) X-Received: by 10.58.217.169 with SMTP id oz9mr375000vec.42.1385566545389; Wed, 27 Nov 2013 07:35:45 -0800 (PST) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id v5si21275254ves.42.2013.11.27.07.35.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id q12so5169054vbe.30 for ; Wed, 27 Nov 2013 07:35:45 -0800 (PST) X-Received: by 10.58.46.18 with SMTP id r18mr35262194vem.4.1385566545267; Wed, 27 Nov 2013 07:35:45 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp294124vcz; Wed, 27 Nov 2013 07:35:44 -0800 (PST) X-Received: by 10.112.143.3 with SMTP id sa3mr28520373lbb.12.1385566544277; Wed, 27 Nov 2013 07:35:44 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id kk3si19312717lbc.137.2013.11.27.07.35.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.45 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id eh20so5419909lab.32 for ; Wed, 27 Nov 2013 07:35:43 -0800 (PST) X-Received: by 10.152.2.197 with SMTP id 5mr7524940law.17.1385566543707; Wed, 27 Nov 2013 07:35:43 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id c15sm8352568lbq.11.2013.11.27.07.35.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:42 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ulf Hansson , David Airlie , Kukjin Kim , linux-samsung-soc@vger.kernel.org, Kevin Hilman , Alan Stern Subject: [PATCH 5/5] drm/exynos: Convert to suspend_late/resume_early callbacks for fimc Date: Wed, 27 Nov 2013 16:35:00 +0100 Message-Id: <1385566500-7666-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1385566500-7666-1-git-send-email-ulf.hansson@linaro.org> References: <1385566500-7666-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , To simplify code for system suspend, convert the .suspend|resume callbacks into .suspend_late|resume_early. In general this could be convenient for any driver that supports both system PM and runtime PM. Move the runtime PM callbacks to be implemented within CONFIG_PM, to make them available for system PM. Use pm_generic_suspend_late_runtime and pm_generic_resume_early_runtime as the new callbacks. Cc: David Airlie Cc: Kukjin Kim Cc: linux-samsung-soc@vger.kernel.org Cc: Kevin Hilman Cc: Alan Stern Cc: Rafael J. Wysocki Cc: Pavel Machek Cc: Len Brown Signed-off-by: Ulf Hansson --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 33 ++++-------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 8adfc8f..7aa17a3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1888,33 +1888,7 @@ static int fimc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int fimc_suspend(struct device *dev) -{ - struct fimc_context *ctx = get_fimc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (pm_runtime_suspended(dev)) - return 0; - - return fimc_clk_ctrl(ctx, false); -} - -static int fimc_resume(struct device *dev) -{ - struct fimc_context *ctx = get_fimc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (!pm_runtime_suspended(dev)) - return fimc_clk_ctrl(ctx, true); - - return 0; -} -#endif - -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int fimc_runtime_suspend(struct device *dev) { struct fimc_context *ctx = get_fimc_context(dev); @@ -1935,8 +1909,9 @@ static int fimc_runtime_resume(struct device *dev) #endif static const struct dev_pm_ops fimc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(fimc_suspend, fimc_resume) - SET_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_generic_suspend_late_runtime, + pm_generic_resume_early_runtime) + SET_PM_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL) }; static const struct of_device_id fimc_of_match[] = {