msm: mdm: enable PM8058 stay-on for 8660 Fusion download mode
This PMIC feature tells PM8058 to not reset XO clock or regulators
so that RAM and peripherals could maintain their state for debug
purpose.
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
diff --git a/arch/arm/mach-msm/mdm.c b/arch/arm/mach-msm/mdm.c
index 61c4195..a3a3aab 100644
--- a/arch/arm/mach-msm/mdm.c
+++ b/arch/arm/mach-msm/mdm.c
@@ -29,6 +29,7 @@
#include <linux/completion.h>
#include <linux/workqueue.h>
#include <linux/clk.h>
+#include <linux/mfd/pmic8058.h>
#include <asm/mach-types.h>
#include <asm/uaccess.h>
#include <mach/mdm.h>
@@ -229,6 +230,8 @@
static void charm_fatal_fn(struct work_struct *work)
{
pr_info("Reseting the charm due to an errfatal\n");
+ if (get_restart_level() == RESET_SOC)
+ pm8058_stay_on();
subsystem_restart("external_modem");
}