From patchwork Sun Feb 12 16:07:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 9568445 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC69A60476 for ; Sun, 12 Feb 2017 16:10:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCE1028394 for ; Sun, 12 Feb 2017 16:10:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B188828399; Sun, 12 Feb 2017 16:10:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48B7E28394 for ; Sun, 12 Feb 2017 16:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbdBLQKI (ORCPT ); Sun, 12 Feb 2017 11:10:08 -0500 Received: from mailout2.hostsharing.net ([83.223.90.233]:32791 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751226AbdBLQKI (ORCPT ); Sun, 12 Feb 2017 11:10:08 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout2.hostsharing.net (Postfix) with ESMTPS id 0DF8C1037F6B4; Sun, 12 Feb 2017 17:10:07 +0100 (CET) Received: from localhost (3-38-90-81.adsl.cmo.de [81.90.38.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id D8068603E044; Sun, 12 Feb 2017 17:10:05 +0100 (CET) X-Mailbox-Line: From 996cae2518fb2bee8988481a18487b8aab4de2a0 Mon Sep 17 00:00:00 2001 Message-Id: <996cae2518fb2bee8988481a18487b8aab4de2a0.1486913733.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Sun, 12 Feb 2017 17:07:45 +0100 Subject: [PATCH v6 6/8] PM / sleep: Define constant for direct_complete To: Bjorn Helgaas Cc: Andreas Noever , linux-pci@vger.kernel.org, "Rafael J. Wysocki" Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chen Yu The PM core introduced the ability to keep devices runtime suspended during the entire system sleep process with commit aae4518b3124 ("PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily"). Drivers opt in to this so-called "direct_complete" mechanism by returning a positive value from their ->prepare hook. Usually this is achieved with a "return 1;" statement, which looks somewhat cryptic to readers not intimately familiar with the PM core. Improve clarity by defining a DPM_DIRECT_COMPLETE constant which drivers may use instead. Suggested-by: Rafael J. Wysocki Acked-by: Mika Westerberg Reviewed-by: Andy Shevchenko Cc: Lee Jones Signed-off-by: Chen Yu [LW: separate this hunk out of mfd patch, add commit message] Signed-off-by: Lukas Wunner --- include/linux/pm.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/pm.h b/include/linux/pm.h index f926af41e122..2d651a30b35c 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -788,4 +788,11 @@ enum dpm_order { DPM_ORDER_DEV_LAST, }; +/* + * Return this from system suspend/hibernation ->prepare() callback to + * request the core to leave the device runtime-suspended during system + * suspend if possible. + */ +#define DPM_DIRECT_COMPLETE 1 + #endif /* _LINUX_PM_H */