Re: [PATCH 2/2] rc-main: remove input events for repeat messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 22, 2017 at 09:24:00PM +0200, David Härdeman wrote:
> Protocols like NEC generate around 10 repeat events per second.
> 
> The input events are not very useful for userspace but still waste power
> by waking up every listener. So let's remove them (MSC_SCAN events
> are still generated for the initial keypress).
> 
> Signed-off-by: David Härdeman <david@xxxxxxxxxxx>
> ---
>  drivers/media/rc/rc-main.c |   13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
> index 7387bd4d75b0..9f490aa11bc4 100644
> --- a/drivers/media/rc/rc-main.c
> +++ b/drivers/media/rc/rc-main.c
> @@ -616,16 +616,11 @@ void rc_repeat(struct rc_dev *dev)
>  
>  	spin_lock_irqsave(&dev->keylock, flags);
>  
> -	if (!dev->keypressed)
> -		goto out;
> -
> -	input_event(dev->input_dev, EV_MSC, MSC_SCAN, dev->last_scancode);
> -	input_sync(dev->input_dev);

I don't agree with this. It's good to see something in user space when
a repeat received. This is useful for debugging purposes.


Sean

> -
> -	dev->keyup_jiffies = jiffies + msecs_to_jiffies(IR_KEYPRESS_TIMEOUT);
> -	mod_timer(&dev->timer_keyup, dev->keyup_jiffies);
> +	if (dev->keypressed) {
> +		dev->keyup_jiffies = jiffies + msecs_to_jiffies(IR_KEYPRESS_TIMEOUT);
> +		mod_timer(&dev->timer_keyup, dev->keyup_jiffies);
> +	}
>  
> -out:
>  	spin_unlock_irqrestore(&dev->keylock, flags);
>  }
>  EXPORT_SYMBOL_GPL(rc_repeat);



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux