diff options
Diffstat (limited to 'linux/drivers/media/video')
41 files changed, 529 insertions, 88 deletions
diff --git a/linux/drivers/media/video/arv.c b/linux/drivers/media/video/arv.c index 3be35eb39..11302b1d1 100644 --- a/linux/drivers/media/video/arv.c +++ b/linux/drivers/media/video/arv.c @@ -550,7 +550,11 @@ static int ar_ioctl(struct inode *inode, struct file *file, unsigned int cmd, /* * Interrupt handler */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void ar_interrupt(int irq, void *dev, struct pt_regs *regs) +#else +static void ar_interrupt(int irq, void *dev) +#endif { struct ar_device *ar = dev; unsigned int line_count; diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index f2924c532..88f7f65f4 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -3780,7 +3780,11 @@ bttv_irq_switch_vbi(struct bttv *btv) spin_unlock(&btv->s_lock); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs) +#else +static irqreturn_t bttv_irq(int irq, void *dev_id) +#endif { u32 stat,astat; u32 dstat; diff --git a/linux/drivers/media/video/cpia2/cpia2_usb.c b/linux/drivers/media/video/cpia2/cpia2_usb.c index f4da02941..0d4bb91dc 100644 --- a/linux/drivers/media/video/cpia2/cpia2_usb.c +++ b/linux/drivers/media/video/cpia2/cpia2_usb.c @@ -49,7 +49,11 @@ static int frame_sizes[] = { #define FRAME_SIZE_PER_DESC frame_sizes[cam->cur_alt] static void process_frame(struct camera_data *cam); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void cpia2_usb_complete(struct urb *urb, struct pt_regs *); +#else +static void cpia2_usb_complete(struct urb *urb); +#endif static int cpia2_usb_probe(struct usb_interface *intf, const struct usb_device_id *id); static void cpia2_usb_disconnect(struct usb_interface *intf); @@ -199,7 +203,11 @@ static void add_COM(struct camera_data *cam) * * callback when incoming packet is received *****************************************************************************/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void cpia2_usb_complete(struct urb *urb, struct pt_regs *regs) +#else +static void cpia2_usb_complete(struct urb *urb) +#endif { int i; unsigned char *cdata; diff --git a/linux/drivers/media/video/cpia_usb.c b/linux/drivers/media/video/cpia_usb.c index 2ee34a3b9..0d974be34 100644 --- a/linux/drivers/media/video/cpia_usb.c +++ b/linux/drivers/media/video/cpia_usb.c @@ -109,7 +109,11 @@ static struct cpia_camera_ops cpia_usb_ops = { static LIST_HEAD(cam_list); static spinlock_t cam_list_lock_usb; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void cpia_usb_complete(struct urb *urb, struct pt_regs *regs) +#else +static void cpia_usb_complete(struct urb *urb) +#endif { int i; char *cdata; diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c index 3fd1abdf7..bf67ec27d 100644 --- a/linux/drivers/media/video/cx88/cx88-alsa.c +++ b/linux/drivers/media/video/cx88/cx88-alsa.c @@ -287,7 +287,11 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip) /* * BOARD Specific: Handles IRQ calls */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t cx8801_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t cx8801_irq(int irq, void *dev_id) +#endif { snd_cx88_card_t *chip = dev_id; struct cx88_core *core = chip->core; diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index f014fc508..184903779 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -282,18 +282,22 @@ struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0x0000bde2, + .extadc = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x0000bde6, + .extadc = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x0000bde6, + .extadc = 1, }}, .radio = { .type = CX88_RADIO, .gpio0 = 0x0000bd62, + .extadc = 1, }, .mpeg = CX88_MPEG_BLACKBIRD, }, @@ -354,6 +358,7 @@ struct cx88_board cx88_boards[] = { .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in? + .extadc = 1, }}, .radio = { .type = CX88_RADIO, @@ -524,6 +529,7 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, + .extadc = 1, }}, .mpeg = CX88_MPEG_BLACKBIRD, }, @@ -647,18 +653,22 @@ struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0x00009d80, + .extadc = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x00009d76, + .extadc = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x00009d76, + .extadc = 1, }}, .radio = { .type = CX88_RADIO, .gpio0 = 0x00009d00, + .extadc = 1, }, .mpeg = CX88_MPEG_BLACKBIRD, }, @@ -787,25 +797,29 @@ struct cx88_board cx88_boards[] = { .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .tda9887_conf = TDA9887_PRESENT, - .mpeg = CX88_MPEG_BLACKBIRD, .input = {{ .type = CX88_VMUX_COMPOSITE1, .vmux = 0, .gpio0 = 0x0000cd73, + .extadc = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 1, .gpio0 = 0x0000cd73, + .extadc = 1, },{ .type = CX88_VMUX_TELEVISION, .vmux = 3, .gpio0 = 0x0000cdb3, + .extadc = 1, }}, .radio = { .type = CX88_RADIO, .vmux = 2, .gpio0 = 0x0000cdf3, + .extadc = 1, }, + .mpeg = CX88_MPEG_BLACKBIRD, }, [CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = { /* Alexander Wold <awold@bigfoot.com> */ @@ -1051,7 +1065,6 @@ struct cx88_board cx88_boards[] = { .mpeg = CX88_MPEG_DVB, }, [CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT] = { - /* FIXME: Audio not working for s-video / composite inputs. */ .name = "KWorld HardwareMpegTV XPert", .tuner_type = TUNER_PHILIPS_TDA8290, .radio_type = UNSET, @@ -1066,10 +1079,12 @@ struct cx88_board cx88_boards[] = { .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x3de6, + .extadc = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x3de6, + .extadc = 1, }}, .radio = { .type = CX88_RADIO, @@ -1285,35 +1300,35 @@ struct cx88_board cx88_boards[] = { .gpio0 = 0x070b, }}, }, - [CX88_BOARD_TE_DTV_250_OEM_SWANN] = { - .name = "Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM", - .tuner_type = TUNER_LG_PAL_NEW_TAPC, - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .input = {{ - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - .gpio0 = 0x003fffff, - .gpio1 = 0x00e00000, - .gpio2 = 0x003fffff, - .gpio3 = 0x02000000, - },{ - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x003fffff, - .gpio1 = 0x00e00000, - .gpio2 = 0x003fffff, - .gpio3 = 0x02000000, - },{ - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x003fffff, - .gpio1 = 0x00e00000, - .gpio2 = 0x003fffff, - .gpio3 = 0x02000000, - }}, - }, + [CX88_BOARD_TE_DTV_250_OEM_SWANN] = { + .name = "Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM", + .tuner_type = TUNER_LG_PAL_NEW_TAPC, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x003fffff, + .gpio1 = 0x00e00000, + .gpio2 = 0x003fffff, + .gpio3 = 0x02000000, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x003fffff, + .gpio1 = 0x00e00000, + .gpio2 = 0x003fffff, + .gpio3 = 0x02000000, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x003fffff, + .gpio1 = 0x00e00000, + .gpio2 = 0x003fffff, + .gpio3 = 0x02000000, + }}, + }, [CX88_BOARD_HAUPPAUGE_HVR1300] = { .name = "Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder", .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3, @@ -1326,14 +1341,17 @@ struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0xe780, + .extadc = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0xe780, + .extadc = 1, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0xe780, + .extadc = 1, }}, /* fixme: Add radio support */ .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c index dd5fd1b64..f90a9e7fd 100644 --- a/linux/drivers/media/video/cx88/cx88-mpeg.c +++ b/linux/drivers/media/video/cx88/cx88-mpeg.c @@ -407,7 +407,11 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev) #define MAX_IRQ_LOOP 10 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t cx8802_irq(int irq, void *dev_id) +#endif { struct cx8802_dev *dev = dev_id; struct cx88_core *core = dev->core; diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c index 6528c05d0..4f2b52012 100644 --- a/linux/drivers/media/video/cx88/cx88-tvaudio.c +++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c @@ -146,19 +146,6 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl) cx88_start_audio_dma(core); if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) { - /* sets sound input from external adc */ - switch (core->board) { - case CX88_BOARD_HAUPPAUGE_ROSLYN: - case CX88_BOARD_KWORLD_MCE200_DELUXE: - case CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT: - case CX88_BOARD_PIXELVIEW_PLAYTV_P7000: - case CX88_BOARD_ASUS_PVR_416: - cx_clear(AUD_CTL, EN_I2SIN_ENABLE); - break; - default: - cx_set(AUD_CTL, EN_I2SIN_ENABLE); - } - cx_write(AUD_I2SINPUTCNTL, 4); cx_write(AUD_BAUDRATE, 1); /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */ diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 1f1640f0f..6a420d6db 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -477,6 +477,14 @@ static int video_mux(struct cx88_core *core, unsigned int input) cx_clear(MO_FILTER_ODD, 0x00002020); break; } + + if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) { + /* sets sound input from external adc */ + if (INPUT(input)->extadc) + cx_set(AUD_CTL, EN_I2SIN_ENABLE); + else + cx_clear(AUD_CTL, EN_I2SIN_ENABLE); + } return 0; } @@ -2057,7 +2065,11 @@ static void cx8800_vid_irq(struct cx8800_dev *dev) } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t cx8800_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t cx8800_irq(int irq, void *dev_id) +#endif { struct cx8800_dev *dev = dev_id; struct cx88_core *core = dev->core; diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 436847b70..657dc9414 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -233,6 +233,7 @@ struct cx88_input { enum cx88_itype type; unsigned int vmux; u32 gpio0, gpio1, gpio2, gpio3; + unsigned int extadc:1; }; struct cx88_board { diff --git a/linux/drivers/media/video/dabusb.c b/linux/drivers/media/video/dabusb.c index 5896b6d4b..44c43d63c 100644 --- a/linux/drivers/media/video/dabusb.c +++ b/linux/drivers/media/video/dabusb.c @@ -169,7 +169,11 @@ static int dabusb_free_buffers (pdabusb_t s) return 0; } /*-------------------------------------------------------------------*/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void dabusb_iso_complete (struct urb *purb, struct pt_regs *regs) +#else +static void dabusb_iso_complete (struct urb *purb) +#endif { pbuff_t b = purb->context; pdabusb_t s = b->s; diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c index c7f7869f5..f5d256862 100644 --- a/linux/drivers/media/video/em28xx/em28xx-core.c +++ b/linux/drivers/media/video/em28xx/em28xx-core.c @@ -441,7 +441,11 @@ int em28xx_resolution_set(struct em28xx *dev) /******************* isoc transfer handling ****************************/ #ifdef ENABLE_DEBUG_ISOC_FRAMES +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void em28xx_isoc_dump(struct urb *urb, struct pt_regs *regs) +#else +static void em28xx_isoc_dump(struct urb *urb) +#endif { int len = 0; int ntrans = 0; @@ -593,7 +597,11 @@ static inline void em28xx_isoc_video_copy(struct em28xx *dev, * em28xx_isoIrq() * handles the incoming isoc urbs and fills the frames from our inqueue */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void em28xx_isocIrq(struct urb *urb, struct pt_regs *regs) +#else +static void em28xx_isocIrq(struct urb *urb) +#endif { struct em28xx *dev = urb->context; int i, status; @@ -604,7 +612,11 @@ static void em28xx_isocIrq(struct urb *urb, struct pt_regs *regs) return; #ifdef ENABLE_DEBUG_ISOC_FRAMES if (isoc_debug>1) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) em28xx_isoc_dump(urb, regs); +#else + em28xx_isoc_dump(urb); +#endif #endif if (urb->status == -ENOENT) diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index 6aaafc023..e7a104098 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -196,7 +196,7 @@ static void em28xx_config_i2c(struct em28xx *dev) route.input = INPUT(dev->ctl_input)->vmux; route.output = 0; - em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, 0); + em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL); em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL); diff --git a/linux/drivers/media/video/et61x251/et61x251_core.c b/linux/drivers/media/video/et61x251/et61x251_core.c index 8992b6e62..d8961d82c 100644 --- a/linux/drivers/media/video/et61x251/et61x251_core.c +++ b/linux/drivers/media/video/et61x251/et61x251_core.c @@ -398,7 +398,11 @@ int et61x251_i2c_write(struct et61x251_device* cam, u8 address, u8 value) /*****************************************************************************/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void et61x251_urb_complete(struct urb *urb, struct pt_regs* regs) +#else +static void et61x251_urb_complete(struct urb *urb) +#endif { struct et61x251_device* cam = urb->context; struct et61x251_frame_t** f; @@ -973,16 +977,32 @@ static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, et61x251_show_i2c_val, et61x251_store_i2c_val); -static void et61x251_create_sysfs(struct et61x251_device* cam) +static int et61x251_create_sysfs(struct et61x251_device* cam) { struct video_device *v4ldev = cam->v4ldev; + int rc; - video_device_create_file(v4ldev, &class_device_attr_reg); - video_device_create_file(v4ldev, &class_device_attr_val); + rc = video_device_create_file(v4ldev, &class_device_attr_reg); + if (rc) goto err; + rc = video_device_create_file(v4ldev, &class_device_attr_val); + if (rc) goto err_reg; if (cam->sensor.sysfs_ops) { - video_device_create_file(v4ldev, &class_device_attr_i2c_reg); - video_device_create_file(v4ldev, &class_device_attr_i2c_val); + rc = video_device_create_file(v4ldev, &class_device_attr_i2c_reg); + if (rc) goto err_val; + rc = video_device_create_file(v4ldev, &class_device_attr_i2c_val); + if (rc) goto err_i2c_reg; } + + return 0; + +err_i2c_reg: + video_device_remove_file(v4ldev, &class_device_attr_i2c_reg); +err_val: + video_device_remove_file(v4ldev, &class_device_attr_val); +err_reg: + video_device_remove_file(v4ldev, &class_device_attr_reg); +err: + return rc; } #endif /* CONFIG_VIDEO_ADV_DEBUG */ @@ -2534,7 +2554,9 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0; #ifdef CONFIG_VIDEO_ADV_DEBUG - et61x251_create_sysfs(cam); + err = et61x251_create_sysfs(cam); + if (err) + goto fail2; DBG(2, "Optional device control through 'sysfs' interface ready"); #endif @@ -2544,6 +2566,13 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) return 0; +#ifdef CONFIG_VIDEO_ADV_DEBUG +fail2: + video_nr[dev_nr] = -1; + dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0; + mutex_unlock(&cam->dev_mutex); + video_unregister_device(cam->v4ldev); +#endif fail: if (cam) { kfree(cam->control_buffer); diff --git a/linux/drivers/media/video/meye.c b/linux/drivers/media/video/meye.c index 1265de39e..2ee2d9fd0 100644 --- a/linux/drivers/media/video/meye.c +++ b/linux/drivers/media/video/meye.c @@ -787,7 +787,11 @@ static void mchip_cont_compression_start(void) /* Interrupt handling */ /****************************************************************************/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t meye_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t meye_irq(int irq, void *dev_id) +#endif { u32 v; int reqnr; diff --git a/linux/drivers/media/video/ov511.c b/linux/drivers/media/video/ov511.c index eb638dde1..b1fb74147 100644 --- a/linux/drivers/media/video/ov511.c +++ b/linux/drivers/media/video/ov511.c @@ -3503,7 +3503,11 @@ check_middle: } static void +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) ov51x_isoc_irq(struct urb *urb, struct pt_regs *regs) +#else +ov51x_isoc_irq(struct urb *urb) +#endif { int i; struct usb_ov511 *ov; diff --git a/linux/drivers/media/video/planb.c b/linux/drivers/media/video/planb.c index baa0c55a7..667edaf0d 100644 --- a/linux/drivers/media/video/planb.c +++ b/linux/drivers/media/video/planb.c @@ -92,7 +92,11 @@ static void planb_close(struct video_device *); static int planb_ioctl(struct video_device *, unsigned int, void *); static int planb_init_done(struct video_device *); static int planb_mmap(struct video_device *, const char *, unsigned long); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void planb_irq(int, void *, struct pt_regs *); +#else +static void planb_irq(int, void *); +#endif static void release_planb(void); int init_planbs(struct video_init *); @@ -1317,7 +1321,11 @@ cmd_tab_data_end: return c1; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void planb_irq(int irq, void *dev_id, struct pt_regs * regs) +#else +static void planb_irq(int irq, void *dev_id) +#endif { unsigned int stat, astat; struct planb *pb = (struct planb *)dev_id; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 065ccb0bb..17cb1d5c6 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -2611,7 +2611,11 @@ void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw) #endif /* 0 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) +#else +static void pvr2_ctl_write_complete(struct urb *urb) +#endif { struct pvr2_hdw *hdw = urb->context; hdw->ctl_write_pend_flag = 0; @@ -2620,7 +2624,11 @@ static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void pvr2_ctl_read_complete(struct urb *urb, struct pt_regs *regs) +#else +static void pvr2_ctl_read_complete(struct urb *urb) +#endif { struct pvr2_hdw *hdw = urb->context; hdw->ctl_read_pend_flag = 0; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index ebfe184ab..760cb5c7f 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -200,6 +200,139 @@ static int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, } } +#if 0 +/* This is special code for spying on IR transactions for 29xxx devices. + We use this to reverse-engineer the IR protocol in order to simulate it + correctly for 24xxx devices. */ +static int i2c_29xxx_ir(struct pvr2_hdw *hdw, + u8 i2c_addr,u8 *wdata,u16 wlen,u8 *rdata,u16 rlen) +{ + char buf[200]; + unsigned int c1,c2; + unsigned int idx,stat; + if (!(rlen || wlen)) { + /* This is a probe attempt. Just let it succeed. */ + pvr2_trace(PVR2_TRACE_DEBUG,"IR: probe"); + return 0; + } + stat = pvr2_i2c_basic_op(hdw,i2c_addr,wdata,wlen,rdata,rlen); + if ((wlen == 0) && (rlen == 3) && (stat == 0) && + (rdata[0] == 0) && (rdata[1] == 0) && (rdata[2] == 0xc1)) { + return stat; + } + c1 = 0; + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + "IR: stat=%d",stat); + c1 += c2; + if (wlen) { + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + " write ["); + c1 += c2; + for (idx = 0; idx < wlen; idx++) { + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + "%s%02x",idx == 0 ? "" : " ", + wdata[idx]); + c1 += c2; + } + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + "]"); + c1 += c2; + } + if (rlen && (stat == 0)) { + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + " read ["); + c1 += c2; + for (idx = 0; idx < rlen; idx++) { + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + "%s%02x",idx == 0 ? "" : " ", + rdata[idx]); + c1 += c2; + } + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + "]"); + c1 += c2; + } else if (rlen) { + c2 = scnprintf(buf+c1,sizeof(buf)-c1, + " read cnt=%u",rlen); + c1 += c2; + } + pvr2_trace(PVR2_TRACE_DEBUG,"%.*s",c1,buf); + return stat; +} +#endif + +/* This is a special entry point for cases of I2C transaction attempts to + the IR receiver. The implementation here simulates the IR receiver by + issuing a command to the FX2 firmware and using that response to return + what the real I2C receiver would have returned. We use this for 24xxx + devices, where the IR receiver chip has been removed and replaced with + FX2 related logic. */ +static int i2c_24xxx_ir(struct pvr2_hdw *hdw, + u8 i2c_addr,u8 *wdata,u16 wlen,u8 *rdata,u16 rlen) +{ + u8 dat[4]; + unsigned int stat; + + if (!(rlen || wlen)) { + /* This is a probe attempt. Just let it succeed. */ + return 0; + } + + /* We don't understand this kind of transaction */ + if ((wlen != 0) || (rlen == 0)) return -EIO; + + if (rlen < 3) { + /* Mike Isely <isely@pobox.com> Appears to be a probe + attempt from lirc. Just fill in zeroes and return. If + we try instead to do the full transaction here, then bad + things seem to happen within the lirc driver module + (version 0.8.0-7 sources from Debian, when run under + vanilla 2.6.17.6 kernel) - and I don't have the patience + to chase it down. */ + if (rlen > 0) rdata[0] = 0; + if (rlen > 1) rdata[1] = 0; + return 0; + } + + /* Issue a command to the FX2 to read the IR receiver. */ + LOCK_TAKE(hdw->ctl_lock); do { + hdw->cmd_buffer[0] = 0xec; + stat = pvr2_send_request(hdw, + hdw->cmd_buffer,1, + hdw->cmd_buffer,4); + dat[0] = hdw->cmd_buffer[0]; + dat[1] = hdw->cmd_buffer[1]; + dat[2] = hdw->cmd_buffer[2]; + dat[3] = hdw->cmd_buffer[3]; + } while (0); LOCK_GIVE(hdw->ctl_lock); + + /* Give up if that operation failed. */ + if (stat != 0) return stat; + + /* Mangle the results into something that looks like the real IR + receiver. */ + rdata[2] = 0xc1; + if (dat[0] != 1) { + /* No code received. */ + rdata[0] = 0; + rdata[1] = 0; + } else { + u16 val; + /* Mash the FX2 firmware-provided IR code into something + that the normal i2c chip-level driver expects. */ + val = dat[1]; + val <<= 8; + val |= dat[2]; + val >>= 1; + val &= ~0x0003; + val |= 0x8000; + rdata[0] = (val >> 8) & 0xffu; + rdata[1] = val & 0xffu; + } + + return 0; +} + /* This is a special entry point that is entered if an I2C operation is attempted to a wm8775 chip on model 24xxx hardware. Autodetect of this part doesn't work, but we know it is really there. So let's look for @@ -913,17 +1046,17 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw) { unsigned int idx; - // The default action for all possible I2C addresses is just to do - // the transfer normally. + /* The default action for all possible I2C addresses is just to do + the transfer normally. */ for (idx = 0; idx < PVR2_I2C_FUNC_CNT; idx++) { hdw->i2c_func[idx] = pvr2_i2c_basic_op; } - // If however we're dealing with new hardware, insert some hacks in - // the I2C transfer stack to let things work better. + /* However, deal with various special cases for 24xxx hardware. */ if (hdw->hdw_type == PVR2_HDW_TYPE_24XXX) { hdw->i2c_func[0x1b] = i2c_hack_wm8775; hdw->i2c_func[0x44] = i2c_hack_cx25840; + hdw->i2c_func[0x18] = i2c_24xxx_ir; } // Configure the adapter and set up everything else related to it. diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c index 7b3b53010..afb378b2a 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -449,7 +449,11 @@ static void pvr2_stream_done(struct pvr2_stream *sp) } while (0); mutex_unlock(&sp->mutex); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void buffer_complete(struct urb *urb, struct pt_regs *regs) +#else +static void buffer_complete(struct urb *urb) +#endif { struct pvr2_buffer *bp = urb->context; struct pvr2_stream *sp; diff --git a/linux/drivers/media/video/pwc/pwc-if.c b/linux/drivers/media/video/pwc/pwc-if.c index f00a606c5..3c83629b1 100644 --- a/linux/drivers/media/video/pwc/pwc-if.c +++ b/linux/drivers/media/video/pwc/pwc-if.c @@ -707,7 +707,11 @@ static int pwc_rcv_short_packet(struct pwc_device *pdev, const struct pwc_frame_ /* This gets called for the Isochronous pipe (video). This is done in * interrupt time, so it has to be fast, not crash, and not stall. Neat. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs) +#else +static void pwc_isoc_handler(struct urb *urb) +#endif { struct pwc_device *pdev; int i, fst, flen; @@ -1057,12 +1061,25 @@ static ssize_t show_snapshot_button_status(struct class_device *class_dev, char static CLASS_DEVICE_ATTR(button, S_IRUGO | S_IWUSR, show_snapshot_button_status, NULL); -static void pwc_create_sysfs_files(struct video_device *vdev) +static int pwc_create_sysfs_files(struct video_device *vdev) { struct pwc_device *pdev = video_get_drvdata(vdev); - if (pdev->features & FEATURE_MOTOR_PANTILT) - video_device_create_file(vdev, &class_device_attr_pan_tilt); - video_device_create_file(vdev, &class_device_attr_button); + int rc; + + rc = video_device_create_file(vdev, &class_device_attr_button); + if (rc) + goto err; + if (pdev->features & FEATURE_MOTOR_PANTILT) { + rc = video_device_create_file(vdev,&class_device_attr_pan_tilt); + if (rc) goto err_button; + } + + return 0; + +err_button: + video_device_remove_file(vdev, &class_device_attr_button); +err: + return rc; } static void pwc_remove_sysfs_files(struct video_device *vdev) @@ -1447,7 +1464,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id struct usb_device *udev = interface_to_usbdev(intf); struct pwc_device *pdev = NULL; int vendor_id, product_id, type_id; - int i, hint; + int i, hint, rc; int features = 0; int video_nr = -1; /* default: use next available device */ char serial_number[30], *name; @@ -1757,9 +1774,8 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id i = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr); if (i < 0) { PWC_ERROR("Failed to register as video device (%d).\n", i); - video_device_release(pdev->vdev); /* Drip... drip... drip... */ - kfree(pdev); /* Oops, no memory leaks please */ - return -EIO; + rc = i; + goto err; } else { PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F); @@ -1771,13 +1787,24 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id PWC_DEBUG_PROBE("probe() function returning struct at 0x%p.\n", pdev); usb_set_intfdata (intf, pdev); - pwc_create_sysfs_files(pdev->vdev); + rc = pwc_create_sysfs_files(pdev->vdev); + if (rc) + goto err_unreg; /* Set the leds off */ pwc_set_leds(pdev, 0, 0); pwc_camera_power(pdev, 0); return 0; + +err_unreg: + if (hint < MAX_DEV_HINTS) + device_hint[hint].pdev = NULL; + video_unregister_device(pdev->vdev); +err: + video_device_release(pdev->vdev); /* Drip... drip... drip... */ + kfree(pdev); /* Oops, no memory leaks please */ + return rc; } /* The user janked out the cable... */ diff --git a/linux/drivers/media/video/saa7134/saa7134-alsa.c b/linux/drivers/media/video/saa7134/saa7134-alsa.c index 64fba2d36..3dcd2203f 100644 --- a/linux/drivers/media/video/saa7134/saa7134-alsa.c +++ b/linux/drivers/media/video/saa7134/saa7134-alsa.c @@ -235,7 +235,11 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, * */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id) +#endif { struct saa7134_dmasound *dmasound = dev_id; struct saa7134_dev *dev = dmasound->priv_data; diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index f6b19bad3..3cdcaa245 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -2463,14 +2463,17 @@ struct saa7134_board saa7134_boards[] = { .vmux = 1, .amux = TV, .tv = 1, + .gpio = 0x0000000, },{ .name = name_comp1, .vmux = 3, .amux = LINE2, + .gpio = 0x0200000, },{ .name = name_svideo, .vmux = 8, .amux = LINE2, + .gpio = 0x0200000, }}, .radio = { .name = name_radio, @@ -3759,6 +3762,12 @@ struct pci_device_id saa7134_pci_tbl[] = { .subdevice = 0x9715, .driver_data = SAA7134_BOARD_AVERMEDIA_STUDIO_507, },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x1043, + .subdevice = 0x4876, + .driver_data = SAA7134_BOARD_ASUSTeK_P7131_DUAL, + },{ /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index 21e363c2f..a65da12e4 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -559,7 +559,11 @@ static void print_irqstatus(struct saa7134_dev *dev, int loop, printk("\n"); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t saa7134_irq(int irq, void *dev_id) +#endif { struct saa7134_dev *dev = (struct saa7134_dev*) dev_id; unsigned long report,status; diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c index b18e9a504..28d3e5bfd 100644 --- a/linux/drivers/media/video/saa7134/saa7134-dvb.c +++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c @@ -895,6 +895,16 @@ static struct tda1004x_config pinnacle_pctv_310i_config = { /* ------------------------------------------------------------------ */ +static struct tda1004x_config asus_p7131_dual_config = { + .demod_address = 0x08, + .invert = 1, + .invert_oclk = 0, + .xtal_freq = TDA10046_XTAL_16M, + .agc_config = TDA10046_AGC_TDA827X, + .if_freq = TDA10046_FREQ_045, + .request_firmware = philips_tda1004x_request_firmware, +}; + static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe) { struct saa7134_dev *dev = fe->dvb->priv; @@ -1168,6 +1178,8 @@ static int dvb_init(struct saa7134_dev *dev) &philips_europa_config, &dev->i2c_adap); if (dev->dvb.frontend) { + dev->original_demod_sleep = dev->dvb.frontend->ops.sleep; + dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep; dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init; dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep; dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params; @@ -1206,9 +1218,10 @@ static int dvb_init(struct saa7134_dev *dev) break; case SAA7134_BOARD_ASUSTeK_P7131_DUAL: dev->dvb.frontend = dvb_attach(tda10046_attach, - &philips_tiger_config, + &asus_p7131_dual_config, &dev->i2c_adap); if (dev->dvb.frontend) { + dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl; dev->dvb.frontend->ops.tuner_ops.init = asus_p7131_dual_tuner_init; dev->dvb.frontend->ops.tuner_ops.sleep = asus_p7131_dual_tuner_sleep; dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params; diff --git a/linux/drivers/media/video/saa7134/saa7134-input.c b/linux/drivers/media/video/saa7134/saa7134-input.c index 78b0c7485..99462db8f 100644 --- a/linux/drivers/media/video/saa7134/saa7134-input.c +++ b/linux/drivers/media/video/saa7134/saa7134-input.c @@ -334,6 +334,7 @@ void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir) switch (dev->board) { case SAA7134_BOARD_PINNACLE_PCTV_110i: + case SAA7134_BOARD_PINNACLE_PCTV_310i: snprintf(ir->c.name, sizeof(ir->c.name), "Pinnacle PCTV"); if (pinnacle_remote == 0) { ir->get_key = get_key_pinnacle_color; diff --git a/linux/drivers/media/video/saa7134/saa7134-oss.c b/linux/drivers/media/video/saa7134/saa7134-oss.c index 510ce8a36..f8cc49af6 100644 --- a/linux/drivers/media/video/saa7134/saa7134-oss.c +++ b/linux/drivers/media/video/saa7134/saa7134-oss.c @@ -832,7 +832,11 @@ struct file_operations saa7134_mixer_fops = { /* ------------------------------------------------------------------ */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t saa7134_oss_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t saa7134_oss_irq(int irq, void *dev_id) +#endif { struct saa7134_dmasound *dmasound = dev_id; struct saa7134_dev *dev = dmasound->priv_data; diff --git a/linux/drivers/media/video/se401.c b/linux/drivers/media/video/se401.c index 67987baee..4d10fe563 100644 --- a/linux/drivers/media/video/se401.c +++ b/linux/drivers/media/video/se401.c @@ -282,7 +282,11 @@ static void se401_auto_resetlevel(struct usb_se401 *se401) } /* irq handler for snapshot button */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void se401_button_irq(struct urb *urb, struct pt_regs *regs) +#else +static void se401_button_irq(struct urb *urb) +#endif { struct usb_se401 *se401 = urb->context; int status; @@ -318,7 +322,11 @@ exit: __FUNCTION__, status); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void se401_video_irq(struct urb *urb, struct pt_regs *regs) +#else +static void se401_video_irq(struct urb *urb) +#endif { struct usb_se401 *se401 = urb->context; int length = urb->actual_length; diff --git a/linux/drivers/media/video/sn9c102/sn9c102_core.c b/linux/drivers/media/video/sn9c102/sn9c102_core.c index 38b149dac..d9c512fef 100644 --- a/linux/drivers/media/video/sn9c102/sn9c102_core.c +++ b/linux/drivers/media/video/sn9c102/sn9c102_core.c @@ -518,7 +518,11 @@ sn9c102_find_eof_header(struct sn9c102_device* cam, void* mem, size_t len) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void sn9c102_urb_complete(struct urb *urb, struct pt_regs* regs) +#else +static void sn9c102_urb_complete(struct urb *urb) +#endif { struct sn9c102_device* cam = urb->context; struct sn9c102_frame_t** f; @@ -1240,23 +1244,53 @@ static CLASS_DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL); -static void sn9c102_create_sysfs(struct sn9c102_device* cam) +static int sn9c102_create_sysfs(struct sn9c102_device* cam) { struct video_device *v4ldev = cam->v4ldev; + int rc; + + rc = video_device_create_file(v4ldev, &class_device_attr_reg); + if (rc) goto err; + rc = video_device_create_file(v4ldev, &class_device_attr_val); + if (rc) goto err_reg; + rc = video_device_create_file(v4ldev, &class_device_attr_frame_header); + if (rc) goto err_val; - video_device_create_file(v4ldev, &class_device_attr_reg); - video_device_create_file(v4ldev, &class_device_attr_val); - video_device_create_file(v4ldev, &class_device_attr_frame_header); - if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) - video_device_create_file(v4ldev, &class_device_attr_green); - else if (cam->bridge == BRIDGE_SN9C103) { - video_device_create_file(v4ldev, &class_device_attr_blue); - video_device_create_file(v4ldev, &class_device_attr_red); - } if (cam->sensor.sysfs_ops) { - video_device_create_file(v4ldev, &class_device_attr_i2c_reg); - video_device_create_file(v4ldev, &class_device_attr_i2c_val); + rc = video_device_create_file(v4ldev, &class_device_attr_i2c_reg); + if (rc) goto err_frhead; + rc = video_device_create_file(v4ldev, &class_device_attr_i2c_val); + if (rc) goto err_i2c_reg; } + + if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) { + rc = video_device_create_file(v4ldev, &class_device_attr_green); + if (rc) goto err_i2c_val; + } else if (cam->bridge == BRIDGE_SN9C103) { + rc = video_device_create_file(v4ldev, &class_device_attr_blue); + if (rc) goto err_i2c_val; + rc = video_device_create_file(v4ldev, &class_device_attr_red); + if (rc) goto err_blue; + } + + return 0; + +err_blue: + video_device_remove_file(v4ldev, &class_device_attr_blue); +err_i2c_val: + if (cam->sensor.sysfs_ops) + video_device_remove_file(v4ldev, &class_device_attr_i2c_val); +err_i2c_reg: + if (cam->sensor.sysfs_ops) + video_device_remove_file(v4ldev, &class_device_attr_i2c_reg); +err_frhead: + video_device_remove_file(v4ldev, &class_device_attr_frame_header); +err_val: + video_device_remove_file(v4ldev, &class_device_attr_val); +err_reg: + video_device_remove_file(v4ldev, &class_device_attr_reg); +err: + return rc; } #endif /* CONFIG_VIDEO_ADV_DEBUG */ @@ -2815,10 +2849,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) DBG(1, "V4L2 device registration failed"); if (err == -ENFILE && video_nr[dev_nr] == -1) DBG(1, "Free /dev/videoX node not found"); - video_nr[dev_nr] = -1; - dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0; - mutex_unlock(&cam->dev_mutex); - goto fail; + goto fail2; } DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor); @@ -2829,7 +2860,9 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0; #ifdef CONFIG_VIDEO_ADV_DEBUG - sn9c102_create_sysfs(cam); + err = sn9c102_create_sysfs(cam); + if (err) + goto fail3; DBG(2, "Optional device control through 'sysfs' interface ready"); #endif @@ -2839,6 +2872,14 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) return 0; +#ifdef CONFIG_VIDEO_ADV_DEBUG +fail3: + video_unregister_device(cam->v4ldev); +#endif +fail2: + video_nr[dev_nr] = -1; + dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0; + mutex_unlock(&cam->dev_mutex); fail: if (cam) { kfree(cam->control_buffer); diff --git a/linux/drivers/media/video/stradis.c b/linux/drivers/media/video/stradis.c index 267252d2a..a11f1cbf9 100644 --- a/linux/drivers/media/video/stradis.c +++ b/linux/drivers/media/video/stradis.c @@ -407,7 +407,11 @@ static void send_osd_data(struct saa7146 *saa) } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t saa7146_irq(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t saa7146_irq(int irq, void *dev_id) +#endif { struct saa7146 *saa = dev_id; u32 stat, astat; diff --git a/linux/drivers/media/video/stv680.c b/linux/drivers/media/video/stv680.c index f8e9f1cbd..5dfa8eadb 100644 --- a/linux/drivers/media/video/stv680.c +++ b/linux/drivers/media/video/stv680.c @@ -614,7 +614,11 @@ static int stv680_set_pict (struct usb_stv *stv680, struct video_picture *p) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void stv680_video_irq (struct urb *urb, struct pt_regs *regs) +#else +static void stv680_video_irq (struct urb *urb) +#endif { struct usb_stv *stv680 = urb->context; int length = urb->actual_length; @@ -690,7 +694,7 @@ static int stv680_start_stream (struct usb_stv *stv680) stv680->sbuf[i].data = kmalloc (stv680->rawbufsize, GFP_KERNEL); if (stv680->sbuf[i].data == NULL) { PDEBUG (0, "STV(e): Could not kmalloc raw data buffer %i", i); - return -1; + goto nomem_err; } } @@ -701,7 +705,7 @@ static int stv680_start_stream (struct usb_stv *stv680) stv680->scratch[i].data = kmalloc (stv680->rawbufsize, GFP_KERNEL); if (stv680->scratch[i].data == NULL) { PDEBUG (0, "STV(e): Could not kmalloc raw scratch buffer %i", i); - return -1; + goto nomem_err; } stv680->scratch[i].state = BUFFER_UNUSED; } @@ -709,7 +713,7 @@ static int stv680_start_stream (struct usb_stv *stv680) for (i = 0; i < STV680_NUMSBUF; i++) { urb = usb_alloc_urb (0, GFP_KERNEL); if (!urb) - return -ENOMEM; + goto nomem_err; /* sbuf is urb->transfer_buffer, later gets memcpyed to scratch */ usb_fill_bulk_urb (urb, stv680->udev, @@ -724,6 +728,21 @@ static int stv680_start_stream (struct usb_stv *stv680) stv680->framecount = 0; return 0; + + nomem_err: + for (i = 0; i < STV680_NUMSCRATCH; i++) { + kfree(stv680->scratch[i].data); + stv680->scratch[i].data = NULL; + } + for (i = 0; i < STV680_NUMSBUF; i++) { + usb_kill_urb(stv680->urb[i]); + usb_free_urb(stv680->urb[i]); + stv680->urb[i] = NULL; + kfree(stv680->sbuf[i].data); + stv680->sbuf[i].data = NULL; + } + return -ENOMEM; + } static int stv680_stop_stream (struct usb_stv *stv680) diff --git a/linux/drivers/media/video/usbvideo/konicawc.c b/linux/drivers/media/video/usbvideo/konicawc.c index 8c0e25fde..5ab17aaab 100644 --- a/linux/drivers/media/video/usbvideo/konicawc.c +++ b/linux/drivers/media/video/usbvideo/konicawc.c @@ -393,7 +393,11 @@ static void resubmit_urb(struct uvd *uvd, struct urb *urb) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void konicawc_isoc_irq(struct urb *urb, struct pt_regs *regs) +#else +static void konicawc_isoc_irq(struct urb *urb) +#endif { struct uvd *uvd = urb->context; struct konicawc *cam = (struct konicawc *)uvd->user_data; diff --git a/linux/drivers/media/video/usbvideo/quickcam_messenger.c b/linux/drivers/media/video/usbvideo/quickcam_messenger.c index 66e750336..95f6b86f0 100644 --- a/linux/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/linux/drivers/media/video/usbvideo/quickcam_messenger.c @@ -130,7 +130,11 @@ static void qcm_report_buttonstat(struct qcm *cam) } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void qcm_int_irq(struct urb *urb, struct pt_regs *regs) +#else +static void qcm_int_irq(struct urb *urb) +#endif { int ret; struct uvd *uvd = urb->context; @@ -611,7 +615,11 @@ static void resubmit_urb(struct uvd *uvd, struct urb *urb) err("usb_submit_urb error (%d)", ret); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void qcm_isoc_irq(struct urb *urb, struct pt_regs *regs) +#else +static void qcm_isoc_irq(struct urb *urb) +#endif { int len; struct uvd *uvd = urb->context; diff --git a/linux/drivers/media/video/usbvideo/usbvideo.c b/linux/drivers/media/video/usbvideo/usbvideo.c index 4db4569a5..0f839d7de 100644 --- a/linux/drivers/media/video/usbvideo/usbvideo.c +++ b/linux/drivers/media/video/usbvideo/usbvideo.c @@ -1680,7 +1680,11 @@ static int usbvideo_CompressIsochronous(struct uvd *uvd, struct urb *urb) return totlen; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void usbvideo_IsocIrq(struct urb *urb, struct pt_regs *regs) +#else +static void usbvideo_IsocIrq(struct urb *urb) +#endif { int i, ret, len; struct uvd *uvd = urb->context; diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c index a8705f7d7..bcaee23da 100644 --- a/linux/drivers/media/video/videodev.c +++ b/linux/drivers/media/video/videodev.c @@ -1307,6 +1307,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ret=vfd->vidioc_g_parm(file, fh, p); } else { struct v4l2_standard s; + int i; if (!vfd->tvnormsize) { printk (KERN_WARNING "%s: no TV norms defined!\n", @@ -1317,8 +1318,14 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; - v4l2_video_std_construct(&s, vfd->tvnorms[vfd->current_norm].id, - vfd->tvnorms[vfd->current_norm].name); + for (i = 0; i < vfd->tvnormsize; i++) + if (vfd->tvnorms[i].id == vfd->current_norm) + break; + if (i >= vfd->tvnormsize) + return -EINVAL; + + v4l2_video_std_construct(&s, vfd->current_norm, + vfd->tvnorms[i].name); memset(p,0,sizeof(*p)); diff --git a/linux/drivers/media/video/vino.c b/linux/drivers/media/video/vino.c index 0ff1ecc00..c4b7fc2bc 100644 --- a/linux/drivers/media/video/vino.c +++ b/linux/drivers/media/video/vino.c @@ -2325,7 +2325,11 @@ static void vino_capture_tasklet(unsigned long channel) { } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t vino_interrupt(int irq, void *dev_id, struct pt_regs *regs) +#else +static irqreturn_t vino_interrupt(int irq, void *dev_id) +#endif { u32 ctrl, intr; unsigned int fc_a, fc_b; diff --git a/linux/drivers/media/video/w9968cf.c b/linux/drivers/media/video/w9968cf.c index 2912326a5..0a9e1d462 100644 --- a/linux/drivers/media/video/w9968cf.c +++ b/linux/drivers/media/video/w9968cf.c @@ -417,7 +417,11 @@ static int w9968cf_write_fsb(struct w9968cf_device*, u16* data); static int w9968cf_write_sb(struct w9968cf_device*, u16 value); static int w9968cf_read_sb(struct w9968cf_device*); static int w9968cf_upload_quantizationtables(struct w9968cf_device*); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs); +#else +static void w9968cf_urb_complete(struct urb *urb); +#endif /* Low-level I2C (SMBus) I/O */ static int w9968cf_smbus_start(struct w9968cf_device*); @@ -781,7 +785,11 @@ static int w9968cf_allocate_memory(struct w9968cf_device* cam) If there are no requested frames in the FIFO list, packets are collected into a temporary buffer. --------------------------------------------------------------------------*/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs) +#else +static void w9968cf_urb_complete(struct urb *urb) +#endif { struct w9968cf_device* cam = (struct w9968cf_device*)urb->context; struct w9968cf_frame_t** f; diff --git a/linux/drivers/media/video/zc0301/zc0301_core.c b/linux/drivers/media/video/zc0301/zc0301_core.c index 1b2be2d2a..aa3ad3c2e 100644 --- a/linux/drivers/media/video/zc0301/zc0301_core.c +++ b/linux/drivers/media/video/zc0301/zc0301_core.c @@ -303,7 +303,11 @@ int zc0301_i2c_write(struct zc0301_device* cam, u16 address, u16 value) /*****************************************************************************/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static void zc0301_urb_complete(struct urb *urb, struct pt_regs* regs) +#else +static void zc0301_urb_complete(struct urb *urb) +#endif { struct zc0301_device* cam = urb->context; struct zc0301_frame_t** f; diff --git a/linux/drivers/media/video/zoran_device.c b/linux/drivers/media/video/zoran_device.c index 57fd910f2..72d1e5f14 100644 --- a/linux/drivers/media/video/zoran_device.c +++ b/linux/drivers/media/video/zoran_device.c @@ -1409,15 +1409,19 @@ error_handler (struct zoran *zr, irqreturn_t zoran_irq (int irq, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) void *dev_id, struct pt_regs *regs) +#else + void *dev_id) +#endif { u32 stat, astat; int count; struct zoran *zr; unsigned long flags; - zr = (struct zoran *) dev_id; + zr = dev_id; count = 0; if (zr->testing) { diff --git a/linux/drivers/media/video/zoran_device.h b/linux/drivers/media/video/zoran_device.h index f19705cbd..c46d1b076 100644 --- a/linux/drivers/media/video/zoran_device.h +++ b/linux/drivers/media/video/zoran_device.h @@ -64,9 +64,13 @@ extern int wait_grab_pending(struct zoran *zr); /* interrupts */ extern void print_interrupts(struct zoran *zr); extern void clear_interrupt_counters(struct zoran *zr); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) extern irqreturn_t zoran_irq(int irq, void *dev_id, struct pt_regs *regs); +#else +extern irqreturn_t zoran_irq(int irq, void *dev_id); +#endif /* JPEG codec access */ extern void jpeg_start(struct zoran *zr); diff --git a/linux/drivers/media/video/zr36120.c b/linux/drivers/media/video/zr36120.c index b5ffe53c4..3d0b1fe18 100644 --- a/linux/drivers/media/video/zr36120.c +++ b/linux/drivers/media/video/zr36120.c @@ -335,13 +335,21 @@ DEBUG(printk(CARD_DEBUG "turning off\n",CARD)); } static +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) void zoran_irq(int irq, void *dev_id, struct pt_regs * regs) +#else +void zoran_irq(int irq, void *dev_id) +#endif { u32 stat,estat; int count = 0; struct zoran *ztv = dev_id; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) UNUSED(irq); UNUSED(regs); +#else + UNUSED(irq); +#endif for (;;) { /* get/clear interrupt status bits */ stat=zrread(ZORAN_ISR); |