From patchwork Wed Oct 11 07:24:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 115517 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp438427qgn; Wed, 11 Oct 2017 00:25:50 -0700 (PDT) X-Received: by 10.101.70.76 with SMTP id k12mr14674686pgr.19.1507706750295; Wed, 11 Oct 2017 00:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507706750; cv=none; d=google.com; s=arc-20160816; b=UyNZS+kplTOnE69McAwLntptsO2mL3aEB5g7Lu1TnuPdWxJ01c1lT5wb96tXIh9Cuy jsCFDbLk+SjPshha1OXNc2J/4D1KwboUSCR3K6xgA9k7ZYzPaerWOWgq/k56kpuDhzrE hJcL0+FfyYTniJZ6lPo+cC3I9+eJrDjpD+MfhN0DqSsr9JC7+1AiI2E43KhvBaZ+rsWK nNjDrvFsOeWwpAmanarBI3jVR1VZ6GRjW2xMhFI92Kj6EkJcW8eyNVQSjh7iOwJzxmhF p7geH+s58AzMRoPBhZPbRcv2fNvw4g7E/AWnv11sl6NBsPVaD5916gfU91DevFqMKEff VrIA== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Hdt5aCKJmcsbnAos6SAKj3IrMUdKUHergXtUJ6NC99s=; b=DjOBigmOA5kLAEw2u+suTpdL7yEuX3nfBxcyQTnwglFmEj667J56gZbrs5KLgvdnZq aKFy7ul83rmslIfroqsfHQmTthZe5LOk6PwE7hJXM5lEIazN8dtqw4BQwpSM6u3PgiVN FORSdSYzM2yPORrohaxeP1upqiRTa0y1NAQTJXK1dB7+GDXk1Rs+SCus5Lk9dOKh6rt0 2eP6oINWfXJo20V/lzz21rUPsEUFZYLurHdNhMAtCU7fvQM1+VCDAUAnDHNqcLuPNXTm 3RFIzPhWmsDtqzOD1b11kzaSICRX6STpgkQ6m2ho1OCiRLysiYgH5hLoawDq5/PQ1tNt oRxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W/X7qlLe; 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 y9si11066262pli.234.2017.10.11.00.25.50; Wed, 11 Oct 2017 00:25:50 -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=W/X7qlLe; 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 S1757272AbdJKHZs (ORCPT + 12 others); Wed, 11 Oct 2017 03:25:48 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:44147 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757076AbdJKHZB (ORCPT ); Wed, 11 Oct 2017 03:25:01 -0400 Received: by mail-pg0-f52.google.com with SMTP id j3so553747pga.1 for ; Wed, 11 Oct 2017 00:25:00 -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 :in-reply-to:references; bh=Hdt5aCKJmcsbnAos6SAKj3IrMUdKUHergXtUJ6NC99s=; b=W/X7qlLej8TJPaza4tKeXcgeljfRfwnf7GdYYLC7Zc4YpBDrX217rp5s0sjGe0SUD3 So3SWHw/6XwfHbQ3W+QJ2Lox0oL6289GPv/FuhNaSjBM/xHnBOMiKONJ37ScoQskpuyL 1wHKmbRLeWDKoi7GNyXcAWnUkMU+Wrr2QEEfo= 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:in-reply-to:references; bh=Hdt5aCKJmcsbnAos6SAKj3IrMUdKUHergXtUJ6NC99s=; b=lwbRa9tEYK4tJJyqHACDs7OBDgfNKpt76Gk4GJ+jb/Ll0A1PJC3Usv6eLM5JzMjunX rz7dvQVSExVIbvg4gqAY3YDgW0ztLLT0cWwh3I42fjyXIAekR7HO49ujHpIRrAELg5Zh 64L9slfOK+vNfPhnKUH1unTGwPsepFv7VPgyYZPehgAu97T7Z/x2jUN/jt31HCaKRlYr Xzhuaw751RyxV4tuuVo8SQjR0ar0SEjxvOwuyHOFr4IayP+osZjUtsiZyLdy6iYSEe1U 3L8NlMBGM02hz6V6yMaLGFa9axLFD4/N6b5jvoIaSRWGWN4QO2WYv7Yo40tK3ke0cI2J /quA== X-Gm-Message-State: AMCzsaXhNukwDvQ8i0caX7s5egNiYwUNWTqRs7WZvAWqr2oVEuIrEZFm V6giol5dYrtcQs7cmHSbM3iNPQ== X-Google-Smtp-Source: AOwi7QCUbdC4HqGqaeBVzVeExt5aOhc0KrnrbBqu2yE1d1ryrTGkxzva6XOy+mVJA3TRH2jg8TvKtQ== X-Received: by 10.98.53.1 with SMTP id c1mr99266pfa.248.1507706700323; Wed, 11 Oct 2017 00:25:00 -0700 (PDT) Received: from localhost ([122.172.169.205]) by smtp.gmail.com with ESMTPSA id n27sm23664402pfi.11.2017.10.11.00.24.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Oct 2017 00:24:59 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , ulf.hansson@linaro.org, Kevin Hilman , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Nishanth Menon , robh+dt@kernel.org, lina.iyer@linaro.org, rnayak@codeaurora.org, sudeep.holla@arm.com, linux-kernel@vger.kernel.org, Len Brown , Pavel Machek , Andy Gross , David Brown Subject: [PATCH V11 5/7] soc: qcom: rpmpd: Add support for set performance state Date: Wed, 11 Oct 2017 12:54:17 +0530 Message-Id: <5122d00c2f3c0ba076fd7879a4cc397183ccfab2.1507703370.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.rc1.236.g92ea95045093 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rajendra Nayak NOT FOR MERGE. With genpd now expecting power domain drivers supporting performance state to support set performance state callbacks, add support for it in the rpmpd driver. Signed-off-by: Rajendra Nayak Signed-off-by: Viresh Kumar --- drivers/soc/qcom/rpmpd.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.7.4 diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c index 0958d7693c4f..34d2eb4e75bf 100644 --- a/drivers/soc/qcom/rpmpd.c +++ b/drivers/soc/qcom/rpmpd.c @@ -230,6 +230,28 @@ static int rpmpd_power_off(struct generic_pm_domain *domain) return ret; } +static int rpmpd_set_performance(struct generic_pm_domain *domain, + unsigned int state) +{ + int ret = 0; + struct rpmpd *pd = domain_to_rpmpd(domain); + + mutex_lock(&rpmpd_lock); + + pd->corner = state; + + if (!pd->enabled && (pd->key != KEY_FLOOR_CORNER)) + goto out; + + ret = rpmpd_aggregate_corner(pd); + +out: + mutex_unlock(&rpmpd_lock); + + return ret; +} + + static int rpmpd_probe(struct platform_device *pdev) { int i; @@ -267,6 +289,7 @@ static int rpmpd_probe(struct platform_device *pdev) rpmpds[i]->rpm = rpm; rpmpds[i]->pd.power_off = rpmpd_power_off; rpmpds[i]->pd.power_on = rpmpd_power_on; + rpmpds[i]->pd.genpd_set_performance_state = rpmpd_set_performance; pm_genpd_init(&rpmpds[i]->pd, NULL, true); data->domains[i] = &rpmpds[i]->pd;