All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Devi Priya <quic_devipriy@quicinc.com>,
	agross@kernel.org, andersson@kernel.org, lgirdwood@gmail.com,
	broonie@kernel.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Cc: quic_srichara@quicinc.com, quic_gokulsri@quicinc.com,
	quic_sjaganat@quicinc.com, quic_kathirav@quicinc.com,
	quic_arajkuma@quicinc.com, quic_anusha@quicinc.com,
	quic_ipkumar@quicinc.com
Subject: Re: [PATCH V2 4/6] regulator: qcom_smd: Add support to define the bootup voltage
Date: Wed, 22 Feb 2023 23:11:42 +0100	[thread overview]
Message-ID: <907628d1-b88d-5ac6-ed9d-7f63e2875738@linaro.org> (raw)
In-Reply-To: <20230217142030.16012-5-quic_devipriy@quicinc.com>



On 17.02.2023 15:20, Devi Priya wrote:
> Kernel does not know the initial voltage set by the bootloaders.
> During regulator registration, the voltage variable is just declared
> and it is zero. Based on that, the regulator framework considers current
> the voltage as zero and tries to bring up each regulator to minimum
> the supported voltage.
> 
> This introduces a dip in the voltage during kernel boot and gets
> stabilized once the voltage scaling comes into picture.
> 
> To avoid the voltage dip, adding support to define the
> bootup voltage set by the boodloaders and based on it, regulator
> framework understands that proper voltage is already set
> 
> Co-developed-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
> ---
Thinking about it again, this seems like something that could be
generalized and introduced into regulator core.. Hardcoding this
will not end well.. Not to mention it'll affect all mp5496-using
boards that are already upstream.

WDYT about regulator-init-microvolts Mark?

Konrad
>  Changes in V2:
> 	- Added the bootup voltages to s2 and l2 regulators
> 
>  drivers/regulator/qcom_smd-regulator.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
> index a40e66cea7e7..5f9fe6b9d368 100644
> --- a/drivers/regulator/qcom_smd-regulator.c
> +++ b/drivers/regulator/qcom_smd-regulator.c
> @@ -800,12 +800,13 @@ struct rpm_regulator_data {
>  	u32 id;
>  	const struct regulator_desc *desc;
>  	const char *supply;
> +	int boot_uV; /* To store the bootup voltage set by bootloaders */
>  };
>  
>  static const struct rpm_regulator_data rpm_mp5496_regulators[] = {
> -	{ "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smpa1, "s1" },
> -	{ "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2" },
> -	{ "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2" },
> +	{ "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smpa1, "s1", 875000  },
> +	{ "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2", 875000  },
> +	{ "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2", 2950000 },
>  	{}
>  };
>  
> @@ -1388,6 +1389,9 @@ static int rpm_regulator_init_vreg(struct qcom_rpm_reg *vreg, struct device *dev
>  	vreg->type	= rpm_data->type;
>  	vreg->id	= rpm_data->id;
>  
> +	if (rpm_data->boot_uV)
> +		vreg->uV = rpm_data->boot_uV;
> +
>  	memcpy(&vreg->desc, rpm_data->desc, sizeof(vreg->desc));
>  	vreg->desc.name = rpm_data->name;
>  	vreg->desc.supply_name = rpm_data->supply;

  reply	other threads:[~2023-02-22 22:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 14:20 [PATCH V2 0/6] Add regulator support for IPQ9574 SoC Devi Priya
2023-02-17 14:20 ` [PATCH V2 1/6] dt-bindings: soc: qcom: smd-rpm: Add IPQ9574 compatible Devi Priya
2023-02-18 10:20   ` Krzysztof Kozlowski
2023-02-17 14:20 ` [PATCH V2 2/6] regulator: qcom_smd: Add s1 sub-node to mp5496 regulator Devi Priya
2023-02-28 14:31   ` Rob Herring
2023-02-17 14:20 ` [PATCH V2 3/6] regulator: qcom_smd: Add MP5496 S1 regulator Devi Priya
2023-02-17 14:20 ` [PATCH V2 4/6] regulator: qcom_smd: Add support to define the bootup voltage Devi Priya
2023-02-22 22:11   ` Konrad Dybcio [this message]
2023-02-22 23:01     ` Mark Brown
2023-03-03 13:21       ` Devi Priya
2023-03-03 13:27         ` Konrad Dybcio
     [not found]           ` <11b05b9f-b969-6648-2204-2da5f8465c96@quicinc.com>
2023-03-07  6:55             ` Devi Priya
2023-03-08 10:27               ` Konrad Dybcio
2023-03-14 17:15                 ` Devi Priya
2023-03-18 14:08                   ` Konrad Dybcio
2023-03-27  8:40                     ` Devi Priya
2023-03-27  9:26                       ` Konrad Dybcio
2023-03-28  6:12                         ` Devi Priya
2023-03-28  8:28                           ` Konrad Dybcio
2023-04-03 14:07                             ` Devi Priya
2023-04-03 17:53                               ` Konrad Dybcio
2023-04-03 18:14                                 ` Mark Brown
2023-04-03 18:21                                   ` Konrad Dybcio
2023-04-03 18:28                                     ` Mark Brown
2023-02-17 14:20 ` [PATCH V2 5/6] arm64: dts: qcom: ipq9574: Add RPM related nodes Devi Priya
2023-02-17 14:50   ` Konrad Dybcio
2023-02-20 13:53     ` Devi Priya
2023-02-20 14:36       ` Konrad Dybcio
2023-02-20 15:22         ` Devi Priya
2023-02-17 14:20 ` [PATCH V2 6/6] arm64: dts: qcom: ipq9574: Add cpufreq support Devi Priya
2023-03-16  3:20 ` (subset) [PATCH V2 0/6] Add regulator support for IPQ9574 SoC Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=907628d1-b88d-5ac6-ed9d-7f63e2875738@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_anusha@quicinc.com \
    --cc=quic_arajkuma@quicinc.com \
    --cc=quic_devipriy@quicinc.com \
    --cc=quic_gokulsri@quicinc.com \
    --cc=quic_ipkumar@quicinc.com \
    --cc=quic_kathirav@quicinc.com \
    --cc=quic_sjaganat@quicinc.com \
    --cc=quic_srichara@quicinc.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.