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: 3015041 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A6D7F9F245 for ; Thu, 10 Oct 2013 10:02:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F3332032D for ; Thu, 10 Oct 2013 10:02:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1152420115 for ; Thu, 10 Oct 2013 10:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754404Ab3JJKCE (ORCPT ); Thu, 10 Oct 2013 06:02:04 -0400 Received: from mail-bk0-f54.google.com ([209.85.214.54]:55410 "EHLO mail-bk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327Ab3JJKCC (ORCPT ); Thu, 10 Oct 2013 06:02:02 -0400 Received: by mail-bk0-f54.google.com with SMTP id mz12so879138bkb.27 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=fOqNEMaNWo361i+kT5cevnWcwTjObXSoVRrOb2kEE89sSmGG3epHyS4glyeLQ05jxS 5N205FiVvT/8aWbtlCTXeN7R2Wy0NW6KYgbBruFeYUbTDESiIlHVykJLT86jfAiomFdn ZLZEjcUsI9oukdaIK6VM7N3g89C1Z2P0HinHfmN3lCZrJ+E0WSIrlJto4CbhEAahSxiv fe6sfF7v9Dn1rudoAPyzukY/W6lc3+sgxQWStteof1AqxVQooSPQRNBC2gjE/TiSVxkW GJXOLdCpBWEC1pCJFb/t3BWdY1bG33w/Ka7nwGsKVuh3KPCIkit+y5iCIa1hYPNdeskY wMbA== X-Gm-Message-State: ALoCoQnfxP/KgzHxkqfpuIeyI+0dMdCKaVxzesN+N5lp2M7R9hrgadNvOrxpNQ0rmMLw9WIeNfdV 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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; }