Skip to contentSkip to conversation

ARM: EXYNOS: implement pm_power_off for EXYNOS5440

PATCH Jungseok Lee 2 participants 3 messages Sep 28, 2013 – Sep 29, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This patch implements pm_power_off function since a power-down control register should be set in order to turn off EXYNOS5440. Otherwise, power domains remain alive despite "poweroff" action.

---
 arch/arm/mach-exynos/common.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/common.c +15 -2
index ba95e5d..21f3ce9 100644
@@ -294,11 +294,24 @@ void exynos5_restart(enum reboot_mode mode, const char *cmd)
 	__raw_writel(val, addr);
 }
 
+static void exynos5440_power_off(void)
+{
+	struct device_node *np;
+	void __iomem *addr;
+
+	np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
+
+	addr = of_iomap(np, 0) + 0x14;
+
+	__raw_writel(0x1, addr);
+}
+
 void __init exynos_init_late(void)
 {
-	if (of_machine_is_compatible("samsung,exynos5440"))
-		/* to be supported later */
+	if (of_machine_is_compatible("samsung,exynos5440")) {
+		pm_power_off = exynos5440_power_off;
 		return;
+	}
 
 	exynos_pm_late_initcall();
 }
Signature · 1 line
1.7.10.4
#1 lore raw

arch/arm/mach-exynos/common.c void exynos5_restart(enum reboot_mode mode, const char *cmd) · line 306

Quoted 11 lines · Jungseok Lee
arch/arm/mach-exynos/common.c +10 -0
+static void exynos5440_power_off(void)
+{
+       struct device_node *np;
+       void __iomem *addr;
+
+       np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
+
+       addr = of_iomap(np, 0) + 0x14;
+
+       __raw_writel(0x1, addr);

Probably the magic numbers could be defined as macros or atleast a comment to that effect would be useful.

Signature · 2 lines
With warm regards,
Sachin
#2 lore raw
Quoted 15 lines · Sachin Kamat

arch/arm/mach-exynos/common.c void exynos5_restart(enum reboot_mode mode, const char *cmd) · line 306

Quoted 11 lines · Jungseok Lee
arch/arm/mach-exynos/common.c +10 -0
+static void exynos5440_power_off(void)
+{
+       struct device_node *np;
+       void __iomem *addr;
+
+       np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
+
+       addr = of_iomap(np, 0) + 0x14;
+
+       __raw_writel(0x1, addr);

Probably the magic numbers could be defined as macros or atleast a comment to that effect would be useful.

Thanks for your suggestion.
I will add some comments on magic numbers and resend a patch. (I've also missed [PATCH] at mail title.)

Best Regards
Jungseok Lee