From patchwork Mon Apr 27 18:24:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Grygorii.Strashko@linaro.org" X-Patchwork-Id: 6282171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9989ABEEE1 for ; Mon, 27 Apr 2015 18:28:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF5F6203B5 for ; Mon, 27 Apr 2015 18:28:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC828203B1 for ; Mon, 27 Apr 2015 18:28:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ymnid-0001kP-Ai; Mon, 27 Apr 2015 18:25:23 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YmniF-0000VN-4v for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2015 18:25:00 +0000 Received: by laat2 with SMTP id t2so86570695laa.1 for ; Mon, 27 Apr 2015 11:24:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=93feexWu3JnL95UMJbYCXbbXUGTUFmrr8S4Ye2rNp04=; b=UQbykDzQ8inj3iWxmsvtQLk+4zVs8qB2zDQO7PmH6iE5pInoltChhYWh1m3yzn60EV zS1bbEGtzxLv/wMsOGdwPvonPIlK+ZValVNHX0iBafQiUulifjqGKDEKXwv2+VSHG1BG BUQRCeymSfAef7/YrcJySiHhq3c7X7DI7O6q9eq9lHOi0xlDkqdd+IjCPElDwJEyOf02 sv2fxI9cG/qfmYoN1saSakBDwRBTIgi8gKjr9eK+QIgJ9ts+DY+ILewpPzRE23bioMue UjOWxtvLSug+TBbVv2WfyuAe9UphOuTnG18gQWbctL602wgrlT9G9I5qTgh5HAo4ucHT cQtw== X-Gm-Message-State: ALoCoQkfmtuULSLNWeA/w5oZVm8NAPgamwpbq5KI0PSTwPCdX1z9fcDtdLrk1NX3TYELoUvV+ZF+ X-Received: by 10.112.148.101 with SMTP id tr5mr11519013lbb.0.1430159077013; Mon, 27 Apr 2015 11:24:37 -0700 (PDT) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id at2sm4953366lbc.12.2015.04.27.11.24.36 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 27 Apr 2015 11:24:36 -0700 (PDT) From: To: "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org Subject: [PATCH 1/3] PM / Sleep: Add macro to define common noirq system PM callbacks Date: Mon, 27 Apr 2015 21:24:30 +0300 Message-Id: <1430159072-31440-2-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430159072-31440-1-git-send-email-grygorii.strashko@linaro.org> References: <1430159072-31440-1-git-send-email-grygorii.strashko@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150427_112459_422291_5B501DDF X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Nishanth Menon , ulf.hansson@linaro.org, Kevin Hilman , Grygorii Strashko , Tony Lindgren , linux-kernel@vger.kernel.org, Santosh Shilimkar , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Grygorii Strashko The same approach is used as for the existing SET_SYSTEM_SLEEP_PM_OPS, but for noirq callbacks. New SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same function. Vice versa happens for ->resume_noirq, ->thaw_noirq and ->restore_noirq. Cc: Tony Lindgren Cc: Nishanth Menon Cc: Kevin Hilman Cc: Santosh Shilimkar Signed-off-by: Grygorii Strashko --- include/linux/pm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/pm.h b/include/linux/pm.h index 2d29c64..4890743 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -342,6 +342,18 @@ struct dev_pm_ops { #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) #endif +#ifdef CONFIG_PM_SLEEP +#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ + .suspend_noirq = suspend_fn, \ + .resume_noirq = resume_fn, \ + .freeze_noirq = suspend_fn, \ + .thaw_noirq = resume_fn, \ + .poweroff_noirq = suspend_fn, \ + .restore_noirq = resume_fn, +#else +#define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) +#endif + #ifdef CONFIG_PM #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ .runtime_suspend = suspend_fn, \