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: 6282151 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-pm@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 8A0CFBEEE1 for ; Mon, 27 Apr 2015 18:26:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC6EB203B5 for ; Mon, 27 Apr 2015 18:26:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE1DC203C1 for ; Mon, 27 Apr 2015 18:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964867AbbD0S0I (ORCPT ); Mon, 27 Apr 2015 14:26:08 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:35040 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964987AbbD0SYi (ORCPT ); Mon, 27 Apr 2015 14:24:38 -0400 Received: by labbd9 with SMTP id bd9so86572936lab.2 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=beqOmA8MTP6BzdtDvOT3RqXdp81xkkuSmScVgeWU+FyJvZjqfw6wMuYq+bsTTgr5AY izDY2cxP+lQ6joc/K/6PCuz6cCnIr0UDXU8i0PDiYLBckTDWjPn6xFhGrXHLzD09bv8r GAaJ0i1/imv6PVUYe9nSQFgk53/pP4bwB6QQIJMUNckVxsfdQL1coLFeY8LQOdaFQuJ/ gTj5gG6ks3oXopjt39ZN8fATswUM4u95+HsvL+CbJ31z0DOPkDsIA2Y4ZP/r0aIkM1NM wlaqk4pySnPYFw7So03jf7pnvcAcf537beJM/gOxSIIJ55SHrchAyyJMi7Y1ClX9SnRI t4ow== X-Gm-Message-State: ALoCoQmL3/NQIHZXSUZWgDsirNv33/1UEQ8l+FQtWiiceEeoxY+O/Fty4W/eDCeFySp126kG6Rh1 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 Cc: ulf.hansson@linaro.org, , , , Grygorii Strashko , Tony Lindgren , Nishanth Menon , Kevin Hilman , Santosh Shilimkar 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> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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, \