V4L/DVB (7071): DiB0700: Start streaming the right way
[safe/jmp/linux-2.6] / drivers / media / dvb / dvb-usb / gl861.c
index e0587e6..6b99d9f 100644 (file)
@@ -56,12 +56,12 @@ static int gl861_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
        struct dvb_usb_device *d = i2c_get_adapdata(adap);
        int i;
 
-       if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
-               return -EAGAIN;
-
        if (num > 2)
                return -EINVAL;
 
+       if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+               return -EAGAIN;
+
        for (i = 0; i < num; i++) {
                /* write/read request */
                if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
@@ -157,6 +157,7 @@ static int gl861_probe(struct usb_interface *intf,
 
 static struct usb_device_id gl861_table [] = {
                { USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580_55801) },
+               { USB_DEVICE(USB_VID_ALINK, USB_VID_ALINK_DTU) },
                { }             /* Terminating entry */
 };
 MODULE_DEVICE_TABLE (usb, gl861_table);
@@ -187,12 +188,16 @@ static struct dvb_usb_device_properties gl861_properties = {
        }},
        .i2c_algo         = &gl861_i2c_algo,
 
-       .num_device_descs = 1,
+       .num_device_descs = 2,
        .devices = {
                {   "MSI Mega Sky 55801 DVB-T USB2.0",
                        { &gl861_table[0], NULL },
                        { NULL },
                },
+               {   "A-LINK DTU DVB-T USB2.0",
+                       { &gl861_table[1], NULL },
+                       { NULL },
+               },
        }
 };