]> err.no Git - linux-2.6/blobdiff - drivers/media/dvb/dvb-usb/dib0700_core.c
Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux
[linux-2.6] / drivers / media / dvb / dvb-usb / dib0700_core.c
index 3ea294eb96bdedc4a7b6e12dfa3af42143cedb6c..595a04696c87af2590588bf87013a44b8e44aa7c 100644 (file)
@@ -13,10 +13,12 @@ int dvb_usb_dib0700_debug;
 module_param_named(debug,dvb_usb_dib0700_debug, int, 0644);
 MODULE_PARM_DESC(debug, "set debugging level (1=info,2=fw,4=fwdata,8=data (or-able))." DVB_USB_DEBUG_STATUS);
 
-static int dvb_usb_dib0700_ir_proto = 1;
+int dvb_usb_dib0700_ir_proto = 1;
 module_param(dvb_usb_dib0700_ir_proto, int, 0644);
 MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6).");
 
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
 /* expecting rx buffer: request data[0] data[1] ... data[2] */
 static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen)
 {
@@ -243,7 +245,7 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
        u8 b[4];
 
        b[0] = REQUEST_ENABLE_VIDEO;
-       b[1] = 0x00;
+       b[1] = (onoff << 4) | 0x00; /* this bit gives a kind of command, rather than enabling something or not */
        b[2] = (0x01 << 4); /* Master mode */
        b[3] = 0x00;
 
@@ -256,15 +258,12 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
 
        b[2] |= st->channel_state;
 
-       if (st->channel_state) /* if at least one channel is active */
-               b[1] = (0x01 << 4) | 0x00;
-
        deb_info("data for streaming: %x %x\n",b[1],b[2]);
 
        return dib0700_ctrl_wr(adap->dev, b, 4);
 }
 
-static int dib0700_rc_setup(struct dvb_usb_device *d)
+int dib0700_rc_setup(struct dvb_usb_device *d)
 {
        u8 rc_setup[3] = {REQUEST_SET_RC, dvb_usb_dib0700_ir_proto, 0};
        int i = dib0700_ctrl_wr(d, rc_setup, 3);
@@ -282,7 +281,8 @@ static int dib0700_probe(struct usb_interface *intf,
        struct dvb_usb_device *dev;
 
        for (i = 0; i < dib0700_device_count; i++)
-               if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev) == 0)
+               if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE,
+                                       &dev, adapter_nr) == 0)
                {
                        dib0700_rc_setup(dev);
                        return 0;