[v2,1/9] soc: qcom: rpmpd: Bring all definitions to the top

Message ID 20230213143524.1943754-2-konrad.dybcio@linaro.org
State New
Headers
Series [v2,1/9] soc: qcom: rpmpd: Bring all definitions to the top |

Commit Message

Konrad Dybcio Feb. 13, 2023, 2:35 p.m. UTC
  Keep all definitions in one place in preparation for a cleanup to make
things tidier.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/soc/qcom/rpmpd.c | 111 +++++++++++++++++----------------------
 1 file changed, 49 insertions(+), 62 deletions(-)
  

Patch

diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
index d99a56509e33..7d9e762232ea 100644
--- a/drivers/soc/qcom/rpmpd.c
+++ b/drivers/soc/qcom/rpmpd.c
@@ -117,12 +117,58 @@  struct rpmpd_desc {
 
 static DEFINE_MUTEX(rpmpd_lock);
 
-/* mdm9607 RPM Power Domains */
+DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, RWCX, LEVEL, 0);
+DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, SMPA, CORNER, 1);
+DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, SMPA, CORNER, 2);
+DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, SMPA, LEVEL, 2);
 DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, SMPA, LEVEL, 3);
+DEFINE_RPMPD_VFL(vddcx_vfl, RWCX, 0);
+DEFINE_RPMPD_VFL(vddcx_vfl, RWSC, 2);
+DEFINE_RPMPD_VFC(vddcx_vfc, SMPA, 1);
+DEFINE_RPMPD_VFC(vddcx_vfc, SMPA, 2);
+DEFINE_RPMPD_VFL(vddcx_vfl, SMPA, 2);
 DEFINE_RPMPD_VFL(vddcx_vfl, SMPA, 3);
 
+DEFINE_RPMPD_CORNER(vddgfx, SMPB, 2);
+DEFINE_RPMPD_VFC(vddgfx_vfc, SMPB, 2);
+
+DEFINE_RPMPD_PAIR(vddgx, vddgx_ao, RWGX, LEVEL, 0);
+
+DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, LDOA, CORNER, 3);
 DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, LDOA, LEVEL, 12);
+DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, SMPA, CORNER, 2);
+DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, RWMX, LEVEL, 0);
+DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, SMPA, LEVEL, 6);
+DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, SMPA, LEVEL, 7);
 DEFINE_RPMPD_VFL(vddmx_vfl, LDOA, 12);
