From patchwork Wed Nov 27 15:34:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21814 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A77A623FE8 for ; Wed, 27 Nov 2013 15:35:28 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id lx4sf23817223iec.10 for ; Wed, 27 Nov 2013 07:35:28 -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=ixOFtcJ5q5fK5qw1/C61G899KJ8CvTpmeuXmaYEoTq8=; b=fjaxXLFBHCLZKQe3V3J+rgR5Zvly7w1X9/urKLKtwaSiPOQqyS/wy3S+vrkjeNbDRW JfWfizJqWfbGVUmNqewU14QCZtawjXXp1XPacHdUXe+GzefDCv9Qy7J7mHl9yojS75lf LgF5s8QouWnE/YY2oG5VQuQa5Y4JgJXVpTGpjRV3kArJfyQ+fvr6eflLohx/OmPSERJ2 iwqh70rF9Je7up+4KdUYQfdXA3rT9IU5DboMU2Q+3r9W3DdDOvkIjTzIp1lVnxvC4t1T KBGeEAhjQwF7VLBjxcJAzWwep07Jiph6DCuomCEn+FyVvCcm9eT7Bc480feM5lZ/Qvvz XJ5w== X-Gm-Message-State: ALoCoQmDdNnAz6egdGgVkf7VvGnZj7hyDGInOrFUEcS0Qc3AqsyGPS1XgxPP0sa2ayEr6AxDfLB7 X-Received: by 10.182.33.6 with SMTP id n6mr12970149obi.6.1385566528132; Wed, 27 Nov 2013 07:35:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.131.4 with SMTP id oi4ls499133qeb.76.gmail; Wed, 27 Nov 2013 07:35:27 -0800 (PST) X-Received: by 10.220.253.66 with SMTP id mz2mr35526115vcb.10.1385566527954; Wed, 27 Nov 2013 07:35:27 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id e3si21272308vek.55.2013.11.27.07.35.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so5054392veb.25 for ; Wed, 27 Nov 2013 07:35:27 -0800 (PST) X-Received: by 10.58.181.230 with SMTP id dz6mr840603vec.35.1385566527864; Wed, 27 Nov 2013 07:35:27 -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 u4csp294105vcz; Wed, 27 Nov 2013 07:35:27 -0800 (PST) X-Received: by 10.112.141.166 with SMTP id rp6mr1932531lbb.39.1385566527204; Wed, 27 Nov 2013 07:35:27 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx.google.com with ESMTPS id wf1si19322994lbb.48.2013.11.27.07.35.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.217.169 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id y6so5640650lbh.0 for ; Wed, 27 Nov 2013 07:35:26 -0800 (PST) X-Received: by 10.152.3.10 with SMTP id 10mr2048694lay.35.1385566526631; Wed, 27 Nov 2013 07:35:26 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id c15sm8352568lbq.11.2013.11.27.07.35.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:25 -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 , Kevin Hilman , Alan Stern Subject: [PATCH 2/5] PM / Runtime: Implement the pm_generic_runtime functions for CONFIG_PM Date: Wed, 27 Nov 2013 16:34:57 +0100 Message-Id: <1385566500-7666-3-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.128.180 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: , The pm_generic_runtime_suspend|resume functions were implemented within CONFIG_PM_RUNTIME. As we also may use runtime PM callbacks during system suspend, to put devices into low power state, we need to move the implementation of pm_generic_runtime_suspend|resume to CONFIG_PM. This change prevents the platform bus from by-passing driver's runtime PM callbacks while only CONFIG_PM_SLEEP and not CONFIG_PM_RUNTIME is being used. Cc: Kevin Hilman Cc: Alan Stern Signed-off-by: Ulf Hansson --- drivers/base/power/generic_ops.c | 4 ++-- include/linux/pm_runtime.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c index 8e78ad1..a4c6cb0 100644 --- a/drivers/base/power/generic_ops.c +++ b/drivers/base/power/generic_ops.c @@ -10,7 +10,7 @@ #include #include -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM /** * pm_generic_runtime_suspend - Generic runtime suspend callback for subsystems. * @dev: Device to suspend. @@ -48,7 +48,7 @@ int pm_generic_runtime_resume(struct device *dev) return ret; } EXPORT_SYMBOL_GPL(pm_generic_runtime_resume); -#endif /* CONFIG_PM_RUNTIME */ +#endif /* CONFIG_PM */ #ifdef CONFIG_PM_SLEEP /** diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 6fa7cea..16c9a62 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -23,6 +23,14 @@ usage_count */ #define RPM_AUTO 0x08 /* Use autosuspend_delay */ +#ifdef CONFIG_PM +extern int pm_generic_runtime_suspend(struct device *dev); +extern int pm_generic_runtime_resume(struct device *dev); +#else +static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } +static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } +#endif + #ifdef CONFIG_PM_RUNTIME extern struct workqueue_struct *pm_wq; @@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev); extern void __pm_runtime_disable(struct device *dev, bool check_resume); extern void pm_runtime_allow(struct device *dev); extern void pm_runtime_forbid(struct device *dev); -extern int pm_generic_runtime_suspend(struct device *dev); -extern int pm_generic_runtime_resume(struct device *dev); extern void pm_runtime_no_callbacks(struct device *dev); extern void pm_runtime_irq_safe(struct device *dev); extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); @@ -142,8 +148,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; } static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } static inline bool pm_runtime_enabled(struct device *dev) { return false; } -static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } -static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } static inline void pm_runtime_no_callbacks(struct device *dev) {} static inline void pm_runtime_irq_safe(struct device *dev) {}