msm: modem-8960: Disable modem watchdog when shutting down modem.
The modem watchdog continues to run even after the modem is shutdown.
So, disable it during shutdown to avoid a watchdog bite when the modem
is powered up again and also to save a tiny bit of power.
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
diff --git a/arch/arm/mach-msm/modem-8960.c b/arch/arm/mach-msm/modem-8960.c
index db41284..03afc94 100644
--- a/arch/arm/mach-msm/modem-8960.c
+++ b/arch/arm/mach-msm/modem-8960.c
@@ -88,8 +88,12 @@
}
}
+#define Q6_FW_WDOG_ENABLE 0x08882024
+#define Q6_SW_WDOG_ENABLE 0x08982024
static int modem_shutdown(const struct subsys_data *subsys)
{
+ void __iomem *q6_fw_wdog_addr;
+ void __iomem *q6_sw_wdog_addr;
int smsm_notif_unregistered = 0;
if (!(smsm_get_state(SMSM_MODEM_STATE) & SMSM_RESET)) {
@@ -99,6 +103,26 @@
smsm_reset_modem(SMSM_RESET);
}
+ /*
+ * Disable the modem watchdog since it keeps running even after the
+ * modem is shutdown.
+ */
+ q6_fw_wdog_addr = ioremap_nocache(Q6_FW_WDOG_ENABLE, 4);
+ if (!q6_fw_wdog_addr)
+ return -ENOMEM;
+
+ q6_sw_wdog_addr = ioremap_nocache(Q6_SW_WDOG_ENABLE, 4);
+ if (!q6_sw_wdog_addr) {
+ iounmap(q6_fw_wdog_addr);
+ return -ENOMEM;
+ }
+
+ writel_relaxed(0x0, q6_fw_wdog_addr);
+ writel_relaxed(0x0, q6_sw_wdog_addr);
+ mb();
+ iounmap(q6_sw_wdog_addr);
+ iounmap(q6_fw_wdog_addr);
+
pil_force_shutdown("modem");
pil_force_shutdown("modem_fw");
disable_irq_nosync(Q6FW_WDOG_EXPIRED_IRQ);