From patchwork Wed Nov 27 15:34:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21816 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0054823FE8 for ; Wed, 27 Nov 2013 15:35:38 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf18005034pdj.11 for ; Wed, 27 Nov 2013 07:35:38 -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=/fzmC+eDOLik2y4gUmQzXmsB/w+J8btCZv+6+USK6sk=; b=YcLsrLr1isqHO0RG9d7teOmbQHla0uqGJdGEdx4nhdreG9Xy0iP0DKlu9ILWGiV8X4 S+4QVVebypuPKjjXhnP02TDm2lzZTOxxDF9qc1bobLsV5LN7Hcrj32M7UHSnhYZ6rDEG S7q2XQKM/9ZyBpcQtsNovGNBpOjzlVugSjqccmFEaWY25eYU9Sny9Dpw9PREXpe/B3nL r6sMhlrRbVBQqY/sJ+VeuUJJToY54e50EI+dIPeFzTbvpyx1X4WvvEYnZ3WDgr2YEv51 KsJTbW+QIdKdN6O/xcbyuYvlDxD4D768IAbupcPdUH2dz6gcuhLYF+z8/EBLagEAQ6Ee W81g== X-Gm-Message-State: ALoCoQlPWDtboch+MyXaBMex0HpnHY/T6TUmYPYy7RQzJ5ssFN0QYfmCWWDZ0B18+EoJH373TVSA X-Received: by 10.66.20.100 with SMTP id m4mr12986601pae.36.1385566538094; Wed, 27 Nov 2013 07:35:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.7 with SMTP id k7ls3034170qed.96.gmail; Wed, 27 Nov 2013 07:35:38 -0800 (PST) X-Received: by 10.220.64.69 with SMTP id d5mr35543916vci.11.1385566537977; Wed, 27 Nov 2013 07:35:37 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id dh7si21276905vcb.38.2013.11.27.07.35.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:37 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.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.128.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so5132661veb.21 for ; Wed, 27 Nov 2013 07:35:37 -0800 (PST) X-Received: by 10.52.163.165 with SMTP id yj5mr693661vdb.42.1385566537894; Wed, 27 Nov 2013 07:35:37 -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 u4csp294117vcz; Wed, 27 Nov 2013 07:35:37 -0800 (PST) X-Received: by 10.152.1.197 with SMTP id 5mr20160413lao.0.1385566536996; Wed, 27 Nov 2013 07:35:36 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by mx.google.com with ESMTPS id le8si10894485lab.168.2013.11.27.07.35.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.47 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id ep20so5247273lab.20 for ; Wed, 27 Nov 2013 07:35:36 -0800 (PST) X-Received: by 10.152.9.9 with SMTP id v9mr302130laa.41.1385566536311; Wed, 27 Nov 2013 07:35:36 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id c15sm8352568lbq.11.2013.11.27.07.35.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:35 -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 4/5] PM / Sleep: Add macro to define common late/early system PM callbacks Date: Wed, 27 Nov 2013 16:34:59 +0100 Message-Id: <1385566500-7666-5-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.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 529657c..fb0f1db 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, \