msm: sysmon: Introduce sysmon_get_reason() for querying failure reasons

The sysmon_get_reason() API queries a subsystem that has crashed for
the reason of the failure and returns it as string.  Common code between
this new API and sysmon_send_event() is refactored into sysmon_send_msg().

Change-Id: I1e4fda7794f493ee286346ade7b1e779a43d1e4c
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/sysmon.h b/arch/arm/mach-msm/sysmon.h
index d014187..77c3329 100644
--- a/arch/arm/mach-msm/sysmon.h
+++ b/arch/arm/mach-msm/sysmon.h
@@ -34,22 +34,10 @@
 	SYSMON_NUM_SS
 };
 
-/**
- * sysmon_send_event() - Notify a subsystem of another's state change.
- * @dest_ss:	ID of subsystem the notification should be sent to.
- * @event_ss:	String name of the subsystem that generated the notification.
- * @notif:	ID of the notification type (ex. SUBSYS_BEFORE_SHUTDOWN)
- *
- * Returns 0 for success, -EINVAL for invalid destination or notification IDs,
- * -ENODEV if the SMD channel is not open, -ETIMEDOUT if the destination
- * subsystem does not respond, and -ENOSYS if the destination subsystem
- * responds, but with something other than an acknowledgement.
- *
- * If CONFIG_MSM_SYSMON_COMM is not defined, always return success (0).
- */
 #ifdef CONFIG_MSM_SYSMON_COMM
 int sysmon_send_event(enum subsys_id dest_ss, const char *event_ss,
 		      enum subsys_notif_type notif);
+int sysmon_get_reason(enum subsys_id dest_ss, char *buf, size_t len);
 #else
 static inline int sysmon_send_event(enum subsys_id dest_ss,
 				    const char *event_ss,
@@ -57,6 +45,11 @@
 {
 	return 0;
 }
+static inline int sysmon_get_reason(enum subsys_id dest_ss, char *buf,
+				    size_t len)
+{
+	return 0;
+}
 #endif
 
 #endif