msm: mdm: Shutdown specific external modem

The shutdown ioctl now gets the system monitor id for the modem to shutdown
from the platform data structure rather than using a hardcoded value.

Change-Id: Ibe7666075903258932014bcf4c79aba0f71184fd
Signed-off-by: Ameya Thakur <ameyat@codeaurora.org>
diff --git a/arch/arm/mach-msm/mdm_common.c b/arch/arm/mach-msm/mdm_common.c
index 63f1af0..07d05be 100644
--- a/arch/arm/mach-msm/mdm_common.c
+++ b/arch/arm/mach-msm/mdm_common.c
@@ -499,14 +499,18 @@
 			pr_debug("%s Image upgrade not supported\n", __func__);
 		break;
 	case SHUTDOWN_CHARM:
-		if (!mdm_drv->pdata->send_shdn)
+		if (!mdm_drv->pdata->send_shdn ||
+				!mdm_drv->pdata->sysmon_subsys_id_valid) {
+			pr_debug("%s shutdown not supported for this mdm\n",
+					__func__);
 			break;
+		}
 		atomic_set(&mdm_drv->mdm_ready, 0);
 		if (mdm_debug_mask & MDM_DEBUG_MASK_SHDN_LOG)
 			pr_info("Sending shutdown request to mdm\n");
-		ret = sysmon_send_shutdown(SYSMON_SS_EXT_MODEM);
+		ret = sysmon_send_shutdown(mdm_drv->pdata->sysmon_subsys_id);
 		if (ret)
-			pr_err("%s: Graceful shutdown of the external modem failed, ret = %d\n",
+			pr_err("%s:Graceful shutdown of mdm failed, ret = %d\n",
 			   __func__, ret);
 		break;
 	default: