Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp616710imm; Fri, 27 Jul 2018 03:06:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGz4ySedmIbaKzfGAwp0+GQl6uEy3r7QUKo5giq5wSO7o+BHwrESJphB//2zL0ibIf4NEy X-Received: by 2002:a65:460e:: with SMTP id v14-v6mr5343183pgq.177.1532686002447; Fri, 27 Jul 2018 03:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532686002; cv=none; d=google.com; s=arc-20160816; b=MSZC3JQzueVBzJtI6ZZI/sgTTh68rvykf5tjQC+DJXLgteUSvoSS48n02YO3hysxWG sgvPMvwiymkE0jiqs2+KAwUTJDlLnTRDSBKJXLawr8isYTrcBCqOyEF6z1eEP1o0SoAT OGMv1j9pDkcp3QB99e0FKAsWopWyZg9jrSj8vMbOC88qepDOtNP6wJBCCMoLU0sS8uW/ 9tqyyVwrlT1HBDL7V2zAupVMkORPN6nWymMqqYTgtIlLelmma+O+mWtS9S39Hz0NebLg boPeRw2ooYMQbwNK3P2Ji0E7pjD5qdXpUuBfHNpAuB5ngPCFYAUIWWceNfTzqtTKLnhI txhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=+DGmImuCKtx1PSrlW3fLyEgoRLjKQDv8qyFbtmgMruE=; b=wl3gT8anT+4cVVTZ9NHG7Ja+90N85VFlGdsPlRLKBRom19bBE//xt4Zif1q0EGAbyC d0QeWkey/tZ3aF6XPPanVsvhNJMVS6gzo5+2eagEUG1of8lPLlpPxfCFRnlvM/+BEMvE EphMWSg9TO/4XJgWR9+s7cxOptxrm9Ig3zBYkiv1nwqq18VI66SXbHxLVniEJnbkEI6s Th6PcPniihovWHjHpTxyxyBHmAq1PCKf7pzJm68YlEvsNKchNM5bclsMkSJ2WYiIhU93 OWPW3CysgKQV0djFT8a7kmbBWYcTY4oGvWjoJx765Jyy+GUb9infBRVm/O2xWvkrBcXN iCfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QRNGi+4g; dkim=pass header.i=@codeaurora.org header.s=default header.b=YOaTm4dU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i28-v6si3747668pfi.105.2018.07.27.03.06.27; Fri, 27 Jul 2018 03:06:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QRNGi+4g; dkim=pass header.i=@codeaurora.org header.s=default header.b=YOaTm4dU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389308AbeG0L0S (ORCPT + 99 others); Fri, 27 Jul 2018 07:26:18 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45348 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730717AbeG0L0S (ORCPT ); Fri, 27 Jul 2018 07:26:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 12C1E60B77; Fri, 27 Jul 2018 10:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532685907; bh=5QeO4p7JnfaRVjRzsqyJ7ke318vLCKCr53a1pr5g8fY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRNGi+4gSx2PJdpIizbXigsVBq8Xzoj0Gxg9sEZxIiusDGJmoKpyA2N/bcSJsX4FN RPDDI531c3+dRu6+IlnPnnTSLXL1IXavV7wVU3MwBviuK2VgdLl/tr2dgsrrTLEbjs zzzjHX+jIz5ru8kcpSqUYsZNs806GfteQBbpEUVo= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,FROM_LOCAL_NOVOWEL,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from rplsssn-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rplsssn@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 38FE8607B9; Fri, 27 Jul 2018 10:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532685905; bh=5QeO4p7JnfaRVjRzsqyJ7ke318vLCKCr53a1pr5g8fY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YOaTm4dUn0TeoAzWT5sQabIahC+gVxyRCoXz+6BLeSvo3KFTGs8de6zYeFa1BZuuu y29e7Dh86DerUmC9WJXGbTWU+p021lTOIp5axAxsDeLM66srMbePC0Nvv/4l6Ygo3N S99Z/83HHegCRu2OFZEK9ji37QfhWSc0STdYIMog= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 38FE8607B9 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rplsssn@codeaurora.org From: Raju P L S S S N To: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, sboyd@kernel.org, evgreen@chromium.org, dianders@chromium.org, mka@chromium.org, ilina@codeaurora.org, "Raju P.L.S.S.S.N" Subject: [PATCH v2 2/6] drivers: qcom: rpmh: export controller idle status Date: Fri, 27 Jul 2018 15:34:45 +0530 Message-Id: <1532685889-31345-3-git-send-email-rplsssn@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532685889-31345-1-git-send-email-rplsssn@codeaurora.org> References: <1532685889-31345-1-git-send-email-rplsssn@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lina Iyer Allow the controller state be read by platform drivers. This is useful for PM drivers which can choose to disallow idle modes when the controller is busy. Signed-off-by: Lina Iyer Signed-off-by: Raju P.L.S.S.S.N --- drivers/soc/qcom/rpmh.c | 13 +++++++++++++ include/soc/qcom/rpmh.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index c7beb68..2382276 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -511,3 +511,16 @@ int rpmh_invalidate(const struct device *dev) return ret; } EXPORT_SYMBOL(rpmh_invalidate); + +/** + * rpmh_ctrlr_idle: Return the controller idle status + * + * @dev: the device making the request + */ +int rpmh_ctrlr_idle(const struct device *dev) +{ + struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev); + + return rpmh_rsc_ctrlr_is_idle(ctrlr_to_drv(ctrlr)); +} +EXPORT_SYMBOL(rpmh_ctrlr_idle); diff --git a/include/soc/qcom/rpmh.h b/include/soc/qcom/rpmh.h index 619e07c..d445322 100644 --- a/include/soc/qcom/rpmh.h +++ b/include/soc/qcom/rpmh.h @@ -24,6 +24,8 @@ int rpmh_write_batch(const struct device *dev, enum rpmh_state state, int rpmh_invalidate(const struct device *dev); +int rpmh_ctrlr_idle(const struct device *dev); + #else static inline int rpmh_write(const struct device *dev, enum rpmh_state state, @@ -46,6 +48,9 @@ static inline int rpmh_flush(const struct device *dev) static inline int rpmh_invalidate(const struct device *dev) { return -ENODEV; } +static inline int rpmh_ctrlr_idle(const struct device *dev) +{ return -ENODEV; } + #endif /* CONFIG_QCOM_RPMH */ #endif /* __SOC_QCOM_RPMH_H__ */ -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project