+DEFINE_RPMPD_VFL(vddmx_vfl, RWMX, 0);
+DEFINE_RPMPD_VFL(vddmx_vfl, RWSM, 6);
+
+DEFINE_RPMPD_PAIR(vddmd, vddmd_ao, SMPA, CORNER, 1);
+DEFINE_RPMPD_PAIR(vddmd, vddmd_ao, SMPA, LEVEL, 1);
+DEFINE_RPMPD_VFC(vddmd_vfc, SMPA, 1);
+
+DEFINE_RPMPD_LEVEL(vdd_lpi_cx, RWLC, 0);
+DEFINE_RPMPD_LEVEL(vdd_lpicx, RWLC, 0);
+DEFINE_RPMPD_VFL(vdd_lpicx_vfl, RWLC, 0);
+
+DEFINE_RPMPD_LEVEL(vdd_lpi_mx, RWLM, 0);
+DEFINE_RPMPD_LEVEL(vdd_lpimx, RWLM, 0);
+DEFINE_RPMPD_VFL(vdd_lpimx_vfl, RWLM, 0);
+
+DEFINE_RPMPD_CORNER(vddsscx, LDOA, 26);
+DEFINE_RPMPD_LEVEL(vdd_ssccx, RWLC, 0);
+DEFINE_RPMPD_LEVEL(vdd_ssccx, RWSC, 0);
+DEFINE_RPMPD_VFC(vddsscx_vfc, LDOA, 26);
+DEFINE_RPMPD_VFL(vdd_ssccx_vfl, RWLC, 0);
+DEFINE_RPMPD_VFL(vdd_ssccx_vfl, RWSC, 0);
+
+DEFINE_RPMPD_LEVEL(vdd_sscmx, RWLM, 0);
+DEFINE_RPMPD_LEVEL(vdd_sscmx, RWSM, 0);
+DEFINE_RPMPD_VFL(vdd_sscmx_vfl, RWLM, 0);
+DEFINE_RPMPD_VFL(vdd_sscmx_vfl, RWSM, 0);
+
+/* mdm9607 RPM Power Domains */
 static struct rpmpd *mdm9607_rpmpds[] = {
 	[MDM9607_VDDCX] =	&SMPA3_LEVEL_vddcx,
 	[MDM9607_VDDCX_AO] =	&SMPA3_LEVEL_vddcx_ao,
@@ -139,9 +185,6 @@  static const struct rpmpd_desc mdm9607_desc = {
 };
 
 /* msm8226 RPM Power Domains */
-DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, SMPA, CORNER, 1);
-DEFINE_RPMPD_VFC(vddcx_vfc, SMPA, 1);
-
 static struct rpmpd *msm8226_rpmpds[] = {
 	[MSM8226_VDDCX] =	&SMPA1_CORNER_vddcx,
 	[MSM8226_VDDCX_AO] =	&SMPA1_CORNER_vddcx_ao,
@@ -155,14 +198,6 @@  static const struct rpmpd_desc msm8226_desc = {
 };
 
 /* msm8939 RPM Power Domains */
-DEFINE_RPMPD_PAIR(vddmd, vddmd_ao, SMPA, CORNER, 1);
-DEFINE_RPMPD_VFC(vddmd_vfc, SMPA, 1);
-
-DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, SMPA, CORNER, 2);
-DEFINE_RPMPD_VFC(vddcx_vfc, SMPA, 2);
-
-DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, LDOA, CORNER, 3);
-
 static struct rpmpd *msm8939_rpmpds[] = {
 	[MSM8939_VDDMDCX] =	&SMPA1_CORNER_vddmd,
 	[MSM8939_VDDMDCX_AO] =	&SMPA1_CORNER_vddmd_ao,
@@ -196,12 +231,6 @@  static const struct rpmpd_desc msm8916_desc = {
 };
 
 /* msm8953 RPM Power Domains */
-DEFINE_RPMPD_PAIR(vddmd, vddmd_ao, SMPA, LEVEL, 1);
-DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, SMPA, LEVEL, 2);
-DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, SMPA, LEVEL, 7);
-
-DEFINE_RPMPD_VFL(vddcx_vfl, SMPA, 2);
-
 static struct rpmpd *msm8953_rpmpds[] = {
 	[MSM8953_VDDMD] =	&SMPA1_LEVEL_vddmd,
 	[MSM8953_VDDMD_AO] =	&SMPA1_LEVEL_vddmd_ao,
@@ -219,11 +248,6 @@  static const struct rpmpd_desc msm8953_desc = {
 };
 
 /* msm8976 RPM Power Domains */
-DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, SMPA, LEVEL, 6);
-
-DEFINE_RPMPD_VFL(vddcx_vfl, RWSC, 2);
-DEFINE_RPMPD_VFL(vddmx_vfl, RWSM, 6);
-
 static struct rpmpd *msm8976_rpmpds[] = {
 	[MSM8976_VDDCX] =	&SMPA2_LEVEL_vddcx,
 	[MSM8976_VDDCX_AO] =	&SMPA2_LEVEL_vddcx_ao,
@@ -240,18 +264,14 @@  static const struct rpmpd_desc msm8976_desc = {
 };
 
 /* msm8994 RPM Power domains */
-DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, SMPA, CORNER, 2);
-/* Attention! *Some* 8994 boards with pm8004 may use SMPC here! */
-DEFINE_RPMPD_CORNER(vddgfx, SMPB, 2);
-
-DEFINE_RPMPD_VFC(vddgfx_vfc, SMPB, 2);
-
 static struct rpmpd *msm8994_rpmpds[] = {
 	[MSM8994_VDDCX] =	&SMPA1_CORNER_vddcx,
 	[MSM8994_VDDCX_AO] =	&SMPA1_CORNER_vddcx_ao,
 	[MSM8994_VDDCX_VFC] =	&SMPA1_vddcx_vfc,
 	[MSM8994_VDDMX] =	&SMPA2_CORNER_vddmx,
 	[MSM8994_VDDMX_AO] =	&SMPA2_CORNER_vddmx_ao,
+
+	/* Attention! *Some* 8994 boards with pm8004 may use SMPC here! */
 	[MSM8994_VDDGFX] =	&SMPB2_vddgfx_corner,
 	[MSM8994_VDDGFX_VFC] =	&SMPB2_vddgfx_vfc,
 };
@@ -263,10 +283,6 @@  static const struct rpmpd_desc msm8994_desc = {
 };
 
 /* msm8996 RPM Power domains */
