msm: scm: Add API to query for service/command availability.
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
This commit is contained in:
committed by
Bryan Huntsman
parent
bcef77324e
commit
988feaf8de
@@ -15,9 +15,10 @@
|
||||
#define SCM_SVC_BOOT 0x1
|
||||
#define SCM_SVC_PIL 0x2
|
||||
#define SCM_SVC_UTIL 0x3
|
||||
#define SCM_SVC_TZ 0x4
|
||||
#define SCM_SVC_IO 0x5
|
||||
#define SCM_SVC_TZSCHEDULER 0xFC
|
||||
#define SCM_SVC_TZ 0x4
|
||||
#define SCM_SVC_IO 0x5
|
||||
#define SCM_SVC_INFO 0x6
|
||||
#define SCM_SVC_TZSCHEDULER 0xFC
|
||||
|
||||
extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len,
|
||||
void *resp_buf, size_t resp_len);
|
||||
@@ -28,5 +29,6 @@ extern u32 scm_call_atomic2(u32 svc, u32 cmd, u32 arg1, u32 arg2);
|
||||
#define SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
|
||||
|
||||
extern u32 scm_get_version(void);
|
||||
extern int scm_is_call_available(u32 svc_id, u32 cmd_id);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -366,6 +366,22 @@ u32 scm_get_version(void)
|
||||
}
|
||||
EXPORT_SYMBOL(scm_get_version);
|
||||
|
||||
#define IS_CALL_AVAIL_CMD 1
|
||||
int scm_is_call_available(u32 svc_id, u32 cmd_id)
|
||||
{
|
||||
int ret;
|
||||
u32 svc_cmd = (svc_id << 10) | cmd_id;
|
||||
u32 ret_val = 0;
|
||||
|
||||
ret = scm_call(SCM_SVC_INFO, IS_CALL_AVAIL_CMD, &svc_cmd,
|
||||
sizeof(svc_cmd), &ret_val, sizeof(ret_val));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
EXPORT_SYMBOL(scm_is_call_available);
|
||||
|
||||
static int scm_init(void)
|
||||
{
|
||||
u32 ctr;
|
||||
|
||||
Reference in New Issue
Block a user