diff mbox

[4/7] em28xx: reduce the polling interval for buttons

Message ID 1385932017-2276-5-git-send-email-fschaefer.oss@googlemail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Frank Schäfer Dec. 1, 2013, 9:06 p.m. UTC
For GPI-connected buttons without (hardware) debouncing, the polling interval 
needs to be reduced to detect button presses properly.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
 drivers/media/usb/em28xx/em28xx-input.c |    2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

Comments

Mauro Carvalho Chehab Dec. 10, 2013, 9:27 p.m. UTC | #1
Em Sun,  1 Dec 2013 22:06:54 +0100
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:

> For GPI-connected buttons without (hardware) debouncing, the polling interval 
> needs to be reduced to detect button presses properly.
> 
> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> ---
>  drivers/media/usb/em28xx/em28xx-input.c |    2 +-
>  1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)
> 
> diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
> index ebc5387..c8f7ecb 100644
> --- a/drivers/media/usb/em28xx/em28xx-input.c
> +++ b/drivers/media/usb/em28xx/em28xx-input.c
> @@ -31,7 +31,7 @@
>  #include "em28xx.h"
>  
>  #define EM28XX_SNAPSHOT_KEY KEY_CAMERA
> -#define EM28XX_BUTTONS_QUERY_INTERVAL 500
> +#define EM28XX_BUTTONS_QUERY_INTERVAL 100
>  
>  static unsigned int ir_debug;
>  module_param(ir_debug, int, 0644);

I don't like this patch. If the reduced timeout is needed for the GPI
connected buttons, you should not change it for the other buttons, as
polling has a high cost, in terms of CPU sleep state (so, a more frequent
polling time drains more power - meaning a lower time when battery is in
usage).
diff mbox

Patch

diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index ebc5387..c8f7ecb 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -31,7 +31,7 @@ 
 #include "em28xx.h"
 
 #define EM28XX_SNAPSHOT_KEY KEY_CAMERA
-#define EM28XX_BUTTONS_QUERY_INTERVAL 500
+#define EM28XX_BUTTONS_QUERY_INTERVAL 100
 
 static unsigned int ir_debug;
 module_param(ir_debug, int, 0644);