-DEFINE_RPMPD_CORNER(vddsscx, LDOA, 26);
-
-DEFINE_RPMPD_VFC(vddsscx_vfc, LDOA, 26);
-
 static struct rpmpd *msm8996_rpmpds[] = {
 	[MSM8996_VDDCX] =	&SMPA1_CORNER_vddcx,
 	[MSM8996_VDDCX_AO] =	&SMPA1_CORNER_vddcx_ao,
@@ -284,18 +300,6 @@  static const struct rpmpd_desc msm8996_desc = {
 };
 
 /* msm8998 RPM Power domains */
-DEFINE_RPMPD_PAIR(vddcx, vddcx_ao, RWCX, LEVEL, 0);
-DEFINE_RPMPD_VFL(vddcx_vfl, RWCX, 0);
-
-DEFINE_RPMPD_PAIR(vddmx, vddmx_ao, RWMX, LEVEL, 0);
-DEFINE_RPMPD_VFL(vddmx_vfl, RWMX, 0);
-
-DEFINE_RPMPD_LEVEL(vdd_ssccx, RWSC, 0);
-DEFINE_RPMPD_VFL(vdd_ssccx_vfl, RWSC, 0);
-
-DEFINE_RPMPD_LEVEL(vdd_sscmx, RWSM, 0);
-DEFINE_RPMPD_VFL(vdd_sscmx_vfl, RWSM, 0);
-
 static struct rpmpd *msm8998_rpmpds[] = {
 	[MSM8998_VDDCX] =		&RWCX0_LEVEL_vddcx,
 	[MSM8998_VDDCX_AO] =		&RWCX0_LEVEL_vddcx_ao,
@@ -316,12 +320,6 @@  static const struct rpmpd_desc msm8998_desc = {
 };
 
 /* qcs404 RPM Power domains */
-DEFINE_RPMPD_LEVEL(vdd_lpicx, RWLC, 0);
-DEFINE_RPMPD_VFL(vdd_lpicx_vfl, RWLC, 0);
-
-DEFINE_RPMPD_LEVEL(vdd_lpimx, RWLM, 0);
-DEFINE_RPMPD_VFL(vdd_lpimx_vfl, RWLM, 0);
-
 static struct rpmpd *qcs404_rpmpds[] = {
 	[QCS404_VDDMX] = &RWMX0_LEVEL_vddmx,
 	[QCS404_VDDMX_AO] = &RWMX0_LEVEL_vddmx_ao,
@@ -339,13 +337,6 @@  static const struct rpmpd_desc qcs404_desc = {
 };
 
 /* sdm660 RPM Power domains */
-
-DEFINE_RPMPD_LEVEL(vdd_ssccx, RWLC, 0);
-DEFINE_RPMPD_VFL(vdd_ssccx_vfl, RWLC, 0);
-
-DEFINE_RPMPD_LEVEL(vdd_sscmx, RWLM, 0);
-DEFINE_RPMPD_VFL(vdd_sscmx_vfl, RWLM, 0);
-
 static struct rpmpd *sdm660_rpmpds[] = {
 	[SDM660_VDDCX] =		&RWCX0_LEVEL_vddcx,
 	[SDM660_VDDCX_AO] =		&RWCX0_LEVEL_vddcx_ao,
@@ -366,9 +357,6 @@  static const struct rpmpd_desc sdm660_desc = {
 };
 
 /* sm4250/6115 RPM Power domains */
-DEFINE_RPMPD_LEVEL(vdd_lpi_cx, RWLC, 0);
-DEFINE_RPMPD_LEVEL(vdd_lpi_mx, RWLM, 0);
-
 static struct rpmpd *sm6115_rpmpds[] = {
 	[SM6115_VDDCX] =		&RWCX0_LEVEL_vddcx,
 	[SM6115_VDDCX_AO] =		&RWCX0_LEVEL_vddcx_ao,
@@ -402,7 +390,6 @@  static const struct rpmpd_desc sm6125_desc = {
 	.max_state = RPM_SMD_LEVEL_BINNING,
 };
 
-DEFINE_RPMPD_PAIR(vddgx, vddgx_ao, RWGX, LEVEL, 0);
 static struct rpmpd *sm6375_rpmpds[] = {
 	[SM6375_VDDCX] = &RWCX0_LEVEL_vddcx,
 	[SM6375_VDDCX_AO] = &RWCX0_LEVEL_vddcx_ao,