Loading drivers/input/misc/hbtp_input.c +11 −3 Original line number Diff line number Diff line /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -89,6 +89,7 @@ struct hbtp_data { u32 power_on_delay; u32 power_off_delay; bool manage_pin_ctrl; bool init_completion_done_once; s16 ROI[MAX_ROI_SIZE]; s16 accelBuffer[MAX_ACCEL_SIZE]; }; Loading Loading @@ -815,8 +816,14 @@ static long hbtp_input_ioctl_handler(struct file *file, unsigned int cmd, return -EFAULT; } mutex_lock(&hbtp->mutex); if (hbtp->init_completion_done_once) { reinit_completion(&hbtp->power_resume_sig); reinit_completion(&hbtp->power_suspend_sig); } else { init_completion(&hbtp->power_resume_sig); init_completion(&hbtp->power_suspend_sig); hbtp->init_completion_done_once = true; } hbtp->power_sig_enabled = true; mutex_unlock(&hbtp->mutex); pr_err("%s: sync_signal option is enabled\n", __func__); Loading Loading @@ -1523,6 +1530,7 @@ static int __init hbtp_init(void) mutex_init(&hbtp->mutex); mutex_init(&hbtp->sensormutex); hbtp->init_completion_done_once = false; error = misc_register(&hbtp_input_misc); if (error) { Loading Loading
drivers/input/misc/hbtp_input.c +11 −3 Original line number Diff line number Diff line /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -89,6 +89,7 @@ struct hbtp_data { u32 power_on_delay; u32 power_off_delay; bool manage_pin_ctrl; bool init_completion_done_once; s16 ROI[MAX_ROI_SIZE]; s16 accelBuffer[MAX_ACCEL_SIZE]; }; Loading Loading @@ -815,8 +816,14 @@ static long hbtp_input_ioctl_handler(struct file *file, unsigned int cmd, return -EFAULT; } mutex_lock(&hbtp->mutex); if (hbtp->init_completion_done_once) { reinit_completion(&hbtp->power_resume_sig); reinit_completion(&hbtp->power_suspend_sig); } else { init_completion(&hbtp->power_resume_sig); init_completion(&hbtp->power_suspend_sig); hbtp->init_completion_done_once = true; } hbtp->power_sig_enabled = true; mutex_unlock(&hbtp->mutex); pr_err("%s: sync_signal option is enabled\n", __func__); Loading Loading @@ -1523,6 +1530,7 @@ static int __init hbtp_init(void) mutex_init(&hbtp->mutex); mutex_init(&hbtp->sensormutex); hbtp->init_completion_done_once = false; error = misc_register(&hbtp_input_misc); if (error) { Loading