summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2015-01-20 20:05:01 +0800
committerAndy Green <andy.green@linaro.org>2015-01-22 00:57:53 +0800
commit35f325fea6bc95f0b5ea5c67a74e2f4b440dad3e (patch)
treef4bf9cf8eb0db6aa722c384fe2de0ba323aad15b
parent2c2a94cf9cc52001bde2f2a5f6fd47de09cd6042 (diff)
ARM: qcom: scm: Add a feat version query API
Some users of SCM need to detect features and also detect if those features have certain versions available. Add this API. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Kumar Gala <galak@codeaurora.org>
-rw-r--r--arch/arm/mach-qcom/scm.c13
-rw-r--r--arch/arm/mach-qcom/scm.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-qcom/scm.c b/arch/arm/mach-qcom/scm.c
index 081099c37574..884fcd61a76d 100644
--- a/arch/arm/mach-qcom/scm.c
+++ b/arch/arm/mach-qcom/scm.c
@@ -338,3 +338,16 @@ int scm_is_call_available(u32 svc_id, u32 cmd_id)
return ret_val;
}
EXPORT_SYMBOL(scm_is_call_available);
+
+#define GET_FEAT_VERSION_CMD 3
+int scm_get_feat_version(u32 feat)
+{
+ if (scm_is_call_available(SCM_SVC_INFO, GET_FEAT_VERSION_CMD)) {
+ u32 version;
+ if (!scm_call(SCM_SVC_INFO, GET_FEAT_VERSION_CMD, &feat,
+ sizeof(feat), &version, sizeof(version)))
+ return version;
+ }
+ return 0;
+}
+EXPORT_SYMBOL(scm_get_feat_version);
diff --git a/arch/arm/mach-qcom/scm.h b/arch/arm/mach-qcom/scm.h
index 6fa8d55981a3..dcb4098802c0 100644
--- a/arch/arm/mach-qcom/scm.h
+++ b/arch/arm/mach-qcom/scm.h
@@ -23,5 +23,6 @@ extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len,
extern u32 scm_get_version(void);
extern int scm_is_call_available(u32 svc_id, u32 cmd_id);
+extern int scm_get_feat_version(u32 feat);
#endif