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: 20931 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4FD2425C9D for ; Thu, 10 Oct 2013 10:02:04 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id ar20sf8538741iec.6 for ; Thu, 10 Oct 2013 03:02:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=u2IAMX7rRzrqiE4s6zd5Q95q7cXhilSH8vEUmZnLQhU=; b=LUaxFQfS3wMoxsuPogcvYh8pBuF7YeNejiMXQUX+RkI0oehaIcibEkBKcwN8vtqlWc iouw6JcaBcTi9OdyonxZ2inwxxdEoCDPVsKJqv7NaLyWhdisvKVe7AvIci8VcNO/mLlj p1amNjhxmHdZmzcJAPN+4+XMNFZH0hcMZP8sYsjIen5XDBcUzfelY/qST0BDY4sI6msw Ex061OyjLyUR9jc0kMNYt+jKYvbZ8TAA9mCKIcCgexdhh2++0qJXnR0zIu+bsHJG2CNf kM+ABvMmGSnlVRGnQQ66UF5YwtmNbMuCQ/Bn/o2ZuuIron9kXjsFiTGLcGgTr8QbppAb IYTg== X-Received: by 10.182.186.73 with SMTP id fi9mr2315011obc.48.1381399322986; Thu, 10 Oct 2013 03:02:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.104 with SMTP id o8ls1032584qek.38.gmail; Thu, 10 Oct 2013 03:02:02 -0700 (PDT) X-Received: by 10.221.55.4 with SMTP id vw4mr6476989vcb.37.1381399322849; Thu, 10 Oct 2013 03:02:02 -0700 (PDT) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id o10si13899998vco.140.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 03:02:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.48; Received: by mail-vb0-f48.google.com with SMTP id w16so1407866vbf.21 for ; Thu, 10 Oct 2013 03:02:02 -0700 (PDT) X-Gm-Message-State: ALoCoQnAS3/o6opiq9GbNX9VNqM8D4YB/6FehGNlUS6UdgXv7Sh3mYcQuuHwrYAZ598zINz9WMSC X-Received: by 10.221.47.193 with SMTP id ut1mr11857398vcb.8.1381399322702; Thu, 10 Oct 2013 03:02:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp361913vcz; Thu, 10 Oct 2013 03:02:02 -0700 (PDT) X-Received: by 10.205.10.132 with SMTP id pa4mr11577915bkb.15.1381399321540; Thu, 10 Oct 2013 03:02:01 -0700 (PDT) Received: from mail-bk0-f46.google.com (mail-bk0-f46.google.com [209.85.214.46]) by mx.google.com with ESMTPS id ye9si6986742bkb.343.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 03:02:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.46 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.214.46; Received: by mail-bk0-f46.google.com with SMTP id 6so842918bkj.5 for ; Thu, 10 Oct 2013 03:02:01 -0700 (PDT) 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; }