From patchwork Fri Apr 3 12:57:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6156521 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 8D09FBF4A7 for ; Fri, 3 Apr 2015 12:58:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2FBF202BE for ; Fri, 3 Apr 2015 12:58:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD7BA203DC for ; Fri, 3 Apr 2015 12:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753076AbbDCM6a (ORCPT ); Fri, 3 Apr 2015 08:58:30 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:37888 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753027AbbDCM62 (ORCPT ); Fri, 3 Apr 2015 08:58:28 -0400 Received: by wibgn9 with SMTP id gn9so139266783wib.1; Fri, 03 Apr 2015 05:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=TKN3MGYxUU5mxs5/9gPhjF/0RMTMJz0MZAqlUvJUjw4=; b=erwEAj5ZEswfnbeADfhbdKjARw+WIHGEzsSKZEJfx3iZhcCJO9RirbsQhehLqghnjN zj53r3OjQSnxKJ/Eihd5Pmw8AtQa/aCaE/PL2Mw4bVyIH+WhqXdfoO2vmek/A8HrQObB A7+gq2t6uaH1JvYTPFMueka2WwcH3nTw1b6Qgt2GxlQP+PYhVCsODcqvz+T5jAf79c8j 4wsrMEgH+rXf4eVbzsZdLMUCH5Q4D8XevXdvlmBnGx4Ag9EMaNK9YT69bnx7CAbeeSnZ gQ2Kmb+KX9Wk/UPCXWdCVlkxLgU7eyqXPBOWcv1Rpg6AqJ9LNcRYCx/B0MZRXrz9bFYe uCxw== X-Received: by 10.180.13.145 with SMTP id h17mr5398625wic.38.1428065906482; Fri, 03 Apr 2015 05:58:26 -0700 (PDT) Received: from cizrna.lan ([109.72.12.93]) by mx.google.com with ESMTPSA id n6sm2664610wiw.6.2015.04.03.05.58.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Apr 2015 05:58:25 -0700 (PDT) From: Tomeu Vizoso To: linux-pm@vger.kernel.org Cc: Tomeu Vizoso , Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/7] Input: Implement dev_pm_ops.prepare in input_class Date: Fri, 3 Apr 2015 14:57:50 +0200 Message-Id: <1428065887-16017-2-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.3.4 In-Reply-To: <1428065887-16017-1-git-send-email-tomeu.vizoso@collabora.com> References: <1428065887-16017-1-git-send-email-tomeu.vizoso@collabora.com> 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 Have it return 1 so that input handlers don't block input devices from remaining runtime suspended when the system goes into a sleep state. For this to happen, the handler device needs to have runtime PM enabled. This can make resume times considerably shorter because these devices won't be resumed when the system is awaken. Signed-off-by: Tomeu Vizoso --- drivers/input/input.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/input/input.c b/drivers/input/input.c index cc357f1..9666309 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1748,6 +1748,15 @@ static const struct dev_pm_ops input_dev_pm_ops = { .poweroff = input_dev_poweroff, .restore = input_dev_resume, }; + +static int input_class_prepare(struct device *dev) +{ + return 1; +} + +static const struct dev_pm_ops input_class_pm_ops = { + .prepare = input_class_prepare, +}; #endif /* CONFIG_PM */ static struct device_type input_dev_type = { @@ -1767,6 +1776,9 @@ static char *input_devnode(struct device *dev, umode_t *mode) struct class input_class = { .name = "input", .devnode = input_devnode, +#ifdef CONFIG_PM_SLEEP + .pm = &input_class_pm_ops, +#endif }; EXPORT_SYMBOL_GPL(input_class);