From: David Collins <quic_collinsd@quicinc.com>
To: <quic_fenglinw@quicinc.com>, Andy Gross <agross@kernel.org>,
"Bjorn Andersson" <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>, <kernel@quicinc.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>, <quic_subbaram@quicinc.com>,
<quic_jprakash@quicinc.com>
Subject: Re: [PATCH 3/4] regulator: qcom-rpmh: add support for pm8010 regulators
Date: Mon, 11 Dec 2023 18:44:52 -0800 [thread overview]
Message-ID: <e1ea82cb-e812-9a1e-3c4d-7f468f5069e9@quicinc.com> (raw)
In-Reply-To: <20231211-pm8010-regulator-v1-3-571e05fb4ecc@quicinc.com>
On 12/10/23 19:17, Fenglin Wu via B4 Relay wrote:
> From: Fenglin Wu <quic_fenglinw@quicinc.com>
>
> Add RPMH regulators exposed by Qualcomm Technologies, Inc. PM8010
> PMIC. It has 7 LDOs with 3 different types, LDO1 - LDO2 are L502
> NMOS LDOs, LDO5 and LDO7 are L502 PMOS LDOs, LDO3/LDO4/LDO6 are
> L502 PMOS LDO for low noise applications. Also, LDO3 - LDO7 don't
> support LPM.
>
> Suggested-by: David Collins <quic_collinsd@quicinc.com>
> Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Reviewed-by: David Collins <quic_collinsd@quicinc.com>
> ---
> drivers/regulator/qcom-rpmh-regulator.c | 62 +++++++++++++++++++++++++++++++++
> 1 file changed, 62 insertions(+)
>
> diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
> index 43b45feb02e6..80e304711345 100644
> --- a/drivers/regulator/qcom-rpmh-regulator.c
> +++ b/drivers/regulator/qcom-rpmh-regulator.c
> @@ -511,6 +511,14 @@ static const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = {
> [REGULATOR_MODE_FAST] = -EINVAL,
> };
>
> +static const int pmic_mode_map_pmic5_ldo_hpm[REGULATOR_MODE_STANDBY + 1] = {
Minor: This is fine as-is. However, it might be a bit better with the
name: "pmic_mode_map_pmic5_ldo_hpm_only".
> + [REGULATOR_MODE_INVALID] = -EINVAL,
> + [REGULATOR_MODE_STANDBY] = -EINVAL,
> + [REGULATOR_MODE_IDLE] = -EINVAL,
> + [REGULATOR_MODE_NORMAL] = PMIC5_LDO_MODE_HPM,
> + [REGULATOR_MODE_FAST] = -EINVAL,
> +};
> +
> static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode)
> {
> unsigned int mode;
> @@ -733,6 +741,33 @@ static const struct rpmh_vreg_hw_data pmic5_pldo515_mv = {
> .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
> };
>
> +static const struct rpmh_vreg_hw_data pmic5_pldo502 = {
> + .regulator_type = VRM,
> + .ops = &rpmh_regulator_vrm_ops,
> + .voltage_ranges = (struct linear_range[]) {
> + REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000),
> + },
> + .n_linear_ranges = 1,
> + .n_voltages = 256,
> + .pmic_mode_map = pmic_mode_map_pmic5_ldo_hpm,
> + .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
> +};
> +
> +static const struct rpmh_vreg_hw_data pmic5_pldo502ln = {
> + .regulator_type = VRM,
> + .ops = &rpmh_regulator_vrm_ops,
> + .voltage_ranges = (struct linear_range[]) {
> + REGULATOR_LINEAR_RANGE(1800000, 0, 2, 200000),
> + REGULATOR_LINEAR_RANGE(2608000, 3, 28, 16000),
> + REGULATOR_LINEAR_RANGE(3104000, 29, 30, 96000),
> + REGULATOR_LINEAR_RANGE(3312000, 31, 31, 0),
> + },
> + .n_linear_ranges = 4,
> + .n_voltages = 32,
> + .pmic_mode_map = pmic_mode_map_pmic5_ldo_hpm,
> + .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
> +};
> +
> static const struct rpmh_vreg_hw_data pmic5_nldo = {
> .regulator_type = VRM,
> .ops = &rpmh_regulator_vrm_drms_ops,
> @@ -759,6 +794,19 @@ static const struct rpmh_vreg_hw_data pmic5_nldo515 = {
> .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
> };
>
> +static const struct rpmh_vreg_hw_data pmic5_nldo502 = {
> + .regulator_type = VRM,
> + .ops = &rpmh_regulator_vrm_drms_ops,
> + .voltage_ranges = (struct linear_range[]) {
> + REGULATOR_LINEAR_RANGE(528000, 0, 127, 8000),
> + },
> + .n_linear_ranges = 1,
> + .n_voltages = 128,
> + .hpm_min_load_uA = 30000,
> + .pmic_mode_map = pmic_mode_map_pmic5_ldo,
> + .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
> +};
> +
> static const struct rpmh_vreg_hw_data pmic5_hfsmps510 = {
> .regulator_type = VRM,
> .ops = &rpmh_regulator_vrm_ops,
> @@ -1210,6 +1258,16 @@ static const struct rpmh_vreg_init_data pm8009_1_vreg_data[] = {
> {}
> };
>
> +static const struct rpmh_vreg_init_data pm8010_vreg_data[] = {
> + RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo502, "vdd-l1-l2"),
> + RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo502, "vdd-l1-l2"),
> + RPMH_VREG("ldo3", "ldo%s3", &pmic5_pldo502ln, "vdd-l3-l4"),
> + RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo502ln, "vdd-l3-l4"),
> + RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo502, "vdd-l5"),
> + RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo502ln, "vdd-l6"),
> + RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo502, "vdd-l7"),
> +};
> +
> static const struct rpmh_vreg_init_data pm6150_vreg_data[] = {
> RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"),
> RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"),
> @@ -1525,6 +1583,10 @@ static const struct of_device_id __maybe_unused rpmh_regulator_match_table[] = {
> .compatible = "qcom,pm8009-1-rpmh-regulators",
> .data = pm8009_1_vreg_data,
> },
> + {
> + .compatible = "qcom,pm8010-rpmh-regulators",
> + .data = pm8010_vreg_data,
> + },
> {
> .compatible = "qcom,pm8150-rpmh-regulators",
> .data = pm8150_vreg_data,
>
next prev parent reply other threads:[~2023-12-12 2:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 3:16 [PATCH 0/4] Add pm8010 RPMH regulators for sm8550 boards Fenglin Wu via B4 Relay
2023-12-11 3:16 ` [PATCH 1/4] regulator: qcom-rpmh: extend to support multiple linear voltage ranges Fenglin Wu via B4 Relay
2023-12-12 2:44 ` David Collins
2023-12-11 3:17 ` [PATCH 2/4] regulator: qcom,rpmh: add compatible for pm8010 RPMH regultor Fenglin Wu via B4 Relay
2023-12-11 7:58 ` Krzysztof Kozlowski
2023-12-11 3:17 ` [PATCH 3/4] regulator: qcom-rpmh: add support for pm8010 regulators Fenglin Wu via B4 Relay
2023-12-12 2:44 ` David Collins [this message]
2023-12-11 3:17 ` [PATCH 4/4] arm64: dts: qcom: Add pm8010 regulators for sm8550 boards Fenglin Wu via B4 Relay
2023-12-11 9:29 ` Konrad Dybcio
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=e1ea82cb-e812-9a1e-3c4d-7f468f5069e9@quicinc.com \
--to=quic_collinsd@quicinc.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@quicinc.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_fenglinw@quicinc.com \
--cc=quic_jprakash@quicinc.com \
--cc=quic_subbaram@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox