From 27bee16a2f42948898d2c056fde45d18b66579f3 Mon Sep 17 00:00:00 2001 From: richagar Date: Wed, 23 Sep 2020 14:22:59 +0530 Subject: [PATCH] msm-perf: Extended support for perf notification Added support for passing init info from userspace Change-Id: Ica31b6ed19e6536dadd36b35b31e5202da75490f Signed-off-by: richagar --- drivers/soc/qcom/msm_performance.c | 34 +++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/msm_performance.c b/drivers/soc/qcom/msm_performance.c index a6343ba7732f..4a3957a901a8 100644 --- a/drivers/soc/qcom/msm_performance.c +++ b/drivers/soc/qcom/msm_performance.c @@ -36,6 +36,7 @@ #define QUEUE_POOL_SIZE 512 /*2^8 always keep in 2^x */ #define INST_EV 0x08 /* 0th event*/ #define CYC_EV 0x11 /* 1st event*/ +#define INIT "Init" static DEFINE_PER_CPU(bool, cpu_is_idle); static DEFINE_PER_CPU(bool, cpu_is_hp); @@ -964,15 +965,42 @@ module_param_cb(evnt_gplaf_pid, ¶m_ops_game_start_pid, NULL, 0644); /*******************************GFX Call************************************/ -static bool splh_notif; +static int splh_notif; +static void init_splh_notif(const char *buf) +{ + /*buf contains the init info from user*/ + if (buf == NULL) + return; + + pr_debug("msm_perf:Init info for scroll :: %s\n", buf); +} + +static void activate_splh_notif(void) +{ + /*received event notification here*/ +} + static int set_splh_notif(const char *buf, const struct kernel_param *kp) { - return param_set_bool(buf, kp); + int ret; + + if (strnstr(buf, INIT, sizeof(INIT)) != NULL) { + init_splh_notif(buf); + return 0; + } + + ret = param_set_int(buf, kp); + if (ret < 0) + return ret; + + activate_splh_notif(); + + return ret; } static const struct kernel_param_ops param_ops_splh_notification = { .set = set_splh_notif, - .get = param_get_bool, + .get = param_get_int, }; module_param_cb(splh_notif, ¶m_ops_splh_notification, &splh_notif, 0644);