diff options
Diffstat (limited to 'drivers/media')
39 files changed, 421 insertions, 246 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-hw-filter.c b/drivers/media/dvb/b2c2/flexcop-hw-filter.c index 75cf237196eb..b386cc66c6b3 100644 --- a/drivers/media/dvb/b2c2/flexcop-hw-filter.c +++ b/drivers/media/dvb/b2c2/flexcop-hw-filter.c | |||
@@ -19,7 +19,7 @@ void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff) | |||
19 | flexcop_set_ibi_value(ctrl_208,SMC_Enable_sig,onoff); | 19 | flexcop_set_ibi_value(ctrl_208,SMC_Enable_sig,onoff); |
20 | } | 20 | } |
21 | 21 | ||
22 | void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff) | 22 | static void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff) |
23 | { | 23 | { |
24 | flexcop_set_ibi_value(ctrl_208,Null_filter_sig,onoff); | 24 | flexcop_set_ibi_value(ctrl_208,Null_filter_sig,onoff); |
25 | } | 25 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 2aa767f9bd7d..cb2e7d6ba283 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/moduleparam.h> | 35 | #include <linux/moduleparam.h> |
36 | #include <linux/vmalloc.h> | 36 | #include <linux/vmalloc.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/rwsem.h> | 38 | #include <linux/spinlock.h> |
39 | #include <linux/sched.h> | 39 | #include <linux/sched.h> |
40 | 40 | ||
41 | #include "dvb_ca_en50221.h" | 41 | #include "dvb_ca_en50221.h" |
@@ -111,9 +111,6 @@ struct dvb_ca_slot { | |||
111 | /* size of the buffer to use when talking to the CAM */ | 111 | /* size of the buffer to use when talking to the CAM */ |
112 | int link_buf_size; | 112 | int link_buf_size; |
113 | 113 | ||
114 | /* semaphore for syncing access to slot structure */ | ||
115 | struct rw_semaphore sem; | ||
116 | |||
117 | /* buffer for incoming packets */ | 114 | /* buffer for incoming packets */ |
118 | struct dvb_ringbuffer rx_buffer; | 115 | struct dvb_ringbuffer rx_buffer; |
119 | 116 | ||
@@ -602,14 +599,11 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb | |||
602 | if (ebuf == NULL) { | 599 | if (ebuf == NULL) { |
603 | int buf_free; | 600 | int buf_free; |
604 | 601 | ||
605 | down_read(&ca->slot_info[slot].sem); | ||
606 | if (ca->slot_info[slot].rx_buffer.data == NULL) { | 602 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
607 | up_read(&ca->slot_info[slot].sem); | ||
608 | status = -EIO; | 603 | status = -EIO; |
609 | goto exit; | 604 | goto exit; |
610 | } | 605 | } |
611 | buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer); | 606 | buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer); |
612 | up_read(&ca->slot_info[slot].sem); | ||
613 | 607 | ||
614 | if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) { | 608 | if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) { |
615 | status = -EAGAIN; | 609 | status = -EAGAIN; |
@@ -680,14 +674,11 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb | |||
680 | 674 | ||
681 | /* OK, add it to the receive buffer, or copy into external buffer if supplied */ | 675 | /* OK, add it to the receive buffer, or copy into external buffer if supplied */ |
682 | if (ebuf == NULL) { | 676 | if (ebuf == NULL) { |
683 | down_read(&ca->slot_info[slot].sem); | ||
684 | if (ca->slot_info[slot].rx_buffer.data == NULL) { | 677 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
685 | up_read(&ca->slot_info[slot].sem); | ||
686 | status = -EIO; | 678 | status = -EIO; |
687 | goto exit; | 679 | goto exit; |
688 | } | 680 | } |
689 | dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read); | 681 | dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read); |
690 | up_read(&ca->slot_info[slot].sem); | ||
691 | } else { | 682 | } else { |
692 | memcpy(ebuf, buf, bytes_read); | 683 | memcpy(ebuf, buf, bytes_read); |
693 | } | 684 | } |
@@ -802,12 +793,8 @@ static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot) | |||
802 | { | 793 | { |
803 | dprintk("%s\n", __FUNCTION__); | 794 | dprintk("%s\n", __FUNCTION__); |
804 | 795 | ||
805 | down_write(&ca->slot_info[slot].sem); | ||
806 | ca->pub->slot_shutdown(ca->pub, slot); | 796 | ca->pub->slot_shutdown(ca->pub, slot); |
807 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; | 797 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; |
808 | vfree(ca->slot_info[slot].rx_buffer.data); | ||
809 | ca->slot_info[slot].rx_buffer.data = NULL; | ||
810 | up_write(&ca->slot_info[slot].sem); | ||
811 | 798 | ||
812 | /* need to wake up all processes to check if they're now | 799 | /* need to wake up all processes to check if they're now |
813 | trying to write to a defunct CAM */ | 800 | trying to write to a defunct CAM */ |
@@ -893,7 +880,7 @@ void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot) | |||
893 | 880 | ||
894 | case DVB_CA_SLOTSTATE_RUNNING: | 881 | case DVB_CA_SLOTSTATE_RUNNING: |
895 | if (ca->open) | 882 | if (ca->open) |
896 | dvb_ca_en50221_read_data(ca, slot, NULL, 0); | 883 | dvb_ca_en50221_thread_wakeup(ca); |
897 | break; | 884 | break; |
898 | } | 885 | } |
899 | } | 886 | } |
@@ -1127,16 +1114,16 @@ static int dvb_ca_en50221_thread(void *data) | |||
1127 | break; | 1114 | break; |
1128 | } | 1115 | } |
1129 | 1116 | ||
1130 | rxbuf = vmalloc(RX_BUFFER_SIZE); | 1117 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
1131 | if (rxbuf == NULL) { | 1118 | rxbuf = vmalloc(RX_BUFFER_SIZE); |
1132 | printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num); | 1119 | if (rxbuf == NULL) { |
1133 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; | 1120 | printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num); |
1134 | dvb_ca_en50221_thread_update_delay(ca); | 1121 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; |
1135 | break; | 1122 | dvb_ca_en50221_thread_update_delay(ca); |
1123 | break; | ||
1124 | } | ||
1125 | dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE); | ||
1136 | } | 1126 | } |
1137 | down_write(&ca->slot_info[slot].sem); | ||
1138 | dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE); | ||
1139 | up_write(&ca->slot_info[slot].sem); | ||
1140 | 1127 | ||
1141 | ca->pub->slot_ts_enable(ca->pub, slot); | 1128 | ca->pub->slot_ts_enable(ca->pub, slot); |
1142 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_RUNNING; | 1129 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_RUNNING; |
@@ -1148,11 +1135,7 @@ static int dvb_ca_en50221_thread(void *data) | |||
1148 | if (!ca->open) | 1135 | if (!ca->open) |
1149 | continue; | 1136 | continue; |
1150 | 1137 | ||
1151 | // no need to poll if the CAM supports IRQs | 1138 | // poll slots for data |
1152 | if (ca->slot_info[slot].da_irq_supported) | ||
1153 | break; | ||
1154 | |||
1155 | // poll mode | ||
1156 | pktcount = 0; | 1139 | pktcount = 0; |
1157 | while ((status = dvb_ca_en50221_read_data(ca, slot, NULL, 0)) > 0) { | 1140 | while ((status = dvb_ca_en50221_read_data(ca, slot, NULL, 0)) > 0) { |
1158 | if (!ca->open) | 1141 | if (!ca->open) |
@@ -1367,12 +1350,13 @@ exit: | |||
1367 | /** | 1350 | /** |
1368 | * Condition for waking up in dvb_ca_en50221_io_read_condition | 1351 | * Condition for waking up in dvb_ca_en50221_io_read_condition |
1369 | */ | 1352 | */ |
1370 | static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *result, int *_slot) | 1353 | static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, |
1354 | int *result, int *_slot) | ||
1371 | { | 1355 | { |
1372 | int slot; | 1356 | int slot; |
1373 | int slot_count = 0; | 1357 | int slot_count = 0; |
1374 | int idx; | 1358 | int idx; |
1375 | int fraglen; | 1359 | size_t fraglen; |
1376 | int connection_id = -1; | 1360 | int connection_id = -1; |
1377 | int found = 0; | 1361 | int found = 0; |
1378 | u8 hdr[2]; | 1362 | u8 hdr[2]; |
@@ -1382,10 +1366,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *resu | |||
1382 | if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) | 1366 | if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) |
1383 | goto nextslot; | 1367 | goto nextslot; |
1384 | 1368 | ||
1385 | down_read(&ca->slot_info[slot].sem); | ||
1386 | |||
1387 | if (ca->slot_info[slot].rx_buffer.data == NULL) { | 1369 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
1388 | up_read(&ca->slot_info[slot].sem); | ||
1389 | return 0; | 1370 | return 0; |
1390 | } | 1371 | } |
1391 | 1372 | ||
@@ -1403,10 +1384,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *resu | |||
1403 | idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen); | 1384 | idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen); |
1404 | } | 1385 | } |
1405 | 1386 | ||
1406 | if (!found) | 1387 | nextslot: |
1407 | up_read(&ca->slot_info[slot].sem); | ||
1408 | |||
1409 | nextslot: | ||
1410 | slot = (slot + 1) % ca->slot_count; | 1388 | slot = (slot + 1) % ca->slot_count; |
1411 | slot_count++; | 1389 | slot_count++; |
1412 | } | 1390 | } |
@@ -1511,8 +1489,7 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user * buf, | |||
1511 | goto exit; | 1489 | goto exit; |
1512 | status = pktlen; | 1490 | status = pktlen; |
1513 | 1491 | ||
1514 | exit: | 1492 | exit: |
1515 | up_read(&ca->slot_info[slot].sem); | ||
1516 | return status; | 1493 | return status; |
1517 | } | 1494 | } |
1518 | 1495 | ||
@@ -1544,11 +1521,11 @@ static int dvb_ca_en50221_io_open(struct inode *inode, struct file *file) | |||
1544 | for (i = 0; i < ca->slot_count; i++) { | 1521 | for (i = 0; i < ca->slot_count; i++) { |
1545 | 1522 | ||
1546 | if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) { | 1523 | if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) { |
1547 | down_write(&ca->slot_info[i].sem); | ||
1548 | if (ca->slot_info[i].rx_buffer.data != NULL) { | 1524 | if (ca->slot_info[i].rx_buffer.data != NULL) { |
1525 | /* it is safe to call this here without locks because | ||
1526 | * ca->open == 0. Data is not read in this case */ | ||
1549 | dvb_ringbuffer_flush(&ca->slot_info[i].rx_buffer); | 1527 | dvb_ringbuffer_flush(&ca->slot_info[i].rx_buffer); |
1550 | } | 1528 | } |
1551 | up_write(&ca->slot_info[i].sem); | ||
1552 | } | 1529 | } |
1553 | } | 1530 | } |
1554 | 1531 | ||
@@ -1607,7 +1584,6 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait) | |||
1607 | dprintk("%s\n", __FUNCTION__); | 1584 | dprintk("%s\n", __FUNCTION__); |
1608 | 1585 | ||
1609 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { | 1586 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { |
1610 | up_read(&ca->slot_info[slot].sem); | ||
1611 | mask |= POLLIN; | 1587 | mask |= POLLIN; |
1612 | } | 1588 | } |
1613 | 1589 | ||
@@ -1619,7 +1595,6 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait) | |||
1619 | poll_wait(file, &ca->wait_queue, wait); | 1595 | poll_wait(file, &ca->wait_queue, wait); |
1620 | 1596 | ||
1621 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { | 1597 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { |
1622 | up_read(&ca->slot_info[slot].sem); | ||
1623 | mask |= POLLIN; | 1598 | mask |= POLLIN; |
1624 | } | 1599 | } |
1625 | 1600 | ||
@@ -1709,7 +1684,6 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, | |||
1709 | ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE; | 1684 | ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE; |
1710 | atomic_set(&ca->slot_info[i].camchange_count, 0); | 1685 | atomic_set(&ca->slot_info[i].camchange_count, 0); |
1711 | ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; | 1686 | ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; |
1712 | init_rwsem(&ca->slot_info[i].sem); | ||
1713 | } | 1687 | } |
1714 | 1688 | ||
1715 | if (signal_pending(current)) { | 1689 | if (signal_pending(current)) { |
@@ -1729,7 +1703,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, | |||
1729 | ca->thread_pid = ret; | 1703 | ca->thread_pid = ret; |
1730 | return 0; | 1704 | return 0; |
1731 | 1705 | ||
1732 | error: | 1706 | error: |
1733 | if (ca != NULL) { | 1707 | if (ca != NULL) { |
1734 | if (ca->dvbdev != NULL) | 1708 | if (ca->dvbdev != NULL) |
1735 | dvb_unregister_device(ca->dvbdev); | 1709 | dvb_unregister_device(ca->dvbdev); |
@@ -1771,6 +1745,9 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca) | |||
1771 | 1745 | ||
1772 | for (i = 0; i < ca->slot_count; i++) { | 1746 | for (i = 0; i < ca->slot_count; i++) { |
1773 | dvb_ca_en50221_slot_shutdown(ca, i); | 1747 | dvb_ca_en50221_slot_shutdown(ca, i); |
1748 | if (ca->slot_info[i].rx_buffer.data != NULL) { | ||
1749 | vfree(ca->slot_info[i].rx_buffer.data); | ||
1750 | } | ||
1774 | } | 1751 | } |
1775 | kfree(ca->slot_info); | 1752 | kfree(ca->slot_info); |
1776 | dvb_unregister_device(ca->dvbdev); | 1753 | dvb_unregister_device(ca->dvbdev); |
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index 87935490bfb2..df536bd2e103 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -151,6 +151,8 @@ struct dvb_net_priv { | |||
151 | unsigned char ule_bridged; /* Whether the ULE_BRIDGED extension header was found. */ | 151 | unsigned char ule_bridged; /* Whether the ULE_BRIDGED extension header was found. */ |
152 | int ule_sndu_remain; /* Nr. of bytes still required for current ULE SNDU. */ | 152 | int ule_sndu_remain; /* Nr. of bytes still required for current ULE SNDU. */ |
153 | unsigned long ts_count; /* Current ts cell counter. */ | 153 | unsigned long ts_count; /* Current ts cell counter. */ |
154 | |||
155 | struct semaphore mutex; | ||
154 | }; | 156 | }; |
155 | 157 | ||
156 | 158 | ||
@@ -881,12 +883,13 @@ static int dvb_net_filter_sec_set(struct net_device *dev, | |||
881 | 883 | ||
882 | static int dvb_net_feed_start(struct net_device *dev) | 884 | static int dvb_net_feed_start(struct net_device *dev) |
883 | { | 885 | { |
884 | int ret, i; | 886 | int ret = 0, i; |
885 | struct dvb_net_priv *priv = dev->priv; | 887 | struct dvb_net_priv *priv = dev->priv; |
886 | struct dmx_demux *demux = priv->demux; | 888 | struct dmx_demux *demux = priv->demux; |
887 | unsigned char *mac = (unsigned char *) dev->dev_addr; | 889 | unsigned char *mac = (unsigned char *) dev->dev_addr; |
888 | 890 | ||
889 | dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); | 891 | dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); |
892 | down(&priv->mutex); | ||
890 | if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) | 893 | if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) |
891 | printk("%s: BUG %d\n", __FUNCTION__, __LINE__); | 894 | printk("%s: BUG %d\n", __FUNCTION__, __LINE__); |
892 | 895 | ||
@@ -900,7 +903,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
900 | dvb_net_sec_callback); | 903 | dvb_net_sec_callback); |
901 | if (ret<0) { | 904 | if (ret<0) { |
902 | printk("%s: could not allocate section feed\n", dev->name); | 905 | printk("%s: could not allocate section feed\n", dev->name); |
903 | return ret; | 906 | goto error; |
904 | } | 907 | } |
905 | 908 | ||
906 | ret = priv->secfeed->set(priv->secfeed, priv->pid, 32768, 1); | 909 | ret = priv->secfeed->set(priv->secfeed, priv->pid, 32768, 1); |
@@ -909,7 +912,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
909 | printk("%s: could not set section feed\n", dev->name); | 912 | printk("%s: could not set section feed\n", dev->name); |
910 | priv->demux->release_section_feed(priv->demux, priv->secfeed); | 913 | priv->demux->release_section_feed(priv->demux, priv->secfeed); |
911 | priv->secfeed=NULL; | 914 | priv->secfeed=NULL; |
912 | return ret; | 915 | goto error; |
913 | } | 916 | } |
914 | 917 | ||
915 | if (priv->rx_mode != RX_MODE_PROMISC) { | 918 | if (priv->rx_mode != RX_MODE_PROMISC) { |
@@ -948,7 +951,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
948 | ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback); | 951 | ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback); |
949 | if (ret < 0) { | 952 | if (ret < 0) { |
950 | printk("%s: could not allocate ts feed\n", dev->name); | 953 | printk("%s: could not allocate ts feed\n", dev->name); |
951 | return ret; | 954 | goto error; |
952 | } | 955 | } |
953 | 956 | ||
954 | /* Set netdevice pointer for ts decaps callback. */ | 957 | /* Set netdevice pointer for ts decaps callback. */ |
@@ -962,23 +965,26 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
962 | printk("%s: could not set ts feed\n", dev->name); | 965 | printk("%s: could not set ts feed\n", dev->name); |
963 | priv->demux->release_ts_feed(priv->demux, priv->tsfeed); | 966 | priv->demux->release_ts_feed(priv->demux, priv->tsfeed); |
964 | priv->tsfeed = NULL; | 967 | priv->tsfeed = NULL; |
965 | return ret; | 968 | goto error; |
966 | } | 969 | } |
967 | 970 | ||
968 | dprintk("%s: start filtering\n", __FUNCTION__); | 971 | dprintk("%s: start filtering\n", __FUNCTION__); |
969 | priv->tsfeed->start_filtering(priv->tsfeed); | 972 | priv->tsfeed->start_filtering(priv->tsfeed); |
970 | } else | 973 | } else |
971 | return -EINVAL; | 974 | ret = -EINVAL; |
972 | 975 | ||
973 | return 0; | 976 | error: |
977 | up(&priv->mutex); | ||
978 | return ret; | ||
974 | } | 979 | } |
975 | 980 | ||
976 | static int dvb_net_feed_stop(struct net_device *dev) | 981 | static int dvb_net_feed_stop(struct net_device *dev) |
977 | { | 982 | { |
978 | struct dvb_net_priv *priv = dev->priv; | 983 | struct dvb_net_priv *priv = dev->priv; |
979 | int i; | 984 | int i, ret = 0; |
980 | 985 | ||
981 | dprintk("%s\n", __FUNCTION__); | 986 | dprintk("%s\n", __FUNCTION__); |
987 | down(&priv->mutex); | ||
982 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { | 988 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { |
983 | if (priv->secfeed) { | 989 | if (priv->secfeed) { |
984 | if (priv->secfeed->is_filtering) { | 990 | if (priv->secfeed->is_filtering) { |
@@ -1019,8 +1025,9 @@ static int dvb_net_feed_stop(struct net_device *dev) | |||
1019 | else | 1025 | else |
1020 | printk("%s: no ts feed to stop\n", dev->name); | 1026 | printk("%s: no ts feed to stop\n", dev->name); |
1021 | } else | 1027 | } else |
1022 | return -EINVAL; | 1028 | ret = -EINVAL; |
1023 | return 0; | 1029 | up(&priv->mutex); |
1030 | return ret; | ||
1024 | } | 1031 | } |
1025 | 1032 | ||
1026 | 1033 | ||
@@ -1044,8 +1051,8 @@ static void wq_set_multicast_list (void *data) | |||
1044 | struct dvb_net_priv *priv = dev->priv; | 1051 | struct dvb_net_priv *priv = dev->priv; |
1045 | 1052 | ||
1046 | dvb_net_feed_stop(dev); | 1053 | dvb_net_feed_stop(dev); |
1047 | |||
1048 | priv->rx_mode = RX_MODE_UNI; | 1054 | priv->rx_mode = RX_MODE_UNI; |
1055 | spin_lock_bh(&dev->xmit_lock); | ||
1049 | 1056 | ||
1050 | if (dev->flags & IFF_PROMISC) { | 1057 | if (dev->flags & IFF_PROMISC) { |
1051 | dprintk("%s: promiscuous mode\n", dev->name); | 1058 | dprintk("%s: promiscuous mode\n", dev->name); |
@@ -1070,6 +1077,7 @@ static void wq_set_multicast_list (void *data) | |||
1070 | } | 1077 | } |
1071 | } | 1078 | } |
1072 | 1079 | ||
1080 | spin_unlock_bh(&dev->xmit_lock); | ||
1073 | dvb_net_feed_start(dev); | 1081 | dvb_net_feed_start(dev); |
1074 | } | 1082 | } |
1075 | 1083 | ||
@@ -1200,6 +1208,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) | |||
1200 | 1208 | ||
1201 | INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); | 1209 | INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); |
1202 | INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); | 1210 | INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); |
1211 | init_MUTEX(&priv->mutex); | ||
1203 | 1212 | ||
1204 | net->base_addr = pid; | 1213 | net->base_addr = pid; |
1205 | 1214 | ||
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index 49f541d9a042..8c7beffb045f 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c | |||
@@ -65,7 +65,7 @@ static struct dvb_usb_rc_key a800_rc_keys[] = { | |||
65 | 65 | ||
66 | }; | 66 | }; |
67 | 67 | ||
68 | int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 68 | static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
69 | { | 69 | { |
70 | u8 key[5]; | 70 | u8 key[5]; |
71 | if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), | 71 | if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 00b946419b40..269d899da488 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -21,9 +21,9 @@ MODULE_LICENSE("GPL"); | |||
21 | int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) | 21 | int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) |
22 | { | 22 | { |
23 | if (d->priv != NULL) { | 23 | if (d->priv != NULL) { |
24 | struct dib_fe_xfer_ops *ops = d->priv; | 24 | struct dibusb_state *st = d->priv; |
25 | if (ops->fifo_ctrl != NULL) | 25 | if (st->ops.fifo_ctrl != NULL) |
26 | if (ops->fifo_ctrl(d->fe,onoff)) { | 26 | if (st->ops.fifo_ctrl(d->fe,onoff)) { |
27 | err("error while controlling the fifo of the demod."); | 27 | err("error while controlling the fifo of the demod."); |
28 | return -ENODEV; | 28 | return -ENODEV; |
29 | } | 29 | } |
@@ -35,9 +35,9 @@ EXPORT_SYMBOL(dibusb_streaming_ctrl); | |||
35 | int dibusb_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) | 35 | int dibusb_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) |
36 | { | 36 | { |
37 | if (d->priv != NULL) { | 37 | if (d->priv != NULL) { |
38 | struct dib_fe_xfer_ops *ops = d->priv; | 38 | struct dibusb_state *st = d->priv; |
39 | if (d->pid_filtering && ops->pid_ctrl != NULL) | 39 | if (st->ops.pid_ctrl != NULL) |
40 | ops->pid_ctrl(d->fe,index,pid,onoff); | 40 | st->ops.pid_ctrl(d->fe,index,pid,onoff); |
41 | } | 41 | } |
42 | return 0; | 42 | return 0; |
43 | } | 43 | } |
@@ -46,9 +46,9 @@ EXPORT_SYMBOL(dibusb_pid_filter); | |||
46 | int dibusb_pid_filter_ctrl(struct dvb_usb_device *d, int onoff) | 46 | int dibusb_pid_filter_ctrl(struct dvb_usb_device *d, int onoff) |
47 | { | 47 | { |
48 | if (d->priv != NULL) { | 48 | if (d->priv != NULL) { |
49 | struct dib_fe_xfer_ops *ops = d->priv; | 49 | struct dibusb_state *st = d->priv; |
50 | if (ops->pid_parse != NULL) | 50 | if (st->ops.pid_parse != NULL) |
51 | if (ops->pid_parse(d->fe,onoff) < 0) | 51 | if (st->ops.pid_parse(d->fe,onoff) < 0) |
52 | err("could not handle pid_parser"); | 52 | err("could not handle pid_parser"); |
53 | } | 53 | } |
54 | return 0; | 54 | return 0; |
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 74545f82eff1..f98e306a5759 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -148,7 +148,7 @@ static struct dvb_usb_rc_key digitv_rc_keys[] = { | |||
148 | }; | 148 | }; |
149 | 149 | ||
150 | /* TODO is it really the NEC protocol ? */ | 150 | /* TODO is it really the NEC protocol ? */ |
151 | int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 151 | static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
152 | { | 152 | { |
153 | u8 key[5]; | 153 | u8 key[5]; |
154 | 154 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index a902059812a2..dd8e0b94edba 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c | |||
@@ -23,7 +23,7 @@ module_param_named(disable_rc_polling, dvb_usb_disable_rc_polling, int, 0644); | |||
23 | MODULE_PARM_DESC(disable_rc_polling, "disable remote control polling (default: 0)."); | 23 | MODULE_PARM_DESC(disable_rc_polling, "disable remote control polling (default: 0)."); |
24 | 24 | ||
25 | /* general initialization functions */ | 25 | /* general initialization functions */ |
26 | int dvb_usb_exit(struct dvb_usb_device *d) | 26 | static int dvb_usb_exit(struct dvb_usb_device *d) |
27 | { | 27 | { |
28 | deb_info("state before exiting everything: %x\n",d->state); | 28 | deb_info("state before exiting everything: %x\n",d->state); |
29 | dvb_usb_remote_exit(d); | 29 | dvb_usb_remote_exit(d); |
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c index 9f639297a9f2..d9a8ede14b45 100644 --- a/drivers/media/dvb/frontends/cx22702.c +++ b/drivers/media/dvb/frontends/cx22702.c | |||
@@ -7,7 +7,7 @@ | |||
7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH | 7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH |
8 | Holger Waechtler <holger@convergence.de> | 8 | Holger Waechtler <holger@convergence.de> |
9 | 9 | ||
10 | Copyright (C) 2004 Steven Toth <steve@toth.demon.co.uk> | 10 | Copyright (C) 2004 Steven Toth <stoth@hauppauge.com> |
11 | 11 | ||
12 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
13 | it under the terms of the GNU General Public License as published by | 13 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/dvb/frontends/cx22702.h b/drivers/media/dvb/frontends/cx22702.h index 11f86806756e..1f250885d2ce 100644 --- a/drivers/media/dvb/frontends/cx22702.h +++ b/drivers/media/dvb/frontends/cx22702.h | |||
@@ -7,7 +7,7 @@ | |||
7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH | 7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH |
8 | Holger Waechtler <holger@convergence.de> | 8 | Holger Waechtler <holger@convergence.de> |
9 | 9 | ||
10 | Copyright (C) 2004 Steven Toth <steve@toth.demon.co.uk> | 10 | Copyright (C) 2004 Steven Toth <stoth@hauppauge.com> |
11 | 11 | ||
12 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
13 | it under the terms of the GNU General Public License as published by | 13 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c index bad0933eb714..84b62881cea7 100644 --- a/drivers/media/dvb/frontends/nxt200x.c +++ b/drivers/media/dvb/frontends/nxt200x.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <linux/init.h> | 44 | #include <linux/init.h> |
45 | #include <linux/module.h> | 45 | #include <linux/module.h> |
46 | #include <linux/moduleparam.h> | 46 | #include <linux/moduleparam.h> |
47 | #include <linux/slab.h> | ||
48 | #include <linux/string.h> | ||
47 | 49 | ||
48 | #include "dvb_frontend.h" | 50 | #include "dvb_frontend.h" |
49 | #include "dvb-pll.h" | 51 | #include "dvb-pll.h" |
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index c6d276618e86..ad8647a3c85e 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c | |||
@@ -140,25 +140,25 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) | |||
140 | /* yeuch! */ | 140 | /* yeuch! */ |
141 | fpxin = state->config->xin * 10; | 141 | fpxin = state->config->xin * 10; |
142 | fptmp = fpxin; do_div(fptmp, 123); | 142 | fptmp = fpxin; do_div(fptmp, 123); |
143 | if (symbolrate < fptmp); | 143 | if (symbolrate < fptmp) |
144 | SFIL = 1; | 144 | SFIL = 1; |
145 | fptmp = fpxin; do_div(fptmp, 160); | 145 | fptmp = fpxin; do_div(fptmp, 160); |
146 | if (symbolrate < fptmp); | 146 | if (symbolrate < fptmp) |
147 | SFIL = 0; | 147 | SFIL = 0; |
148 | fptmp = fpxin; do_div(fptmp, 246); | 148 | fptmp = fpxin; do_div(fptmp, 246); |
149 | if (symbolrate < fptmp); | 149 | if (symbolrate < fptmp) |
150 | SFIL = 1; | 150 | SFIL = 1; |
151 | fptmp = fpxin; do_div(fptmp, 320); | 151 | fptmp = fpxin; do_div(fptmp, 320); |
152 | if (symbolrate < fptmp); | 152 | if (symbolrate < fptmp) |
153 | SFIL = 0; | 153 | SFIL = 0; |
154 | fptmp = fpxin; do_div(fptmp, 492); | 154 | fptmp = fpxin; do_div(fptmp, 492); |
155 | if (symbolrate < fptmp); | 155 | if (symbolrate < fptmp) |
156 | SFIL = 1; | 156 | SFIL = 1; |
157 | fptmp = fpxin; do_div(fptmp, 640); | 157 | fptmp = fpxin; do_div(fptmp, 640); |
158 | if (symbolrate < fptmp); | 158 | if (symbolrate < fptmp) |
159 | SFIL = 0; | 159 | SFIL = 0; |
160 | fptmp = fpxin; do_div(fptmp, 984); | 160 | fptmp = fpxin; do_div(fptmp, 984); |
161 | if (symbolrate < fptmp); | 161 | if (symbolrate < fptmp) |
162 | SFIL = 1; | 162 | SFIL = 1; |
163 | 163 | ||
164 | fin = state->config->xin >> 4; | 164 | fin = state->config->xin >> 4; |
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index d8bf65877897..fa5034a9ecf5 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig | |||
@@ -81,6 +81,7 @@ config DVB_BUDGET_CI | |||
81 | tristate "Budget cards with onboard CI connector" | 81 | tristate "Budget cards with onboard CI connector" |
82 | depends on DVB_CORE && PCI | 82 | depends on DVB_CORE && PCI |
83 | select VIDEO_SAA7146 | 83 | select VIDEO_SAA7146 |
84 | select DVB_STV0297 | ||
84 | select DVB_STV0299 | 85 | select DVB_STV0299 |
85 | select DVB_TDA1004X | 86 | select DVB_TDA1004X |
86 | help | 87 | help |
diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c index c3801e328fe9..6079e8865d5b 100644 --- a/drivers/media/dvb/ttpci/av7110_ca.c +++ b/drivers/media/dvb/ttpci/av7110_ca.c | |||
@@ -40,6 +40,7 @@ | |||
40 | 40 | ||
41 | #include "av7110.h" | 41 | #include "av7110.h" |
42 | #include "av7110_hw.h" | 42 | #include "av7110_hw.h" |
43 | #include "av7110_ca.h" | ||
43 | 44 | ||
44 | 45 | ||
45 | void CI_handle(struct av7110 *av7110, u8 *data, u16 len) | 46 | void CI_handle(struct av7110 *av7110, u8 *data, u16 len) |
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index aa75dc03a0b3..9f51bae7194c 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c | |||
@@ -1020,6 +1020,8 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); | |||
1020 | 1020 | ||
1021 | static struct saa7146_extension budget_extension = { | 1021 | static struct saa7146_extension budget_extension = { |
1022 | .name = "budget_av", | 1022 | .name = "budget_av", |
1023 | .flags = SAA7146_I2C_SHORT_DELAY, | ||
1024 | |||
1023 | .pci_tbl = pci_tbl, | 1025 | .pci_tbl = pci_tbl, |
1024 | 1026 | ||
1025 | .module = THIS_MODULE, | 1027 | .module = THIS_MODULE, |
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 75fb92d60998..b9b3cd9c0369 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -1166,7 +1166,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); | |||
1166 | 1166 | ||
1167 | static struct saa7146_extension budget_extension = { | 1167 | static struct saa7146_extension budget_extension = { |
1168 | .name = "budget_ci dvb\0", | 1168 | .name = "budget_ci dvb\0", |
1169 | .flags = 0, | 1169 | .flags = SAA7146_I2C_SHORT_DELAY, |
1170 | 1170 | ||
1171 | .module = THIS_MODULE, | 1171 | .module = THIS_MODULE, |
1172 | .pci_tbl = &pci_tbl[0], | 1172 | .pci_tbl = &pci_tbl[0], |
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index 4fd8bbc47037..bc4ce7559cbe 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c | |||
@@ -738,7 +738,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); | |||
738 | 738 | ||
739 | static struct saa7146_extension budget_extension = { | 739 | static struct saa7146_extension budget_extension = { |
740 | .name = "budget dvb\0", | 740 | .name = "budget dvb\0", |
741 | .flags = 0, | 741 | .flags = SAA7146_I2C_SHORT_DELAY, |
742 | 742 | ||
743 | .module = THIS_MODULE, | 743 | .module = THIS_MODULE, |
744 | .pci_tbl = pci_tbl, | 744 | .pci_tbl = pci_tbl, |
diff --git a/drivers/media/dvb/ttpci/ttpci-eeprom.c b/drivers/media/dvb/ttpci/ttpci-eeprom.c index e9a8457b0727..ac79ef178c05 100644 --- a/drivers/media/dvb/ttpci/ttpci-eeprom.c +++ b/drivers/media/dvb/ttpci/ttpci-eeprom.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/string.h> | 37 | #include <linux/string.h> |
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | 39 | ||
40 | #include "ttpci-eeprom.h" | ||
40 | 41 | ||
41 | #if 1 | 42 | #if 1 |
42 | #define dprintk(x...) do { printk(x); } while (0) | 43 | #define dprintk(x...) do { printk(x); } while (0) |
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index ecb9a31dd003..cc4a723e24db 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -32,9 +32,6 @@ config VIDEO_BT848_DVB | |||
32 | ---help--- | 32 | ---help--- |
33 | This adds support for DVB/ATSC cards based on the BT878 chip. | 33 | This adds support for DVB/ATSC cards based on the BT878 chip. |
34 | 34 | ||
35 | To compile this driver as a module, choose M here: the | ||
36 | module will be called dvb-bt8xx. | ||
37 | |||
38 | config VIDEO_SAA6588 | 35 | config VIDEO_SAA6588 |
39 | tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" | 36 | tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" |
40 | depends on VIDEO_DEV && I2C && VIDEO_BT848 | 37 | depends on VIDEO_DEV && I2C && VIDEO_BT848 |
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c index e31ebb11c468..012be639aa18 100644 --- a/drivers/media/video/bttv-cards.c +++ b/drivers/media/video/bttv-cards.c | |||
@@ -2904,7 +2904,7 @@ void __devinit bttv_idcard(struct bttv *btv) | |||
2904 | */ | 2904 | */ |
2905 | 2905 | ||
2906 | /* Some Modular Technology cards have an eeprom, but no subsystem ID */ | 2906 | /* Some Modular Technology cards have an eeprom, but no subsystem ID */ |
2907 | void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) | 2907 | static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) |
2908 | { | 2908 | { |
2909 | int type = -1; | 2909 | int type = -1; |
2910 | 2910 | ||
@@ -3879,7 +3879,7 @@ static void __devinit init_PXC200(struct bttv *btv) | |||
3879 | * error. ERROR_CPLD_Check_Failed. | 3879 | * error. ERROR_CPLD_Check_Failed. |
3880 | */ | 3880 | */ |
3881 | /* ----------------------------------------------------------------------- */ | 3881 | /* ----------------------------------------------------------------------- */ |
3882 | void | 3882 | static void |
3883 | init_RTV24 (struct bttv *btv) | 3883 | init_RTV24 (struct bttv *btv) |
3884 | { | 3884 | { |
3885 | uint32_t dataRead = 0; | 3885 | uint32_t dataRead = 0; |
@@ -4103,7 +4103,7 @@ void tea5757_set_freq(struct bttv *btv, unsigned short freq) | |||
4103 | /* ----------------------------------------------------------------------- */ | 4103 | /* ----------------------------------------------------------------------- */ |
4104 | /* winview */ | 4104 | /* winview */ |
4105 | 4105 | ||
4106 | void winview_audio(struct bttv *btv, struct video_audio *v, int set) | 4106 | static void winview_audio(struct bttv *btv, struct video_audio *v, int set) |
4107 | { | 4107 | { |
4108 | /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */ | 4108 | /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */ |
4109 | int bits_out, loops, vol, data; | 4109 | int bits_out, loops, vol, data; |
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index 709099f03bd2..3c58a2a68906 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c | |||
@@ -1720,7 +1720,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) | |||
1720 | memset(i,0,sizeof(*i)); | 1720 | memset(i,0,sizeof(*i)); |
1721 | i->index = n; | 1721 | i->index = n; |
1722 | i->type = V4L2_INPUT_TYPE_CAMERA; | 1722 | i->type = V4L2_INPUT_TYPE_CAMERA; |
1723 | i->audioset = 1; | 1723 | i->audioset = 0; |
1724 | if (i->index == bttv_tvcards[btv->c.type].tuner) { | 1724 | if (i->index == bttv_tvcards[btv->c.type].tuner) { |
1725 | sprintf(i->name, "Television"); | 1725 | sprintf(i->name, "Television"); |
1726 | i->type = V4L2_INPUT_TYPE_TUNER; | 1726 | i->type = V4L2_INPUT_TYPE_TUNER; |
@@ -1771,12 +1771,20 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) | |||
1771 | memset(t,0,sizeof(*t)); | 1771 | memset(t,0,sizeof(*t)); |
1772 | strcpy(t->name, "Television"); | 1772 | strcpy(t->name, "Television"); |
1773 | t->type = V4L2_TUNER_ANALOG_TV; | 1773 | t->type = V4L2_TUNER_ANALOG_TV; |
1774 | t->rangehigh = 0xffffffffUL; | ||
1775 | t->capability = V4L2_TUNER_CAP_NORM; | 1774 | t->capability = V4L2_TUNER_CAP_NORM; |
1776 | t->rxsubchans = V4L2_TUNER_SUB_MONO; | 1775 | t->rxsubchans = V4L2_TUNER_SUB_MONO; |
1777 | if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) | 1776 | if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) |
1778 | t->signal = 0xffff; | 1777 | t->signal = 0xffff; |
1779 | { | 1778 | { |
1779 | struct video_tuner tuner; | ||
1780 | |||
1781 | memset(&tuner, 0, sizeof (tuner)); | ||
1782 | tuner.rangehigh = 0xffffffffUL; | ||
1783 | bttv_call_i2c_clients(btv, VIDIOCGTUNER, &tuner); | ||
1784 | t->rangelow = tuner.rangelow; | ||
1785 | t->rangehigh = tuner.rangehigh; | ||
1786 | } | ||
1787 | { | ||
1780 | /* Hmmm ... */ | 1788 | /* Hmmm ... */ |
1781 | struct video_audio va; | 1789 | struct video_audio va; |
1782 | memset(&va, 0, sizeof(struct video_audio)); | 1790 | memset(&va, 0, sizeof(struct video_audio)); |
@@ -1853,7 +1861,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) | |||
1853 | } | 1861 | } |
1854 | case VIDIOC_LOG_STATUS: | 1862 | case VIDIOC_LOG_STATUS: |
1855 | { | 1863 | { |
1856 | bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, 0); | 1864 | bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, NULL); |
1857 | return 0; | 1865 | return 0; |
1858 | } | 1866 | } |
1859 | 1867 | ||
@@ -2029,19 +2037,33 @@ static int bttv_switch_type(struct bttv_fh *fh, enum v4l2_buf_type type) | |||
2029 | return 0; | 2037 | return 0; |
2030 | } | 2038 | } |
2031 | 2039 | ||
2040 | static void | ||
2041 | pix_format_set_size (struct v4l2_pix_format * f, | ||
2042 | const struct bttv_format * fmt, | ||
2043 | unsigned int width, | ||
2044 | unsigned int height) | ||
2045 | { | ||
2046 | f->width = width; | ||
2047 | f->height = height; | ||
2048 | |||
2049 | if (fmt->flags & FORMAT_FLAGS_PLANAR) { | ||
2050 | f->bytesperline = width; /* Y plane */ | ||
2051 | f->sizeimage = (width * height * fmt->depth) >> 3; | ||
2052 | } else { | ||
2053 | f->bytesperline = (width * fmt->depth) >> 3; | ||
2054 | f->sizeimage = height * f->bytesperline; | ||
2055 | } | ||
2056 | } | ||
2057 | |||
2032 | static int bttv_g_fmt(struct bttv_fh *fh, struct v4l2_format *f) | 2058 | static int bttv_g_fmt(struct bttv_fh *fh, struct v4l2_format *f) |
2033 | { | 2059 | { |
2034 | switch (f->type) { | 2060 | switch (f->type) { |
2035 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: | 2061 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: |
2036 | memset(&f->fmt.pix,0,sizeof(struct v4l2_pix_format)); | 2062 | memset(&f->fmt.pix,0,sizeof(struct v4l2_pix_format)); |
2037 | f->fmt.pix.width = fh->width; | 2063 | pix_format_set_size (&f->fmt.pix, fh->fmt, |
2038 | f->fmt.pix.height = fh->height; | 2064 | fh->width, fh->height); |
2039 | f->fmt.pix.field = fh->cap.field; | 2065 | f->fmt.pix.field = fh->cap.field; |
2040 | f->fmt.pix.pixelformat = fh->fmt->fourcc; | 2066 | f->fmt.pix.pixelformat = fh->fmt->fourcc; |
2041 | f->fmt.pix.bytesperline = | ||
2042 | (f->fmt.pix.width * fh->fmt->depth) >> 3; | ||
2043 | f->fmt.pix.sizeimage = | ||
2044 | f->fmt.pix.height * f->fmt.pix.bytesperline; | ||
2045 | return 0; | 2067 | return 0; |
2046 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: | 2068 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: |
2047 | memset(&f->fmt.win,0,sizeof(struct v4l2_window)); | 2069 | memset(&f->fmt.win,0,sizeof(struct v4l2_window)); |
@@ -2106,11 +2128,9 @@ static int bttv_try_fmt(struct bttv_fh *fh, struct bttv *btv, | |||
2106 | f->fmt.pix.width = maxw; | 2128 | f->fmt.pix.width = maxw; |
2107 | if (f->fmt.pix.height > maxh) | 2129 | if (f->fmt.pix.height > maxh) |
2108 | f->fmt.pix.height = maxh; | 2130 | f->fmt.pix.height = maxh; |
2109 | f->fmt.pix.width &= ~0x03; | 2131 | pix_format_set_size (&f->fmt.pix, fmt, |
2110 | f->fmt.pix.bytesperline = | 2132 | f->fmt.pix.width & ~3, |
2111 | (f->fmt.pix.width * fmt->depth) >> 3; | 2133 | f->fmt.pix.height); |
2112 | f->fmt.pix.sizeimage = | ||
2113 | f->fmt.pix.height * f->fmt.pix.bytesperline; | ||
2114 | 2134 | ||
2115 | return 0; | 2135 | return 0; |
2116 | } | 2136 | } |
@@ -2278,6 +2298,15 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2278 | retval = -EINVAL; | 2298 | retval = -EINVAL; |
2279 | goto fh_unlock_and_return; | 2299 | goto fh_unlock_and_return; |
2280 | } | 2300 | } |
2301 | if (fmt->flags & FORMAT_FLAGS_RAW) { | ||
2302 | /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL * | ||
2303 | RAW_LINES * 2. F1 is stored at offset 0, F2 | ||
2304 | at buffer size / 2. */ | ||
2305 | fh->width = RAW_BPL; | ||
2306 | fh->height = gbufsize / RAW_BPL; | ||
2307 | btv->init.width = RAW_BPL; | ||
2308 | btv->init.height = gbufsize / RAW_BPL; | ||
2309 | } | ||
2281 | fh->ovfmt = fmt; | 2310 | fh->ovfmt = fmt; |
2282 | fh->fmt = fmt; | 2311 | fh->fmt = fmt; |
2283 | btv->init.ovfmt = fmt; | 2312 | btv->init.ovfmt = fmt; |
@@ -2589,9 +2618,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2589 | 2618 | ||
2590 | if (0 == v4l2) | 2619 | if (0 == v4l2) |
2591 | return -EINVAL; | 2620 | return -EINVAL; |
2592 | strcpy(cap->driver,"bttv"); | 2621 | memset(cap, 0, sizeof (*cap)); |
2593 | strlcpy(cap->card,btv->video_dev->name,sizeof(cap->card)); | 2622 | strlcpy(cap->driver, "bttv", sizeof (cap->driver)); |
2594 | sprintf(cap->bus_info,"PCI:%s",pci_name(btv->c.pci)); | 2623 | strlcpy(cap->card, btv->video_dev->name, sizeof (cap->card)); |
2624 | snprintf(cap->bus_info, sizeof (cap->bus_info), | ||
2625 | "PCI:%s", pci_name(btv->c.pci)); | ||
2595 | cap->version = BTTV_VERSION_CODE; | 2626 | cap->version = BTTV_VERSION_CODE; |
2596 | cap->capabilities = | 2627 | cap->capabilities = |
2597 | V4L2_CAP_VIDEO_CAPTURE | | 2628 | V4L2_CAP_VIDEO_CAPTURE | |
@@ -2952,6 +2983,8 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait) | |||
2952 | fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR; | 2983 | fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR; |
2953 | field = videobuf_next_field(&fh->cap); | 2984 | field = videobuf_next_field(&fh->cap); |
2954 | if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) { | 2985 | if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) { |
2986 | kfree (fh->cap.read_buf); | ||
2987 | fh->cap.read_buf = NULL; | ||
2955 | up(&fh->cap.lock); | 2988 | up(&fh->cap.lock); |
2956 | return POLLERR; | 2989 | return POLLERR; |
2957 | } | 2990 | } |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index f6afeec499c5..aea3f038cff6 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -208,8 +208,11 @@ static void cx25840_initialize(struct i2c_client *client, int loadfw) | |||
208 | 208 | ||
209 | static void input_change(struct i2c_client *client) | 209 | static void input_change(struct i2c_client *client) |
210 | { | 210 | { |
211 | struct cx25840_state *state = i2c_get_clientdata(client); | ||
211 | v4l2_std_id std = cx25840_get_v4lstd(client); | 212 | v4l2_std_id std = cx25840_get_v4lstd(client); |
212 | 213 | ||
214 | /* Note: perhaps V4L2_STD_PAL_M should be handled as V4L2_STD_NTSC | ||
215 | instead of V4L2_STD_PAL. Someone needs to test this. */ | ||
213 | if (std & V4L2_STD_PAL) { | 216 | if (std & V4L2_STD_PAL) { |
214 | /* Follow tuner change procedure for PAL */ | 217 | /* Follow tuner change procedure for PAL */ |
215 | cx25840_write(client, 0x808, 0xff); | 218 | cx25840_write(client, 0x808, 0xff); |
@@ -220,7 +223,32 @@ static void input_change(struct i2c_client *client) | |||
220 | cx25840_write(client, 0x80b, 0x10); | 223 | cx25840_write(client, 0x80b, 0x10); |
221 | } else if (std & V4L2_STD_NTSC) { | 224 | } else if (std & V4L2_STD_NTSC) { |
222 | /* NTSC */ | 225 | /* NTSC */ |
223 | cx25840_write(client, 0x808, 0xf6); | 226 | if (state->cardtype == CARDTYPE_PVR150_WORKAROUND) { |
227 | /* Certain Hauppauge PVR150 models have a hardware bug | ||
228 | that causes audio to drop out. For these models the | ||
229 | audio standard must be set explicitly. | ||
230 | To be precise: it affects cards with tuner models | ||
231 | 85, 99 and 112 (model numbers from tveeprom). */ | ||
232 | if (std == V4L2_STD_NTSC_M_JP) { | ||
233 | /* Japan uses EIAJ audio standard */ | ||
234 | cx25840_write(client, 0x808, 0x2f); | ||
235 | } else { | ||
236 | /* Others use the BTSC audio standard */ | ||
237 | cx25840_write(client, 0x808, 0x1f); | ||
238 | } | ||
239 | /* South Korea uses the A2-M (aka Zweiton M) audio | ||
240 | standard, and should set 0x808 to 0x3f, but I don't | ||
241 | know how to detect this. */ | ||
242 | } else if (std == V4L2_STD_NTSC_M_JP) { | ||
243 | /* Japan uses EIAJ audio standard */ | ||
244 | cx25840_write(client, 0x808, 0xf7); | ||
245 | } else { | ||
246 | /* Others use the BTSC audio standard */ | ||
247 | cx25840_write(client, 0x808, 0xf6); | ||
248 | } | ||
249 | /* South Korea uses the A2-M (aka Zweiton M) audio standard, | ||
250 | and should set 0x808 to 0xf8, but I don't know how to | ||
251 | detect this. */ | ||
224 | cx25840_write(client, 0x80b, 0x00); | 252 | cx25840_write(client, 0x80b, 0x00); |
225 | } | 253 | } |
226 | 254 | ||
@@ -241,7 +269,8 @@ static int set_input(struct i2c_client *client, enum cx25840_input input) | |||
241 | case CX25840_TUNER: | 269 | case CX25840_TUNER: |
242 | cx25840_dbg("now setting Tuner input\n"); | 270 | cx25840_dbg("now setting Tuner input\n"); |
243 | 271 | ||
244 | if (state->cardtype == CARDTYPE_PVR150) { | 272 | if (state->cardtype == CARDTYPE_PVR150 || |
273 | state->cardtype == CARDTYPE_PVR150_WORKAROUND) { | ||
245 | /* CH_SEL_ADC2=1 */ | 274 | /* CH_SEL_ADC2=1 */ |
246 | cx25840_and_or(client, 0x102, ~0x2, 0x02); | 275 | cx25840_and_or(client, 0x102, ~0x2, 0x02); |
247 | } | 276 | } |
@@ -363,6 +392,7 @@ static int set_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl) | |||
363 | case CX25840_CID_CARDTYPE: | 392 | case CX25840_CID_CARDTYPE: |
364 | switch (ctrl->value) { | 393 | switch (ctrl->value) { |
365 | case CARDTYPE_PVR150: | 394 | case CARDTYPE_PVR150: |
395 | case CARDTYPE_PVR150_WORKAROUND: | ||
366 | case CARDTYPE_PG600: | 396 | case CARDTYPE_PG600: |
367 | state->cardtype = ctrl->value; | 397 | state->cardtype = ctrl->value; |
368 | break; | 398 | break; |
@@ -714,7 +744,7 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, | |||
714 | 744 | ||
715 | /* ----------------------------------------------------------------------- */ | 745 | /* ----------------------------------------------------------------------- */ |
716 | 746 | ||
717 | struct i2c_driver i2c_driver_cx25840; | 747 | static struct i2c_driver i2c_driver_cx25840; |
718 | 748 | ||
719 | static int cx25840_detect_client(struct i2c_adapter *adapter, int address, | 749 | static int cx25840_detect_client(struct i2c_adapter *adapter, int address, |
720 | int kind) | 750 | int kind) |
@@ -807,7 +837,7 @@ static int cx25840_detach_client(struct i2c_client *client) | |||
807 | 837 | ||
808 | /* ----------------------------------------------------------------------- */ | 838 | /* ----------------------------------------------------------------------- */ |
809 | 839 | ||
810 | struct i2c_driver i2c_driver_cx25840 = { | 840 | static struct i2c_driver i2c_driver_cx25840 = { |
811 | .name = "cx25840", | 841 | .name = "cx25840", |
812 | 842 | ||
813 | .id = I2C_DRIVERID_CX25840, | 843 | .id = I2C_DRIVERID_CX25840, |
diff --git a/drivers/media/video/cx25840/cx25840.h b/drivers/media/video/cx25840/cx25840.h index 5c3f0639fb77..4932ed1c9b19 100644 --- a/drivers/media/video/cx25840/cx25840.h +++ b/drivers/media/video/cx25840/cx25840.h | |||
@@ -40,9 +40,16 @@ extern int cx25840_debug; | |||
40 | 40 | ||
41 | #define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0) | 41 | #define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0) |
42 | 42 | ||
43 | /* The CARDTYPE_PVR150_WORKAROUND cardtype activates a workaround for a | ||
44 | hardware bug that is present in PVR150 (and possible PVR500) cards that | ||
45 | have certain NTSC tuners (tveeprom model numbers 85, 99 and 112). The | ||
46 | audio autodetect fails on some channels for these models and the workaround | ||
47 | is to select the audio standard explicitly. Many thanks to Hauppauge for | ||
48 | providing this information. */ | ||
43 | enum cx25840_cardtype { | 49 | enum cx25840_cardtype { |
44 | CARDTYPE_PVR150, | 50 | CARDTYPE_PVR150, |
45 | CARDTYPE_PG600 | 51 | CARDTYPE_PG600, |
52 | CARDTYPE_PVR150_WORKAROUND, | ||
46 | }; | 53 | }; |
47 | 54 | ||
48 | enum cx25840_input { | 55 | enum cx25840_input { |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index f2268631b7c0..951709aa88ba 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -567,6 +567,7 @@ struct cx88_board cx88_boards[] = { | |||
567 | .radio_type = UNSET, | 567 | .radio_type = UNSET, |
568 | .tuner_addr = ADDR_UNSET, | 568 | .tuner_addr = ADDR_UNSET, |
569 | .radio_addr = ADDR_UNSET, | 569 | .radio_addr = ADDR_UNSET, |
570 | .tda9887_conf = TDA9887_PRESENT, | ||
570 | .input = {{ | 571 | .input = {{ |
571 | .type = CX88_VMUX_TELEVISION, | 572 | .type = CX88_VMUX_TELEVISION, |
572 | .vmux = 0, | 573 | .vmux = 0, |
@@ -711,6 +712,7 @@ struct cx88_board cx88_boards[] = { | |||
711 | .radio_type = UNSET, | 712 | .radio_type = UNSET, |
712 | .tuner_addr = ADDR_UNSET, | 713 | .tuner_addr = ADDR_UNSET, |
713 | .radio_addr = ADDR_UNSET, | 714 | .radio_addr = ADDR_UNSET, |
715 | .tda9887_conf = TDA9887_PRESENT, | ||
714 | .input = {{ | 716 | .input = {{ |
715 | .type = CX88_VMUX_TELEVISION, | 717 | .type = CX88_VMUX_TELEVISION, |
716 | .vmux = 0, | 718 | .vmux = 0, |
@@ -1083,41 +1085,28 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) | |||
1083 | tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data); | 1085 | tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data); |
1084 | core->tuner_type = tv.tuner_type; | 1086 | core->tuner_type = tv.tuner_type; |
1085 | core->has_radio = tv.has_radio; | 1087 | core->has_radio = tv.has_radio; |
1086 | } | ||
1087 | |||
1088 | static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee) | ||
1089 | { | ||
1090 | int model; | ||
1091 | int tuner; | ||
1092 | 1088 | ||
1093 | /* Make sure we support the board model */ | 1089 | /* Make sure we support the board model */ |
1094 | model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c]; | 1090 | switch (tv.model) |
1095 | switch(model) { | 1091 | { |
1096 | case 90002: | 1092 | case 90002: /* Nova-T-PCI (9002) */ |
1097 | case 90500: | 1093 | case 92001: /* Nova-S-Plus (Video and IR) */ |
1098 | case 90501: | 1094 | case 92002: /* Nova-S-Plus (Video and IR) */ |
1095 | case 90003: /* Nova-T-PCI (9002 No RF out) */ | ||
1096 | case 90500: /* Nova-T-PCI (oem) */ | ||
1097 | case 90501: /* Nova-T-PCI (oem/IR) */ | ||
1098 | case 92000: /* Nova-SE2 (OEM, No Video or IR) */ | ||
1099 | |||
1099 | /* known */ | 1100 | /* known */ |
1100 | break; | 1101 | break; |
1101 | default: | 1102 | default: |
1102 | printk("%s: warning: unknown hauppauge model #%d\n", | 1103 | printk("%s: warning: unknown hauppauge model #%d\n", |
1103 | core->name, model); | 1104 | core->name, tv.model); |
1104 | break; | 1105 | break; |
1105 | } | 1106 | } |
1106 | 1107 | ||
1107 | /* Make sure we support the tuner */ | 1108 | printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", |
1108 | tuner = ee[0x2d]; | 1109 | core->name, tv.model); |
1109 | switch(tuner) { | ||
1110 | case 0x4B: /* dtt 7595 */ | ||
1111 | case 0x4C: /* dtt 7592 */ | ||
1112 | break; | ||
1113 | default: | ||
1114 | printk("%s: error: unknown hauppauge tuner 0x%02x\n", | ||
1115 | core->name, tuner); | ||
1116 | return -ENODEV; | ||
1117 | } | ||
1118 | printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n", | ||
1119 | core->name, model, tuner); | ||
1120 | return 0; | ||
1121 | } | 1110 | } |
1122 | 1111 | ||
1123 | /* ----------------------------------------------------------------------- */ | 1112 | /* ----------------------------------------------------------------------- */ |
@@ -1201,7 +1190,7 @@ void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) | |||
1201 | 1190 | ||
1202 | void cx88_card_setup(struct cx88_core *core) | 1191 | void cx88_card_setup(struct cx88_core *core) |
1203 | { | 1192 | { |
1204 | static u8 eeprom[128]; | 1193 | static u8 eeprom[256]; |
1205 | 1194 | ||
1206 | if (0 == core->i2c_rc) { | 1195 | if (0 == core->i2c_rc) { |
1207 | core->i2c_client.addr = 0xa0 >> 1; | 1196 | core->i2c_client.addr = 0xa0 >> 1; |
@@ -1224,7 +1213,7 @@ void cx88_card_setup(struct cx88_core *core) | |||
1224 | break; | 1213 | break; |
1225 | case CX88_BOARD_HAUPPAUGE_DVB_T1: | 1214 | case CX88_BOARD_HAUPPAUGE_DVB_T1: |
1226 | if (0 == core->i2c_rc) | 1215 | if (0 == core->i2c_rc) |
1227 | hauppauge_eeprom_dvb(core,eeprom); | 1216 | hauppauge_eeprom(core,eeprom); |
1228 | break; | 1217 | break; |
1229 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: | 1218 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: |
1230 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: | 1219 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: |
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index eb806af17182..bb6eb54e19ce 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -837,6 +837,29 @@ static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) | |||
837 | return -1; | 837 | return -1; |
838 | } | 838 | } |
839 | 839 | ||
840 | int cx88_start_audio_dma(struct cx88_core *core) | ||
841 | { | ||
842 | /* setup fifo + format */ | ||
843 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); | ||
844 | cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); | ||
845 | |||
846 | cx_write(MO_AUDD_LNGTH, 128); /* fifo bpl size */ | ||
847 | cx_write(MO_AUDR_LNGTH, 128); /* fifo bpl size */ | ||
848 | |||
849 | /* start dma */ | ||
850 | cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ | ||
851 | |||
852 | return 0; | ||
853 | } | ||
854 | |||
855 | int cx88_stop_audio_dma(struct cx88_core *core) | ||
856 | { | ||
857 | /* stop dma */ | ||
858 | cx_write(MO_AUD_DMACNTRL, 0x0000); | ||
859 | |||
860 | return 0; | ||
861 | } | ||
862 | |||
840 | static int set_tvaudio(struct cx88_core *core) | 863 | static int set_tvaudio(struct cx88_core *core) |
841 | { | 864 | { |
842 | struct cx88_tvnorm *norm = core->tvnorm; | 865 | struct cx88_tvnorm *norm = core->tvnorm; |
@@ -877,12 +900,16 @@ static int set_tvaudio(struct cx88_core *core) | |||
877 | cx88_set_tvaudio(core); | 900 | cx88_set_tvaudio(core); |
878 | /* cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO); */ | 901 | /* cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO); */ |
879 | 902 | ||
880 | cx_write(MO_AUDD_LNGTH, 128); /* fifo size */ | 903 | /* |
881 | cx_write(MO_AUDR_LNGTH, 128); /* fifo size */ | 904 | This should be needed only on cx88-alsa. It seems that some cx88 chips have |
882 | cx_write(MO_AUD_DMACNTRL, 0x03); /* need audio fifo */ | 905 | bugs and does require DMA enabled for it to work. |
906 | */ | ||
907 | cx88_start_audio_dma(core); | ||
883 | return 0; | 908 | return 0; |
884 | } | 909 | } |
885 | 910 | ||
911 | |||
912 | |||
886 | int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm) | 913 | int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm) |
887 | { | 914 | { |
888 | u32 fsc8; | 915 | u32 fsc8; |
@@ -1204,6 +1231,8 @@ EXPORT_SYMBOL(cx88_set_scale); | |||
1204 | EXPORT_SYMBOL(cx88_vdev_init); | 1231 | EXPORT_SYMBOL(cx88_vdev_init); |
1205 | EXPORT_SYMBOL(cx88_core_get); | 1232 | EXPORT_SYMBOL(cx88_core_get); |
1206 | EXPORT_SYMBOL(cx88_core_put); | 1233 | EXPORT_SYMBOL(cx88_core_put); |
1234 | EXPORT_SYMBOL(cx88_start_audio_dma); | ||
1235 | EXPORT_SYMBOL(cx88_stop_audio_dma); | ||
1207 | 1236 | ||
1208 | /* | 1237 | /* |
1209 | * Local variables: | 1238 | * Local variables: |
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index 6d9bec1c583b..a1b120c8a9b5 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -119,13 +119,10 @@ static void set_audio_registers(struct cx88_core *core, const struct rlist *l) | |||
119 | 119 | ||
120 | static void set_audio_start(struct cx88_core *core, u32 mode) | 120 | static void set_audio_start(struct cx88_core *core, u32 mode) |
121 | { | 121 | { |
122 | // mute | 122 | /* mute */ |
123 | cx_write(AUD_VOL_CTL, (1 << 6)); | 123 | cx_write(AUD_VOL_CTL, (1 << 6)); |
124 | 124 | ||
125 | // start programming | 125 | /* start programming */ |
126 | cx_write(MO_AUD_DMACNTRL, 0x0000); | ||
127 | msleep(100); | ||
128 | //cx_write(AUD_CTL, 0x0000); | ||
129 | cx_write(AUD_INIT, mode); | 126 | cx_write(AUD_INIT, mode); |
130 | cx_write(AUD_INIT_LD, 0x0001); | 127 | cx_write(AUD_INIT_LD, 0x0001); |
131 | cx_write(AUD_SOFT_RESET, 0x0001); | 128 | cx_write(AUD_SOFT_RESET, 0x0001); |
@@ -135,17 +132,21 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) | |||
135 | { | 132 | { |
136 | u32 volume; | 133 | u32 volume; |
137 | 134 | ||
135 | /* restart dma; This avoids buzz in NICAM and is good in others */ | ||
136 | cx88_stop_audio_dma(core); | ||
137 | cx_write(AUD_RATE_THRES_DMD, 0x000000C0); | ||
138 | cx88_start_audio_dma(core); | ||
139 | |||
138 | if (cx88_boards[core->board].blackbird) { | 140 | if (cx88_boards[core->board].blackbird) { |
139 | // sets sound input from external adc | 141 | /* sets sound input from external adc */ |
140 | cx_set(AUD_CTL, EN_I2SIN_ENABLE); | 142 | cx_set(AUD_CTL, EN_I2SIN_ENABLE); |
141 | //cx_write(AUD_I2SINPUTCNTL, 0); | ||
142 | cx_write(AUD_I2SINPUTCNTL, 4); | 143 | cx_write(AUD_I2SINPUTCNTL, 4); |
143 | cx_write(AUD_BAUDRATE, 1); | 144 | cx_write(AUD_BAUDRATE, 1); |
144 | // 'pass-thru mode': this enables the i2s output to the mpeg encoder | 145 | /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */ |
145 | cx_set(AUD_CTL, EN_I2SOUT_ENABLE); | 146 | cx_set(AUD_CTL, EN_I2SOUT_ENABLE); |
146 | cx_write(AUD_I2SOUTPUTCNTL, 1); | 147 | cx_write(AUD_I2SOUTPUTCNTL, 1); |
147 | cx_write(AUD_I2SCNTL, 0); | 148 | cx_write(AUD_I2SCNTL, 0); |
148 | //cx_write(AUD_APB_IN_RATE_ADJ, 0); | 149 | /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */ |
149 | } else { | 150 | } else { |
150 | ctl |= EN_DAC_ENABLE; | 151 | ctl |= EN_DAC_ENABLE; |
151 | cx_write(AUD_CTL, ctl); | 152 | cx_write(AUD_CTL, ctl); |
@@ -153,7 +154,6 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) | |||
153 | 154 | ||
154 | /* finish programming */ | 155 | /* finish programming */ |
155 | cx_write(AUD_SOFT_RESET, 0x0000); | 156 | cx_write(AUD_SOFT_RESET, 0x0000); |
156 | cx_write(MO_AUD_DMACNTRL, 0x0003); | ||
157 | 157 | ||
158 | /* unmute */ | 158 | /* unmute */ |
159 | volume = cx_sread(SHADOW_AUD_VOL_CTL); | 159 | volume = cx_sread(SHADOW_AUD_VOL_CTL); |
@@ -313,7 +313,6 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode) | |||
313 | {AUD_RATE_ADJ3, 0x00000100}, | 313 | {AUD_RATE_ADJ3, 0x00000100}, |
314 | {AUD_RATE_ADJ4, 0x00000400}, | 314 | {AUD_RATE_ADJ4, 0x00000400}, |
315 | {AUD_RATE_ADJ5, 0x00001000}, | 315 | {AUD_RATE_ADJ5, 0x00001000}, |
316 | //{ AUD_DMD_RA_DDS, 0x00c0d5ce }, | ||
317 | {AUD_ERRLOGPERIOD_R, 0x00000fff}, | 316 | {AUD_ERRLOGPERIOD_R, 0x00000fff}, |
318 | {AUD_ERRINTRPTTHSHLD1_R, 0x000003ff}, | 317 | {AUD_ERRINTRPTTHSHLD1_R, 0x000003ff}, |
319 | {AUD_ERRINTRPTTHSHLD2_R, 0x000000ff}, | 318 | {AUD_ERRINTRPTTHSHLD2_R, 0x000000ff}, |
@@ -351,12 +350,12 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode) | |||
351 | set_audio_registers(core, nicam_l); | 350 | set_audio_registers(core, nicam_l); |
352 | break; | 351 | break; |
353 | case WW_I: | 352 | case WW_I: |
354 | dprintk("%s PAL-I NICAM (status: devel)\n", __FUNCTION__); | 353 | dprintk("%s PAL-I NICAM (status: known-good)\n", __FUNCTION__); |
355 | set_audio_registers(core, nicam_bgdki_common); | 354 | set_audio_registers(core, nicam_bgdki_common); |
356 | set_audio_registers(core, nicam_i); | 355 | set_audio_registers(core, nicam_i); |
357 | break; | 356 | break; |
358 | default: | 357 | default: |
359 | dprintk("%s PAL-BGDK NICAM (status: unknown)\n", __FUNCTION__); | 358 | dprintk("%s PAL-BGDK NICAM (status: known-good)\n", __FUNCTION__); |
360 | set_audio_registers(core, nicam_bgdki_common); | 359 | set_audio_registers(core, nicam_bgdki_common); |
361 | set_audio_registers(core, nicam_default); | 360 | set_audio_registers(core, nicam_default); |
362 | break; | 361 | break; |
@@ -715,8 +714,7 @@ int cx88_detect_nicam(struct cx88_core *core) | |||
715 | /* if bit1=1 then nicam is detected */ | 714 | /* if bit1=1 then nicam is detected */ |
716 | j += ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1); | 715 | j += ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1); |
717 | 716 | ||
718 | /* 3x detected: absolutly sure now */ | 717 | if (j == 1) { |
719 | if (j == 3) { | ||
720 | dprintk("nicam is detected.\n"); | 718 | dprintk("nicam is detected.\n"); |
721 | return 1; | 719 | return 1; |
722 | } | 720 | } |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index b19d3a9e2298..27fb080fd7aa 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -491,6 +491,10 @@ extern struct cx88_core* cx88_core_get(struct pci_dev *pci); | |||
491 | extern void cx88_core_put(struct cx88_core *core, | 491 | extern void cx88_core_put(struct cx88_core *core, |
492 | struct pci_dev *pci); | 492 | struct pci_dev *pci); |
493 | 493 | ||
494 | extern int cx88_start_audio_dma(struct cx88_core *core); | ||
495 | extern int cx88_stop_audio_dma(struct cx88_core *core); | ||
496 | |||
497 | |||
494 | /* ----------------------------------------------------------- */ | 498 | /* ----------------------------------------------------------- */ |
495 | /* cx88-vbi.c */ | 499 | /* cx88-vbi.c */ |
496 | 500 | ||
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index d54bc0127484..9f6e5e5355a1 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | /* #define ENABLE_DEBUG_ISOC_FRAMES */ | 33 | /* #define ENABLE_DEBUG_ISOC_FRAMES */ |
34 | 34 | ||
35 | unsigned int core_debug; | 35 | static unsigned int core_debug; |
36 | module_param(core_debug,int,0644); | 36 | module_param(core_debug,int,0644); |
37 | MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); | 37 | MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); |
38 | 38 | ||
@@ -41,7 +41,7 @@ MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); | |||
41 | printk(KERN_INFO "%s %s :"fmt, \ | 41 | printk(KERN_INFO "%s %s :"fmt, \ |
42 | dev->name, __FUNCTION__ , ##arg); } while (0) | 42 | dev->name, __FUNCTION__ , ##arg); } while (0) |
43 | 43 | ||
44 | unsigned int reg_debug; | 44 | static unsigned int reg_debug; |
45 | module_param(reg_debug,int,0644); | 45 | module_param(reg_debug,int,0644); |
46 | MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); | 46 | MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); |
47 | 47 | ||
@@ -50,7 +50,7 @@ MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); | |||
50 | printk(KERN_INFO "%s %s :"fmt, \ | 50 | printk(KERN_INFO "%s %s :"fmt, \ |
51 | dev->name, __FUNCTION__ , ##arg); } while (0) | 51 | dev->name, __FUNCTION__ , ##arg); } while (0) |
52 | 52 | ||
53 | unsigned int isoc_debug; | 53 | static unsigned int isoc_debug; |
54 | module_param(isoc_debug,int,0644); | 54 | module_param(isoc_debug,int,0644); |
55 | MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]"); | 55 | MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]"); |
56 | 56 | ||
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 57c1826b928e..abec32c175aa 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -226,7 +226,7 @@ static int em28xx_config(struct em28xx *dev) | |||
226 | * em28xx_config_i2c() | 226 | * em28xx_config_i2c() |
227 | * configure i2c attached devices | 227 | * configure i2c attached devices |
228 | */ | 228 | */ |
229 | void em28xx_config_i2c(struct em28xx *dev) | 229 | static void em28xx_config_i2c(struct em28xx *dev) |
230 | { | 230 | { |
231 | struct v4l2_frequency f; | 231 | struct v4l2_frequency f; |
232 | struct video_decoder_init em28xx_vdi = {.data = NULL }; | 232 | struct video_decoder_init em28xx_vdi = {.data = NULL }; |
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 801c736e9328..124c502ea1f3 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
@@ -278,7 +278,7 @@ static int ir_probe(struct i2c_adapter *adap); | |||
278 | 278 | ||
279 | static struct i2c_driver driver = { | 279 | static struct i2c_driver driver = { |
280 | .name = "ir remote kbd driver", | 280 | .name = "ir remote kbd driver", |
281 | .id = I2C_DRIVERID_EXP3, /* FIXME */ | 281 | .id = I2C_DRIVERID_I2C_IR, |
282 | .flags = I2C_DF_NOTIFY, | 282 | .flags = I2C_DF_NOTIFY, |
283 | .attach_adapter = ir_probe, | 283 | .attach_adapter = ir_probe, |
284 | .detach_client = ir_detach, | 284 | .detach_client = ir_detach, |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 0235cef07b31..e717e30d8187 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -771,17 +771,19 @@ static v4l2_std_id saa7115_get_v4lstd(struct i2c_client *client) | |||
771 | 771 | ||
772 | static void saa7115_log_status(struct i2c_client *client) | 772 | static void saa7115_log_status(struct i2c_client *client) |
773 | { | 773 | { |
774 | static const char * const audclk_freq_strs[] = { | ||
775 | "44.1 kHz", | ||
776 | "48 kHz", | ||
777 | "32 kHz" | ||
778 | }; | ||
779 | struct saa7115_state *state = i2c_get_clientdata(client); | 774 | struct saa7115_state *state = i2c_get_clientdata(client); |
775 | char *audfreq = "undefined"; | ||
780 | int reg1e, reg1f; | 776 | int reg1e, reg1f; |
781 | int signalOk; | 777 | int signalOk; |
782 | int vcr; | 778 | int vcr; |
783 | 779 | ||
784 | saa7115_info("Audio frequency: %s\n", audclk_freq_strs[state->audclk_freq]); | 780 | switch (state->audclk_freq) { |
781 | case V4L2_AUDCLK_32_KHZ: audfreq = "32 kHz"; break; | ||
782 | case V4L2_AUDCLK_441_KHZ: audfreq = "44.1 kHz"; break; | ||
783 | case V4L2_AUDCLK_48_KHZ: audfreq = "48 kHz"; break; | ||
784 | } | ||
785 | |||
786 | saa7115_info("Audio frequency: %s\n", audfreq); | ||
785 | if (client->name[6] == '4') { | 787 | if (client->name[6] == '4') { |
786 | /* status for the saa7114 */ | 788 | /* status for the saa7114 */ |
787 | reg1f = saa7115_read(client, 0x1f); | 789 | reg1f = saa7115_read(client, 0x1f); |
diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c index 25b30f352d84..59e13fdea780 100644 --- a/drivers/media/video/saa711x.c +++ b/drivers/media/video/saa711x.c | |||
@@ -323,7 +323,7 @@ saa711x_command (struct i2c_client *client, | |||
323 | 323 | ||
324 | case VIDEO_MODE_SECAM: | 324 | case VIDEO_MODE_SECAM: |
325 | saa711x_write(client, 0x08, | 325 | saa711x_write(client, 0x08, |
326 | (decoder->reg[0x0e] & 0x3f) | 0x00); | 326 | (decoder->reg[0x08] & 0x3f) | 0x00); |
327 | saa711x_write(client, 0x0e, | 327 | saa711x_write(client, 0x0e, |
328 | (decoder->reg[0x0e] & 0x8f) | 0x50); | 328 | (decoder->reg[0x0e] & 0x8f) | 0x50); |
329 | break; | 329 | break; |
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 843431f10e3b..3428e1ed0032 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -223,7 +223,7 @@ static const struct i2c_reg_value saa7127_init_config_60hz[] = { | |||
223 | }; | 223 | }; |
224 | 224 | ||
225 | #define SAA7127_50HZ_DAC_CONTROL 0x02 | 225 | #define SAA7127_50HZ_DAC_CONTROL 0x02 |
226 | struct i2c_reg_value saa7127_init_config_50hz[] = { | 226 | static struct i2c_reg_value saa7127_init_config_50hz[] = { |
227 | { SAA7127_REG_BURST_START, 0x21 }, | 227 | { SAA7127_REG_BURST_START, 0x21 }, |
228 | /* BURST_END is also used as a chip ID in saa7127_detect_client */ | 228 | /* BURST_END is also used as a chip ID in saa7127_detect_client */ |
229 | { SAA7127_REG_BURST_END, 0x1d }, | 229 | { SAA7127_REG_BURST_END, 0x1d }, |
@@ -696,7 +696,7 @@ static int saa7127_command(struct i2c_client *client, | |||
696 | 696 | ||
697 | /* ----------------------------------------------------------------------- */ | 697 | /* ----------------------------------------------------------------------- */ |
698 | 698 | ||
699 | struct i2c_driver i2c_driver_saa7127; | 699 | static struct i2c_driver i2c_driver_saa7127; |
700 | 700 | ||
701 | /* ----------------------------------------------------------------------- */ | 701 | /* ----------------------------------------------------------------------- */ |
702 | 702 | ||
@@ -818,7 +818,7 @@ static int saa7127_detach(struct i2c_client *client) | |||
818 | 818 | ||
819 | /* ----------------------------------------------------------------------- */ | 819 | /* ----------------------------------------------------------------------- */ |
820 | 820 | ||
821 | struct i2c_driver i2c_driver_saa7127 = { | 821 | static struct i2c_driver i2c_driver_saa7127 = { |
822 | .name = "saa7127", | 822 | .name = "saa7127", |
823 | .id = I2C_DRIVERID_SAA7127, | 823 | .id = I2C_DRIVERID_SAA7127, |
824 | .flags = I2C_DF_NOTIFY, | 824 | .flags = I2C_DF_NOTIFY, |
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 5707c666660b..263c6e2e3e8e 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
@@ -58,8 +58,6 @@ static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; | |||
58 | module_param_array(index, int, NULL, 0444); | 58 | module_param_array(index, int, NULL, 0444); |
59 | MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); | 59 | MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); |
60 | 60 | ||
61 | int position; | ||
62 | |||
63 | #define dprintk(fmt, arg...) if (debug) \ | 61 | #define dprintk(fmt, arg...) if (debug) \ |
64 | printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ## arg) | 62 | printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ## arg) |
65 | 63 | ||
@@ -140,7 +138,8 @@ static void saa7134_dma_start(struct saa7134_dev *dev) | |||
140 | * | 138 | * |
141 | */ | 139 | */ |
142 | 140 | ||
143 | void saa7134_irq_alsa_done(struct saa7134_dev *dev, unsigned long status) | 141 | static void saa7134_irq_alsa_done(struct saa7134_dev *dev, |
142 | unsigned long status) | ||
144 | { | 143 | { |
145 | int next_blk, reg = 0; | 144 | int next_blk, reg = 0; |
146 | 145 | ||
@@ -881,7 +880,7 @@ static void snd_saa7134_free(snd_card_t * card) | |||
881 | * | 880 | * |
882 | */ | 881 | */ |
883 | 882 | ||
884 | int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) | 883 | static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) |
885 | { | 884 | { |
886 | 885 | ||
887 | snd_card_t *card; | 886 | snd_card_t *card; |
@@ -945,6 +944,8 @@ int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) | |||
945 | sprintf(card->longname, "%s at 0x%lx irq %d", | 944 | sprintf(card->longname, "%s at 0x%lx irq %d", |
946 | chip->dev->name, chip->iobase, chip->irq); | 945 | chip->dev->name, chip->iobase, chip->irq); |
947 | 946 | ||
947 | printk(KERN_INFO "%s/alsa: %s registered as card %d\n",dev->name,card->longname,index[devnum]); | ||
948 | |||
948 | if ((err = snd_card_register(card)) == 0) { | 949 | if ((err = snd_card_register(card)) == 0) { |
949 | snd_saa7134_cards[devnum] = card; | 950 | snd_saa7134_cards[devnum] = card; |
950 | return 0; | 951 | return 0; |
@@ -955,6 +956,22 @@ __nodev: | |||
955 | return err; | 956 | return err; |
956 | } | 957 | } |
957 | 958 | ||
959 | |||
960 | static int alsa_device_init(struct saa7134_dev *dev) | ||
961 | { | ||
962 | dev->dmasound.priv_data = dev; | ||
963 | alsa_card_saa7134_create(dev,dev->nr); | ||
964 | return 1; | ||
965 | } | ||
966 | |||
967 | static int alsa_device_exit(struct saa7134_dev *dev) | ||
968 | { | ||
969 | |||
970 | snd_card_free(snd_saa7134_cards[dev->nr]); | ||
971 | snd_saa7134_cards[dev->nr] = NULL; | ||
972 | return 1; | ||
973 | } | ||
974 | |||
958 | /* | 975 | /* |
959 | * Module initializer | 976 | * Module initializer |
960 | * | 977 | * |
@@ -968,22 +985,21 @@ static int saa7134_alsa_init(void) | |||
968 | struct saa7134_dev *dev = NULL; | 985 | struct saa7134_dev *dev = NULL; |
969 | struct list_head *list; | 986 | struct list_head *list; |
970 | 987 | ||
971 | position = 0; | ||
972 | |||
973 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); | 988 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); |
974 | 989 | ||
975 | list_for_each(list,&saa7134_devlist) { | 990 | list_for_each(list,&saa7134_devlist) { |
976 | dev = list_entry(list, struct saa7134_dev, devlist); | 991 | dev = list_entry(list, struct saa7134_dev, devlist); |
977 | if (dev->dmasound.priv_data == NULL) { | 992 | if (dev->dmasound.priv_data == NULL) { |
978 | dev->dmasound.priv_data = dev; | 993 | alsa_device_init(dev); |
979 | alsa_card_saa7134_create(dev,position); | ||
980 | position++; | ||
981 | } else { | 994 | } else { |
982 | printk(KERN_ERR "saa7134 ALSA: DMA sound is being handled by OSS. ignoring %s\n",dev->name); | 995 | printk(KERN_ERR "saa7134 ALSA: DMA sound is being handled by OSS. ignoring %s\n",dev->name); |
983 | return -EBUSY; | 996 | return -EBUSY; |
984 | } | 997 | } |
985 | } | 998 | } |
986 | 999 | ||
1000 | dmasound_init = alsa_device_init; | ||
1001 | dmasound_exit = alsa_device_exit; | ||
1002 | |||
987 | if (dev == NULL) | 1003 | if (dev == NULL) |
988 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); | 1004 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); |
989 | 1005 | ||
@@ -994,7 +1010,7 @@ static int saa7134_alsa_init(void) | |||
994 | * Module destructor | 1010 | * Module destructor |
995 | */ | 1011 | */ |
996 | 1012 | ||
997 | void saa7134_alsa_exit(void) | 1013 | static void saa7134_alsa_exit(void) |
998 | { | 1014 | { |
999 | int idx; | 1015 | int idx; |
1000 | 1016 | ||
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 4275d2ddb864..1a093bf176f3 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -88,6 +88,9 @@ LIST_HEAD(saa7134_devlist); | |||
88 | static LIST_HEAD(mops_list); | 88 | static LIST_HEAD(mops_list); |
89 | static unsigned int saa7134_devcount; | 89 | static unsigned int saa7134_devcount; |
90 | 90 | ||
91 | int (*dmasound_init)(struct saa7134_dev *dev); | ||
92 | int (*dmasound_exit)(struct saa7134_dev *dev); | ||
93 | |||
91 | #define dprintk(fmt, arg...) if (core_debug) \ | 94 | #define dprintk(fmt, arg...) if (core_debug) \ |
92 | printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg) | 95 | printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg) |
93 | 96 | ||
@@ -184,8 +187,7 @@ void saa7134_track_gpio(struct saa7134_dev *dev, char *msg) | |||
184 | /* ----------------------------------------------------------- */ | 187 | /* ----------------------------------------------------------- */ |
185 | /* delayed request_module */ | 188 | /* delayed request_module */ |
186 | 189 | ||
187 | #ifdef CONFIG_MODULES | 190 | #if defined(CONFIG_MODULES) && defined(MODULE) |
188 | |||
189 | static int need_empress; | 191 | static int need_empress; |
190 | static int need_dvb; | 192 | static int need_dvb; |
191 | static int need_alsa; | 193 | static int need_alsa; |
@@ -234,9 +236,7 @@ static void request_module_depend(char *name, int *flag) | |||
234 | } | 236 | } |
235 | 237 | ||
236 | #else | 238 | #else |
237 | |||
238 | #define request_module_depend(name,flag) | 239 | #define request_module_depend(name,flag) |
239 | |||
240 | #endif /* CONFIG_MODULES */ | 240 | #endif /* CONFIG_MODULES */ |
241 | 241 | ||
242 | /* ------------------------------------------------------------------ */ | 242 | /* ------------------------------------------------------------------ */ |
@@ -1017,6 +1017,10 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
1017 | /* check for signal */ | 1017 | /* check for signal */ |
1018 | saa7134_irq_video_intl(dev); | 1018 | saa7134_irq_video_intl(dev); |
1019 | 1019 | ||
1020 | if (dmasound_init && !dev->dmasound.priv_data) { | ||
1021 | dmasound_init(dev); | ||
1022 | } | ||
1023 | |||
1020 | return 0; | 1024 | return 0; |
1021 | 1025 | ||
1022 | fail4: | 1026 | fail4: |
@@ -1040,6 +1044,11 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev) | |||
1040 | struct list_head *item; | 1044 | struct list_head *item; |
1041 | struct saa7134_mpeg_ops *mops; | 1045 | struct saa7134_mpeg_ops *mops; |
1042 | 1046 | ||
1047 | /* Release DMA sound modules if present */ | ||
1048 | if (dmasound_exit && dev->dmasound.priv_data) { | ||
1049 | dmasound_exit(dev); | ||
1050 | } | ||
1051 | |||
1043 | /* debugging ... */ | 1052 | /* debugging ... */ |
1044 | if (irq_debug) { | 1053 | if (irq_debug) { |
1045 | u32 report = saa_readl(SAA7134_IRQ_REPORT); | 1054 | u32 report = saa_readl(SAA7134_IRQ_REPORT); |
@@ -1071,6 +1080,7 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev) | |||
1071 | saa7134_i2c_unregister(dev); | 1080 | saa7134_i2c_unregister(dev); |
1072 | saa7134_unregister_video(dev); | 1081 | saa7134_unregister_video(dev); |
1073 | 1082 | ||
1083 | |||
1074 | /* the DMA sound modules should be unloaded before reaching | 1084 | /* the DMA sound modules should be unloaded before reaching |
1075 | this, but just in case they are still present... */ | 1085 | this, but just in case they are still present... */ |
1076 | if (dev->dmasound.priv_data != NULL) { | 1086 | if (dev->dmasound.priv_data != NULL) { |
@@ -1078,6 +1088,7 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev) | |||
1078 | dev->dmasound.priv_data = NULL; | 1088 | dev->dmasound.priv_data = NULL; |
1079 | } | 1089 | } |
1080 | 1090 | ||
1091 | |||
1081 | /* release resources */ | 1092 | /* release resources */ |
1082 | free_irq(pci_dev->irq, dev); | 1093 | free_irq(pci_dev->irq, dev); |
1083 | iounmap(dev->lmmio); | 1094 | iounmap(dev->lmmio); |
@@ -1149,10 +1160,10 @@ static int saa7134_init(void) | |||
1149 | 1160 | ||
1150 | static void saa7134_fini(void) | 1161 | static void saa7134_fini(void) |
1151 | { | 1162 | { |
1152 | #ifdef CONFIG_MODULES | 1163 | #if defined(CONFIG_MODULES) && defined(MODULE) |
1153 | if (pending_registered) | 1164 | if (pending_registered) |
1154 | unregister_module_notifier(&pending_notifier); | 1165 | unregister_module_notifier(&pending_notifier); |
1155 | #endif | 1166 | #endif /* CONFIG_MODULES */ |
1156 | pci_unregister_driver(&saa7134_pci_driver); | 1167 | pci_unregister_driver(&saa7134_pci_driver); |
1157 | } | 1168 | } |
1158 | 1169 | ||
@@ -1168,6 +1179,8 @@ EXPORT_SYMBOL(saa7134_boards); | |||
1168 | 1179 | ||
1169 | /* ----------------- for the DMA sound modules --------------- */ | 1180 | /* ----------------- for the DMA sound modules --------------- */ |
1170 | 1181 | ||
1182 | EXPORT_SYMBOL(dmasound_init); | ||
1183 | EXPORT_SYMBOL(dmasound_exit); | ||
1171 | EXPORT_SYMBOL(saa7134_pgtable_free); | 1184 | EXPORT_SYMBOL(saa7134_pgtable_free); |
1172 | EXPORT_SYMBOL(saa7134_pgtable_build); | 1185 | EXPORT_SYMBOL(saa7134_pgtable_build); |
1173 | EXPORT_SYMBOL(saa7134_pgtable_alloc); | 1186 | EXPORT_SYMBOL(saa7134_pgtable_alloc); |
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c index fd9ed11ab1e2..5a579194e455 100644 --- a/drivers/media/video/saa7134/saa7134-oss.c +++ b/drivers/media/video/saa7134/saa7134-oss.c | |||
@@ -899,26 +899,26 @@ void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status) | |||
899 | spin_unlock(&dev->slock); | 899 | spin_unlock(&dev->slock); |
900 | } | 900 | } |
901 | 901 | ||
902 | int saa7134_dsp_create(struct saa7134_dev *dev) | 902 | static int saa7134_dsp_create(struct saa7134_dev *dev) |
903 | { | 903 | { |
904 | int err; | 904 | int err; |
905 | 905 | ||
906 | err = dev->dmasound.minor_dsp = | 906 | err = dev->dmasound.minor_dsp = |
907 | register_sound_dsp(&saa7134_dsp_fops, | 907 | register_sound_dsp(&saa7134_dsp_fops, |
908 | dsp_nr[dev->nr]); | 908 | dsp_nr[dev->nr]); |
909 | if (err < 0) { | 909 | if (err < 0) { |
910 | goto fail; | 910 | goto fail; |
911 | } | 911 | } |
912 | printk(KERN_INFO "%s: registered device dsp%d\n", | 912 | printk(KERN_INFO "%s: registered device dsp%d\n", |
913 | dev->name,dev->dmasound.minor_dsp >> 4); | 913 | dev->name,dev->dmasound.minor_dsp >> 4); |
914 | 914 | ||
915 | err = dev->dmasound.minor_mixer = | 915 | err = dev->dmasound.minor_mixer = |
916 | register_sound_mixer(&saa7134_mixer_fops, | 916 | register_sound_mixer(&saa7134_mixer_fops, |
917 | mixer_nr[dev->nr]); | 917 | mixer_nr[dev->nr]); |
918 | if (err < 0) | 918 | if (err < 0) |
919 | goto fail; | 919 | goto fail; |
920 | printk(KERN_INFO "%s: registered device mixer%d\n", | 920 | printk(KERN_INFO "%s: registered device mixer%d\n", |
921 | dev->name,dev->dmasound.minor_mixer >> 4); | 921 | dev->name,dev->dmasound.minor_mixer >> 4); |
922 | 922 | ||
923 | return 0; | 923 | return 0; |
924 | 924 | ||
@@ -929,6 +929,31 @@ fail: | |||
929 | 929 | ||
930 | } | 930 | } |
931 | 931 | ||
932 | static int oss_device_init(struct saa7134_dev *dev) | ||
933 | { | ||
934 | dev->dmasound.priv_data = dev; | ||
935 | saa7134_oss_init1(dev); | ||
936 | saa7134_dsp_create(dev); | ||
937 | return 1; | ||
938 | } | ||
939 | |||
940 | static int oss_device_exit(struct saa7134_dev *dev) | ||
941 | { | ||
942 | |||
943 | unregister_sound_mixer(dev->dmasound.minor_mixer); | ||
944 | unregister_sound_dsp(dev->dmasound.minor_dsp); | ||
945 | |||
946 | saa7134_oss_fini(dev); | ||
947 | |||
948 | if (dev->pci->irq > 0) { | ||
949 | synchronize_irq(dev->pci->irq); | ||
950 | free_irq(dev->pci->irq,&dev->dmasound); | ||
951 | } | ||
952 | |||
953 | dev->dmasound.priv_data = NULL; | ||
954 | return 1; | ||
955 | } | ||
956 | |||
932 | static int saa7134_oss_init(void) | 957 | static int saa7134_oss_init(void) |
933 | { | 958 | { |
934 | struct saa7134_dev *dev = NULL; | 959 | struct saa7134_dev *dev = NULL; |
@@ -939,9 +964,7 @@ static int saa7134_oss_init(void) | |||
939 | list_for_each(list,&saa7134_devlist) { | 964 | list_for_each(list,&saa7134_devlist) { |
940 | dev = list_entry(list, struct saa7134_dev, devlist); | 965 | dev = list_entry(list, struct saa7134_dev, devlist); |
941 | if (dev->dmasound.priv_data == NULL) { | 966 | if (dev->dmasound.priv_data == NULL) { |
942 | dev->dmasound.priv_data = dev; | 967 | oss_device_init(dev); |
943 | saa7134_oss_init1(dev); | ||
944 | saa7134_dsp_create(dev); | ||
945 | } else { | 968 | } else { |
946 | printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name); | 969 | printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name); |
947 | return -EBUSY; | 970 | return -EBUSY; |
@@ -951,11 +974,14 @@ static int saa7134_oss_init(void) | |||
951 | if (dev == NULL) | 974 | if (dev == NULL) |
952 | printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); | 975 | printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); |
953 | 976 | ||
977 | dmasound_init = oss_device_init; | ||
978 | dmasound_exit = oss_device_exit; | ||
979 | |||
954 | return 0; | 980 | return 0; |
955 | 981 | ||
956 | } | 982 | } |
957 | 983 | ||
958 | void saa7134_oss_exit(void) | 984 | static void saa7134_oss_exit(void) |
959 | { | 985 | { |
960 | struct saa7134_dev *dev = NULL; | 986 | struct saa7134_dev *dev = NULL; |
961 | struct list_head *list; | 987 | struct list_head *list; |
@@ -967,18 +993,7 @@ void saa7134_oss_exit(void) | |||
967 | if (!dev->dmasound.minor_dsp) | 993 | if (!dev->dmasound.minor_dsp) |
968 | continue; | 994 | continue; |
969 | 995 | ||
970 | unregister_sound_mixer(dev->dmasound.minor_mixer); | 996 | oss_device_exit(dev); |
971 | unregister_sound_dsp(dev->dmasound.minor_dsp); | ||
972 | |||
973 | saa7134_oss_fini(dev); | ||
974 | |||
975 | if (dev->pci->irq > 0) { | ||
976 | synchronize_irq(dev->pci->irq); | ||
977 | free_irq(dev->pci->irq,&dev->dmasound); | ||
978 | } | ||
979 | |||
980 | dev->dmasound.priv_data = NULL; | ||
981 | |||
982 | } | 997 | } |
983 | 998 | ||
984 | printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); | 999 | printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); |
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 244e1973081c..add49db1ad41 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -571,6 +571,10 @@ void saa7134_dma_free(struct saa7134_dev *dev,struct saa7134_buf *buf); | |||
571 | 571 | ||
572 | int saa7134_set_dmabits(struct saa7134_dev *dev); | 572 | int saa7134_set_dmabits(struct saa7134_dev *dev); |
573 | 573 | ||
574 | extern int (*dmasound_init)(struct saa7134_dev *dev); | ||
575 | extern int (*dmasound_exit)(struct saa7134_dev *dev); | ||
576 | |||
577 | |||
574 | /* ----------------------------------------------------------- */ | 578 | /* ----------------------------------------------------------- */ |
575 | /* saa7134-cards.c */ | 579 | /* saa7134-cards.c */ |
576 | 580 | ||
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 72e8741e8b59..d95aecebbda3 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -81,7 +81,7 @@ hauppauge_tuner_fmt[] = | |||
81 | { 0x00000010, " PAL(I)" }, | 81 | { 0x00000010, " PAL(I)" }, |
82 | { 0x00400000, " SECAM(L/L')" }, | 82 | { 0x00400000, " SECAM(L/L')" }, |
83 | { 0x00000e00, " PAL(D/K)" }, | 83 | { 0x00000e00, " PAL(D/K)" }, |
84 | { 0x03000000, " ATSC Digital" }, | 84 | { 0x03000000, " ATSC/DVB Digital" }, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* This is the full list of possible tuners. Many thanks to Hauppauge for | 87 | /* This is the full list of possible tuners. Many thanks to Hauppauge for |
@@ -209,13 +209,27 @@ hauppauge_tuner[] = | |||
209 | { TUNER_ABSENT, "Philips FMD1216ME"}, | 209 | { TUNER_ABSENT, "Philips FMD1216ME"}, |
210 | { TUNER_TEA5767, "Philips TEA5768HL FM Radio"}, | 210 | { TUNER_TEA5767, "Philips TEA5768HL FM Radio"}, |
211 | { TUNER_ABSENT, "Panasonic ENV57H12D5"}, | 211 | { TUNER_ABSENT, "Panasonic ENV57H12D5"}, |
212 | { TUNER_ABSENT, "TCL MFNM05-4"}, | 212 | { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05-4"}, |
213 | { TUNER_ABSENT, "TCL MNM05-4"}, | 213 | { TUNER_ABSENT, "TCL MNM05-4"}, |
214 | { TUNER_PHILIPS_FM1216ME_MK3, "TCL MPE05-2"}, | 214 | { TUNER_PHILIPS_FM1216ME_MK3, "TCL MPE05-2"}, |
215 | { TUNER_ABSENT, "TCL MQNM05-4"}, | 215 | { TUNER_ABSENT, "TCL MQNM05-4"}, |
216 | { TUNER_ABSENT, "LG TAPC-W701D"}, | 216 | { TUNER_ABSENT, "LG TAPC-W701D"}, |
217 | { TUNER_ABSENT, "TCL 9886P-WM"}, | 217 | { TUNER_ABSENT, "TCL 9886P-WM"}, |
218 | { TUNER_ABSENT, "TCL 1676NM-WM"}, | 218 | { TUNER_ABSENT, "TCL 1676NM-WM"}, |
219 | /* 110-119 */ | ||
220 | { TUNER_ABSENT, "Thompson DTT75105"}, | ||
221 | { TUNER_ABSENT, "Conexant_CX24109"}, | ||
222 | { TUNER_ABSENT, "TCL M2523_5N_E"}, | ||
223 | { TUNER_ABSENT, "TCL M2523_3DB_E"}, | ||
224 | { TUNER_ABSENT, "Philips 8275A"}, | ||
225 | { TUNER_ABSENT, "Microtune MT2060"}, | ||
226 | { TUNER_ABSENT, "Philips FM1236 MK5"}, | ||
227 | { TUNER_ABSENT, "Philips FM1216ME MK5"}, | ||
228 | { TUNER_ABSENT, "TCL M2523_3DI_E"}, | ||
229 | { TUNER_ABSENT, "Samsung THPD5222FG30A"}, | ||
230 | /* 120-129 */ | ||
231 | { TUNER_ABSENT, "Xceive XC3028"}, | ||
232 | { TUNER_ABSENT, "Philips FQ1216LME MK5"}, | ||
219 | }; | 233 | }; |
220 | 234 | ||
221 | static struct HAUPPAUGE_AUDIOIC | 235 | static struct HAUPPAUGE_AUDIOIC |
@@ -325,6 +339,7 @@ static int hasRadioTuner(int tunerType) | |||
325 | case 78: //PNPEnv_TUNER_TDA8275C1_8290_FM: | 339 | case 78: //PNPEnv_TUNER_TDA8275C1_8290_FM: |
326 | case 89: //PNPEnv_TUNER_TCL_MFPE05_2: | 340 | case 89: //PNPEnv_TUNER_TCL_MFPE05_2: |
327 | case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4: | 341 | case 92: //PNPEnv_TUNER_PHILIPS_FQ1236A_MK4: |
342 | case 105: | ||
328 | return 1; | 343 | return 1; |
329 | } | 344 | } |
330 | return 0; | 345 | return 0; |
@@ -368,10 +383,15 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
368 | memset(tvee, 0, sizeof(*tvee)); | 383 | memset(tvee, 0, sizeof(*tvee)); |
369 | done = len = beenhere = 0; | 384 | done = len = beenhere = 0; |
370 | 385 | ||
371 | /* Hack for processing eeprom for em28xx */ | 386 | /* Hack for processing eeprom for em28xx and cx 2388x*/ |
372 | if ((eeprom_data[0]==0x1a)&&(eeprom_data[1]==0xeb)&& | 387 | if ((eeprom_data[0] == 0x1a) && (eeprom_data[1] == 0xeb) && |
373 | (eeprom_data[2]==0x67)&&(eeprom_data[3]==0x95)) | 388 | (eeprom_data[2] == 0x67) && (eeprom_data[3] == 0x95)) |
374 | start=0xa0; | 389 | start=0xa0; /* Generic em28xx offset */ |
390 | else if (((eeprom_data[0] & 0xf0) == 0x10) && | ||
391 | (eeprom_data[1] == 0x00) && | ||
392 | (eeprom_data[2] == 0x00) && | ||
393 | (eeprom_data[8] == 0x84)) | ||
394 | start=8; /* Generic cx2388x offset */ | ||
375 | else | 395 | else |
376 | start=0; | 396 | start=0; |
377 | 397 | ||
@@ -448,6 +468,17 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
448 | eeprom_data[i+5] + | 468 | eeprom_data[i+5] + |
449 | (eeprom_data[i+6] << 8) + | 469 | (eeprom_data[i+6] << 8) + |
450 | (eeprom_data[i+7] << 16); | 470 | (eeprom_data[i+7] << 16); |
471 | |||
472 | if ( (eeprom_data[i + 8] && 0xf0) && | ||
473 | (tvee->serial_number < 0xffffff) ) { | ||
474 | tvee->MAC_address[0] = 0x00; | ||
475 | tvee->MAC_address[1] = 0x0D; | ||
476 | tvee->MAC_address[2] = 0xFE; | ||
477 | tvee->MAC_address[3] = eeprom_data[i + 7]; | ||
478 | tvee->MAC_address[4] = eeprom_data[i + 6]; | ||
479 | tvee->MAC_address[5] = eeprom_data[i + 5]; | ||
480 | tvee->has_MAC_address = 1; | ||
481 | } | ||
451 | break; | 482 | break; |
452 | 483 | ||
453 | case 0x05: | 484 | case 0x05: |
@@ -466,11 +497,14 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
466 | case 0x06: | 497 | case 0x06: |
467 | /* tag 'ModelRev' */ | 498 | /* tag 'ModelRev' */ |
468 | tvee->model = | 499 | tvee->model = |
469 | eeprom_data[i+1] + | 500 | eeprom_data[i + 1] + |
470 | (eeprom_data[i+2] << 8); | 501 | (eeprom_data[i + 2] << 8) + |
471 | tvee->revision = eeprom_data[i+5] + | 502 | (eeprom_data[i + 3] << 16) + |
472 | (eeprom_data[i+6] << 8) + | 503 | (eeprom_data[i + 4] << 24); |
473 | (eeprom_data[i+7] << 16); | 504 | tvee->revision = |
505 | eeprom_data[i +5 ] + | ||
506 | (eeprom_data[i + 6] << 8) + | ||
507 | (eeprom_data[i + 7] << 16); | ||
474 | break; | 508 | break; |
475 | 509 | ||
476 | case 0x07: | 510 | case 0x07: |
@@ -563,6 +597,8 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
563 | t_name2 = "unknown"; | 597 | t_name2 = "unknown"; |
564 | } | 598 | } |
565 | 599 | ||
600 | tvee->tuner_hauppauge_model = tuner1; | ||
601 | tvee->tuner2_hauppauge_model = tuner2; | ||
566 | tvee->tuner_formats = 0; | 602 | tvee->tuner_formats = 0; |
567 | tvee->tuner2_formats = 0; | 603 | tvee->tuner2_formats = 0; |
568 | for (i = j = 0; i < 8; i++) { | 604 | for (i = j = 0; i < 8; i++) { |
@@ -578,6 +614,12 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
578 | 614 | ||
579 | tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n", | 615 | tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n", |
580 | tvee->model, tvee->rev_str, tvee->serial_number); | 616 | tvee->model, tvee->rev_str, tvee->serial_number); |
617 | if (tvee->has_MAC_address == 1) { | ||
618 | tveeprom_info("MAC address is %02X-%02X-%02X-%02X-%02X-%02X\n", | ||
619 | tvee->MAC_address[0], tvee->MAC_address[1], | ||
620 | tvee->MAC_address[2], tvee->MAC_address[3], | ||
621 | tvee->MAC_address[4], tvee->MAC_address[5]); | ||
622 | } | ||
581 | tveeprom_info("tuner model is %s (idx %d, type %d)\n", | 623 | tveeprom_info("tuner model is %s (idx %d, type %d)\n", |
582 | t_name1, tuner1, tvee->tuner_type); | 624 | t_name1, tuner1, tvee->tuner_type); |
583 | tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n", | 625 | tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n", |
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c index acfd3a103f35..9a6bf287e26a 100644 --- a/drivers/media/video/video-buf.c +++ b/drivers/media/video/video-buf.c | |||
@@ -753,10 +753,9 @@ videobuf_read_zerocopy(struct videobuf_queue *q, char __user *data, | |||
753 | int retval; | 753 | int retval; |
754 | 754 | ||
755 | /* setup stuff */ | 755 | /* setup stuff */ |
756 | retval = -ENOMEM; | ||
757 | q->read_buf = videobuf_alloc(q->msize); | 756 | q->read_buf = videobuf_alloc(q->msize); |
758 | if (NULL == q->read_buf) | 757 | if (NULL == q->read_buf) |
759 | goto done; | 758 | return -ENOMEM; |
760 | 759 | ||
761 | q->read_buf->memory = V4L2_MEMORY_USERPTR; | 760 | q->read_buf->memory = V4L2_MEMORY_USERPTR; |
762 | q->read_buf->baddr = (unsigned long)data; | 761 | q->read_buf->baddr = (unsigned long)data; |
@@ -817,10 +816,14 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, | |||
817 | if (NULL == q->read_buf) | 816 | if (NULL == q->read_buf) |
818 | goto done; | 817 | goto done; |
819 | q->read_buf->memory = V4L2_MEMORY_USERPTR; | 818 | q->read_buf->memory = V4L2_MEMORY_USERPTR; |
819 | q->read_buf->bsize = count; /* preferred size */ | ||
820 | field = videobuf_next_field(q); | 820 | field = videobuf_next_field(q); |
821 | retval = q->ops->buf_prepare(q,q->read_buf,field); | 821 | retval = q->ops->buf_prepare(q,q->read_buf,field); |
822 | if (0 != retval) | 822 | if (0 != retval) { |
823 | kfree (q->read_buf); | ||
824 | q->read_buf = NULL; | ||
823 | goto done; | 825 | goto done; |
826 | } | ||
824 | spin_lock_irqsave(q->irqlock,flags); | 827 | spin_lock_irqsave(q->irqlock,flags); |
825 | q->ops->buf_queue(q,q->read_buf); | 828 | q->ops->buf_queue(q,q->read_buf); |
826 | spin_unlock_irqrestore(q->irqlock,flags); | 829 | spin_unlock_irqrestore(q->irqlock,flags); |
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 83c49f9610d0..6de5b0094b82 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -76,14 +76,14 @@ static void video_release(struct class_device *cd) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | static struct class video_class = { | 78 | static struct class video_class = { |
79 | .name = VIDEO_NAME, | 79 | .name = VIDEO_NAME, |
80 | .release = video_release, | 80 | .release = video_release, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | /* | 83 | /* |
84 | * Active devices | 84 | * Active devices |
85 | */ | 85 | */ |
86 | 86 | ||
87 | static struct video_device *video_device[VIDEO_NUM_DEVICES]; | 87 | static struct video_device *video_device[VIDEO_NUM_DEVICES]; |
88 | static DECLARE_MUTEX(videodev_lock); | 88 | static DECLARE_MUTEX(videodev_lock); |
89 | 89 | ||
@@ -101,7 +101,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
101 | int err = 0; | 101 | int err = 0; |
102 | struct video_device *vfl; | 102 | struct video_device *vfl; |
103 | struct file_operations *old_fops; | 103 | struct file_operations *old_fops; |
104 | 104 | ||
105 | if(minor>=VIDEO_NUM_DEVICES) | 105 | if(minor>=VIDEO_NUM_DEVICES) |
106 | return -ENODEV; | 106 | return -ENODEV; |
107 | down(&videodev_lock); | 107 | down(&videodev_lock); |
@@ -189,7 +189,7 @@ video_usercopy(struct inode *inode, struct file *file, | |||
189 | return -ENOMEM; | 189 | return -ENOMEM; |
190 | parg = mbuf; | 190 | parg = mbuf; |
191 | } | 191 | } |
192 | 192 | ||
193 | err = -EFAULT; | 193 | err = -EFAULT; |
194 | if (_IOC_DIR(cmd) & _IOC_WRITE) | 194 | if (_IOC_DIR(cmd) & _IOC_WRITE) |
195 | if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) | 195 | if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) |
@@ -240,7 +240,7 @@ int video_exclusive_open(struct inode *inode, struct file *file) | |||
240 | int video_exclusive_release(struct inode *inode, struct file *file) | 240 | int video_exclusive_release(struct inode *inode, struct file *file) |
241 | { | 241 | { |
242 | struct video_device *vfl = video_devdata(file); | 242 | struct video_device *vfl = video_devdata(file); |
243 | 243 | ||
244 | vfl->users--; | 244 | vfl->users--; |
245 | return 0; | 245 | return 0; |
246 | } | 246 | } |
@@ -253,7 +253,7 @@ static struct file_operations video_fops; | |||
253 | * @type: type of device to register | 253 | * @type: type of device to register |
254 | * @nr: which device number (0 == /dev/video0, 1 == /dev/video1, ... | 254 | * @nr: which device number (0 == /dev/video0, 1 == /dev/video1, ... |
255 | * -1 == first free) | 255 | * -1 == first free) |
256 | * | 256 | * |
257 | * The registration code assigns minor numbers based on the type | 257 | * The registration code assigns minor numbers based on the type |
258 | * requested. -ENFILE is returned in all the device slots for this | 258 | * requested. -ENFILE is returned in all the device slots for this |
259 | * category are full. If not then the minor field is set and the | 259 | * category are full. If not then the minor field is set and the |
@@ -269,7 +269,7 @@ static struct file_operations video_fops; | |||
269 | * | 269 | * |
270 | * %VFL_TYPE_VBI - Vertical blank data (undecoded) | 270 | * %VFL_TYPE_VBI - Vertical blank data (undecoded) |
271 | * | 271 | * |
272 | * %VFL_TYPE_RADIO - A radio card | 272 | * %VFL_TYPE_RADIO - A radio card |
273 | */ | 273 | */ |
274 | 274 | ||
275 | int video_register_device(struct video_device *vfd, int type, int nr) | 275 | int video_register_device(struct video_device *vfd, int type, int nr) |
@@ -278,7 +278,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
278 | int base; | 278 | int base; |
279 | int end; | 279 | int end; |
280 | char *name_base; | 280 | char *name_base; |
281 | 281 | ||
282 | switch(type) | 282 | switch(type) |
283 | { | 283 | { |
284 | case VFL_TYPE_GRABBER: | 284 | case VFL_TYPE_GRABBER: |
@@ -293,7 +293,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
293 | break; | 293 | break; |
294 | case VFL_TYPE_VBI: | 294 | case VFL_TYPE_VBI: |
295 | base=224; | 295 | base=224; |
296 | end=240; | 296 | end=256; |
297 | name_base = "vbi"; | 297 | name_base = "vbi"; |
298 | break; | 298 | break; |
299 | case VFL_TYPE_RADIO: | 299 | case VFL_TYPE_RADIO: |
@@ -334,7 +334,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
334 | init_MUTEX(&vfd->lock); | 334 | init_MUTEX(&vfd->lock); |
335 | 335 | ||
336 | /* sysfs class */ | 336 | /* sysfs class */ |
337 | memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); | 337 | memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); |
338 | if (vfd->dev) | 338 | if (vfd->dev) |
339 | vfd->class_dev.dev = vfd->dev; | 339 | vfd->class_dev.dev = vfd->dev; |
340 | vfd->class_dev.class = &video_class; | 340 | vfd->class_dev.class = &video_class; |
@@ -360,7 +360,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
360 | * This unregisters the passed device and deassigns the minor | 360 | * This unregisters the passed device and deassigns the minor |
361 | * number. Future open calls will be met with errors. | 361 | * number. Future open calls will be met with errors. |
362 | */ | 362 | */ |
363 | 363 | ||
364 | void video_unregister_device(struct video_device *vfd) | 364 | void video_unregister_device(struct video_device *vfd) |
365 | { | 365 | { |
366 | down(&videodev_lock); | 366 | down(&videodev_lock); |
@@ -384,7 +384,7 @@ static struct file_operations video_fops= | |||
384 | /* | 384 | /* |
385 | * Initialise video for linux | 385 | * Initialise video for linux |
386 | */ | 386 | */ |
387 | 387 | ||
388 | static int __init videodev_init(void) | 388 | static int __init videodev_init(void) |
389 | { | 389 | { |
390 | int ret; | 390 | int ret; |