Earlier, all of the RPMH power domain properties were initially
removed from the device tree due to the absence of driver support.
Since support for SA8775P_MMCX and SA8775P_MMCX_AO has now been
added in the RPMH Power Domain Driver for the SA8775P platform,
remove only SA8775P_CX entries.

Signed-off-by: Aswin Murugan <[email protected]>
---
 arch/arm/mach-snapdragon/Kconfig    | 7 +++++++
 arch/arm/mach-snapdragon/of_fixup.c | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
index 976c0e35fce..28e564889bc 100644
--- a/arch/arm/mach-snapdragon/Kconfig
+++ b/arch/arm/mach-snapdragon/Kconfig
@@ -1,5 +1,12 @@
 if ARCH_SNAPDRAGON
 
+config OF_LIVE_SA8775P
+       bool "Enable OF LIVE SA8775P"
+       select OF_LIVE
+       help
+         Say Y here to enable support for OF LIVE fixups
+         on the Snapdragon SA8775 SoC.
+
 config SYS_SOC
        default "snapdragon"
 
diff --git a/arch/arm/mach-snapdragon/of_fixup.c 
b/arch/arm/mach-snapdragon/of_fixup.c
index b398c6b7b9f..456261eeae2 100644
--- a/arch/arm/mach-snapdragon/of_fixup.c
+++ b/arch/arm/mach-snapdragon/of_fixup.c
@@ -19,6 +19,7 @@
 #define pr_fmt(fmt) "of_fixup: " fmt
 
 #include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/power/qcom-rpmpd.h>
 #include <dm/of_access.h>
 #include <dm/of.h>
 #include <event.h>
@@ -155,6 +156,11 @@ static void fixup_power_domains(struct device_node *root)
 
                val = prop->value;
                if (val[0] == cpu_to_fdt32(pd->phandle))
+                       /* Check if the rpmh power domain is SA8775P_CX and 
remove it */
+                       if (IS_ENABLED(CONFIG_OF_LIVE_SA8775P) &&
+                           (val[1] != cpu_to_fdt32(SA8775P_CX))
+                                       continue;
+
                        of_remove_property(np, prop);
        }
 }
-- 
2.34.1

Reply via email to