From patchwork Tue Dec 10 13:37:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 22210 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C4F9E23FD8 for ; Tue, 10 Dec 2013 13:38:09 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id gq1sf18637066obb.10 for ; Tue, 10 Dec 2013 05:38:09 -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=0wPZwZprVS2zko4IC+cMIewjDmXfNf736nP1MyqDF8w=; b=hiHg685TWvBX1+aTci5C5kls2tSxpKVQK5y2B2Q5fGIDw3WccuXItQWG5Q9fzR8Lne TVUiCA4JtxP2FpHewaGR46GTXOsc8kuRJPnOHbJhMD/xL1GpxyWyx4/83MwC0ISo+KpY 2CKts5mDBG84i4STMTN8FhIFz5Y8a+rLFjvtaUZvU5E5a9rMqlOIYF0balx+axRaEWFD JaWzuehx95SkRxJdOTiDbfyGY8hbcVevSKzesPobC6u03VweRQid+yvS/z4cEhCbRvrd T+wFxUDvWHzKlJ5h2pqHIkLkl7Z82It8gWQCLjZGY0cq/2PJCNtVCVIeQD2vuLcNgFzr /eFA== X-Gm-Message-State: ALoCoQl/2TQQuw48zAdyWSfrkA8li+5sRBD9sXIyWO00VjJTryi8BR5G/WrWrtg54soAEKOAzGlQ X-Received: by 10.42.85.148 with SMTP id q20mr7209770icl.22.1386682689399; Tue, 10 Dec 2013 05:38:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.5 with SMTP id ky5ls2348463qeb.26.gmail; Tue, 10 Dec 2013 05:38:09 -0800 (PST) X-Received: by 10.220.164.202 with SMTP id f10mr854758vcy.25.1386682689279; Tue, 10 Dec 2013 05:38:09 -0800 (PST) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id gs2si5144906vdc.44.2013.12.10.05.38.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 05:38:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lf12so4486911vcb.21 for ; Tue, 10 Dec 2013 05:38:09 -0800 (PST) X-Received: by 10.220.11.7 with SMTP id r7mr14042565vcr.12.1386682689186; Tue, 10 Dec 2013 05:38:09 -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 u4csp188578vcz; Tue, 10 Dec 2013 05:38:08 -0800 (PST) X-Received: by 10.152.116.65 with SMTP id ju1mr5281188lab.60.1386682688300; Tue, 10 Dec 2013 05:38:08 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id a4si5462332laf.158.2013.12.10.05.38.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 05:38:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.53 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id mc6so2399406lab.26 for ; Tue, 10 Dec 2013 05:38:07 -0800 (PST) X-Received: by 10.152.115.202 with SMTP id jq10mr4216675lab.69.1386682687769; Tue, 10 Dec 2013 05:38:07 -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.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 05:38:07 -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 3/3] PM / Sleep: Add macro to define common late/early system PM callbacks Date: Tue, 10 Dec 2013 14:37:42 +0100 Message-Id: <1386682662-17633-4-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.220.176 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: , We use the same approach as for the existing SET_SYSTEM_SLEEP_PM_OPS, but for the late and early callbacks instead. The new SET_LATE_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will point ->suspend_late, ->freeze_late and ->poweroff_late to the same function. Vice verse happens for ->resume_early, ->thaw_early and ->restore_early. Cc: Kevin Hilman Cc: Alan Stern Signed-off-by: Ulf Hansson --- include/linux/pm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/pm.h b/include/linux/pm.h index 7a830a7..8c6583a 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -311,6 +311,18 @@ struct dev_pm_ops { #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) #endif +#ifdef CONFIG_PM_SLEEP +#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ + .suspend_late = suspend_fn, \ + .resume_early = resume_fn, \ + .freeze_late = suspend_fn, \ + .thaw_early = resume_fn, \ + .poweroff_late = suspend_fn, \ + .restore_early = resume_fn, +#else +#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) +#endif + #ifdef CONFIG_PM_RUNTIME #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ .runtime_suspend = suspend_fn, \