blob: 429a15571e4070d5a4b5bb06a52ff30aa5cb3c6e [file] [log] [blame]
Matt Wagantallf8020902011-08-30 21:19:23 -07001/*
2 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __MSM_SYSMON_H
16#define __MSM_SYSMON_H
17
18#include <mach/subsystem_notif.h>
19
Matt Wagantall14080c12011-10-19 12:24:00 -070020/**
21 * enum subsys_id - Destination subsystems for events.
22 */
Matt Wagantallf8020902011-08-30 21:19:23 -070023enum subsys_id {
24 SYSMON_SS_MODEM,
25 SYSMON_SS_LPASS,
26 SYSMON_SS_WCNSS,
27 SYSMON_SS_DSPS,
28 SYSMON_SS_Q6FW,
29 SYSMON_NUM_SS
30};
31
Matt Wagantall14080c12011-10-19 12:24:00 -070032
33/**
34 * sysmon_send_event() - Notify a subsystem of another's state change.
35 * @dest_ss: ID of subsystem the notification should be sent to.
36 * @event_ss: String name of the subsystem that generated the notification.
37 * @notif: ID of the notification type (ex. SUBSYS_BEFORE_SHUTDOWN)
38 *
39 * Returns 0 for success, -EINVAL for invalid destination or notification IDs,
40 * -ENODEV if the SMD channel is not open, -ETIMEDOUT if the destination
41 * subsystem does not respond, and -ENOSYS if the destination subsystem
42 * responds, but with something other than an acknowledgement.
43 *
44 * If CONFIG_MSM_SYSMON_COMM is not defined, always return success (0).
45 */
Matt Wagantallf8020902011-08-30 21:19:23 -070046#ifdef CONFIG_MSM_SYSMON_COMM
47int sysmon_send_event(enum subsys_id dest_ss, const char *event_ss,
48 enum subsys_notif_type notif);
49#else
50static inline int sysmon_send_event(enum subsys_id dest_ss,
51 const char *event_ss,
52 enum subsys_notif_type notif)
53{
54 return 0;
55}
56#endif
57
58#endif