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: 6282141 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B10DF9F313 for ; Mon, 27 Apr 2015 18:26:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBFEE203A9 for ; Mon, 27 Apr 2015 18:26:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23C3B203B1 for ; Mon, 27 Apr 2015 18:26:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964936AbbD0S0I (ORCPT ); Mon, 27 Apr 2015 14:26:08 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:32798 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964979AbbD0SYi (ORCPT ); Mon, 27 Apr 2015 14:24:38 -0400 Received: by layy10 with SMTP id y10so86639785lay.0 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=Cv7dqAtTcTA9sw38JXfza6cxL2FlhoLJWP75ehrZnfH58P7iYrXy3AKhexxHJJ+4+q FTtN26D8rloqKQ3woBosECwQoilqWdJx9LO/+mobK4+YamsiCINNcdIdWv3FhYSGyWWb bDjh7O9koN3u8OLpRIu99r0xADyWW4B4FVFBPE5UyTZl5iSVrGylEGEH5U01Fy4alCge Eul/BL7DSMpx4whwoKmFiZiAKfgMU77j45M+ImzMul+0nyiCdsl6cYm75KX2TRjl3dgw bqHh2k1x9txmFYuadwJDqfepSLOjIoNZIYKtJuThPRJBYD7etcSSOKUU7xdzPmPliWlh Q57Q== X-Gm-Message-State: ALoCoQk9uKmdclp6x/f7XOAQcrc1MwilB7noHIEjrdKb36SfYYrkedFIGwfVOnbANqEl7EGqpMTg 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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, \