From patchwork Tue Dec 10 13:37:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 22208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EFACC23908 for ; Tue, 10 Dec 2013 13:38:07 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z6sf10717662yhz.3 for ; Tue, 10 Dec 2013 05:38:07 -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=7pz5LBHZqnGQY1sue1RnX3wsU8E10jS0edNgFBoscG0=; b=ZsDJEOnf/aLTAveMCFQj7ShHRAhlfxA/av2zhekOSzX/6SwcNrM+BluzCU3Lo7dusR d1jnjt6PJzXokMcI4lzwh1Nk/+CHwevwYqOxVFEjzmF+uCXqkfocUPuQXGkTbBLsaZCZ 6QPgsGPjJGyc2UAOmEoRJ3WHhm8egUY2guYnQSKiF/+wEsTVpp+x4Xz61Qsi0slNrMh+ tpWEH1BnVbTj8t3qHmpYd6M0Kt0mnZqf8SgY45Y36cVr/n8xe7t697vGQMGrZV4CqVCU Xt8mK+FjXGA0x24dJYkWF6kxNLZ8BTf9kvYTvSm3lWsZRar3LwTlQShfryN7BqnICCkT bdxQ== X-Gm-Message-State: ALoCoQkh4+VK6CauTtSDqFFF/P3bgVLNz0k/PpdAg0Ii/WJpN/nc6iNjtBK1La0KrQ9QTEijDjjN X-Received: by 10.236.89.15 with SMTP id b15mr6214612yhf.13.1386682687789; Tue, 10 Dec 2013 05:38:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.10 with SMTP id q10ls2397977qen.0.gmail; Tue, 10 Dec 2013 05:38:07 -0800 (PST) X-Received: by 10.221.19.5 with SMTP id qi5mr13665215vcb.15.1386682687685; Tue, 10 Dec 2013 05:38:07 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id gw1si5139643vcb.137.2013.12.10.05.38.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 05:38:07 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 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.47; Received: by mail-vb0-f47.google.com with SMTP id q12so532898vbe.20 for ; Tue, 10 Dec 2013 05:38:07 -0800 (PST) X-Received: by 10.220.74.69 with SMTP id t5mr4514901vcj.18.1386682687577; Tue, 10 Dec 2013 05:38:07 -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 u4csp188572vcz; Tue, 10 Dec 2013 05:38:06 -0800 (PST) X-Received: by 10.152.143.101 with SMTP id sd5mr8246844lab.26.1386682686244; Tue, 10 Dec 2013 05:38:06 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id 9si5467382lal.102.2013.12.10.05.38.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 05:38:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.54 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id b8so2644113lan.41 for ; Tue, 10 Dec 2013 05:38:05 -0800 (PST) X-Received: by 10.152.116.65 with SMTP id ju1mr5281066lab.60.1386682685675; Tue, 10 Dec 2013 05:38:05 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id di11sm21862187lac.0.2013.12.10.05.38.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 05:38:04 -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 V2 2/3] PM / Runtime: Implement the pm_generic_runtime functions for CONFIG_PM Date: Tue, 10 Dec 2013 14:37:41 +0100 Message-Id: <1386682662-17633-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386682662-17633-1-git-send-email-ulf.hansson@linaro.org> References: <1386682662-17633-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.47 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 gives a power domain provision to invoke a platform driver's runtime PM callback from a power domain's system PM callback. This were earlier prevented by the platform bus, since it uses the pm_generic_runtime_suspend|resume functions as runtime PM callbacks. 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 5ee030a..a2e55bf 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) {}