]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/power/reset/msm-poweroff.c
power: reset: set arm_pm_restart hook in msm-poweroff driver
[karo-tx-linux.git] / drivers / power / reset / msm-poweroff.c
index 4702efdfe466626f97f2b887868e47f611107d17..082ec66018d114ac138bdceb0abe790bc0fdae94 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/reboot.h>
 #include <linux/pm.h>
+#include <asm/system_misc.h>
 
 static void __iomem *msm_ps_hold;
 static int do_msm_restart(struct notifier_block *nb, unsigned long action,
@@ -37,6 +38,11 @@ static struct notifier_block restart_nb = {
        .priority = 128,
 };
 
+static inline void __do_msm_restart(enum reboot_mode reboot_mode, const char *cmd)
+{
+       do_msm_restart(&restart_nb, 0, NULL);
+}
+
 static void do_msm_poweroff(void)
 {
        /* TODO: Add poweroff capability */
@@ -55,6 +61,7 @@ static int msm_restart_probe(struct platform_device *pdev)
 
        register_restart_handler(&restart_nb);
 
+       arm_pm_restart = __do_msm_restart;
        pm_power_off = do_msm_poweroff;
 
        return 0;
@@ -62,7 +69,7 @@ static int msm_restart_probe(struct platform_device *pdev)
 
 static const struct of_device_id of_msm_restart_match[] = {
        { .compatible = "qcom,pshold", },
-       {},
+       {}
 };
 MODULE_DEVICE_TABLE(of, of_msm_restart_match);