Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5029671yba; Mon, 13 May 2019 04:16:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4ygecrqUZNCtcb4H6dJiSOW/lNE+7mjM7wpkPXRjC9WwlnvYCU1MMhpdQ0Cxf96p3xkxB X-Received: by 2002:a63:6841:: with SMTP id d62mr30559851pgc.17.1557746181626; Mon, 13 May 2019 04:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557746181; cv=none; d=google.com; s=arc-20160816; b=EoUbLzDqeRuNZzuivu/s/y3+7v3zIa61DoyljqB93KyRusZQQuZRq2KUmzDLofENRm +iiIXYnR+5nWK+sQD3FyxL946Ar4DHU1ApjQ8IELAeGVB8Z6pUNC4gmo7cIPJldRBa3X TMYKYdTVM1LTzdpRFTNXriU2a92EqCYLiTtFzZIaGmsSxcDyUqBhHIETku9O9kyHehea SfbfiAzcKX+8oPOPnXeT/k4LzD0HDqokC3eSl4LdTMNk2aupc8eCZsSJ18hrs+BCLh1g H5P1VT8TkFgSmUctWpsqfJ+XVUkgv56W0HFV54MyVgsld+ElWlmf1l+bdcqD5wk/oopI CM4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=T97xSy1vW+DBL6snfeY76f6f1W5QCcDHZrABfQe3crk=; b=KVqtRz+BDYM9ZKes+1XQmHe60GKrfX8YlVobHWJ9Mnct+SQYoI1QFIrrJ2VKd3As/K 1hhKQpJVhN9nP1dfa8daSMEdFqlSQlDqYSJ9XOOjLWYhK3pM02C1poWhim+fuKVxWhoU tiRtcLFvqQZe9k4+NlGLc0WMXUyopIYB4/skveQVEm6nxDr8svqIO+8Nsehj2pYJN63U xnclrzevTf19fw7V441fis966IYIHiyBST9IFq5VmD3AyPamsfksv967R7Tgx2FUkeRl MFpzcJDjlFAqn/wkOGdSMikRCwHxyS9nT2jKe21r88YOvlEuD1jfWlkr4sfYTQOuDURG iuDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=duspvJgL; dkim=pass header.i=@codeaurora.org header.s=default header.b=YronulV9; 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 6si15973705pgl.470.2019.05.13.04.16.05; Mon, 13 May 2019 04:16:21 -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=duspvJgL; dkim=pass header.i=@codeaurora.org header.s=default header.b=YronulV9; 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 S1728954AbfEMKUn (ORCPT + 99 others); Mon, 13 May 2019 06:20:43 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55850 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727690AbfEMKUm (ORCPT ); Mon, 13 May 2019 06:20:42 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 485E060C72; Mon, 13 May 2019 10:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557742841; bh=9qbE9DNsT7sHR+XIxHoeAAs2S5N1haUdw3Jt612GZno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=duspvJgLY6ATJbIzQz8rkrrAXzgIar+9cWfyNhcFuzMVsHfko64V6JZbz47QhQLDP mBVWr2Mfrj+Uv7ElZxVmIr8GWmAboZmnIp6qYW7miGGU7MZShzGncDctNG/mSSAmeZ wVp6/TpGrFYhAPRhAik1IE2sND+RkSc9dNqWEGBs= 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.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9532E60ACA; Mon, 13 May 2019 10:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557742840; bh=9qbE9DNsT7sHR+XIxHoeAAs2S5N1haUdw3Jt612GZno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YronulV9I4I0iQfXZGtNt4yyrD6vRlbWSVhE72Ry85twC9vCqzoE59jPstJfFfqKx SvXVTOwmU4oREFh/aMx4x5owCwOIKU4qQCpQ5ScqaGqYMG14S2vmgHLZ5hNyJcHVNi dcFLMPdyhUEQEsW7SKOIMfkCA4F8yp+0ymx+c044= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9532E60ACA 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=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, robh+dt@kernel.org, agross@kernel.org Cc: david.brown@linaro.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, rnayak@codeaurora.org, marc.w.gonzalez@free.fr, Sibi Sankar Subject: [PATCH v4 2/9] soc: qcom: rpmpd: Add support to set rpmpd state to max Date: Mon, 13 May 2019 15:50:08 +0530 Message-Id: <20190513102015.26551-3-sibis@codeaurora.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190513102015.26551-1-sibis@codeaurora.org> References: <20190513102015.26551-1-sibis@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rpmpd max state varies across SoCs and SoC families, add support in the driver to make it SoC/SoC family specific Signed-off-by: Sibi Sankar --- drivers/soc/qcom/rpmpd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c index 235d01870dd8..94015ece40e9 100644 --- a/drivers/soc/qcom/rpmpd.c +++ b/drivers/soc/qcom/rpmpd.c @@ -25,7 +25,7 @@ #define KEY_ENABLE 0x6e657773 /* swen */ #define KEY_FLOOR_CORNER 0x636676 /* vfc */ -#define MAX_RPMPD_STATE 6 +#define MAX_8996_RPMPD_STATE 6 #define DEFINE_RPMPD_CORNER_SMPA(_platform, _name, _active, r_id) \ static struct rpmpd _platform##_##_active; \ @@ -83,12 +83,14 @@ struct rpmpd { const int res_type; const int res_id; struct qcom_smd_rpm *rpm; + unsigned int max_state; __le32 key; }; struct rpmpd_desc { struct rpmpd **rpmpds; size_t num_pds; + unsigned int max_state; }; static DEFINE_MUTEX(rpmpd_lock); @@ -114,6 +116,7 @@ static struct rpmpd *msm8996_rpmpds[] = { static const struct rpmpd_desc msm8996_desc = { .rpmpds = msm8996_rpmpds, .num_pds = ARRAY_SIZE(msm8996_rpmpds), + .max_state = MAX_8996_RPMPD_STATE, }; static const struct of_device_id rpmpd_match_table[] = { @@ -225,8 +228,8 @@ static int rpmpd_set_performance(struct generic_pm_domain *domain, int ret = 0; struct rpmpd *pd = domain_to_rpmpd(domain); - if (state > MAX_RPMPD_STATE) - state = MAX_RPMPD_STATE; + if (state > pd->max_state) + state = pd->max_state; mutex_lock(&rpmpd_lock); @@ -287,6 +290,7 @@ static int rpmpd_probe(struct platform_device *pdev) } rpmpds[i]->rpm = rpm; + rpmpds[i]->max_state = desc->max_state; rpmpds[i]->pd.power_off = rpmpd_power_off; rpmpds[i]->pd.power_on = rpmpd_power_on; rpmpds[i]->pd.set_performance_state = rpmpd_set_performance; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project