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: 9517687 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 D42FC601B7 for ; Sun, 15 Jan 2017 20:06:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FBF2283F6 for ; Sun, 15 Jan 2017 20:06:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8468E283FB; Sun, 15 Jan 2017 20:06:28 +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 F332D283F6 for ; Sun, 15 Jan 2017 20:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbdAOUGQ (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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 */