All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] V4L/DVB: cx88: Add module parameter to disable IR
@ 2010-11-18  6:43 Jeremy Kerr
  2010-11-18  7:24 ` Mariusz Białończyk
       [not found] ` <4CE4D3D5.5090108@skyboo.net>
  0 siblings, 2 replies; 3+ messages in thread
From: Jeremy Kerr @ 2010-11-18  6:43 UTC (permalink / raw)
  To: linux-media

From: Jeremy Kerr <jk@ozlabs.org>

Currently, the cx88-input code unconditionally establishes an input
device for IR events. On some cards, this sets up a hrtimer to poll the
IR status frequently - I get around 200 wakeups per second from this
polling, and don't use the IR ports.

Although the hrtimer is only run when the input device is opened, the
device is actually unconditionally opened by kbd_connect, because we
have the EV_KEY bit set in the input device descriptor. In effect, the
IR device is always opened (and so polling) if CONFIG_VT.

This change adds a module parameter, 'ir_disable' to disable the IR
code, and not register this input device at all. This drastically
reduces the number of wakeups per second for me.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 drivers/media/video/cx88/cx88-input.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index fc777bc..d49af18 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -67,6 +67,10 @@ static int ir_debug;
 module_param(ir_debug, int, 0644);	/* debug level [IR] */
 MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
 
+static int ir_disable;
+module_param(ir_disable, int, 0644);
+MODULE_PARM_DESC(ir_disable, "disable IR support");
+
 #define ir_dprintk(fmt, arg...)	if (ir_debug) \
 	printk(KERN_DEBUG "%s IR: " fmt , ir->core->name , ##arg)
 
@@ -244,6 +248,9 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
 				 * used with a full-code IR table
 				 */
 
+	if (ir_disable)
+		return 0;
+
 	ir = kzalloc(sizeof(*ir), GFP_KERNEL);
 	input_dev = input_allocate_device();
 	if (!ir || !input_dev)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-18  7:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18  6:43 [PATCH] V4L/DVB: cx88: Add module parameter to disable IR Jeremy Kerr
2010-11-18  7:24 ` Mariusz Białończyk
     [not found] ` <4CE4D3D5.5090108@skyboo.net>
2010-11-18  7:30   ` Jeremy Kerr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.