From patchwork Sun Jan 15 20:03: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: 715474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3v1nSB0mVfz9t0P for ; Mon, 16 Jan 2017 07:06:18 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbdAOUGQ (ORCPT ); Sun, 15 Jan 2017 15:06:16 -0500 Received: from mailout1.hostsharing.net ([83.223.95.204]:55125 "EHLO mailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbdAOUGP (ORCPT ); Sun, 15 Jan 2017 15:06:15 -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 mailout1.hostsharing.net (Postfix) with ESMTPS id 1E82D101903B9; Sun, 15 Jan 2017 21:06:09 +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 F41E360BFC4E; Sun, 15 Jan 2017 21:06:07 +0100 (CET) X-Mailbox-Line: From 9deb018c4b1286ccd69bb264f1a784148c4b3d16 Mon Sep 17 00:00:00 2001 Message-Id: <9deb018c4b1286ccd69bb264f1a784148c4b3d16.1484486499.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Sun, 15 Jan 2017 21:03:45 +0100 Subject: [PATCH v5 6/8] PM / sleep: Define constant for direct_complete To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Andreas Noever , linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Chen Yu , Lee Jones Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 */