From patchwork Thu Oct 10 10:01:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3015051 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4E7DDBF924 for ; Thu, 10 Oct 2013 10:02:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 357DF2032D for ; Thu, 10 Oct 2013 10:02:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DEB020324 for ; Thu, 10 Oct 2013 10:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754604Ab3JJKCE (ORCPT ); Thu, 10 Oct 2013 06:02:04 -0400 Received: from mail-bk0-f42.google.com ([209.85.214.42]:62878 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011Ab3JJKCC (ORCPT ); Thu, 10 Oct 2013 06:02:02 -0400 Received: by mail-bk0-f42.google.com with SMTP id my10so889480bkb.1 for ; Thu, 10 Oct 2013 03:02:01 -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=u2IAMX7rRzrqiE4s6zd5Q95q7cXhilSH8vEUmZnLQhU=; b=HJGyrpHT90Qbs1NPrtvK8mk7Pw8+yi2OpZtxs1+JiYyuVK3sSPKxO78by+ulfU6AuN pesWMmRTy4iH2LKH95qlhXNSxh2iSJ73gE1MR/+JJM3kOwu1onRqWM9HqkcuoM40wMln FEJmcB9/Zw4Ye1h/IVk8/XS/I5EJLISdo9cn5vjVOXNil3ROIsqwETGeCOjHrtxdviom t34i8tCS1FMKSMNEAvqsJHea9ba/IT09b/C7dsFcpZs6/oF68v+8Mp9NTcu8ZWFOu/6p 8HyUV1KV1WMgWA2VGYLvMgTQO+r9NOJa1IYLh1+kMlYFYcJjxCHie+MrK+0E3ZobBORn sXCw== X-Gm-Message-State: ALoCoQnPjcu5rwtl/x6/uyaKl0kzn3P5p8WDs2GDU9IWTYwjyckSaMBbJt2XkhJvQR1i2uEtkMWb X-Received: by 10.205.15.72 with SMTP id pt8mr11580837bkb.17.1381399320909; Thu, 10 Oct 2013 03:02:00 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id l5sm26653429bko.7.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 03:02:00 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Len Brown , Pavel Machek , " Rafael J. Wysocki" , Kevin Hilman , Alan Stern , Mika Westerberg , linux-pm@vger.kernel.org, Ulf Hansson Subject: [PATCH 1/2] PM / Runtime: Add helper function to get value of use_autosuspend Date: Thu, 10 Oct 2013 12:01:46 +0200 Message-Id: <1381399307-21534-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381399307-21534-1-git-send-email-ulf.hansson@linaro.org> References: <1381399307-21534-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 In some cases it will be useful to know whether a device has the autosuspend mode enabled. Provide a helper function that returns the current setting. Cc: Len Brown Cc: Pavel Machek Cc: Rafael J. Wysocki Cc: Kevin Hilman Cc: Alan Stern Cc: Mika Westerberg Cc: linux-pm@vger.kernel.org Signed-off-by: Ulf Hansson --- include/linux/pm_runtime.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 6fa7cea..bcc2ad4 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -91,6 +91,11 @@ static inline bool pm_runtime_status_suspended(struct device *dev) return dev->power.runtime_status == RPM_SUSPENDED; } +static inline bool pm_runtime_autosuspend_used(struct device *dev) +{ + return dev->power.use_autosuspend; +} + static inline bool pm_runtime_enabled(struct device *dev) { return !dev->power.disable_depth; @@ -140,6 +145,7 @@ static inline void device_set_run_wake(struct device *dev, bool enable) {} static inline bool pm_runtime_suspended(struct device *dev) { return false; } static inline bool pm_runtime_active(struct device *dev) { return true; } static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } +static inline bool pm_runtime_autosuspend_used(struct device *dev) { return false; } static inline bool pm_runtime_enabled(struct device *dev) { return false; } static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }