[media] dvbsky: add option to disable IR receiver
authorOlli Salonen <olli.salonen@iki.fi>
Sun, 12 Oct 2014 11:31:38 +0000 (08:31 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 3 Nov 2014 13:06:43 +0000 (11:06 -0200)
Add an option to disable remote controller for DVBSky devices by specifying
the disable_rc option at modprobe.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/dvb-usb-v2/dvbsky.c

index f390a046d39d04ea2b27721a18b7c1d3c5259daf..2499635df52fa28f357556af75acfb6ebd2dd3cd 100644 (file)
 #define DVBSKY_MSG_DELAY       0/*2000*/
 #define DVBSKY_BUF_LEN 64
 
+static int dvb_usb_dvbsky_disable_rc;
+module_param_named(disable_rc, dvb_usb_dvbsky_disable_rc, int, 0644);
+MODULE_PARM_DESC(disable_rc, "Disable inbuilt IR receiver.");
+
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 struct dvbsky_state {
@@ -213,6 +217,11 @@ static int dvbsky_rc_query(struct dvb_usb_device *d)
 
 static int dvbsky_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc)
 {
+       if (dvb_usb_dvbsky_disable_rc) {
+               rc->map_name = NULL;
+               return 0;
+       }
+
        rc->allowed_protos = RC_BIT_RC5;
        rc->query          = dvbsky_rc_query;
        rc->interval       = 300;