diff mbox series

[V3,2/5] regulator: qcom_smd: Add MP5496 S1 regulator

Message ID 20230406070032.22243-3-quic_devipriy@quicinc.com
State New
Headers show
Series Add regulator support for IPQ9574 SoC | expand

Commit Message

Devi Priya April 6, 2023, 7 a.m. UTC
Adding support for MP5496 S1 regulator on IPQ9574 SoC.

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>
---
 Changes in V3:
	- No change

 drivers/regulator/qcom_smd-regulator.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Devi Priya April 7, 2023, 2:59 p.m. UTC | #1
On 4/7/2023 1:07 AM, Konrad Dybcio wrote:
> 
> 
> On 6.04.2023 09:00, Devi Priya wrote:
>> Adding support for MP5496 S1 regulator on IPQ9574 SoC.
>>
>> 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>
>> ---
>>   Changes in V3:
>> 	- No change
>>
>>   drivers/regulator/qcom_smd-regulator.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
>> index 6f722b2d682e..cb77b3bd1723 100644
>> --- a/drivers/regulator/qcom_smd-regulator.c
>> +++ b/drivers/regulator/qcom_smd-regulator.c
>> @@ -749,6 +749,15 @@ static const struct regulator_desc pms405_pldo600 = {
>>   	.ops = &rpm_smps_ldo_ops,
>>   };
>>   
>> +static const struct regulator_desc mp5496_smpa1 = {
>> +	.linear_ranges = (struct linear_range[]) {
>> +		REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500),
>> +	},
>> +	.n_linear_ranges = 1,
>> +	.n_voltages = 128,
>> +	.ops = &rpm_mp5496_ops,
>> +};
>> +
> As far as I can tell, this is identical to struct mp5496_smpa2, so
> this patch could come down to:
> 
> - static const struct regulator_desc mp5496_smpa1 = {
> + static const struct regulator_desc mp5496_smps = {
> 
> 
> 
> +	{ "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smps, "s1" },
> -  	{ "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2" },
> +	{ "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smps, "s2" },
> 
Yes, right. Will update it
> Konrad
>>   static const struct regulator_desc mp5496_smpa2 = {
>>   	.linear_ranges = (struct linear_range[]) {
>>   		REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500),
>> @@ -794,6 +803,7 @@ struct rpm_regulator_data {
>>   };
>>   
>>   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" },
>>   	{}
Best Regards,
Devi Priya
diff mbox series

Patch

diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
index 6f722b2d682e..cb77b3bd1723 100644
--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -749,6 +749,15 @@  static const struct regulator_desc pms405_pldo600 = {
 	.ops = &rpm_smps_ldo_ops,
 };
 
+static const struct regulator_desc mp5496_smpa1 = {
+	.linear_ranges = (struct linear_range[]) {
+		REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500),
+	},
+	.n_linear_ranges = 1,
+	.n_voltages = 128,
+	.ops = &rpm_mp5496_ops,
+};
+
 static const struct regulator_desc mp5496_smpa2 = {
 	.linear_ranges = (struct linear_range[]) {
 		REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500),
@@ -794,6 +803,7 @@  struct rpm_regulator_data {
 };
 
 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" },
 	{}