From patchwork Sat Aug 10 00:58:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 170991 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp10715976ile; Fri, 9 Aug 2019 17:58:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNIihj3hhyDlGdQpm7CIht0tjCTa1aZJpQGI+7Ssb2PgruZsw+8f+UhFazKcNE/TpbjWko X-Received: by 2002:a17:90a:2ec1:: with SMTP id h1mr12114267pjs.119.1565398733128; Fri, 09 Aug 2019 17:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565398733; cv=none; d=google.com; s=arc-20160816; b=0z+YCpd7adkrpYwIsFIdzmZlQ7maH0TSu3h0vvJXEqzQ1SETtBj5Q04R8FtMGjtqTx 291hvYFx6/Nd6P2tL50Pi8P6JIJq+Wg5TllRgax/8An/l8MhStdwhvjcyVMgyHDhpkJI 8o1PYfr+gZ6Xt/AGnISf3KfWf5g+MVuLFqWJnggxwXH990qIE9jEnjpaE2veZF5g2y3z Ryutqf99GIusEb3fwcoONsmpzU/RSzbSR8KB/C5H6gOOOQ7gdCmryZKWzmIlPb/QJX3m M1wxGfUQSFheSxgGj1482cGnBDCsbkDZ+eiFKEPRrC5axGER9EDktD9rYWV2os6zVhII V60Q== 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:dkim-signature; bh=13LVANg+Nc4wFsq66FKdnpOxcNuSuCvqcBPgkyt37SU=; b=dTkEZUQyrMQHgLSawBCMeX8mJudEJuG599fQ9SVI75EeNyK1vtxRO/z1uwPUKnhjcq KpKxm1Mt5sc1vmNRNLGi+CxKZFLbsbY9yukL1Qxe1AlI4xTQZp/kz+W3aww+e081Vpdh xBl9v/jzUej30iJivNmmATwjk/KNg6jvKDnP8E3WVwEzbI/dyN41sqr1EoZDmxc1k1q3 3n/9B77++e4jQpqU9iL/MQM+sL6M2g9UmTnhjTzO7R14TUpqX6llSlLlj4iI9iZVDRqz MkzNjdNVQgyG+UldGGI2VlhTe+tuMVEU3aSncqR4ogTLSw1R83GI4cyHlBfA986upqB0 T82A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fkj1qM9f; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17si25793031pgc.461.2019.08.09.17.58.52; Fri, 09 Aug 2019 17:58:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=@linaro.org header.s=google header.b=fkj1qM9f; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726219AbfHJA6w (ORCPT + 11 others); Fri, 9 Aug 2019 20:58:52 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:40974 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfHJA6w (ORCPT ); Fri, 9 Aug 2019 20:58:52 -0400 Received: by mail-qk1-f195.google.com with SMTP id g17so2401634qkk.8 for ; Fri, 09 Aug 2019 17:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=13LVANg+Nc4wFsq66FKdnpOxcNuSuCvqcBPgkyt37SU=; b=fkj1qM9fpuWVUyr8YFX96K/2OyizzEfajg6DpswTKkG/OhVeSk2Fc+uduUGyGafahx qEncxtkTPQmbq2yn6z4WOIm34roKXlIk1qnKVZx26SDb6Zu60Do/RIPcilBsUR3n6COx LdvK6eX0x75jB5f0AfwKR3PkNk1jVmVFnPUOUNnHvlavHjYrazxS9c7jJxYsn6vPy/Nh xdDHeO2W78Q8iIf/uQqfICn3+ujmhZxFZK66apZFPSas95MfmuIrSjcSgzIMf7wyyiPS dGz3da4NQjrVYfK6kI8mF4S2uF7QVTLAQ9N4Do7DPs5Kgyszx+8eBVLfOgOIjsJWR0+X XngQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=13LVANg+Nc4wFsq66FKdnpOxcNuSuCvqcBPgkyt37SU=; b=bramyJozsIEeScA7TZGFhVaofFEJWdyq6rKsmp7s8ENs1Y6WdRGSW48aAqBDyDgbQa hYEcfeSm++CuRhyb+u/zM69Ycin+m6vmBsSQoAacUiGcfwqT7RZcmuD4COxSrlA+X7p+ NYal3BDHm7KyHUTkWd2rdPf8iAlni/gsngCH7uCpf2Zw+iKAPCg1J4ca+yHt+jtAl4Uz 6dI/b+RHvcSNpzr4n+DHvFduGj9+NeFsYJ0LQqsk7MDP6vzGIn8avu1fLGrR4AcRhb5T ykywrzbuMp04lLxCC39X+V8KmKAfxfg4uNq9PieAw/Nnpp3s6AkPl8wVzupp5G+mC0ja RcLQ== X-Gm-Message-State: APjAAAV9YxYXhU/daIQ8/LqlG6Td/BdxCkIY8Ene7QQhwMiqtqeps2sJ t8D/FicLZrxCOf63B8cUF7rujQ== X-Received: by 2002:a37:6905:: with SMTP id e5mr14664658qkc.121.1565398731271; Fri, 09 Aug 2019 17:58:51 -0700 (PDT) Received: from Thara-Work-Ubuntu.fios-router.home (pool-71-255-245-97.washdc.fios.verizon.net. [71.255.245.97]) by smtp.googlemail.com with ESMTPSA id t9sm4603105qtr.29.2019.08.09.17.58.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Aug 2019 17:58:50 -0700 (PDT) From: Thara Gopinath To: qualcomm-lt@lists.linaro.org, linux-pm@vger.kernel.org Cc: bjorn.andersson@linaro.org, ulf.hansson@linaro.org, rnayak@codeaurora.org Subject: [PATCH 2/4] soc: qcom: rpmhpd: Introduce function to retrieve power domain performance state count Date: Fri, 9 Aug 2019 20:58:45 -0400 Message-Id: <1565398727-23090-3-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1565398727-23090-1-git-send-email-thara.gopinath@linaro.org> References: <1565398727-23090-1-git-send-email-thara.gopinath@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Populate .get_performace_state_count in genpd ops to retrieve the count of performance states supported by a rpmh power domain. Signed-off-by: Thara Gopinath --- drivers/soc/qcom/rpmhpd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.1.4 diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index 5741ec3..c3ceffd 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -285,6 +285,15 @@ static unsigned int rpmhpd_get_performance_state(struct generic_pm_domain *genpd return dev_pm_opp_get_level(opp); } +static int rpmhpd_performance_states_count(struct generic_pm_domain *domain, + unsigned int *count) +{ + struct rpmhpd *pd = domain_to_rpmhpd(domain); + + *count = pd->level_count; + return 0; +} + static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd) { int i; @@ -373,6 +382,8 @@ static int rpmhpd_probe(struct platform_device *pdev) rpmhpds[i]->pd.power_on = rpmhpd_power_on; rpmhpds[i]->pd.set_performance_state = rpmhpd_set_performance_state; rpmhpds[i]->pd.opp_to_performance_state = rpmhpd_get_performance_state; + rpmhpds[i]->pd.get_performance_state_count = + rpmhpd_performance_states_count; pm_genpd_init(&rpmhpds[i]->pd, NULL, true); data->domains[i] = &rpmhpds[i]->pd;