diff mbox series

[2/7] soc: qcom: rpmpd: Expand #defines into structs

Message ID 20230125032728.611640-3-konrad.dybcio@linaro.org
State New
Headers show
Series RPMPD cleanup + parent PD | expand

Commit Message

Konrad Dybcio Jan. 25, 2023, 3:27 a.m. UTC
Expand preprocessor macros into human-readable structs for easier
reference.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/soc/qcom/rpmpd.c | 839 +++++++++++++++++++++++++++++++++------
 1 file changed, 722 insertions(+), 117 deletions(-)
diff mbox series

Patch

diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
index 0c2d930ab38f..9a7da7cead9e 100644
--- a/drivers/soc/qcom/rpmpd.c
+++ b/drivers/soc/qcom/rpmpd.c
@@ -40,57 +40,6 @@ 
 
 #define MAX_CORNER_RPMPD_STATE	6
 
-#define DEFINE_RPMPD_PAIR(_platform, _name, _active, r_type, r_key,	\
-			  r_id)						\
-	static struct rpmpd _platform##_##_active;			\
-	static struct rpmpd _platform##_##_name = {			\
-		.pd = {	.name = #_name,	},				\
-		.peer = &_platform##_##_active,				\
-		.res_type = RPMPD_##r_type,				\
-		.res_id = r_id,						\
-		.key = KEY_##r_key,					\
-	};								\
-	static struct rpmpd _platform##_##_active = {			\
-		.pd = { .name = #_active, },				\
-		.peer = &_platform##_##_name,				\
-		.active_only = true,					\
-		.res_type = RPMPD_##r_type,				\
-		.res_id = r_id,						\
-		.key = KEY_##r_key,					\
-	}
-
-#define DEFINE_RPMPD_CORNER(_platform, _name, r_type, r_id)		\
-	static struct rpmpd _platform##_##_name = {			\
-		.pd = { .name = #_name, },				\
-		.res_type = RPMPD_##r_type,				\
-		.res_id = r_id,						\
-		.key = KEY_CORNER,					\
-	}
-
-#define DEFINE_RPMPD_LEVEL(_platform, _name, r_type, r_id)		\
-	static struct rpmpd _platform##_##_name = {			\
-		.pd = { .name = #_name, },				\
-		.res_type = RPMPD_##r_type,				\
-		.res_id = r_id,						\
-		.key = KEY_LEVEL,					\
-	}
-
-#define DEFINE_RPMPD_VFC(_platform, _name, r_type, r_id)		\
-	static struct rpmpd _platform##_##_name = {			\
-		.pd = { .name = #_name, },				\
-		.res_type = RPMPD_##r_type,				\
-		.res_id = r_id,						\
-		.key = KEY_FLOOR_CORNER,				\
-	}
-
-#define DEFINE_RPMPD_VFL(_platform, _name, r_type, r_id)		\
-	static struct rpmpd _platform##_##_name = {			\
-		.pd = { .name = #_name, },				\
-		.res_type = RPMPD_##r_type,				\
-		.res_id = r_id,						\
-		.key = KEY_FLOOR_LEVEL,					\
-	}
-
 struct rpmpd_req {
 	__le32 key;
 	__le32 nbytes;
@@ -120,11 +69,56 @@  struct rpmpd_desc {
 static DEFINE_MUTEX(rpmpd_lock);
 
 /* mdm9607 RPM Power Domains */
-DEFINE_RPMPD_PAIR(mdm9607, vddcx, vddcx_ao, SMPA, LEVEL, 3);
-DEFINE_RPMPD_VFL(mdm9607, vddcx_vfl, SMPA, 3);
+static struct rpmpd mdm9607_vddcx_ao;
+static struct rpmpd mdm9607_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &mdm9607_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 3,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd mdm9607_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &mdm9607_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 3,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd mdm9607_vddcx_vfl = {
+	.pd = { .name = "vddcx_vfl", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 3,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd mdm9607_vddmx_ao;
+static struct rpmpd mdm9607_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &mdm9607_vddmx_ao,
+	.res_type = RPMPD_LDOA,
+	.res_id = 12,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd mdm9607_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &mdm9607_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_LDOA,
+	.res_id = 12,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd mdm9607_vddmx_vfl = {
+	.pd = { .name = "vddmx_vfl", },
+	.res_type = RPMPD_LDOA,
+	.res_id = 12,
+	.key = KEY_FLOOR_LEVEL,
+};
 
-DEFINE_RPMPD_PAIR(mdm9607, vddmx, vddmx_ao, LDOA, LEVEL, 12);
-DEFINE_RPMPD_VFL(mdm9607, vddmx_vfl, LDOA, 12);
 static struct rpmpd *mdm9607_rpmpds[] = {
 	[MDM9607_VDDCX] =	&mdm9607_vddcx,
 	[MDM9607_VDDCX_AO] =	&mdm9607_vddcx_ao,
@@ -141,8 +135,30 @@  static const struct rpmpd_desc mdm9607_desc = {
 };
 
 /* msm8226 RPM Power Domains */
-DEFINE_RPMPD_PAIR(msm8226, vddcx, vddcx_ao, SMPA, CORNER, 1);
-DEFINE_RPMPD_VFC(msm8226, vddcx_vfc, SMPA, 1);
+static struct rpmpd msm8226_vddcx_ao;
+static struct rpmpd msm8226_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8226_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8226_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8226_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8226_vddcx_vfc = {
+	.pd = { .name = "vddcx_vfc", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_FLOOR_CORNER,
+};
 
 static struct rpmpd *msm8226_rpmpds[] = {
 	[MSM8226_VDDCX] =	&msm8226_vddcx,
@@ -157,13 +173,73 @@  static const struct rpmpd_desc msm8226_desc = {
 };
 
 /* msm8939 RPM Power Domains */
-DEFINE_RPMPD_PAIR(msm8939, vddmd, vddmd_ao, SMPA, CORNER, 1);
-DEFINE_RPMPD_VFC(msm8939, vddmd_vfc, SMPA, 1);
+static struct rpmpd msm8939_vddmd_ao;
+static struct rpmpd msm8939_vddmd = {
+	.pd = { .name = "vddmd", },
+	.peer = &msm8939_vddmd_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8939_vddmd_ao = {
+	.pd = { .name = "vddmd_ao", },
+	.peer = &msm8939_vddmd,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8939_vddmd_vfc = {
+	.pd = { .name = "vddmd_vfc", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_FLOOR_CORNER,
+};
 
-DEFINE_RPMPD_PAIR(msm8939, vddcx, vddcx_ao, SMPA, CORNER, 2);
-DEFINE_RPMPD_VFC(msm8939, vddcx_vfc, SMPA, 2);
+static struct rpmpd msm8939_vddcx_ao;
+static struct rpmpd msm8939_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8939_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8939_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8939_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8939_vddcx_vfc = {
+	.pd = { .name = "vddcx_vfc", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_FLOOR_CORNER,
+};
 
-DEFINE_RPMPD_PAIR(msm8939, vddmx, vddmx_ao, LDOA, CORNER, 3);
+static struct rpmpd msm8939_vddmx_ao;
+static struct rpmpd msm8939_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &msm8939_vddmx_ao,
+	.res_type = RPMPD_LDOA,
+	.res_id = 3,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8939_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &msm8939_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_LDOA,
+	.res_id = 3,
+	.key = KEY_CORNER,
+};
 
 static struct rpmpd *msm8939_rpmpds[] = {
 	[MSM8939_VDDMDCX] =	&msm8939_vddmd,
@@ -183,10 +259,48 @@  static const struct rpmpd_desc msm8939_desc = {
 };
 
 /* msm8916 RPM Power Domains */
-DEFINE_RPMPD_PAIR(msm8916, vddcx, vddcx_ao, SMPA, CORNER, 1);
-DEFINE_RPMPD_PAIR(msm8916, vddmx, vddmx_ao, LDOA, CORNER, 3);
+static struct rpmpd msm8916_vddcx_ao;
+static struct rpmpd msm8916_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8916_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8916_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8916_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8916_vddmx_ao;
+static struct rpmpd msm8916_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &msm8916_vddmx_ao,
+	.res_type = RPMPD_LDOA,
+	.res_id = 3,
+	.key = KEY_CORNER,
+};
 
-DEFINE_RPMPD_VFC(msm8916, vddcx_vfc, SMPA, 1);
+static struct rpmpd msm8916_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &msm8916_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_LDOA,
+	.res_id = 3,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8916_vddcx_vfc = {
+	.pd = { .name = "vddcx_vfc", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_FLOOR_CORNER,
+};
 
 static struct rpmpd *msm8916_rpmpds[] = {
 	[MSM8916_VDDCX] =	&msm8916_vddcx,
@@ -203,11 +317,66 @@  static const struct rpmpd_desc msm8916_desc = {
 };
 
 /* msm8953 RPM Power Domains */
-DEFINE_RPMPD_PAIR(msm8953, vddmd, vddmd_ao, SMPA, LEVEL, 1);
-DEFINE_RPMPD_PAIR(msm8953, vddcx, vddcx_ao, SMPA, LEVEL, 2);
-DEFINE_RPMPD_PAIR(msm8953, vddmx, vddmx_ao, SMPA, LEVEL, 7);
+static struct rpmpd msm8953_vddmd_ao;
+static struct rpmpd msm8953_vddmd = {
+	.pd = { .name = "vddmd", },
+	.peer = &msm8953_vddmd_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_VFL(msm8953, vddcx_vfl, SMPA, 2);
+static struct rpmpd msm8953_vddmd_ao = {
+	.pd = { .name = "vddmd_ao", },
+	.peer = &msm8953_vddmd,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8953_vddcx_ao;
+static struct rpmpd msm8953_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8953_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8953_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8953_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8953_vddmx_ao;
+static struct rpmpd msm8953_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &msm8953_vddmx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 7,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8953_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &msm8953_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 7,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8953_vddcx_vfl = {
+	.pd = { .name = "vddcx_vfl", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_FLOOR_LEVEL,
+};
 
 static struct rpmpd *msm8953_rpmpds[] = {
 	[MSM8953_VDDMD] =	&msm8953_vddmd,
@@ -226,11 +395,55 @@  static const struct rpmpd_desc msm8953_desc = {
 };
 
 /* msm8976 RPM Power Domains */
-DEFINE_RPMPD_PAIR(msm8976, vddcx, vddcx_ao, SMPA, LEVEL, 2);
-DEFINE_RPMPD_PAIR(msm8976, vddmx, vddmx_ao, SMPA, LEVEL, 6);
+static struct rpmpd msm8976_vddcx_ao;
+static struct rpmpd msm8976_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8976_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_VFL(msm8976, vddcx_vfl, RWSC, 2);
-DEFINE_RPMPD_VFL(msm8976, vddmx_vfl, RWSM, 6);
+static struct rpmpd msm8976_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8976_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8976_vddmx_ao;
+static struct rpmpd msm8976_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &msm8976_vddmx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 6,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8976_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &msm8976_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 6,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8976_vddcx_vfl = {
+	.pd = { .name = "vddcx_vfl", },
+	.res_type = RPMPD_RWSC,
+	.res_id = 2,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd msm8976_vddmx_vfl = {
+	.pd = { .name = "vddmx_vfl", },
+	.res_type = RPMPD_RWSM,
+	.res_id = 6,
+	.key = KEY_FLOOR_LEVEL,
+};
 
 static struct rpmpd *msm8976_rpmpds[] = {
 	[MSM8976_VDDCX] =	&msm8976_vddcx,
@@ -248,13 +461,63 @@  static const struct rpmpd_desc msm8976_desc = {
 };
 
 /* msm8994 RPM Power domains */
-DEFINE_RPMPD_PAIR(msm8994, vddcx, vddcx_ao, SMPA, CORNER, 1);
-DEFINE_RPMPD_PAIR(msm8994, vddmx, vddmx_ao, SMPA, CORNER, 2);
-/* Attention! *Some* 8994 boards with pm8004 may use SMPC here! */
-DEFINE_RPMPD_CORNER(msm8994, vddgfx, SMPB, 2);
+static struct rpmpd msm8994_vddcx_ao;
+static struct rpmpd msm8994_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8994_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8994_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8994_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
 
-DEFINE_RPMPD_VFC(msm8994, vddcx_vfc, SMPA, 1);
-DEFINE_RPMPD_VFC(msm8994, vddgfx_vfc, SMPB, 2);
+static struct rpmpd msm8994_vddmx_ao;
+static struct rpmpd msm8994_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &msm8994_vddmx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8994_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &msm8994_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8994_vddgfx = {
+	.pd = { .name = "vddgfx", },
+	/* SMPC if your board has a PM8004! */
+	.res_type = RPMPD_SMPB,
+	.res_id = 2,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8994_vddcx_vfc = {
+	.pd = { .name = "vddcx_vfc", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_FLOOR_CORNER,
+};
+
+static struct rpmpd msm8994_vddgfx_vfc = {
+	.pd = { .name = "vddgfx_vfc", },
+	.res_type = RPMPD_SMPB,
+	.res_id = 2,
+	.key = KEY_FLOOR_CORNER,
+};
 
 static struct rpmpd *msm8994_rpmpds[] = {
 	[MSM8994_VDDCX] =	&msm8994_vddcx,
@@ -273,12 +536,62 @@  static const struct rpmpd_desc msm8994_desc = {
 };
 
 /* msm8996 RPM Power domains */
-DEFINE_RPMPD_PAIR(msm8996, vddcx, vddcx_ao, SMPA, CORNER, 1);
-DEFINE_RPMPD_PAIR(msm8996, vddmx, vddmx_ao, SMPA, CORNER, 2);
-DEFINE_RPMPD_CORNER(msm8996, vddsscx, LDOA, 26);
+static struct rpmpd msm8996_vddcx_ao;
+static struct rpmpd msm8996_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8996_vddcx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
 
-DEFINE_RPMPD_VFC(msm8996, vddcx_vfc, SMPA, 1);
-DEFINE_RPMPD_VFC(msm8996, vddsscx_vfc, LDOA, 26);
+static struct rpmpd msm8996_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8996_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8996_vddmx_ao;
+static struct rpmpd msm8996_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &msm8996_vddmx_ao,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8996_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &msm8996_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_SMPA,
+	.res_id = 2,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8996_vddsscx = {
+	.pd = { .name = "vddsscx", },
+	.res_type = RPMPD_LDOA,
+	.res_id = 26,
+	.key = KEY_CORNER,
+};
+
+static struct rpmpd msm8996_vddcx_vfc = {
+	.pd = { .name = "vddcx_vfc", },
+	.res_type = RPMPD_SMPA,
+	.res_id = 1,
+	.key = KEY_FLOOR_CORNER,
+};
+
+static struct rpmpd msm8996_vddsscx_vfc = {
+	.pd = { .name = "vddsscx_vfc", },
+	.res_type = RPMPD_LDOA,
+	.res_id = 26,
+	.key = KEY_FLOOR_CORNER,
+};
 
 static struct rpmpd *msm8996_rpmpds[] = {
 	[MSM8996_VDDCX] =	&msm8996_vddcx,
@@ -297,17 +610,83 @@  static const struct rpmpd_desc msm8996_desc = {
 };
 
 /* msm8998 RPM Power domains */
-DEFINE_RPMPD_PAIR(msm8998, vddcx, vddcx_ao, RWCX, LEVEL, 0);
-DEFINE_RPMPD_VFL(msm8998, vddcx_vfl, RWCX, 0);
+static struct rpmpd msm8998_vddcx_ao;
+static struct rpmpd msm8998_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &msm8998_vddcx_ao,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8998_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &msm8998_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8998_vddcx_vfl = {
+	.pd = { .name = "vddcx_vfl", },
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
 
-DEFINE_RPMPD_PAIR(msm8998, vddmx, vddmx_ao, RWMX, LEVEL, 0);
-DEFINE_RPMPD_VFL(msm8998, vddmx_vfl, RWMX, 0);
+static struct rpmpd msm8998_vddmx_ao;
+static struct rpmpd msm8998_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &msm8998_vddmx_ao,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_LEVEL(msm8998, vdd_ssccx, RWSC, 0);
-DEFINE_RPMPD_VFL(msm8998, vdd_ssccx_vfl, RWSC, 0);
+static struct rpmpd msm8998_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &msm8998_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_LEVEL(msm8998, vdd_sscmx, RWSM, 0);
-DEFINE_RPMPD_VFL(msm8998, vdd_sscmx_vfl, RWSM, 0);
+static struct rpmpd msm8998_vddmx_vfl = {
+	.pd = { .name = "vddmx_vfl", },
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd msm8998_vdd_ssccx = {
+	.pd = { .name = "vdd_ssccx", },
+	.res_type = RPMPD_RWSC,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8998_vdd_ssccx_vfl = {
+	.pd = { .name = "vdd_ssccx_vfl", },
+	.res_type = RPMPD_RWSC,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd msm8998_vdd_sscmx = {
+	.pd = { .name = "vdd_sscmx", },
+	.res_type = RPMPD_RWSM,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd msm8998_vdd_sscmx_vfl = {
+	.pd = { .name = "vdd_sscmx_vfl", },
+	.res_type = RPMPD_RWSM,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
 
 static struct rpmpd *msm8998_rpmpds[] = {
 	[MSM8998_VDDCX] =		&msm8998_vddcx,
@@ -329,14 +708,58 @@  static const struct rpmpd_desc msm8998_desc = {
 };
 
 /* qcs404 RPM Power domains */
-DEFINE_RPMPD_PAIR(qcs404, vddmx, vddmx_ao, RWMX, LEVEL, 0);
-DEFINE_RPMPD_VFL(qcs404, vddmx_vfl, RWMX, 0);
+static struct rpmpd qcs404_vddmx_ao;
+static struct rpmpd qcs404_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &qcs404_vddmx_ao,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd qcs404_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &qcs404_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd qcs404_vddmx_vfl = {
+	.pd = { .name = "vddmx_vfl", },
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd qcs404_vdd_lpicx = {
+	.pd = { .name = "vdd_lpicx", },
+	.res_type = RPMPD_RWLC,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd qcs404_vdd_lpicx_vfl = {
+	.pd = { .name = "vdd_lpicx_vfl", },
+	.res_type = RPMPD_RWLC,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
 
-DEFINE_RPMPD_LEVEL(qcs404, vdd_lpicx, RWLC, 0);
-DEFINE_RPMPD_VFL(qcs404, vdd_lpicx_vfl, RWLC, 0);
+static struct rpmpd qcs404_vdd_lpimx = {
+	.pd = { .name = "vdd_lpimx", },
+	.res_type = RPMPD_RWLM,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_LEVEL(qcs404, vdd_lpimx, RWLM, 0);
-DEFINE_RPMPD_VFL(qcs404, vdd_lpimx_vfl, RWLM, 0);
+static struct rpmpd qcs404_vdd_lpimx_vfl = {
+	.pd = { .name = "vdd_lpimx_vfl", },
+	.res_type = RPMPD_RWLM,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
 
 static struct rpmpd *qcs404_rpmpds[] = {
 	[QCS404_VDDMX] = &qcs404_vddmx,
@@ -355,17 +778,83 @@  static const struct rpmpd_desc qcs404_desc = {
 };
 
 /* sdm660 RPM Power domains */
-DEFINE_RPMPD_PAIR(sdm660, vddcx, vddcx_ao, RWCX, LEVEL, 0);
-DEFINE_RPMPD_VFL(sdm660, vddcx_vfl, RWCX, 0);
+static struct rpmpd sdm660_vddcx_ao;
+static struct rpmpd sdm660_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &sdm660_vddcx_ao,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_PAIR(sdm660, vddmx, vddmx_ao, RWMX, LEVEL, 0);
-DEFINE_RPMPD_VFL(sdm660, vddmx_vfl, RWMX, 0);
+static struct rpmpd sdm660_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &sdm660_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_LEVEL(sdm660, vdd_ssccx, RWLC, 0);
-DEFINE_RPMPD_VFL(sdm660, vdd_ssccx_vfl, RWLC, 0);
+static struct rpmpd sdm660_vddcx_vfl = {
+	.pd = { .name = "vddcx_vfl", },
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
 
-DEFINE_RPMPD_LEVEL(sdm660, vdd_sscmx, RWLM, 0);
-DEFINE_RPMPD_VFL(sdm660, vdd_sscmx_vfl, RWLM, 0);
+static struct rpmpd sdm660_vddmx_ao;
+static struct rpmpd sdm660_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &sdm660_vddmx_ao,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sdm660_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &sdm660_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sdm660_vddmx_vfl = {
+	.pd = { .name = "vddmx_vfl", },
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd sdm660_vdd_ssccx = {
+	.pd = { .name = "vdd_ssccx", },
+	.res_type = RPMPD_RWLC,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sdm660_vdd_ssccx_vfl = {
+	.pd = { .name = "vdd_ssccx_vfl", },
+	.res_type = RPMPD_RWLC,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd sdm660_vdd_sscmx = {
+	.pd = { .name = "vdd_sscmx", },
+	.res_type = RPMPD_RWLM,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sdm660_vdd_sscmx_vfl = {
+	.pd = { .name = "vdd_sscmx_vfl", },
+	.res_type = RPMPD_RWLM,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
 
 static struct rpmpd *sdm660_rpmpds[] = {
 	[SDM660_VDDCX] =		&sdm660_vddcx,
@@ -387,14 +876,69 @@  static const struct rpmpd_desc sdm660_desc = {
 };
 
 /* sm4250/6115 RPM Power domains */
-DEFINE_RPMPD_PAIR(sm6115, vddcx, vddcx_ao, RWCX, LEVEL, 0);
-DEFINE_RPMPD_VFL(sm6115, vddcx_vfl, RWCX, 0);
+static struct rpmpd sm6115_vddcx_ao;
+static struct rpmpd sm6115_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &sm6115_vddcx_ao,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sm6115_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &sm6115_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sm6115_vddcx_vfl = {
+	.pd = { .name = "vddcx_vfl", },
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd sm6115_vddmx_ao;
+static struct rpmpd sm6115_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &sm6115_vddmx_ao,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_PAIR(sm6115, vddmx, vddmx_ao, RWMX, LEVEL, 0);
-DEFINE_RPMPD_VFL(sm6115, vddmx_vfl, RWMX, 0);
+static struct rpmpd sm6115_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &sm6115_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sm6115_vddmx_vfl = {
+	.pd = { .name = "vddmx_vfl", },
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd sm6115_vdd_lpi_cx = {
+	.pd = { .name = "vdd_lpi_cx", },
+	.res_type = RPMPD_RWLC,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_LEVEL(sm6115, vdd_lpi_cx, RWLC, 0);
-DEFINE_RPMPD_LEVEL(sm6115, vdd_lpi_mx, RWLM, 0);
+static struct rpmpd sm6115_vdd_lpi_mx = {
+	.pd = { .name = "vdd_lpi_mx", },
+	.res_type = RPMPD_RWLM,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
 static struct rpmpd *sm6115_rpmpds[] = {
 	[SM6115_VDDCX] =		&sm6115_vddcx,
@@ -414,11 +958,55 @@  static const struct rpmpd_desc sm6115_desc = {
 };
 
 /* sm6125 RPM Power domains */
-DEFINE_RPMPD_PAIR(sm6125, vddcx, vddcx_ao, RWCX, LEVEL, 0);
-DEFINE_RPMPD_VFL(sm6125, vddcx_vfl, RWCX, 0);
+static struct rpmpd sm6125_vddcx_ao;
+static struct rpmpd sm6125_vddcx = {
+	.pd = { .name = "vddcx", },
+	.peer = &sm6125_vddcx_ao,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sm6125_vddcx_ao = {
+	.pd = { .name = "vddcx_ao", },
+	.peer = &sm6125_vddcx,
+	.active_only = true,
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sm6125_vddcx_vfl = {
+	.pd = { .name = "vddcx_vfl", },
+	.res_type = RPMPD_RWCX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
+
+static struct rpmpd sm6125_vddmx_ao;
+static struct rpmpd sm6125_vddmx = {
+	.pd = { .name = "vddmx", },
+	.peer = &sm6125_vddmx_ao,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sm6125_vddmx_ao = {
+	.pd = { .name = "vddmx_ao", },
+	.peer = &sm6125_vddmx,
+	.active_only = true,
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
 
-DEFINE_RPMPD_PAIR(sm6125, vddmx, vddmx_ao, RWMX, LEVEL, 0);
-DEFINE_RPMPD_VFL(sm6125, vddmx_vfl, RWMX, 0);
+static struct rpmpd sm6125_vddmx_vfl = {
+	.pd = { .name = "vddmx_vfl", },
+	.res_type = RPMPD_RWMX,
+	.res_id = 0,
+	.key = KEY_FLOOR_LEVEL,
+};
 
 static struct rpmpd *sm6125_rpmpds[] = {
 	[SM6125_VDDCX] =		&sm6125_vddcx,
@@ -435,7 +1023,24 @@  static const struct rpmpd_desc sm6125_desc = {
 	.max_state = RPM_SMD_LEVEL_BINNING,
 };
 
-DEFINE_RPMPD_PAIR(sm6375, vddgx, vddgx_ao, RWGX, LEVEL, 0);
+static struct rpmpd sm6375_vddgx_ao;
+static struct rpmpd sm6375_vddgx = {
+	.pd = {	.name = "vddgx", },
+	.peer = &sm6375_vddgx_ao,
+	.res_type = RPMPD_RWGX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
+static struct rpmpd sm6375_vddgx_ao = {
+	.pd = {	.name = "vddgx_ao", },
+	.peer = &sm6375_vddgx,
+	.active_only = true,
+	.res_type = RPMPD_RWGX,
+	.res_id = 0,
+	.key = KEY_LEVEL,
+};
+
 static struct rpmpd *sm6375_rpmpds[] = {
 	[SM6375_VDDCX] = &sm6125_vddcx,
 	[SM6375_VDDCX_AO] = &sm6125_vddcx_ao,