Commit 9179746652faf0aba07b8b7f770dcf29892a24c6
Exists in
master
and in
7 other branches
Merge branch 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: [media] mantis_pci: remove asm/pgtable.h include [media] tda829x: fix regression in probe functions [media] mceusb: don't claim multifunction device non-IR parts [media] nuvoton-cir: fix wake from suspend [media] cx18: Add support for Hauppauge HVR-1600 models with s5h1411 [media] ivtv: Fix corrective action taken upon DMA ERR interrupt to avoid hang [media] cx25840: fix probing of cx2583x chips [media] cx23885: Remove unused 'err:' labels to quiet compiler warning [media] cx23885: Revert "Check for slave nack on all transactions" [media] DiB7000M: add pid filtering [media] Fix sysfs rc protocol lookup for rc-5-sz [media] au0828: fix VBI handling when in V4L2 streaming mode [media] ir-raw: Properly initialize the IR event (BZ#27202) [media] s2255drv: firmware re-loading changes [media] Fix double free of video_device in mem2mem_testdev [media] DM04/QQBOX memcpy to const char fix
Showing 21 changed files Side-by-side Diff
- drivers/media/common/tuners/tda8290.c
- drivers/media/dvb/dvb-usb/dib0700_devices.c
- drivers/media/dvb/dvb-usb/lmedm04.c
- drivers/media/dvb/frontends/dib7000m.c
- drivers/media/dvb/frontends/dib7000m.h
- drivers/media/dvb/mantis/mantis_pci.c
- drivers/media/rc/ir-raw.c
- drivers/media/rc/mceusb.c
- drivers/media/rc/nuvoton-cir.c
- drivers/media/rc/nuvoton-cir.h
- drivers/media/rc/rc-main.c
- drivers/media/video/au0828/au0828-video.c
- drivers/media/video/cx18/cx18-cards.c
- drivers/media/video/cx18/cx18-driver.c
- drivers/media/video/cx18/cx18-driver.h
- drivers/media/video/cx18/cx18-dvb.c
- drivers/media/video/cx23885/cx23885-i2c.c
- drivers/media/video/cx25840/cx25840-core.c
- drivers/media/video/ivtv/ivtv-irq.c
- drivers/media/video/mem2mem_testdev.c
- drivers/media/video/s2255drv.c
drivers/media/common/tuners/tda8290.c
| ... | ... | @@ -658,13 +658,13 @@ |
| 658 | 658 | #define TDA8290_ID 0x89 |
| 659 | 659 | u8 reg = 0x1f, id; |
| 660 | 660 | struct i2c_msg msg_read[] = { |
| 661 | - { .addr = 0x4b, .flags = 0, .len = 1, .buf = ® }, | |
| 662 | - { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id }, | |
| 661 | + { .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = ® }, | |
| 662 | + { .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id }, | |
| 663 | 663 | }; |
| 664 | 664 | |
| 665 | 665 | /* detect tda8290 */ |
| 666 | 666 | if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { |
| 667 | - printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n", | |
| 667 | + printk(KERN_WARNING "%s: couldn't read register 0x%02x\n", | |
| 668 | 668 | __func__, reg); |
| 669 | 669 | return -ENODEV; |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | |
| ... | ... | @@ -685,13 +685,13 @@ |
| 685 | 685 | #define TDA8295C2_ID 0x8b |
| 686 | 686 | u8 reg = 0x2f, id; |
| 687 | 687 | struct i2c_msg msg_read[] = { |
| 688 | - { .addr = 0x4b, .flags = 0, .len = 1, .buf = ® }, | |
| 689 | - { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id }, | |
| 688 | + { .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = ® }, | |
| 689 | + { .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id }, | |
| 690 | 690 | }; |
| 691 | 691 | |
| 692 | - /* detect tda8290 */ | |
| 692 | + /* detect tda8295 */ | |
| 693 | 693 | if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) { |
| 694 | - printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n", | |
| 694 | + printk(KERN_WARNING "%s: couldn't read register 0x%02x\n", | |
| 695 | 695 | __func__, reg); |
| 696 | 696 | return -ENODEV; |
| 697 | 697 | } |
drivers/media/dvb/dvb-usb/dib0700_devices.c
| ... | ... | @@ -870,6 +870,23 @@ |
| 870 | 870 | return 0; |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | +static int stk7700p_pid_filter(struct dvb_usb_adapter *adapter, int index, | |
| 874 | + u16 pid, int onoff) | |
| 875 | +{ | |
| 876 | + struct dib0700_state *st = adapter->dev->priv; | |
| 877 | + if (st->is_dib7000pc) | |
| 878 | + return dib7000p_pid_filter(adapter->fe, index, pid, onoff); | |
| 879 | + return dib7000m_pid_filter(adapter->fe, index, pid, onoff); | |
| 880 | +} | |
| 881 | + | |
| 882 | +static int stk7700p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) | |
| 883 | +{ | |
| 884 | + struct dib0700_state *st = adapter->dev->priv; | |
| 885 | + if (st->is_dib7000pc) | |
| 886 | + return dib7000p_pid_filter_ctrl(adapter->fe, onoff); | |
| 887 | + return dib7000m_pid_filter_ctrl(adapter->fe, onoff); | |
| 888 | +} | |
| 889 | + | |
| 873 | 890 | static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
| 874 | 891 | { |
| 875 | 892 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); |
| ... | ... | @@ -1875,8 +1892,8 @@ |
| 1875 | 1892 | { |
| 1876 | 1893 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 1877 | 1894 | .pid_filter_count = 32, |
| 1878 | - .pid_filter = stk70x0p_pid_filter, | |
| 1879 | - .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, | |
| 1895 | + .pid_filter = stk7700p_pid_filter, | |
| 1896 | + .pid_filter_ctrl = stk7700p_pid_filter_ctrl, | |
| 1880 | 1897 | .frontend_attach = stk7700p_frontend_attach, |
| 1881 | 1898 | .tuner_attach = stk7700p_tuner_attach, |
| 1882 | 1899 |
drivers/media/dvb/dvb-usb/lmedm04.c
| ... | ... | @@ -659,7 +659,7 @@ |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | /* Default firmware for LME2510C */ |
| 662 | -const char lme_firmware[50] = "dvb-usb-lme2510c-s7395.fw"; | |
| 662 | +char lme_firmware[50] = "dvb-usb-lme2510c-s7395.fw"; | |
| 663 | 663 | |
| 664 | 664 | static void lme_coldreset(struct usb_device *dev) |
| 665 | 665 | { |
| ... | ... | @@ -1006,7 +1006,7 @@ |
| 1006 | 1006 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1007 | 1007 | .usb_ctrl = DEVICE_SPECIFIC, |
| 1008 | 1008 | .download_firmware = lme2510_download_firmware, |
| 1009 | - .firmware = lme_firmware, | |
| 1009 | + .firmware = (const char *)&lme_firmware, | |
| 1010 | 1010 | .size_of_priv = sizeof(struct lme2510_state), |
| 1011 | 1011 | .num_adapters = 1, |
| 1012 | 1012 | .adapter = { |
| ... | ... | @@ -1109,6 +1109,6 @@ |
| 1109 | 1109 | |
| 1110 | 1110 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); |
| 1111 | 1111 | MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); |
| 1112 | -MODULE_VERSION("1.74"); | |
| 1112 | +MODULE_VERSION("1.75"); | |
| 1113 | 1113 | MODULE_LICENSE("GPL"); |
drivers/media/dvb/frontends/dib7000m.c
| ... | ... | @@ -1285,6 +1285,25 @@ |
| 1285 | 1285 | } |
| 1286 | 1286 | EXPORT_SYMBOL(dib7000m_get_i2c_master); |
| 1287 | 1287 | |
| 1288 | +int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff) | |
| 1289 | +{ | |
| 1290 | + struct dib7000m_state *state = fe->demodulator_priv; | |
| 1291 | + u16 val = dib7000m_read_word(state, 294 + state->reg_offs) & 0xffef; | |
| 1292 | + val |= (onoff & 0x1) << 4; | |
| 1293 | + dprintk("PID filter enabled %d", onoff); | |
| 1294 | + return dib7000m_write_word(state, 294 + state->reg_offs, val); | |
| 1295 | +} | |
| 1296 | +EXPORT_SYMBOL(dib7000m_pid_filter_ctrl); | |
| 1297 | + | |
| 1298 | +int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff) | |
| 1299 | +{ | |
| 1300 | + struct dib7000m_state *state = fe->demodulator_priv; | |
| 1301 | + dprintk("PID filter: index %x, PID %d, OnOff %d", id, pid, onoff); | |
| 1302 | + return dib7000m_write_word(state, 300 + state->reg_offs + id, | |
| 1303 | + onoff ? (1 << 13) | pid : 0); | |
| 1304 | +} | |
| 1305 | +EXPORT_SYMBOL(dib7000m_pid_filter); | |
| 1306 | + | |
| 1288 | 1307 | #if 0 |
| 1289 | 1308 | /* used with some prototype boards */ |
| 1290 | 1309 | int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, |
drivers/media/dvb/frontends/dib7000m.h
| ... | ... | @@ -46,6 +46,8 @@ |
| 46 | 46 | extern struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *, |
| 47 | 47 | enum dibx000_i2c_interface, |
| 48 | 48 | int); |
| 49 | +extern int dib7000m_pid_filter(struct dvb_frontend *, u8 id, u16 pid, u8 onoff); | |
| 50 | +extern int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff); | |
| 49 | 51 | #else |
| 50 | 52 | static inline |
| 51 | 53 | struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap, |
| ... | ... | @@ -62,6 +64,19 @@ |
| 62 | 64 | { |
| 63 | 65 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 64 | 66 | return NULL; |
| 67 | +} | |
| 68 | +static inline int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, | |
| 69 | + u16 pid, u8 onoff) | |
| 70 | +{ | |
| 71 | + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | |
| 72 | + return -ENODEV; | |
| 73 | +} | |
| 74 | + | |
| 75 | +static inline int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, | |
| 76 | + uint8_t onoff) | |
| 77 | +{ | |
| 78 | + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | |
| 79 | + return -ENODEV; | |
| 65 | 80 | } |
| 66 | 81 | #endif |
| 67 | 82 |
drivers/media/dvb/mantis/mantis_pci.c
drivers/media/rc/ir-raw.c
| ... | ... | @@ -112,7 +112,7 @@ |
| 112 | 112 | { |
| 113 | 113 | ktime_t now; |
| 114 | 114 | s64 delta; /* ns */ |
| 115 | - struct ir_raw_event ev; | |
| 115 | + DEFINE_IR_RAW_EVENT(ev); | |
| 116 | 116 | int rc = 0; |
| 117 | 117 | |
| 118 | 118 | if (!dev->raw) |
| ... | ... | @@ -125,7 +125,6 @@ |
| 125 | 125 | * being called for the first time, note that delta can't |
| 126 | 126 | * possibly be negative. |
| 127 | 127 | */ |
| 128 | - ev.duration = 0; | |
| 129 | 128 | if (delta > IR_MAX_DURATION || !dev->raw->last_type) |
| 130 | 129 | type |= IR_START_EVENT; |
| 131 | 130 | else |
drivers/media/rc/mceusb.c
| ... | ... | @@ -148,6 +148,7 @@ |
| 148 | 148 | MCE_GEN2_TX_INV, |
| 149 | 149 | POLARIS_EVK, |
| 150 | 150 | CX_HYBRID_TV, |
| 151 | + MULTIFUNCTION, | |
| 151 | 152 | }; |
| 152 | 153 | |
| 153 | 154 | struct mceusb_model { |
| 154 | 155 | |
| ... | ... | @@ -155,9 +156,10 @@ |
| 155 | 156 | u32 mce_gen2:1; |
| 156 | 157 | u32 mce_gen3:1; |
| 157 | 158 | u32 tx_mask_normal:1; |
| 158 | - u32 is_polaris:1; | |
| 159 | 159 | u32 no_tx:1; |
| 160 | 160 | |
| 161 | + int ir_intfnum; | |
| 162 | + | |
| 161 | 163 | const char *rc_map; /* Allow specify a per-board map */ |
| 162 | 164 | const char *name; /* per-board name */ |
| 163 | 165 | }; |
| ... | ... | @@ -179,7 +181,6 @@ |
| 179 | 181 | .tx_mask_normal = 1, |
| 180 | 182 | }, |
| 181 | 183 | [POLARIS_EVK] = { |
| 182 | - .is_polaris = 1, | |
| 183 | 184 | /* |
| 184 | 185 | * In fact, the EVK is shipped without |
| 185 | 186 | * remotes, but we should have something handy, |
| 186 | 187 | |
| ... | ... | @@ -189,10 +190,13 @@ |
| 189 | 190 | .name = "Conexant Hybrid TV (cx231xx) MCE IR", |
| 190 | 191 | }, |
| 191 | 192 | [CX_HYBRID_TV] = { |
| 192 | - .is_polaris = 1, | |
| 193 | 193 | .no_tx = 1, /* tx isn't wired up at all */ |
| 194 | 194 | .name = "Conexant Hybrid TV (cx231xx) MCE IR", |
| 195 | 195 | }, |
| 196 | + [MULTIFUNCTION] = { | |
| 197 | + .mce_gen2 = 1, | |
| 198 | + .ir_intfnum = 2, | |
| 199 | + }, | |
| 196 | 200 | }; |
| 197 | 201 | |
| 198 | 202 | static struct usb_device_id mceusb_dev_table[] = { |
| ... | ... | @@ -216,8 +220,9 @@ |
| 216 | 220 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, |
| 217 | 221 | /* Philips/Spinel plus IR transceiver for ASUS */ |
| 218 | 222 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, |
| 219 | - /* Realtek MCE IR Receiver */ | |
| 220 | - { USB_DEVICE(VENDOR_REALTEK, 0x0161) }, | |
| 223 | + /* Realtek MCE IR Receiver and card reader */ | |
| 224 | + { USB_DEVICE(VENDOR_REALTEK, 0x0161), | |
| 225 | + .driver_info = MULTIFUNCTION }, | |
| 221 | 226 | /* SMK/Toshiba G83C0004D410 */ |
| 222 | 227 | { USB_DEVICE(VENDOR_SMK, 0x031d), |
| 223 | 228 | .driver_info = MCE_GEN2_TX_INV }, |
| ... | ... | @@ -1101,7 +1106,7 @@ |
| 1101 | 1106 | bool is_gen3; |
| 1102 | 1107 | bool is_microsoft_gen1; |
| 1103 | 1108 | bool tx_mask_normal; |
| 1104 | - bool is_polaris; | |
| 1109 | + int ir_intfnum; | |
| 1105 | 1110 | |
| 1106 | 1111 | dev_dbg(&intf->dev, "%s called\n", __func__); |
| 1107 | 1112 | |
| 1108 | 1113 | |
| ... | ... | @@ -1110,13 +1115,11 @@ |
| 1110 | 1115 | is_gen3 = mceusb_model[model].mce_gen3; |
| 1111 | 1116 | is_microsoft_gen1 = mceusb_model[model].mce_gen1; |
| 1112 | 1117 | tx_mask_normal = mceusb_model[model].tx_mask_normal; |
| 1113 | - is_polaris = mceusb_model[model].is_polaris; | |
| 1118 | + ir_intfnum = mceusb_model[model].ir_intfnum; | |
| 1114 | 1119 | |
| 1115 | - if (is_polaris) { | |
| 1116 | - /* Interface 0 is IR */ | |
| 1117 | - if (idesc->desc.bInterfaceNumber) | |
| 1118 | - return -ENODEV; | |
| 1119 | - } | |
| 1120 | + /* There are multi-function devices with non-IR interfaces */ | |
| 1121 | + if (idesc->desc.bInterfaceNumber != ir_intfnum) | |
| 1122 | + return -ENODEV; | |
| 1120 | 1123 | |
| 1121 | 1124 | /* step through the endpoints to find first bulk in and out endpoint */ |
| 1122 | 1125 | for (i = 0; i < idesc->desc.bNumEndpoints; ++i) { |
drivers/media/rc/nuvoton-cir.c
| ... | ... | @@ -385,8 +385,9 @@ |
| 385 | 385 | |
| 386 | 386 | static void nvt_cir_wake_regs_init(struct nvt_dev *nvt) |
| 387 | 387 | { |
| 388 | - /* set number of bytes needed for wake key comparison (default 67) */ | |
| 389 | - nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_LEN, CIR_WAKE_FIFO_CMP_DEEP); | |
| 388 | + /* set number of bytes needed for wake from s3 (default 65) */ | |
| 389 | + nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_CMP_BYTES, | |
| 390 | + CIR_WAKE_FIFO_CMP_DEEP); | |
| 390 | 391 | |
| 391 | 392 | /* set tolerance/variance allowed per byte during wake compare */ |
| 392 | 393 | nvt_cir_wake_reg_write(nvt, CIR_WAKE_CMP_TOLERANCE, |
drivers/media/rc/nuvoton-cir.h
| ... | ... | @@ -305,8 +305,11 @@ |
| 305 | 305 | #define CIR_WAKE_IRFIFOSTS_RX_EMPTY 0x20 |
| 306 | 306 | #define CIR_WAKE_IRFIFOSTS_RX_FULL 0x10 |
| 307 | 307 | |
| 308 | -/* CIR Wake FIFO buffer is 67 bytes long */ | |
| 309 | -#define CIR_WAKE_FIFO_LEN 67 | |
| 308 | +/* | |
| 309 | + * The CIR Wake FIFO buffer is 67 bytes long, but the stock remote wakes | |
| 310 | + * the system comparing only 65 bytes (fails with this set to 67) | |
| 311 | + */ | |
| 312 | +#define CIR_WAKE_FIFO_CMP_BYTES 65 | |
| 310 | 313 | /* CIR Wake byte comparison tolerance */ |
| 311 | 314 | #define CIR_WAKE_CMP_TOLERANCE 5 |
| 312 | 315 |
drivers/media/rc/rc-main.c
| ... | ... | @@ -850,7 +850,7 @@ |
| 850 | 850 | count++; |
| 851 | 851 | } else { |
| 852 | 852 | for (i = 0; i < ARRAY_SIZE(proto_names); i++) { |
| 853 | - if (!strncasecmp(tmp, proto_names[i].name, strlen(proto_names[i].name))) { | |
| 853 | + if (!strcasecmp(tmp, proto_names[i].name)) { | |
| 854 | 854 | tmp += strlen(proto_names[i].name); |
| 855 | 855 | mask = proto_names[i].type; |
| 856 | 856 | break; |
drivers/media/video/au0828/au0828-video.c
| ... | ... | @@ -1758,7 +1758,12 @@ |
| 1758 | 1758 | if (rc < 0) |
| 1759 | 1759 | return rc; |
| 1760 | 1760 | |
| 1761 | - return videobuf_reqbufs(&fh->vb_vidq, rb); | |
| 1761 | + if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) | |
| 1762 | + rc = videobuf_reqbufs(&fh->vb_vidq, rb); | |
| 1763 | + else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | |
| 1764 | + rc = videobuf_reqbufs(&fh->vb_vbiq, rb); | |
| 1765 | + | |
| 1766 | + return rc; | |
| 1762 | 1767 | } |
| 1763 | 1768 | |
| 1764 | 1769 | static int vidioc_querybuf(struct file *file, void *priv, |
| ... | ... | @@ -1772,7 +1777,12 @@ |
| 1772 | 1777 | if (rc < 0) |
| 1773 | 1778 | return rc; |
| 1774 | 1779 | |
| 1775 | - return videobuf_querybuf(&fh->vb_vidq, b); | |
| 1780 | + if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) | |
| 1781 | + rc = videobuf_querybuf(&fh->vb_vidq, b); | |
| 1782 | + else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | |
| 1783 | + rc = videobuf_querybuf(&fh->vb_vbiq, b); | |
| 1784 | + | |
| 1785 | + return rc; | |
| 1776 | 1786 | } |
| 1777 | 1787 | |
| 1778 | 1788 | static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) |
| ... | ... | @@ -1785,7 +1795,12 @@ |
| 1785 | 1795 | if (rc < 0) |
| 1786 | 1796 | return rc; |
| 1787 | 1797 | |
| 1788 | - return videobuf_qbuf(&fh->vb_vidq, b); | |
| 1798 | + if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) | |
| 1799 | + rc = videobuf_qbuf(&fh->vb_vidq, b); | |
| 1800 | + else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | |
| 1801 | + rc = videobuf_qbuf(&fh->vb_vbiq, b); | |
| 1802 | + | |
| 1803 | + return rc; | |
| 1789 | 1804 | } |
| 1790 | 1805 | |
| 1791 | 1806 | static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) |
| ... | ... | @@ -1806,7 +1821,12 @@ |
| 1806 | 1821 | dev->greenscreen_detected = 0; |
| 1807 | 1822 | } |
| 1808 | 1823 | |
| 1809 | - return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); | |
| 1824 | + if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) | |
| 1825 | + rc = videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); | |
| 1826 | + else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) | |
| 1827 | + rc = videobuf_dqbuf(&fh->vb_vbiq, b, file->f_flags & O_NONBLOCK); | |
| 1828 | + | |
| 1829 | + return rc; | |
| 1810 | 1830 | } |
| 1811 | 1831 | |
| 1812 | 1832 | static struct v4l2_file_operations au0828_v4l_fops = { |
drivers/media/video/cx18/cx18-cards.c
| ... | ... | @@ -95,6 +95,53 @@ |
| 95 | 95 | .i2c = &cx18_i2c_std, |
| 96 | 96 | }; |
| 97 | 97 | |
| 98 | +static const struct cx18_card cx18_card_hvr1600_s5h1411 = { | |
| 99 | + .type = CX18_CARD_HVR_1600_S5H1411, | |
| 100 | + .name = "Hauppauge HVR-1600", | |
| 101 | + .comment = "Simultaneous Digital and Analog TV capture supported\n", | |
| 102 | + .v4l2_capabilities = CX18_CAP_ENCODER, | |
| 103 | + .hw_audio_ctrl = CX18_HW_418_AV, | |
| 104 | + .hw_muxer = CX18_HW_CS5345, | |
| 105 | + .hw_all = CX18_HW_TVEEPROM | CX18_HW_418_AV | CX18_HW_TUNER | | |
| 106 | + CX18_HW_CS5345 | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL | | |
| 107 | + CX18_HW_Z8F0811_IR_HAUP, | |
| 108 | + .video_inputs = { | |
| 109 | + { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE7 }, | |
| 110 | + { CX18_CARD_INPUT_SVIDEO1, 1, CX18_AV_SVIDEO1 }, | |
| 111 | + { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE3 }, | |
| 112 | + { CX18_CARD_INPUT_SVIDEO2, 2, CX18_AV_SVIDEO2 }, | |
| 113 | + { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE4 }, | |
| 114 | + }, | |
| 115 | + .audio_inputs = { | |
| 116 | + { CX18_CARD_INPUT_AUD_TUNER, | |
| 117 | + CX18_AV_AUDIO8, CS5345_IN_1 | CS5345_MCLK_1_5 }, | |
| 118 | + { CX18_CARD_INPUT_LINE_IN1, | |
| 119 | + CX18_AV_AUDIO_SERIAL1, CS5345_IN_2 }, | |
| 120 | + { CX18_CARD_INPUT_LINE_IN2, | |
| 121 | + CX18_AV_AUDIO_SERIAL1, CS5345_IN_3 }, | |
| 122 | + }, | |
| 123 | + .radio_input = { CX18_CARD_INPUT_AUD_TUNER, | |
| 124 | + CX18_AV_AUDIO_SERIAL1, CS5345_IN_4 }, | |
| 125 | + .ddr = { | |
| 126 | + /* ESMT M13S128324A-5B memory */ | |
| 127 | + .chip_config = 0x003, | |
| 128 | + .refresh = 0x30c, | |
| 129 | + .timing1 = 0x44220e82, | |
| 130 | + .timing2 = 0x08, | |
| 131 | + .tune_lane = 0, | |
| 132 | + .initial_emrs = 0, | |
| 133 | + }, | |
| 134 | + .gpio_init.initial_value = 0x3001, | |
| 135 | + .gpio_init.direction = 0x3001, | |
| 136 | + .gpio_i2c_slave_reset = { | |
| 137 | + .active_lo_mask = 0x3001, | |
| 138 | + .msecs_asserted = 10, | |
| 139 | + .msecs_recovery = 40, | |
| 140 | + .ir_reset_mask = 0x0001, | |
| 141 | + }, | |
| 142 | + .i2c = &cx18_i2c_std, | |
| 143 | +}; | |
| 144 | + | |
| 98 | 145 | static const struct cx18_card cx18_card_hvr1600_samsung = { |
| 99 | 146 | .type = CX18_CARD_HVR_1600_SAMSUNG, |
| 100 | 147 | .name = "Hauppauge HVR-1600 (Preproduction)", |
| ... | ... | @@ -523,7 +570,8 @@ |
| 523 | 570 | &cx18_card_toshiba_qosmio_dvbt, |
| 524 | 571 | &cx18_card_leadtek_pvr2100, |
| 525 | 572 | &cx18_card_leadtek_dvr3100h, |
| 526 | - &cx18_card_gotview_dvd3 | |
| 573 | + &cx18_card_gotview_dvd3, | |
| 574 | + &cx18_card_hvr1600_s5h1411 | |
| 527 | 575 | }; |
| 528 | 576 | |
| 529 | 577 | const struct cx18_card *cx18_get_card(u16 index) |
drivers/media/video/cx18/cx18-driver.c
| ... | ... | @@ -157,6 +157,7 @@ |
| 157 | 157 | "\t\t\t 7 = Leadtek WinFast PVR2100\n" |
| 158 | 158 | "\t\t\t 8 = Leadtek WinFast DVR3100 H\n" |
| 159 | 159 | "\t\t\t 9 = GoTView PCI DVD3 Hybrid\n" |
| 160 | + "\t\t\t 10 = Hauppauge HVR 1600 (S5H1411)\n" | |
| 160 | 161 | "\t\t\t 0 = Autodetect (default)\n" |
| 161 | 162 | "\t\t\t-1 = Ignore this card\n\t\t"); |
| 162 | 163 | MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); |
| ... | ... | @@ -337,6 +338,7 @@ |
| 337 | 338 | switch (cx->card->type) { |
| 338 | 339 | case CX18_CARD_HVR_1600_ESMT: |
| 339 | 340 | case CX18_CARD_HVR_1600_SAMSUNG: |
| 341 | + case CX18_CARD_HVR_1600_S5H1411: | |
| 340 | 342 | tveeprom_hauppauge_analog(&c, tv, eedata); |
| 341 | 343 | break; |
| 342 | 344 | case CX18_CARD_YUAN_MPC718: |
| ... | ... | @@ -365,7 +367,25 @@ |
| 365 | 367 | from the model number. Use the cardtype module option if you |
| 366 | 368 | have one of these preproduction models. */ |
| 367 | 369 | switch (tv.model) { |
| 368 | - case 74000 ... 74999: | |
| 370 | + case 74301: /* Retail models */ | |
| 371 | + case 74321: | |
| 372 | + case 74351: /* OEM models */ | |
| 373 | + case 74361: | |
| 374 | + /* Digital side is s5h1411/tda18271 */ | |
| 375 | + cx->card = cx18_get_card(CX18_CARD_HVR_1600_S5H1411); | |
| 376 | + break; | |
| 377 | + case 74021: /* Retail models */ | |
| 378 | + case 74031: | |
| 379 | + case 74041: | |
| 380 | + case 74141: | |
| 381 | + case 74541: /* OEM models */ | |
| 382 | + case 74551: | |
| 383 | + case 74591: | |
| 384 | + case 74651: | |
| 385 | + case 74691: | |
| 386 | + case 74751: | |
| 387 | + case 74891: | |
| 388 | + /* Digital side is s5h1409/mxl5005s */ | |
| 369 | 389 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); |
| 370 | 390 | break; |
| 371 | 391 | case 0x718: |
| ... | ... | @@ -377,7 +397,8 @@ |
| 377 | 397 | CX18_ERR("Invalid EEPROM\n"); |
| 378 | 398 | return; |
| 379 | 399 | default: |
| 380 | - CX18_ERR("Unknown model %d, defaulting to HVR-1600\n", tv.model); | |
| 400 | + CX18_ERR("Unknown model %d, defaulting to original HVR-1600 " | |
| 401 | + "(cardtype=1)\n", tv.model); | |
| 381 | 402 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); |
| 382 | 403 | break; |
| 383 | 404 | } |
drivers/media/video/cx18/cx18-driver.h
| ... | ... | @@ -85,7 +85,8 @@ |
| 85 | 85 | #define CX18_CARD_LEADTEK_PVR2100 6 /* Leadtek WinFast PVR2100 */ |
| 86 | 86 | #define CX18_CARD_LEADTEK_DVR3100H 7 /* Leadtek WinFast DVR3100 H */ |
| 87 | 87 | #define CX18_CARD_GOTVIEW_PCI_DVD3 8 /* GoTView PCI DVD3 Hybrid */ |
| 88 | -#define CX18_CARD_LAST 8 | |
| 88 | +#define CX18_CARD_HVR_1600_S5H1411 9 /* Hauppauge HVR 1600 s5h1411/tda18271*/ | |
| 89 | +#define CX18_CARD_LAST 9 | |
| 89 | 90 | |
| 90 | 91 | #define CX18_ENC_STREAM_TYPE_MPG 0 |
| 91 | 92 | #define CX18_ENC_STREAM_TYPE_TS 1 |
drivers/media/video/cx18/cx18-dvb.c
| ... | ... | @@ -29,6 +29,8 @@ |
| 29 | 29 | #include "cx18-gpio.h" |
| 30 | 30 | #include "s5h1409.h" |
| 31 | 31 | #include "mxl5005s.h" |
| 32 | +#include "s5h1411.h" | |
| 33 | +#include "tda18271.h" | |
| 32 | 34 | #include "zl10353.h" |
| 33 | 35 | |
| 34 | 36 | #include <linux/firmware.h> |
| ... | ... | @@ -77,6 +79,32 @@ |
| 77 | 79 | }; |
| 78 | 80 | |
| 79 | 81 | /* |
| 82 | + * CX18_CARD_HVR_1600_S5H1411 | |
| 83 | + */ | |
| 84 | +static struct s5h1411_config hcw_s5h1411_config = { | |
| 85 | + .output_mode = S5H1411_SERIAL_OUTPUT, | |
| 86 | + .gpio = S5H1411_GPIO_OFF, | |
| 87 | + .vsb_if = S5H1411_IF_44000, | |
| 88 | + .qam_if = S5H1411_IF_4000, | |
| 89 | + .inversion = S5H1411_INVERSION_ON, | |
| 90 | + .status_mode = S5H1411_DEMODLOCKING, | |
| 91 | + .mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, | |
| 92 | +}; | |
| 93 | + | |
| 94 | +static struct tda18271_std_map hauppauge_tda18271_std_map = { | |
| 95 | + .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3, | |
| 96 | + .if_lvl = 6, .rfagc_top = 0x37 }, | |
| 97 | + .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0, | |
| 98 | + .if_lvl = 6, .rfagc_top = 0x37 }, | |
| 99 | +}; | |
| 100 | + | |
| 101 | +static struct tda18271_config hauppauge_tda18271_config = { | |
| 102 | + .std_map = &hauppauge_tda18271_std_map, | |
| 103 | + .gate = TDA18271_GATE_DIGITAL, | |
| 104 | + .output_opt = TDA18271_OUTPUT_LT_OFF, | |
| 105 | +}; | |
| 106 | + | |
| 107 | +/* | |
| 80 | 108 | * CX18_CARD_LEADTEK_DVR3100H |
| 81 | 109 | */ |
| 82 | 110 | /* Information/confirmation of proper config values provided by Terry Wu */ |
| ... | ... | @@ -244,6 +272,7 @@ |
| 244 | 272 | switch (cx->card->type) { |
| 245 | 273 | case CX18_CARD_HVR_1600_ESMT: |
| 246 | 274 | case CX18_CARD_HVR_1600_SAMSUNG: |
| 275 | + case CX18_CARD_HVR_1600_S5H1411: | |
| 247 | 276 | v = cx18_read_reg(cx, CX18_REG_DMUX_NUM_PORT_0_CONTROL); |
| 248 | 277 | v |= 0x00400000; /* Serial Mode */ |
| 249 | 278 | v |= 0x00002000; /* Data Length - Byte */ |
| ... | ... | @@ -454,6 +483,15 @@ |
| 454 | 483 | &hauppauge_hvr1600_tuner); |
| 455 | 484 | ret = 0; |
| 456 | 485 | } |
| 486 | + break; | |
| 487 | + case CX18_CARD_HVR_1600_S5H1411: | |
| 488 | + dvb->fe = dvb_attach(s5h1411_attach, | |
| 489 | + &hcw_s5h1411_config, | |
| 490 | + &cx->i2c_adap[0]); | |
| 491 | + if (dvb->fe != NULL) | |
| 492 | + dvb_attach(tda18271_attach, dvb->fe, | |
| 493 | + 0x60, &cx->i2c_adap[0], | |
| 494 | + &hauppauge_tda18271_config); | |
| 457 | 495 | break; |
| 458 | 496 | case CX18_CARD_LEADTEK_DVR3100H: |
| 459 | 497 | dvb->fe = dvb_attach(zl10353_attach, |
drivers/media/video/cx23885/cx23885-i2c.c
| ... | ... | @@ -122,10 +122,6 @@ |
| 122 | 122 | |
| 123 | 123 | if (!i2c_wait_done(i2c_adap)) |
| 124 | 124 | goto eio; |
| 125 | - if (!i2c_slave_did_ack(i2c_adap)) { | |
| 126 | - retval = -ENXIO; | |
| 127 | - goto err; | |
| 128 | - } | |
| 129 | 125 | if (i2c_debug) { |
| 130 | 126 | printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]); |
| 131 | 127 | if (!(ctrl & I2C_NOSTOP)) |
| ... | ... | @@ -158,7 +154,6 @@ |
| 158 | 154 | |
| 159 | 155 | eio: |
| 160 | 156 | retval = -EIO; |
| 161 | - err: | |
| 162 | 157 | if (i2c_debug) |
| 163 | 158 | printk(KERN_ERR " ERR: %d\n", retval); |
| 164 | 159 | return retval; |
| ... | ... | @@ -209,10 +204,6 @@ |
| 209 | 204 | |
| 210 | 205 | if (!i2c_wait_done(i2c_adap)) |
| 211 | 206 | goto eio; |
| 212 | - if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) { | |
| 213 | - retval = -ENXIO; | |
| 214 | - goto err; | |
| 215 | - } | |
| 216 | 207 | msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; |
| 217 | 208 | if (i2c_debug) { |
| 218 | 209 | dprintk(1, " %02x", msg->buf[cnt]); |
| ... | ... | @@ -224,7 +215,6 @@ |
| 224 | 215 | |
| 225 | 216 | eio: |
| 226 | 217 | retval = -EIO; |
| 227 | - err: | |
| 228 | 218 | if (i2c_debug) |
| 229 | 219 | printk(KERN_ERR " ERR: %d\n", retval); |
| 230 | 220 | return retval; |
drivers/media/video/cx25840/cx25840-core.c
| ... | ... | @@ -2015,7 +2015,8 @@ |
| 2015 | 2015 | kfree(state); |
| 2016 | 2016 | return err; |
| 2017 | 2017 | } |
| 2018 | - v4l2_ctrl_cluster(2, &state->volume); | |
| 2018 | + if (!is_cx2583x(state)) | |
| 2019 | + v4l2_ctrl_cluster(2, &state->volume); | |
| 2019 | 2020 | v4l2_ctrl_handler_setup(&state->hdl); |
| 2020 | 2021 | |
| 2021 | 2022 | if (client->dev.platform_data) { |
drivers/media/video/ivtv/ivtv-irq.c
| ... | ... | @@ -628,22 +628,66 @@ |
| 628 | 628 | static void ivtv_irq_dma_err(struct ivtv *itv) |
| 629 | 629 | { |
| 630 | 630 | u32 data[CX2341X_MBOX_MAX_DATA]; |
| 631 | + u32 status; | |
| 631 | 632 | |
| 632 | 633 | del_timer(&itv->dma_timer); |
| 634 | + | |
| 633 | 635 | ivtv_api_get_data(&itv->enc_mbox, IVTV_MBOX_DMA_END, 2, data); |
| 636 | + status = read_reg(IVTV_REG_DMASTATUS); | |
| 634 | 637 | IVTV_DEBUG_WARN("DMA ERROR %08x %08x %08x %d\n", data[0], data[1], |
| 635 | - read_reg(IVTV_REG_DMASTATUS), itv->cur_dma_stream); | |
| 636 | - write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS); | |
| 638 | + status, itv->cur_dma_stream); | |
| 639 | + /* | |
| 640 | + * We do *not* write back to the IVTV_REG_DMASTATUS register to | |
| 641 | + * clear the error status, if either the encoder write (0x02) or | |
| 642 | + * decoder read (0x01) bus master DMA operation do not indicate | |
| 643 | + * completed. We can race with the DMA engine, which may have | |
| 644 | + * transitioned to completed status *after* we read the register. | |
| 645 | + * Setting a IVTV_REG_DMASTATUS flag back to "busy" status, after the | |
| 646 | + * DMA engine has completed, will cause the DMA engine to stop working. | |
| 647 | + */ | |
| 648 | + status &= 0x3; | |
| 649 | + if (status == 0x3) | |
| 650 | + write_reg(status, IVTV_REG_DMASTATUS); | |
| 651 | + | |
| 637 | 652 | if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags) && |
| 638 | 653 | itv->cur_dma_stream >= 0 && itv->cur_dma_stream < IVTV_MAX_STREAMS) { |
| 639 | 654 | struct ivtv_stream *s = &itv->streams[itv->cur_dma_stream]; |
| 640 | 655 | |
| 641 | - /* retry */ | |
| 642 | - if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) | |
| 656 | + if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) { | |
| 657 | + /* retry */ | |
| 658 | + /* | |
| 659 | + * FIXME - handle cases of DMA error similar to | |
| 660 | + * encoder below, except conditioned on status & 0x1 | |
| 661 | + */ | |
| 643 | 662 | ivtv_dma_dec_start(s); |
| 644 | - else | |
| 645 | - ivtv_dma_enc_start(s); | |
| 646 | - return; | |
| 663 | + return; | |
| 664 | + } else { | |
| 665 | + if ((status & 0x2) == 0) { | |
| 666 | + /* | |
| 667 | + * CX2341x Bus Master DMA write is ongoing. | |
| 668 | + * Reset the timer and let it complete. | |
| 669 | + */ | |
| 670 | + itv->dma_timer.expires = | |
| 671 | + jiffies + msecs_to_jiffies(600); | |
| 672 | + add_timer(&itv->dma_timer); | |
| 673 | + return; | |
| 674 | + } | |
| 675 | + | |
| 676 | + if (itv->dma_retries < 3) { | |
| 677 | + /* | |
| 678 | + * CX2341x Bus Master DMA write has ended. | |
| 679 | + * Retry the write, starting with the first | |
| 680 | + * xfer segment. Just retrying the current | |
| 681 | + * segment is not sufficient. | |
| 682 | + */ | |
| 683 | + s->sg_processed = 0; | |
| 684 | + itv->dma_retries++; | |
| 685 | + ivtv_dma_enc_start_xfer(s); | |
| 686 | + return; | |
| 687 | + } | |
| 688 | + /* Too many retries, give up on this one */ | |
| 689 | + } | |
| 690 | + | |
| 647 | 691 | } |
| 648 | 692 | if (test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { |
| 649 | 693 | ivtv_udma_start(itv); |
drivers/media/video/mem2mem_testdev.c
drivers/media/video/s2255drv.c
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | #include <linux/usb.h> |
| 58 | 58 | |
| 59 | 59 | #define S2255_MAJOR_VERSION 1 |
| 60 | -#define S2255_MINOR_VERSION 20 | |
| 60 | +#define S2255_MINOR_VERSION 21 | |
| 61 | 61 | #define S2255_RELEASE 0 |
| 62 | 62 | #define S2255_VERSION KERNEL_VERSION(S2255_MAJOR_VERSION, \ |
| 63 | 63 | S2255_MINOR_VERSION, \ |
| 64 | 64 | |
| ... | ... | @@ -312,9 +312,9 @@ |
| 312 | 312 | }; |
| 313 | 313 | |
| 314 | 314 | /* current cypress EEPROM firmware version */ |
| 315 | -#define S2255_CUR_USB_FWVER ((3 << 8) | 6) | |
| 315 | +#define S2255_CUR_USB_FWVER ((3 << 8) | 11) | |
| 316 | 316 | /* current DSP FW version */ |
| 317 | -#define S2255_CUR_DSP_FWVER 8 | |
| 317 | +#define S2255_CUR_DSP_FWVER 10102 | |
| 318 | 318 | /* Need DSP version 5+ for video status feature */ |
| 319 | 319 | #define S2255_MIN_DSP_STATUS 5 |
| 320 | 320 | #define S2255_MIN_DSP_COLORFILTER 8 |
| 321 | 321 | |
| ... | ... | @@ -492,9 +492,11 @@ |
| 492 | 492 | |
| 493 | 493 | static void s2255_reset_dsppower(struct s2255_dev *dev) |
| 494 | 494 | { |
| 495 | - s2255_vendor_req(dev, 0x40, 0x0b0b, 0x0b0b, NULL, 0, 1); | |
| 495 | + s2255_vendor_req(dev, 0x40, 0x0b0b, 0x0b01, NULL, 0, 1); | |
| 496 | 496 | msleep(10); |
| 497 | 497 | s2255_vendor_req(dev, 0x50, 0x0000, 0x0000, NULL, 0, 1); |
| 498 | + msleep(600); | |
| 499 | + s2255_vendor_req(dev, 0x10, 0x0000, 0x0000, NULL, 0, 1); | |
| 498 | 500 | return; |
| 499 | 501 | } |
| 500 | 502 |