aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
committerJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
commitf1bbbb6912662b9f6070c5bfc4ca9eb1f06a9d5b (patch)
treec2c130a74be25b0b2dff992e1a195e2728bdaadd /drivers/media/dvb
parentfd0961ff67727482bb20ca7e8ea97b83e9de2ddb (diff)
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dm1105/dm1105.c2
-rw-r--r--drivers/media/dvb/dvb-core/dmxdev.c31
-rw-r--r--drivers/media/dvb/dvb-core/dvb_ca_en50221.c17
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c30
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c27
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c17
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.h11
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig4
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c4
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h1
-rw-r--r--drivers/media/dvb/dvb-usb/ttusb2.c95
-rw-r--r--drivers/media/dvb/firewire/firedtv-1394.c2
-rw-r--r--drivers/media/dvb/firewire/firedtv-ci.c5
-rw-r--r--drivers/media/dvb/frontends/au8522_decoder.c26
-rw-r--r--drivers/media/dvb/frontends/ds3000.c5
-rw-r--r--drivers/media/dvb/frontends/stv6110x.c5
-rw-r--r--drivers/media/dvb/ngene/ngene-cards.c15
-rw-r--r--drivers/media/dvb/ngene/ngene-core.c80
-rw-r--r--drivers/media/dvb/ngene/ngene-dvb.c15
-rw-r--r--drivers/media/dvb/ngene/ngene-i2c.c1
-rw-r--r--drivers/media/dvb/ngene/ngene.h3
-rw-r--r--drivers/media/dvb/ttpci/Kconfig5
-rw-r--r--drivers/media/dvb/ttpci/av7110.c4
-rw-r--r--drivers/media/dvb/ttpci/av7110_av.c8
-rw-r--r--drivers/media/dvb/ttpci/av7110_ca.c5
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c1
26 files changed, 279 insertions, 140 deletions
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c
index b762e561a6d5..bca07c0bcd01 100644
--- a/drivers/media/dvb/dm1105/dm1105.c
+++ b/drivers/media/dvb/dm1105/dm1105.c
@@ -594,7 +594,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)
594int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) 594int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
595{ 595{
596 struct input_dev *input_dev; 596 struct input_dev *input_dev;
597 char *ir_codes = NULL; 597 char *ir_codes = RC_MAP_DM1105_NEC;
598 int err = -ENOMEM; 598 int err = -ENOMEM;
599 599
600 input_dev = input_allocate_device(); 600 input_dev = input_allocate_device();
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c
index 9ddc57909d49..425862ffb285 100644
--- a/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/drivers/media/dvb/dvb-core/dmxdev.c
@@ -25,6 +25,7 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/smp_lock.h>
28#include <linux/poll.h> 29#include <linux/poll.h>
29#include <linux/ioctl.h> 30#include <linux/ioctl.h>
30#include <linux/wait.h> 31#include <linux/wait.h>
@@ -963,7 +964,7 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count,
963 return ret; 964 return ret;
964} 965}
965 966
966static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, 967static int dvb_demux_do_ioctl(struct file *file,
967 unsigned int cmd, void *parg) 968 unsigned int cmd, void *parg)
968{ 969{
969 struct dmxdev_filter *dmxdevfilter = file->private_data; 970 struct dmxdev_filter *dmxdevfilter = file->private_data;
@@ -1084,10 +1085,16 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file,
1084 return ret; 1085 return ret;
1085} 1086}
1086 1087
1087static int dvb_demux_ioctl(struct inode *inode, struct file *file, 1088static long dvb_demux_ioctl(struct file *file, unsigned int cmd,
1088 unsigned int cmd, unsigned long arg) 1089 unsigned long arg)
1089{ 1090{
1090 return dvb_usercopy(inode, file, cmd, arg, dvb_demux_do_ioctl); 1091 int ret;
1092
1093 lock_kernel();
1094 ret = dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
1095 unlock_kernel();
1096
1097 return ret;
1091} 1098}
1092 1099
1093static unsigned int dvb_demux_poll(struct file *file, poll_table *wait) 1100static unsigned int dvb_demux_poll(struct file *file, poll_table *wait)
@@ -1139,7 +1146,7 @@ static int dvb_demux_release(struct inode *inode, struct file *file)
1139static const struct file_operations dvb_demux_fops = { 1146static const struct file_operations dvb_demux_fops = {
1140 .owner = THIS_MODULE, 1147 .owner = THIS_MODULE,
1141 .read = dvb_demux_read, 1148 .read = dvb_demux_read,
1142 .ioctl = dvb_demux_ioctl, 1149 .unlocked_ioctl = dvb_demux_ioctl,
1143 .open = dvb_demux_open, 1150 .open = dvb_demux_open,
1144 .release = dvb_demux_release, 1151 .release = dvb_demux_release,
1145 .poll = dvb_demux_poll, 1152 .poll = dvb_demux_poll,
@@ -1152,7 +1159,7 @@ static struct dvb_device dvbdev_demux = {
1152 .fops = &dvb_demux_fops 1159 .fops = &dvb_demux_fops
1153}; 1160};
1154 1161
1155static int dvb_dvr_do_ioctl(struct inode *inode, struct file *file, 1162static int dvb_dvr_do_ioctl(struct file *file,
1156 unsigned int cmd, void *parg) 1163 unsigned int cmd, void *parg)
1157{ 1164{
1158 struct dvb_device *dvbdev = file->private_data; 1165 struct dvb_device *dvbdev = file->private_data;
@@ -1176,10 +1183,16 @@ static int dvb_dvr_do_ioctl(struct inode *inode, struct file *file,
1176 return ret; 1183 return ret;
1177} 1184}
1178 1185
1179static int dvb_dvr_ioctl(struct inode *inode, struct file *file, 1186static long dvb_dvr_ioctl(struct file *file,
1180 unsigned int cmd, unsigned long arg) 1187 unsigned int cmd, unsigned long arg)
1181{ 1188{
1182 return dvb_usercopy(inode, file, cmd, arg, dvb_dvr_do_ioctl); 1189 int ret;
1190
1191 lock_kernel();
1192 ret = dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
1193 unlock_kernel();
1194
1195 return ret;
1183} 1196}
1184 1197
1185static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait) 1198static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait)
@@ -1208,7 +1221,7 @@ static const struct file_operations dvb_dvr_fops = {
1208 .owner = THIS_MODULE, 1221 .owner = THIS_MODULE,
1209 .read = dvb_dvr_read, 1222 .read = dvb_dvr_read,
1210 .write = dvb_dvr_write, 1223 .write = dvb_dvr_write,
1211 .ioctl = dvb_dvr_ioctl, 1224 .unlocked_ioctl = dvb_dvr_ioctl,
1212 .open = dvb_dvr_open, 1225 .open = dvb_dvr_open,
1213 .release = dvb_dvr_release, 1226 .release = dvb_dvr_release,
1214 .poll = dvb_dvr_poll, 1227 .poll = dvb_dvr_poll,
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index cb22da53bfb0..ef259a0718ac 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -36,6 +36,7 @@
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/spinlock.h> 37#include <linux/spinlock.h>
38#include <linux/sched.h> 38#include <linux/sched.h>
39#include <linux/smp_lock.h>
39#include <linux/kthread.h> 40#include <linux/kthread.h>
40 41
41#include "dvb_ca_en50221.h" 42#include "dvb_ca_en50221.h"
@@ -1181,7 +1182,7 @@ static int dvb_ca_en50221_thread(void *data)
1181 * 1182 *
1182 * @return 0 on success, <0 on error. 1183 * @return 0 on success, <0 on error.
1183 */ 1184 */
1184static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file, 1185static int dvb_ca_en50221_io_do_ioctl(struct file *file,
1185 unsigned int cmd, void *parg) 1186 unsigned int cmd, void *parg)
1186{ 1187{
1187 struct dvb_device *dvbdev = file->private_data; 1188 struct dvb_device *dvbdev = file->private_data;
@@ -1255,10 +1256,16 @@ static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file,
1255 * 1256 *
1256 * @return 0 on success, <0 on error. 1257 * @return 0 on success, <0 on error.
1257 */ 1258 */
1258static int dvb_ca_en50221_io_ioctl(struct inode *inode, struct file *file, 1259static long dvb_ca_en50221_io_ioctl(struct file *file,
1259 unsigned int cmd, unsigned long arg) 1260 unsigned int cmd, unsigned long arg)
1260{ 1261{
1261 return dvb_usercopy(inode, file, cmd, arg, dvb_ca_en50221_io_do_ioctl); 1262 int ret;
1263
1264 lock_kernel();
1265 ret = dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
1266 unlock_kernel();
1267
1268 return ret;
1262} 1269}
1263 1270
1264 1271
@@ -1611,7 +1618,7 @@ static const struct file_operations dvb_ca_fops = {
1611 .owner = THIS_MODULE, 1618 .owner = THIS_MODULE,
1612 .read = dvb_ca_en50221_io_read, 1619 .read = dvb_ca_en50221_io_read,
1613 .write = dvb_ca_en50221_io_write, 1620 .write = dvb_ca_en50221_io_write,
1614 .ioctl = dvb_ca_en50221_io_ioctl, 1621 .unlocked_ioctl = dvb_ca_en50221_io_ioctl,
1615 .open = dvb_ca_en50221_io_open, 1622 .open = dvb_ca_en50221_io_open,
1616 .release = dvb_ca_en50221_io_release, 1623 .release = dvb_ca_en50221_io_release,
1617 .poll = dvb_ca_en50221_io_poll, 1624 .poll = dvb_ca_en50221_io_poll,
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 6932def4d266..44ae89ecef94 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -36,6 +36,7 @@
36#include <linux/list.h> 36#include <linux/list.h>
37#include <linux/freezer.h> 37#include <linux/freezer.h>
38#include <linux/jiffies.h> 38#include <linux/jiffies.h>
39#include <linux/smp_lock.h>
39#include <linux/kthread.h> 40#include <linux/kthread.h>
40#include <asm/processor.h> 41#include <asm/processor.h>
41 42
@@ -1195,14 +1196,14 @@ static void dtv_property_cache_submit(struct dvb_frontend *fe)
1195 } 1196 }
1196} 1197}
1197 1198
1198static int dvb_frontend_ioctl_legacy(struct inode *inode, struct file *file, 1199static int dvb_frontend_ioctl_legacy(struct file *file,
1199 unsigned int cmd, void *parg); 1200 unsigned int cmd, void *parg);
1200static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file, 1201static int dvb_frontend_ioctl_properties(struct file *file,
1201 unsigned int cmd, void *parg); 1202 unsigned int cmd, void *parg);
1202 1203
1203static int dtv_property_process_get(struct dvb_frontend *fe, 1204static int dtv_property_process_get(struct dvb_frontend *fe,
1204 struct dtv_property *tvp, 1205 struct dtv_property *tvp,
1205 struct inode *inode, struct file *file) 1206 struct file *file)
1206{ 1207{
1207 int r = 0; 1208 int r = 0;
1208 1209
@@ -1335,7 +1336,6 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
1335 1336
1336static int dtv_property_process_set(struct dvb_frontend *fe, 1337static int dtv_property_process_set(struct dvb_frontend *fe,
1337 struct dtv_property *tvp, 1338 struct dtv_property *tvp,
1338 struct inode *inode,
1339 struct file *file) 1339 struct file *file)
1340{ 1340{
1341 int r = 0; 1341 int r = 0;
@@ -1366,7 +1366,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
1366 dprintk("%s() Finalised property cache\n", __func__); 1366 dprintk("%s() Finalised property cache\n", __func__);
1367 dtv_property_cache_submit(fe); 1367 dtv_property_cache_submit(fe);
1368 1368
1369 r |= dvb_frontend_ioctl_legacy(inode, file, FE_SET_FRONTEND, 1369 r |= dvb_frontend_ioctl_legacy(file, FE_SET_FRONTEND,
1370 &fepriv->parameters); 1370 &fepriv->parameters);
1371 break; 1371 break;
1372 case DTV_FREQUENCY: 1372 case DTV_FREQUENCY:
@@ -1398,12 +1398,12 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
1398 break; 1398 break;
1399 case DTV_VOLTAGE: 1399 case DTV_VOLTAGE:
1400 fe->dtv_property_cache.voltage = tvp->u.data; 1400 fe->dtv_property_cache.voltage = tvp->u.data;
1401 r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_VOLTAGE, 1401 r = dvb_frontend_ioctl_legacy(file, FE_SET_VOLTAGE,
1402 (void *)fe->dtv_property_cache.voltage); 1402 (void *)fe->dtv_property_cache.voltage);
1403 break; 1403 break;
1404 case DTV_TONE: 1404 case DTV_TONE:
1405 fe->dtv_property_cache.sectone = tvp->u.data; 1405 fe->dtv_property_cache.sectone = tvp->u.data;
1406 r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_TONE, 1406 r = dvb_frontend_ioctl_legacy(file, FE_SET_TONE,
1407 (void *)fe->dtv_property_cache.sectone); 1407 (void *)fe->dtv_property_cache.sectone);
1408 break; 1408 break;
1409 case DTV_CODE_RATE_HP: 1409 case DTV_CODE_RATE_HP:
@@ -1487,7 +1487,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
1487 return r; 1487 return r;
1488} 1488}
1489 1489
1490static int dvb_frontend_ioctl(struct inode *inode, struct file *file, 1490static int dvb_frontend_ioctl(struct file *file,
1491 unsigned int cmd, void *parg) 1491 unsigned int cmd, void *parg)
1492{ 1492{
1493 struct dvb_device *dvbdev = file->private_data; 1493 struct dvb_device *dvbdev = file->private_data;
@@ -1509,17 +1509,17 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
1509 return -ERESTARTSYS; 1509 return -ERESTARTSYS;
1510 1510
1511 if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) 1511 if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY))
1512 err = dvb_frontend_ioctl_properties(inode, file, cmd, parg); 1512 err = dvb_frontend_ioctl_properties(file, cmd, parg);
1513 else { 1513 else {
1514 fe->dtv_property_cache.state = DTV_UNDEFINED; 1514 fe->dtv_property_cache.state = DTV_UNDEFINED;
1515 err = dvb_frontend_ioctl_legacy(inode, file, cmd, parg); 1515 err = dvb_frontend_ioctl_legacy(file, cmd, parg);
1516 } 1516 }
1517 1517
1518 up(&fepriv->sem); 1518 up(&fepriv->sem);
1519 return err; 1519 return err;
1520} 1520}
1521 1521
1522static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file, 1522static int dvb_frontend_ioctl_properties(struct file *file,
1523 unsigned int cmd, void *parg) 1523 unsigned int cmd, void *parg)
1524{ 1524{
1525 struct dvb_device *dvbdev = file->private_data; 1525 struct dvb_device *dvbdev = file->private_data;
@@ -1555,7 +1555,7 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,
1555 } 1555 }
1556 1556
1557 for (i = 0; i < tvps->num; i++) { 1557 for (i = 0; i < tvps->num; i++) {
1558 (tvp + i)->result = dtv_property_process_set(fe, tvp + i, inode, file); 1558 (tvp + i)->result = dtv_property_process_set(fe, tvp + i, file);
1559 err |= (tvp + i)->result; 1559 err |= (tvp + i)->result;
1560 } 1560 }
1561 1561
@@ -1587,7 +1587,7 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,
1587 } 1587 }
1588 1588
1589 for (i = 0; i < tvps->num; i++) { 1589 for (i = 0; i < tvps->num; i++) {
1590 (tvp + i)->result = dtv_property_process_get(fe, tvp + i, inode, file); 1590 (tvp + i)->result = dtv_property_process_get(fe, tvp + i, file);
1591 err |= (tvp + i)->result; 1591 err |= (tvp + i)->result;
1592 } 1592 }
1593 1593
@@ -1604,7 +1604,7 @@ out:
1604 return err; 1604 return err;
1605} 1605}
1606 1606
1607static int dvb_frontend_ioctl_legacy(struct inode *inode, struct file *file, 1607static int dvb_frontend_ioctl_legacy(struct file *file,
1608 unsigned int cmd, void *parg) 1608 unsigned int cmd, void *parg)
1609{ 1609{
1610 struct dvb_device *dvbdev = file->private_data; 1610 struct dvb_device *dvbdev = file->private_data;
@@ -2031,7 +2031,7 @@ static int dvb_frontend_release(struct inode *inode, struct file *file)
2031 2031
2032static const struct file_operations dvb_frontend_fops = { 2032static const struct file_operations dvb_frontend_fops = {
2033 .owner = THIS_MODULE, 2033 .owner = THIS_MODULE,
2034 .ioctl = dvb_generic_ioctl, 2034 .unlocked_ioctl = dvb_generic_ioctl,
2035 .poll = dvb_frontend_poll, 2035 .poll = dvb_frontend_poll,
2036 .open = dvb_frontend_open, 2036 .open = dvb_frontend_open,
2037 .release = dvb_frontend_release 2037 .release = dvb_frontend_release
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index cccea412088b..6c3a8a06ccab 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -59,6 +59,7 @@
59#include <linux/netdevice.h> 59#include <linux/netdevice.h>
60#include <linux/etherdevice.h> 60#include <linux/etherdevice.h>
61#include <linux/dvb/net.h> 61#include <linux/dvb/net.h>
62#include <linux/smp_lock.h>
62#include <linux/uio.h> 63#include <linux/uio.h>
63#include <asm/uaccess.h> 64#include <asm/uaccess.h>
64#include <linux/crc32.h> 65#include <linux/crc32.h>
@@ -350,6 +351,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
350 const u8 *ts, *ts_end, *from_where = NULL; 351 const u8 *ts, *ts_end, *from_where = NULL;
351 u8 ts_remain = 0, how_much = 0, new_ts = 1; 352 u8 ts_remain = 0, how_much = 0, new_ts = 1;
352 struct ethhdr *ethh = NULL; 353 struct ethhdr *ethh = NULL;
354 bool error = false;
353 355
354#ifdef ULE_DEBUG 356#ifdef ULE_DEBUG
355 /* The code inside ULE_DEBUG keeps a history of the last 100 TS cells processed. */ 357 /* The code inside ULE_DEBUG keeps a history of the last 100 TS cells processed. */
@@ -459,10 +461,16 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
459 461
460 /* Drop partly decoded SNDU, reset state, resync on PUSI. */ 462 /* Drop partly decoded SNDU, reset state, resync on PUSI. */
461 if (priv->ule_skb) { 463 if (priv->ule_skb) {
462 dev_kfree_skb( priv->ule_skb ); 464 error = true;
465 dev_kfree_skb(priv->ule_skb);
466 }
467
468 if (error || priv->ule_sndu_remain) {
463 dev->stats.rx_errors++; 469 dev->stats.rx_errors++;
464 dev->stats.rx_frame_errors++; 470 dev->stats.rx_frame_errors++;
471 error = false;
465 } 472 }
473
466 reset_ule(priv); 474 reset_ule(priv);
467 priv->need_pusi = 1; 475 priv->need_pusi = 1;
468 continue; 476 continue;
@@ -534,6 +542,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
534 from_where += 2; 542 from_where += 2;
535 } 543 }
536 544
545 priv->ule_sndu_remain = priv->ule_sndu_len + 2;
537 /* 546 /*
538 * State of current TS: 547 * State of current TS:
539 * ts_remain (remaining bytes in the current TS cell) 548 * ts_remain (remaining bytes in the current TS cell)
@@ -543,6 +552,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
543 */ 552 */
544 switch (ts_remain) { 553 switch (ts_remain) {
545 case 1: 554 case 1:
555 priv->ule_sndu_remain--;
546 priv->ule_sndu_type = from_where[0] << 8; 556 priv->ule_sndu_type = from_where[0] << 8;
547 priv->ule_sndu_type_1 = 1; /* first byte of ule_type is set. */ 557 priv->ule_sndu_type_1 = 1; /* first byte of ule_type is set. */
548 ts_remain -= 1; from_where += 1; 558 ts_remain -= 1; from_where += 1;
@@ -556,6 +566,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
556 default: /* complete ULE header is present in current TS. */ 566 default: /* complete ULE header is present in current TS. */
557 /* Extract ULE type field. */ 567 /* Extract ULE type field. */
558 if (priv->ule_sndu_type_1) { 568 if (priv->ule_sndu_type_1) {
569 priv->ule_sndu_type_1 = 0;
559 priv->ule_sndu_type |= from_where[0]; 570 priv->ule_sndu_type |= from_where[0];
560 from_where += 1; /* points to payload start. */ 571 from_where += 1; /* points to payload start. */
561 ts_remain -= 1; 572 ts_remain -= 1;
@@ -1329,7 +1340,7 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned long num)
1329 return 0; 1340 return 0;
1330} 1341}
1331 1342
1332static int dvb_net_do_ioctl(struct inode *inode, struct file *file, 1343static int dvb_net_do_ioctl(struct file *file,
1333 unsigned int cmd, void *parg) 1344 unsigned int cmd, void *parg)
1334{ 1345{
1335 struct dvb_device *dvbdev = file->private_data; 1346 struct dvb_device *dvbdev = file->private_data;
@@ -1431,10 +1442,16 @@ static int dvb_net_do_ioctl(struct inode *inode, struct file *file,
1431 return 0; 1442 return 0;
1432} 1443}
1433 1444
1434static int dvb_net_ioctl(struct inode *inode, struct file *file, 1445static long dvb_net_ioctl(struct file *file,
1435 unsigned int cmd, unsigned long arg) 1446 unsigned int cmd, unsigned long arg)
1436{ 1447{
1437 return dvb_usercopy(inode, file, cmd, arg, dvb_net_do_ioctl); 1448 int ret;
1449
1450 lock_kernel();
1451 ret = dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
1452 unlock_kernel();
1453
1454 return ret;
1438} 1455}
1439 1456
1440static int dvb_net_close(struct inode *inode, struct file *file) 1457static int dvb_net_close(struct inode *inode, struct file *file)
@@ -1455,7 +1472,7 @@ static int dvb_net_close(struct inode *inode, struct file *file)
1455 1472
1456static const struct file_operations dvb_net_fops = { 1473static const struct file_operations dvb_net_fops = {
1457 .owner = THIS_MODULE, 1474 .owner = THIS_MODULE,
1458 .ioctl = dvb_net_ioctl, 1475 .unlocked_ioctl = dvb_net_ioctl,
1459 .open = dvb_generic_open, 1476 .open = dvb_generic_open,
1460 .release = dvb_net_close, 1477 .release = dvb_net_close,
1461}; 1478};
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 94159b90f733..b915c39d782f 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -154,10 +154,11 @@ int dvb_generic_release(struct inode *inode, struct file *file)
154EXPORT_SYMBOL(dvb_generic_release); 154EXPORT_SYMBOL(dvb_generic_release);
155 155
156 156
157int dvb_generic_ioctl(struct inode *inode, struct file *file, 157long dvb_generic_ioctl(struct file *file,
158 unsigned int cmd, unsigned long arg) 158 unsigned int cmd, unsigned long arg)
159{ 159{
160 struct dvb_device *dvbdev = file->private_data; 160 struct dvb_device *dvbdev = file->private_data;
161 int ret;
161 162
162 if (!dvbdev) 163 if (!dvbdev)
163 return -ENODEV; 164 return -ENODEV;
@@ -165,7 +166,11 @@ int dvb_generic_ioctl(struct inode *inode, struct file *file,
165 if (!dvbdev->kernel_ioctl) 166 if (!dvbdev->kernel_ioctl)
166 return -EINVAL; 167 return -EINVAL;
167 168
168 return dvb_usercopy (inode, file, cmd, arg, dvbdev->kernel_ioctl); 169 lock_kernel();
170 ret = dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl);
171 unlock_kernel();
172
173 return ret;
169} 174}
170EXPORT_SYMBOL(dvb_generic_ioctl); 175EXPORT_SYMBOL(dvb_generic_ioctl);
171 176
@@ -377,9 +382,9 @@ EXPORT_SYMBOL(dvb_unregister_adapter);
377 define this as video_usercopy(). this will introduce a dependecy 382 define this as video_usercopy(). this will introduce a dependecy
378 to the v4l "videodev.o" module, which is unnecessary for some 383 to the v4l "videodev.o" module, which is unnecessary for some
379 cards (ie. the budget dvb-cards don't need the v4l module...) */ 384 cards (ie. the budget dvb-cards don't need the v4l module...) */
380int dvb_usercopy(struct inode *inode, struct file *file, 385int dvb_usercopy(struct file *file,
381 unsigned int cmd, unsigned long arg, 386 unsigned int cmd, unsigned long arg,
382 int (*func)(struct inode *inode, struct file *file, 387 int (*func)(struct file *file,
383 unsigned int cmd, void *arg)) 388 unsigned int cmd, void *arg))
384{ 389{
385 char sbuf[128]; 390 char sbuf[128];
@@ -416,7 +421,7 @@ int dvb_usercopy(struct inode *inode, struct file *file,
416 } 421 }
417 422
418 /* call driver */ 423 /* call driver */
419 if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) 424 if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD)
420 err = -EINVAL; 425 err = -EINVAL;
421 426
422 if (err < 0) 427 if (err < 0)
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
index f7b499d4a3c0..fcc6ae98745e 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@ -116,8 +116,7 @@ struct dvb_device {
116 116
117 wait_queue_head_t wait_queue; 117 wait_queue_head_t wait_queue;
118 /* don't really need those !? -- FIXME: use video_usercopy */ 118 /* don't really need those !? -- FIXME: use video_usercopy */
119 int (*kernel_ioctl)(struct inode *inode, struct file *file, 119 int (*kernel_ioctl)(struct file *file, unsigned int cmd, void *arg);
120 unsigned int cmd, void *arg);
121 120
122 void *priv; 121 void *priv;
123}; 122};
@@ -138,17 +137,15 @@ extern void dvb_unregister_device (struct dvb_device *dvbdev);
138 137
139extern int dvb_generic_open (struct inode *inode, struct file *file); 138extern int dvb_generic_open (struct inode *inode, struct file *file);
140extern int dvb_generic_release (struct inode *inode, struct file *file); 139extern int dvb_generic_release (struct inode *inode, struct file *file);
141extern int dvb_generic_ioctl (struct inode *inode, struct file *file, 140extern long dvb_generic_ioctl (struct file *file,
142 unsigned int cmd, unsigned long arg); 141 unsigned int cmd, unsigned long arg);
143 142
144/* we don't mess with video_usercopy() any more, 143/* we don't mess with video_usercopy() any more,
145we simply define out own dvb_usercopy(), which will hopefully become 144we simply define out own dvb_usercopy(), which will hopefully become
146generic_usercopy() someday... */ 145generic_usercopy() someday... */
147 146
148extern int dvb_usercopy(struct inode *inode, struct file *file, 147extern int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
149 unsigned int cmd, unsigned long arg, 148 int (*func)(struct file *file, unsigned int cmd, void *arg));
150 int (*func)(struct inode *inode, struct file *file,
151 unsigned int cmd, void *arg));
152 149
153/** generic DVB attach function. */ 150/** generic DVB attach function. */
154#ifdef CONFIG_MEDIA_ATTACH 151#ifdef CONFIG_MEDIA_ATTACH
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index e5f91f16ffa4..553b48ac1919 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -76,6 +76,7 @@ config DVB_USB_DIB0700
76 select DVB_S5H1411 if !DVB_FE_CUSTOMISE 76 select DVB_S5H1411 if !DVB_FE_CUSTOMISE
77 select DVB_LGDT3305 if !DVB_FE_CUSTOMISE 77 select DVB_LGDT3305 if !DVB_FE_CUSTOMISE
78 select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE 78 select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE
79 select DVB_TUNER_DIB0090 if !DVB_FE_CUSTOMISE
79 select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMISE 80 select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMISE
80 select MEDIA_TUNER_MT2266 if !MEDIA_TUNER_CUSTOMISE 81 select MEDIA_TUNER_MT2266 if !MEDIA_TUNER_CUSTOMISE
81 select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE 82 select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE
@@ -134,6 +135,7 @@ config DVB_USB_M920X
134 select DVB_TDA1004X if !DVB_FE_CUSTOMISE 135 select DVB_TDA1004X if !DVB_FE_CUSTOMISE
135 select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMISE 136 select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMISE
136 select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMISE 137 select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMISE
138 select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
137 help 139 help
138 Say Y here to support the MSI Mega Sky 580 USB2.0 DVB-T receiver. 140 Say Y here to support the MSI Mega Sky 580 USB2.0 DVB-T receiver.
139 Currently, only devices with a product id of 141 Currently, only devices with a product id of
@@ -264,7 +266,7 @@ config DVB_USB_DW2102
264 select DVB_STB6000 if !DVB_FE_CUSTOMISE 266 select DVB_STB6000 if !DVB_FE_CUSTOMISE
265 select DVB_CX24116 if !DVB_FE_CUSTOMISE 267 select DVB_CX24116 if !DVB_FE_CUSTOMISE
266 select DVB_SI21XX if !DVB_FE_CUSTOMISE 268 select DVB_SI21XX if !DVB_FE_CUSTOMISE
267 select DVB_TDA10021 if !DVB_FE_CUSTOMISE 269 select DVB_TDA10023 if !DVB_FE_CUSTOMISE
268 select DVB_MT312 if !DVB_FE_CUSTOMISE 270 select DVB_MT312 if !DVB_FE_CUSTOMISE
269 select DVB_ZL10039 if !DVB_FE_CUSTOMISE 271 select DVB_ZL10039 if !DVB_FE_CUSTOMISE
270 select DVB_DS3000 if !DVB_FE_CUSTOMISE 272 select DVB_DS3000 if !DVB_FE_CUSTOMISE
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 0eb490889162..11e9e85dac86 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -1026,8 +1026,10 @@ static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap)
1026 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); 1026 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
1027 1027
1028 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, 1028 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
1029 &cxusb_dualdig4_rev2_config) < 0) 1029 &cxusb_dualdig4_rev2_config) < 0) {
1030 printk(KERN_WARNING "Unable to enumerate dib7000p\n");
1030 return -ENODEV; 1031 return -ENODEV;
1032 }
1031 1033
1032 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, 1034 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
1033 &cxusb_dualdig4_rev2_config); 1035 &cxusb_dualdig4_rev2_config);
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 085c4e457e0e..b4afe6f8ed19 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -198,6 +198,7 @@
198#define USB_PID_AVERMEDIA_A850 0x850a 198#define USB_PID_AVERMEDIA_A850 0x850a
199#define USB_PID_AVERMEDIA_A805 0xa805 199#define USB_PID_AVERMEDIA_A805 0xa805
200#define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006 200#define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006
201#define USB_PID_TECHNOTREND_CONNECT_CT3650 0x300d
201#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a 202#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a
202#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081 203#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081
203#define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058 204#define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c
index 20ca9d9ee99b..a6de489a6a39 100644
--- a/drivers/media/dvb/dvb-usb/ttusb2.c
+++ b/drivers/media/dvb/dvb-usb/ttusb2.c
@@ -29,6 +29,8 @@
29 29
30#include "tda826x.h" 30#include "tda826x.h"
31#include "tda10086.h" 31#include "tda10086.h"
32#include "tda1002x.h"
33#include "tda827x.h"
32#include "lnbp21.h" 34#include "lnbp21.h"
33 35
34/* debug */ 36/* debug */
@@ -150,7 +152,17 @@ static struct tda10086_config tda10086_config = {
150 .xtal_freq = TDA10086_XTAL_16M, 152 .xtal_freq = TDA10086_XTAL_16M,
151}; 153};
152 154
153static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap) 155static struct tda10023_config tda10023_config = {
156 .demod_address = 0x0c,
157 .invert = 0,
158 .xtal = 16000000,
159 .pll_m = 11,
160 .pll_p = 3,
161 .pll_n = 1,
162 .deltaf = 0xa511,
163};
164
165static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap)
154{ 166{
155 if (usb_set_interface(adap->dev->udev,0,3) < 0) 167 if (usb_set_interface(adap->dev->udev,0,3) < 0)
156 err("set interface to alts=3 failed"); 168 err("set interface to alts=3 failed");
@@ -163,7 +175,27 @@ static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap)
163 return 0; 175 return 0;
164} 176}
165 177
166static int ttusb2_tuner_attach(struct dvb_usb_adapter *adap) 178static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap)
179{
180 if (usb_set_interface(adap->dev->udev, 0, 3) < 0)
181 err("set interface to alts=3 failed");
182 if ((adap->fe = dvb_attach(tda10023_attach, &tda10023_config, &adap->dev->i2c_adap, 0x48)) == NULL) {
183 deb_info("TDA10023 attach failed\n");
184 return -ENODEV;
185 }
186 return 0;
187}
188
189static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap)
190{
191 if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL) {
192 printk(KERN_ERR "%s: No tda827x found!\n", __func__);
193 return -ENODEV;
194 }
195 return 0;
196}
197
198static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap)
167{ 199{
168 if (dvb_attach(tda826x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) { 200 if (dvb_attach(tda826x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) {
169 deb_info("TDA8263 attach failed\n"); 201 deb_info("TDA8263 attach failed\n");
@@ -180,6 +212,7 @@ static int ttusb2_tuner_attach(struct dvb_usb_adapter *adap)
180/* DVB USB Driver stuff */ 212/* DVB USB Driver stuff */
181static struct dvb_usb_device_properties ttusb2_properties; 213static struct dvb_usb_device_properties ttusb2_properties;
182static struct dvb_usb_device_properties ttusb2_properties_s2400; 214static struct dvb_usb_device_properties ttusb2_properties_s2400;
215static struct dvb_usb_device_properties ttusb2_properties_ct3650;
183 216
184static int ttusb2_probe(struct usb_interface *intf, 217static int ttusb2_probe(struct usb_interface *intf,
185 const struct usb_device_id *id) 218 const struct usb_device_id *id)
@@ -187,6 +220,8 @@ static int ttusb2_probe(struct usb_interface *intf,
187 if (0 == dvb_usb_device_init(intf, &ttusb2_properties, 220 if (0 == dvb_usb_device_init(intf, &ttusb2_properties,
188 THIS_MODULE, NULL, adapter_nr) || 221 THIS_MODULE, NULL, adapter_nr) ||
189 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400, 222 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400,
223 THIS_MODULE, NULL, adapter_nr) ||
224 0 == dvb_usb_device_init(intf, &ttusb2_properties_ct3650,
190 THIS_MODULE, NULL, adapter_nr)) 225 THIS_MODULE, NULL, adapter_nr))
191 return 0; 226 return 0;
192 return -ENODEV; 227 return -ENODEV;
@@ -197,6 +232,8 @@ static struct usb_device_id ttusb2_table [] = {
197 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) }, 232 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) },
198 { USB_DEVICE(USB_VID_TECHNOTREND, 233 { USB_DEVICE(USB_VID_TECHNOTREND,
199 USB_PID_TECHNOTREND_CONNECT_S2400) }, 234 USB_PID_TECHNOTREND_CONNECT_S2400) },
235 { USB_DEVICE(USB_VID_TECHNOTREND,
236 USB_PID_TECHNOTREND_CONNECT_CT3650) },
200 {} /* Terminating entry */ 237 {} /* Terminating entry */
201}; 238};
202MODULE_DEVICE_TABLE (usb, ttusb2_table); 239MODULE_DEVICE_TABLE (usb, ttusb2_table);
@@ -214,8 +251,8 @@ static struct dvb_usb_device_properties ttusb2_properties = {
214 { 251 {
215 .streaming_ctrl = NULL, // ttusb2_streaming_ctrl, 252 .streaming_ctrl = NULL, // ttusb2_streaming_ctrl,
216 253
217 .frontend_attach = ttusb2_frontend_attach, 254 .frontend_attach = ttusb2_frontend_tda10086_attach,
218 .tuner_attach = ttusb2_tuner_attach, 255 .tuner_attach = ttusb2_tuner_tda826x_attach,
219 256
220 /* parameter for the MPEG2-data transfer */ 257 /* parameter for the MPEG2-data transfer */
221 .stream = { 258 .stream = {
@@ -266,8 +303,8 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = {
266 { 303 {
267 .streaming_ctrl = NULL, 304 .streaming_ctrl = NULL,
268 305
269 .frontend_attach = ttusb2_frontend_attach, 306 .frontend_attach = ttusb2_frontend_tda10086_attach,
270 .tuner_attach = ttusb2_tuner_attach, 307 .tuner_attach = ttusb2_tuner_tda826x_attach,
271 308
272 /* parameter for the MPEG2-data transfer */ 309 /* parameter for the MPEG2-data transfer */
273 .stream = { 310 .stream = {
@@ -301,6 +338,52 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = {
301 } 338 }
302}; 339};
303 340
341static struct dvb_usb_device_properties ttusb2_properties_ct3650 = {
342 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
343
344 .usb_ctrl = CYPRESS_FX2,
345
346 .size_of_priv = sizeof(struct ttusb2_state),
347
348 .num_adapters = 1,
349 .adapter = {
350 {
351 .streaming_ctrl = NULL,
352
353 .frontend_attach = ttusb2_frontend_tda10023_attach,
354 .tuner_attach = ttusb2_tuner_tda827x_attach,
355
356 /* parameter for the MPEG2-data transfer */
357 .stream = {
358 .type = USB_ISOC,
359 .count = 5,
360 .endpoint = 0x02,
361 .u = {
362 .isoc = {
363 .framesperurb = 4,
364 .framesize = 940,
365 .interval = 1,
366 }
367 }
368 }
369 },
370 },
371
372 .power_ctrl = ttusb2_power_ctrl,
373 .identify_state = ttusb2_identify_state,
374
375 .i2c_algo = &ttusb2_i2c_algo,
376
377 .generic_bulk_ctrl_endpoint = 0x01,
378
379 .num_device_descs = 1,
380 .devices = {
381 { "Technotrend TT-connect CT-3650",
382 .warm_ids = { &ttusb2_table[3], NULL },
383 },
384 }
385};
386
304static struct usb_driver ttusb2_driver = { 387static struct usb_driver ttusb2_driver = {
305 .name = "dvb_usb_ttusb2", 388 .name = "dvb_usb_ttusb2",
306 .probe = ttusb2_probe, 389 .probe = ttusb2_probe,
diff --git a/drivers/media/dvb/firewire/firedtv-1394.c b/drivers/media/dvb/firewire/firedtv-1394.c
index 26333b4f4d3e..b34ca7afb0e6 100644
--- a/drivers/media/dvb/firewire/firedtv-1394.c
+++ b/drivers/media/dvb/firewire/firedtv-1394.c
@@ -58,7 +58,7 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
58 num = hpsb_iso_n_ready(iso); 58 num = hpsb_iso_n_ready(iso);
59 59
60 if (!fdtv) { 60 if (!fdtv) {
61 dev_err(fdtv->device, "received at unknown iso channel\n"); 61 pr_err("received at unknown iso channel\n");
62 goto out; 62 goto out;
63 } 63 }
64 64
diff --git a/drivers/media/dvb/firewire/firedtv-ci.c b/drivers/media/dvb/firewire/firedtv-ci.c
index 853e04b7cb36..d3c2cf60de76 100644
--- a/drivers/media/dvb/firewire/firedtv-ci.c
+++ b/drivers/media/dvb/firewire/firedtv-ci.c
@@ -175,8 +175,7 @@ static int fdtv_ca_send_msg(struct firedtv *fdtv, void *arg)
175 return err; 175 return err;
176} 176}
177 177
178static int fdtv_ca_ioctl(struct inode *inode, struct file *file, 178static int fdtv_ca_ioctl(struct file *file, unsigned int cmd, void *arg)
179 unsigned int cmd, void *arg)
180{ 179{
181 struct dvb_device *dvbdev = file->private_data; 180 struct dvb_device *dvbdev = file->private_data;
182 struct firedtv *fdtv = dvbdev->priv; 181 struct firedtv *fdtv = dvbdev->priv;
@@ -217,7 +216,7 @@ static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait)
217 216
218static const struct file_operations fdtv_ca_fops = { 217static const struct file_operations fdtv_ca_fops = {
219 .owner = THIS_MODULE, 218 .owner = THIS_MODULE,
220 .ioctl = dvb_generic_ioctl, 219 .unlocked_ioctl = dvb_generic_ioctl,
221 .open = dvb_generic_open, 220 .open = dvb_generic_open,
222 .release = dvb_generic_release, 221 .release = dvb_generic_release,
223 .poll = fdtv_ca_io_poll, 222 .poll = fdtv_ca_io_poll,
diff --git a/drivers/media/dvb/frontends/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c
index 68dba3a4b4da..29cdbfe36852 100644
--- a/drivers/media/dvb/frontends/au8522_decoder.c
+++ b/drivers/media/dvb/frontends/au8522_decoder.c
@@ -567,30 +567,6 @@ static int au8522_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
567 567
568/* ----------------------------------------------------------------------- */ 568/* ----------------------------------------------------------------------- */
569 569
570static int au8522_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
571{
572 switch (fmt->type) {
573 default:
574 return -EINVAL;
575 }
576 return 0;
577}
578
579static int au8522_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
580{
581 switch (fmt->type) {
582 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
583 /* Not yet implemented */
584 break;
585 default:
586 return -EINVAL;
587 }
588
589 return 0;
590}
591
592/* ----------------------------------------------------------------------- */
593
594#ifdef CONFIG_VIDEO_ADV_DEBUG 570#ifdef CONFIG_VIDEO_ADV_DEBUG
595static int au8522_g_register(struct v4l2_subdev *sd, 571static int au8522_g_register(struct v4l2_subdev *sd,
596 struct v4l2_dbg_register *reg) 572 struct v4l2_dbg_register *reg)
@@ -772,8 +748,6 @@ static const struct v4l2_subdev_audio_ops au8522_audio_ops = {
772 748
773static const struct v4l2_subdev_video_ops au8522_video_ops = { 749static const struct v4l2_subdev_video_ops au8522_video_ops = {
774 .s_routing = au8522_s_video_routing, 750 .s_routing = au8522_s_video_routing,
775 .g_fmt = au8522_g_fmt,
776 .s_fmt = au8522_s_fmt,
777 .s_stream = au8522_s_stream, 751 .s_stream = au8522_s_stream,
778}; 752};
779 753
diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c
index 78001e8bcdb7..fc61d9230db8 100644
--- a/drivers/media/dvb/frontends/ds3000.c
+++ b/drivers/media/dvb/frontends/ds3000.c
@@ -969,15 +969,12 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config,
969 dprintk("%s\n", __func__); 969 dprintk("%s\n", __func__);
970 970
971 /* allocate memory for the internal state */ 971 /* allocate memory for the internal state */
972 state = kmalloc(sizeof(struct ds3000_state), GFP_KERNEL); 972 state = kzalloc(sizeof(struct ds3000_state), GFP_KERNEL);
973 if (state == NULL) { 973 if (state == NULL) {
974 printk(KERN_ERR "Unable to kmalloc\n"); 974 printk(KERN_ERR "Unable to kmalloc\n");
975 goto error2; 975 goto error2;
976 } 976 }
977 977
978 /* setup the state */
979 memset(state, 0, sizeof(struct ds3000_state));
980
981 state->config = config; 978 state->config = config;
982 state->i2c = i2c; 979 state->i2c = i2c;
983 state->prevUCBS2 = 0; 980 state->prevUCBS2 = 0;
diff --git a/drivers/media/dvb/frontends/stv6110x.c b/drivers/media/dvb/frontends/stv6110x.c
index 42591ce1aaad..f36cab12bdc7 100644
--- a/drivers/media/dvb/frontends/stv6110x.c
+++ b/drivers/media/dvb/frontends/stv6110x.c
@@ -303,7 +303,10 @@ static int stv6110x_set_mode(struct dvb_frontend *fe, enum tuner_mode mode)
303 303
304static int stv6110x_sleep(struct dvb_frontend *fe) 304static int stv6110x_sleep(struct dvb_frontend *fe)
305{ 305{
306 return stv6110x_set_mode(fe, TUNER_SLEEP); 306 if (fe->tuner_priv)
307 return stv6110x_set_mode(fe, TUNER_SLEEP);
308
309 return 0;
307} 310}
308 311
309static int stv6110x_get_status(struct dvb_frontend *fe, u32 *status) 312static int stv6110x_get_status(struct dvb_frontend *fe, u32 *status)
diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c
index 692c3e226e83..4692a41ad95b 100644
--- a/drivers/media/dvb/ngene/ngene-cards.c
+++ b/drivers/media/dvb/ngene/ngene-cards.c
@@ -217,6 +217,19 @@ static struct ngene_info ngene_info_cineS2v5 = {
217 .fw_version = 15, 217 .fw_version = 15,
218}; 218};
219 219
220static struct ngene_info ngene_info_duoFlexS2 = {
221 .type = NGENE_SIDEWINDER,
222 .name = "Digital Devices DuoFlex S2 miniPCIe",
223 .io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN},
224 .demod_attach = {demod_attach_stv0900, demod_attach_stv0900},
225 .tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110},
226 .fe_config = {&fe_cineS2, &fe_cineS2},
227 .tuner_config = {&tuner_cineS2_0, &tuner_cineS2_1},
228 .lnb = {0x0a, 0x08},
229 .tsf = {3, 3},
230 .fw_version = 15,
231};
232
220static struct ngene_info ngene_info_m780 = { 233static struct ngene_info ngene_info_m780 = {
221 .type = NGENE_APP, 234 .type = NGENE_APP,
222 .name = "Aver M780 ATSC/QAM-B", 235 .name = "Aver M780 ATSC/QAM-B",
@@ -256,6 +269,8 @@ static const struct pci_device_id ngene_id_tbl[] __devinitdata = {
256 NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2), 269 NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),
257 NGENE_ID(0x18c3, 0xdb02, ngene_info_satixS2v2), 270 NGENE_ID(0x18c3, 0xdb02, ngene_info_satixS2v2),
258 NGENE_ID(0x18c3, 0xdd00, ngene_info_cineS2v5), 271 NGENE_ID(0x18c3, 0xdd00, ngene_info_cineS2v5),
272 NGENE_ID(0x18c3, 0xdd10, ngene_info_duoFlexS2),
273 NGENE_ID(0x18c3, 0xdd20, ngene_info_duoFlexS2),
259 NGENE_ID(0x1461, 0x062e, ngene_info_m780), 274 NGENE_ID(0x1461, 0x062e, ngene_info_m780),
260 {0} 275 {0}
261}; 276};
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c
index c8b4dfa0ab5f..4caeb163a666 100644
--- a/drivers/media/dvb/ngene/ngene-core.c
+++ b/drivers/media/dvb/ngene/ngene-core.c
@@ -53,8 +53,6 @@ MODULE_PARM_DESC(debug, "Print debugging information.");
53 53
54DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 54DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
55 55
56#define COMMAND_TIMEOUT_WORKAROUND
57
58#define dprintk if (debug) printk 56#define dprintk if (debug) printk
59 57
60#define ngwriteb(dat, adr) writeb((dat), (char *)(dev->iomem + (adr))) 58#define ngwriteb(dat, adr) writeb((dat), (char *)(dev->iomem + (adr)))
@@ -147,24 +145,24 @@ static void demux_tasklet(unsigned long data)
147 } else { 145 } else {
148 if (chan->HWState == HWSTATE_RUN) { 146 if (chan->HWState == HWSTATE_RUN) {
149 u32 Flags = 0; 147 u32 Flags = 0;
148 IBufferExchange *exch1 = chan->pBufferExchange;
149 IBufferExchange *exch2 = chan->pBufferExchange2;
150 if (Cur->ngeneBuffer.SR.Flags & 0x01) 150 if (Cur->ngeneBuffer.SR.Flags & 0x01)
151 Flags |= BEF_EVEN_FIELD; 151 Flags |= BEF_EVEN_FIELD;
152 if (Cur->ngeneBuffer.SR.Flags & 0x20) 152 if (Cur->ngeneBuffer.SR.Flags & 0x20)
153 Flags |= BEF_OVERFLOW; 153 Flags |= BEF_OVERFLOW;
154 if (chan->pBufferExchange) 154 spin_unlock_irq(&chan->state_lock);
155 chan->pBufferExchange(chan, 155 if (exch1)
156 Cur->Buffer1, 156 exch1(chan, Cur->Buffer1,
157 chan-> 157 chan->Capture1Length,
158 Capture1Length, 158 Cur->ngeneBuffer.SR.Clock,
159 Cur->ngeneBuffer. 159 Flags);
160 SR.Clock, Flags); 160 if (exch2)
161 if (chan->pBufferExchange2) 161 exch2(chan, Cur->Buffer2,
162 chan->pBufferExchange2(chan, 162 chan->Capture2Length,
163 Cur->Buffer2, 163 Cur->ngeneBuffer.SR.Clock,
164 chan-> 164 Flags);
165 Capture2Length, 165 spin_lock_irq(&chan->state_lock);
166 Cur->ngeneBuffer.
167 SR.Clock, Flags);
168 } else if (chan->HWState != HWSTATE_STOP) 166 } else if (chan->HWState != HWSTATE_STOP)
169 chan->HWState = HWSTATE_RUN; 167 chan->HWState = HWSTATE_RUN;
170 } 168 }
@@ -572,11 +570,7 @@ static int ngene_command_stream_control(struct ngene *dev, u8 stream,
572 u16 BsSPI = ((stream & 1) ? 0x9800 : 0x9700); 570 u16 BsSPI = ((stream & 1) ? 0x9800 : 0x9700);
573 u16 BsSDO = 0x9B00; 571 u16 BsSDO = 0x9B00;
574 572
575 /* down(&dev->stream_mutex); */ 573 down(&dev->stream_mutex);
576 while (down_trylock(&dev->stream_mutex)) {
577 printk(KERN_INFO DEVICE_NAME ": SC locked\n");
578 msleep(1);
579 }
580 memset(&com, 0, sizeof(com)); 574 memset(&com, 0, sizeof(com));
581 com.cmd.hdr.Opcode = CMD_CONTROL; 575 com.cmd.hdr.Opcode = CMD_CONTROL;
582 com.cmd.hdr.Length = sizeof(struct FW_STREAM_CONTROL) - 2; 576 com.cmd.hdr.Length = sizeof(struct FW_STREAM_CONTROL) - 2;
@@ -1252,14 +1246,17 @@ static int ngene_load_firm(struct ngene *dev)
1252 version = 15; 1246 version = 15;
1253 size = 23466; 1247 size = 23466;
1254 fw_name = "ngene_15.fw"; 1248 fw_name = "ngene_15.fw";
1249 dev->cmd_timeout_workaround = true;
1255 break; 1250 break;
1256 case 16: 1251 case 16:
1257 size = 23498; 1252 size = 23498;
1258 fw_name = "ngene_16.fw"; 1253 fw_name = "ngene_16.fw";
1254 dev->cmd_timeout_workaround = true;
1259 break; 1255 break;
1260 case 17: 1256 case 17:
1261 size = 24446; 1257 size = 24446;
1262 fw_name = "ngene_17.fw"; 1258 fw_name = "ngene_17.fw";
1259 dev->cmd_timeout_workaround = true;
1263 break; 1260 break;
1264 } 1261 }
1265 1262
@@ -1299,11 +1296,16 @@ static void ngene_stop(struct ngene *dev)
1299 ngwritel(0, NGENE_EVENT); 1296 ngwritel(0, NGENE_EVENT);
1300 ngwritel(0, NGENE_EVENT_HI); 1297 ngwritel(0, NGENE_EVENT_HI);
1301 free_irq(dev->pci_dev->irq, dev); 1298 free_irq(dev->pci_dev->irq, dev);
1299#ifdef CONFIG_PCI_MSI
1300 if (dev->msi_enabled)
1301 pci_disable_msi(dev->pci_dev);
1302#endif
1302} 1303}
1303 1304
1304static int ngene_start(struct ngene *dev) 1305static int ngene_start(struct ngene *dev)
1305{ 1306{
1306 int stat; 1307 int stat;
1308 unsigned long flags;
1307 int i; 1309 int i;
1308 1310
1309 pci_set_master(dev->pci_dev); 1311 pci_set_master(dev->pci_dev);
@@ -1333,6 +1335,28 @@ static int ngene_start(struct ngene *dev)
1333 if (stat < 0) 1335 if (stat < 0)
1334 goto fail; 1336 goto fail;
1335 1337
1338#ifdef CONFIG_PCI_MSI
1339 /* enable MSI if kernel and card support it */
1340 if (pci_msi_enabled() && dev->card_info->msi_supported) {
1341 ngwritel(0, NGENE_INT_ENABLE);
1342 free_irq(dev->pci_dev->irq, dev);
1343 stat = pci_enable_msi(dev->pci_dev);
1344 if (stat) {
1345 printk(KERN_INFO DEVICE_NAME
1346 ": MSI not available\n");
1347 flags = IRQF_SHARED;
1348 } else {
1349 flags = 0;
1350 dev->msi_enabled = true;
1351 }
1352 stat = request_irq(dev->pci_dev->irq, irq_handler,
1353 flags, "nGene", dev);
1354 if (stat < 0)
1355 goto fail2;
1356 ngwritel(1, NGENE_INT_ENABLE);
1357 }
1358#endif
1359
1336 stat = ngene_i2c_init(dev, 0); 1360 stat = ngene_i2c_init(dev, 0);
1337 if (stat < 0) 1361 if (stat < 0)
1338 goto fail; 1362 goto fail;
@@ -1358,10 +1382,18 @@ static int ngene_start(struct ngene *dev)
1358 bconf = BUFFER_CONFIG_3333; 1382 bconf = BUFFER_CONFIG_3333;
1359 stat = ngene_command_config_buf(dev, bconf); 1383 stat = ngene_command_config_buf(dev, bconf);
1360 } 1384 }
1361 return stat; 1385 if (!stat)
1386 return stat;
1387
1388 /* otherwise error: fall through */
1362fail: 1389fail:
1363 ngwritel(0, NGENE_INT_ENABLE); 1390 ngwritel(0, NGENE_INT_ENABLE);
1364 free_irq(dev->pci_dev->irq, dev); 1391 free_irq(dev->pci_dev->irq, dev);
1392#ifdef CONFIG_PCI_MSI
1393fail2:
1394 if (dev->msi_enabled)
1395 pci_disable_msi(dev->pci_dev);
1396#endif
1365 return stat; 1397 return stat;
1366} 1398}
1367 1399
@@ -1379,10 +1411,8 @@ static void release_channel(struct ngene_channel *chan)
1379 struct ngene_info *ni = dev->card_info; 1411 struct ngene_info *ni = dev->card_info;
1380 int io = ni->io_type[chan->number]; 1412 int io = ni->io_type[chan->number];
1381 1413
1382#ifdef COMMAND_TIMEOUT_WORKAROUND 1414 if (chan->dev->cmd_timeout_workaround && chan->running)
1383 if (chan->running)
1384 set_transfer(chan, 0); 1415 set_transfer(chan, 0);
1385#endif
1386 1416
1387 tasklet_kill(&chan->demux_tasklet); 1417 tasklet_kill(&chan->demux_tasklet);
1388 1418
diff --git a/drivers/media/dvb/ngene/ngene-dvb.c b/drivers/media/dvb/ngene/ngene-dvb.c
index 96013eb353cd..48f980b21d66 100644
--- a/drivers/media/dvb/ngene/ngene-dvb.c
+++ b/drivers/media/dvb/ngene/ngene-dvb.c
@@ -37,15 +37,12 @@
37#include <linux/pci.h> 37#include <linux/pci.h>
38#include <linux/smp_lock.h> 38#include <linux/smp_lock.h>
39#include <linux/timer.h> 39#include <linux/timer.h>
40#include <linux/version.h>
41#include <linux/byteorder/generic.h> 40#include <linux/byteorder/generic.h>
42#include <linux/firmware.h> 41#include <linux/firmware.h>
43#include <linux/vmalloc.h> 42#include <linux/vmalloc.h>
44 43
45#include "ngene.h" 44#include "ngene.h"
46 45
47#define COMMAND_TIMEOUT_WORKAROUND
48
49 46
50/****************************************************************************/ 47/****************************************************************************/
51/* COMMAND API interface ****************************************************/ 48/* COMMAND API interface ****************************************************/
@@ -69,9 +66,7 @@ void *tsin_exchange(void *priv, void *buf, u32 len, u32 clock, u32 flags)
69 struct ngene_channel *chan = priv; 66 struct ngene_channel *chan = priv;
70 67
71 68
72#ifdef COMMAND_TIMEOUT_WORKAROUND
73 if (chan->users > 0) 69 if (chan->users > 0)
74#endif
75 dvb_dmx_swfilter(&chan->demux, buf, len); 70 dvb_dmx_swfilter(&chan->demux, buf, len);
76 return NULL; 71 return NULL;
77} 72}
@@ -106,11 +101,8 @@ int ngene_start_feed(struct dvb_demux_feed *dvbdmxfeed)
106 struct ngene_channel *chan = dvbdmx->priv; 101 struct ngene_channel *chan = dvbdmx->priv;
107 102
108 if (chan->users == 0) { 103 if (chan->users == 0) {
109#ifdef COMMAND_TIMEOUT_WORKAROUND 104 if (!chan->dev->cmd_timeout_workaround || !chan->running)
110 if (!chan->running)
111#endif
112 set_transfer(chan, 1); 105 set_transfer(chan, 1);
113 /* msleep(10); */
114 } 106 }
115 107
116 return ++chan->users; 108 return ++chan->users;
@@ -124,9 +116,8 @@ int ngene_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
124 if (--chan->users) 116 if (--chan->users)
125 return chan->users; 117 return chan->users;
126 118
127#ifndef COMMAND_TIMEOUT_WORKAROUND 119 if (!chan->dev->cmd_timeout_workaround)
128 set_transfer(chan, 0); 120 set_transfer(chan, 0);
129#endif
130 121
131 return 0; 122 return 0;
132} 123}
diff --git a/drivers/media/dvb/ngene/ngene-i2c.c b/drivers/media/dvb/ngene/ngene-i2c.c
index 2ef54ca6badd..477fe0aade86 100644
--- a/drivers/media/dvb/ngene/ngene-i2c.c
+++ b/drivers/media/dvb/ngene/ngene-i2c.c
@@ -39,7 +39,6 @@
39#include <linux/pci_ids.h> 39#include <linux/pci_ids.h>
40#include <linux/smp_lock.h> 40#include <linux/smp_lock.h>
41#include <linux/timer.h> 41#include <linux/timer.h>
42#include <linux/version.h>
43#include <linux/byteorder/generic.h> 42#include <linux/byteorder/generic.h>
44#include <linux/firmware.h> 43#include <linux/firmware.h>
45#include <linux/vmalloc.h> 44#include <linux/vmalloc.h>
diff --git a/drivers/media/dvb/ngene/ngene.h b/drivers/media/dvb/ngene/ngene.h
index 676fcbb79026..8fb4200f83f8 100644
--- a/drivers/media/dvb/ngene/ngene.h
+++ b/drivers/media/dvb/ngene/ngene.h
@@ -725,6 +725,8 @@ struct ngene {
725 u32 device_version; 725 u32 device_version;
726 u32 fw_interface_version; 726 u32 fw_interface_version;
727 u32 icounts; 727 u32 icounts;
728 bool msi_enabled;
729 bool cmd_timeout_workaround;
728 730
729 u8 *CmdDoneByte; 731 u8 *CmdDoneByte;
730 int BootFirmware; 732 int BootFirmware;
@@ -797,6 +799,7 @@ struct ngene_info {
797#define NGENE_VBOX_V2 7 799#define NGENE_VBOX_V2 7
798 800
799 int fw_version; 801 int fw_version;
802 bool msi_supported;
800 char *name; 803 char *name;
801 804
802 int io_type[MAX_STREAM]; 805 int io_type[MAX_STREAM];
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
index d8d4214fd65f..32a7ec65ec42 100644
--- a/drivers/media/dvb/ttpci/Kconfig
+++ b/drivers/media/dvb/ttpci/Kconfig
@@ -68,13 +68,14 @@ config DVB_BUDGET
68 select DVB_VES1820 if !DVB_FE_CUSTOMISE 68 select DVB_VES1820 if !DVB_FE_CUSTOMISE
69 select DVB_L64781 if !DVB_FE_CUSTOMISE 69 select DVB_L64781 if !DVB_FE_CUSTOMISE
70 select DVB_TDA8083 if !DVB_FE_CUSTOMISE 70 select DVB_TDA8083 if !DVB_FE_CUSTOMISE
71 select DVB_TDA10021 if !DVB_FE_CUSTOMISE
72 select DVB_TDA10023 if !DVB_FE_CUSTOMISE
73 select DVB_S5H1420 if !DVB_FE_CUSTOMISE 71 select DVB_S5H1420 if !DVB_FE_CUSTOMISE
74 select DVB_TDA10086 if !DVB_FE_CUSTOMISE 72 select DVB_TDA10086 if !DVB_FE_CUSTOMISE
75 select DVB_TDA826X if !DVB_FE_CUSTOMISE 73 select DVB_TDA826X if !DVB_FE_CUSTOMISE
76 select DVB_LNBP21 if !DVB_FE_CUSTOMISE 74 select DVB_LNBP21 if !DVB_FE_CUSTOMISE
77 select DVB_TDA1004X if !DVB_FE_CUSTOMISE 75 select DVB_TDA1004X if !DVB_FE_CUSTOMISE
76 select DVB_ISL6423 if !DVB_FE_CUSTOMISE
77 select DVB_STV090x if !DVB_FE_CUSTOMISE
78 select DVB_STV6110x if !DVB_FE_CUSTOMISE
78 help 79 help
79 Support for simple SAA7146 based DVB cards (so called Budget- 80 Support for simple SAA7146 based DVB cards (so called Budget-
80 or Nova-PCI cards) without onboard MPEG2 decoder, and without 81 or Nova-PCI cards) without onboard MPEG2 decoder, and without
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 38915591c6e5..a6be529eec5c 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -708,7 +708,7 @@ static void gpioirq(unsigned long cookie)
708 708
709 709
710#ifdef CONFIG_DVB_AV7110_OSD 710#ifdef CONFIG_DVB_AV7110_OSD
711static int dvb_osd_ioctl(struct inode *inode, struct file *file, 711static int dvb_osd_ioctl(struct file *file,
712 unsigned int cmd, void *parg) 712 unsigned int cmd, void *parg)
713{ 713{
714 struct dvb_device *dvbdev = file->private_data; 714 struct dvb_device *dvbdev = file->private_data;
@@ -727,7 +727,7 @@ static int dvb_osd_ioctl(struct inode *inode, struct file *file,
727 727
728static const struct file_operations dvb_osd_fops = { 728static const struct file_operations dvb_osd_fops = {
729 .owner = THIS_MODULE, 729 .owner = THIS_MODULE,
730 .ioctl = dvb_generic_ioctl, 730 .unlocked_ioctl = dvb_generic_ioctl,
731 .open = dvb_generic_open, 731 .open = dvb_generic_open,
732 .release = dvb_generic_release, 732 .release = dvb_generic_release,
733}; 733};
diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c
index 53884814161c..13efba942dac 100644
--- a/drivers/media/dvb/ttpci/av7110_av.c
+++ b/drivers/media/dvb/ttpci/av7110_av.c
@@ -1089,7 +1089,7 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
1089} 1089}
1090 1090
1091 1091
1092static int dvb_video_ioctl(struct inode *inode, struct file *file, 1092static int dvb_video_ioctl(struct file *file,
1093 unsigned int cmd, void *parg) 1093 unsigned int cmd, void *parg)
1094{ 1094{
1095 struct dvb_device *dvbdev = file->private_data; 1095 struct dvb_device *dvbdev = file->private_data;
@@ -1297,7 +1297,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
1297 return ret; 1297 return ret;
1298} 1298}
1299 1299
1300static int dvb_audio_ioctl(struct inode *inode, struct file *file, 1300static int dvb_audio_ioctl(struct file *file,
1301 unsigned int cmd, void *parg) 1301 unsigned int cmd, void *parg)
1302{ 1302{
1303 struct dvb_device *dvbdev = file->private_data; 1303 struct dvb_device *dvbdev = file->private_data;
@@ -1517,7 +1517,7 @@ static int dvb_audio_release(struct inode *inode, struct file *file)
1517static const struct file_operations dvb_video_fops = { 1517static const struct file_operations dvb_video_fops = {
1518 .owner = THIS_MODULE, 1518 .owner = THIS_MODULE,
1519 .write = dvb_video_write, 1519 .write = dvb_video_write,
1520 .ioctl = dvb_generic_ioctl, 1520 .unlocked_ioctl = dvb_generic_ioctl,
1521 .open = dvb_video_open, 1521 .open = dvb_video_open,
1522 .release = dvb_video_release, 1522 .release = dvb_video_release,
1523 .poll = dvb_video_poll, 1523 .poll = dvb_video_poll,
@@ -1535,7 +1535,7 @@ static struct dvb_device dvbdev_video = {
1535static const struct file_operations dvb_audio_fops = { 1535static const struct file_operations dvb_audio_fops = {
1536 .owner = THIS_MODULE, 1536 .owner = THIS_MODULE,
1537 .write = dvb_audio_write, 1537 .write = dvb_audio_write,
1538 .ioctl = dvb_generic_ioctl, 1538 .unlocked_ioctl = dvb_generic_ioctl,
1539 .open = dvb_audio_open, 1539 .open = dvb_audio_open,
1540 .release = dvb_audio_release, 1540 .release = dvb_audio_release,
1541 .poll = dvb_audio_poll, 1541 .poll = dvb_audio_poll,
diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c
index ac7779c45c5b..4eba35a018e3 100644
--- a/drivers/media/dvb/ttpci/av7110_ca.c
+++ b/drivers/media/dvb/ttpci/av7110_ca.c
@@ -248,8 +248,7 @@ static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
248 return mask; 248 return mask;
249} 249}
250 250
251static int dvb_ca_ioctl(struct inode *inode, struct file *file, 251static int dvb_ca_ioctl(struct file *file, unsigned int cmd, void *parg)
252 unsigned int cmd, void *parg)
253{ 252{
254 struct dvb_device *dvbdev = file->private_data; 253 struct dvb_device *dvbdev = file->private_data;
255 struct av7110 *av7110 = dvbdev->priv; 254 struct av7110 *av7110 = dvbdev->priv;
@@ -350,7 +349,7 @@ static const struct file_operations dvb_ca_fops = {
350 .owner = THIS_MODULE, 349 .owner = THIS_MODULE,
351 .read = dvb_ca_read, 350 .read = dvb_ca_read,
352 .write = dvb_ca_write, 351 .write = dvb_ca_write,
353 .ioctl = dvb_generic_ioctl, 352 .unlocked_ioctl = dvb_generic_ioctl,
354 .open = dvb_ca_open, 353 .open = dvb_ca_open,
355 .release = dvb_generic_release, 354 .release = dvb_generic_release,
356 .poll = dvb_ca_poll, 355 .poll = dvb_ca_poll,
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 461714396331..13ac9e3ab121 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -215,6 +215,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
215 break; 215 break;
216 case 0x1010: 216 case 0x1010:
217 case 0x1017: 217 case 0x1017:
218 case 0x1019:
218 case 0x101a: 219 case 0x101a:
219 /* for the Technotrend 1500 bundled remote */ 220 /* for the Technotrend 1500 bundled remote */
220 ir_codes = RC_MAP_TT_1500; 221 ir_codes = RC_MAP_TT_1500;