diff options
| -rwxr-xr-x | drivers/oneplus/input/touchscreen/touchpanel_common_driver.c | 11 |
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; |
