From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D77F3C04AA7 for ; Mon, 13 May 2019 10:21:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB6C920989 for ; Mon, 13 May 2019 10:21:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="duspvJgL"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="YronulV9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728852AbfEMKUm (ORCPT ); Mon, 13 May 2019 06:20:42 -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= 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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