aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibXZR <xzr467706992@163.com>2021-01-22 20:45:50 +0800
committerSemavi Ulusoy <doc.divxm@gmail.com>2021-10-09 20:04:28 +0300
commitf228ed6447c0a65bf4b53674f59346d2f2b57f1b (patch)
treec00d0b7bbd99188d013f0d802a9ebf82e6e9382a
parent3137d0f3ed756fa11bdddb5b2c10b538e5acdcb5 (diff)
touchpanel_common_driver: Expose gaming statusr11.1
* Game center writes this node when entering a game Signed-off-by: LibXZR <xzr467706992@163.com> Signed-off-by: chandu078 <chandudyavanapelli03@gmail.com> Change-Id: If8b17a35bd18e5772db76d4ea1c159a48801b2c2
-rwxr-xr-xdrivers/oneplus/input/touchscreen/touchpanel_common_driver.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c b/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
index e370a025a03d..825f5f33b3c1 100755
--- a/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
+++ b/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
@@ -1329,6 +1329,8 @@ static const struct file_operations proc_write_ps_status_fops = {
.owner = THIS_MODULE,
};
+bool is_gaming __read_mostly;
+
//proc/touchpanel/game_switch_enable
static ssize_t proc_game_switch_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{
@@ -1336,9 +1338,6 @@ static ssize_t proc_game_switch_write(struct file *file, const char __user *buff
char buf[4] = {0};
struct touchpanel_data *ts = PDE_DATA(file_inode(file));
- if (ts->force_game_switch)
- return count;
-
if (count > 4) {
TPD_INFO("%s:count > 4\n",__func__);
return count;
@@ -1358,6 +1357,12 @@ static ssize_t proc_game_switch_write(struct file *file, const char __user *buff
return count;
}
sscanf(buf, "%x", &value);
+
+ is_gaming = value > 0;
+
+ if (ts->force_game_switch)
+ return count;
+
ts->noise_level = value;
ts->game_mode_status = value > 0 ? 1 : 0;