aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/Kconfig1
-rw-r--r--drivers/media/common/saa7146_core.c2
-rw-r--r--drivers/media/dvb/b2c2/flexcop-pci.c2
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.c2
-rw-r--r--drivers/media/dvb/bt8xx/bt878.c2
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c4
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c4
-rw-r--r--drivers/media/dvb/dvb-core/Kconfig2
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig1
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-common.c11
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb.h2
-rw-r--r--drivers/media/dvb/dvb-usb/nova-t-usb2.c3
-rw-r--r--drivers/media/dvb/dvb-usb/usb-urb.c7
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c2
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.h3
-rw-r--r--drivers/media/dvb/frontends/tda10086.h9
-rw-r--r--drivers/media/dvb/frontends/tda826x.h19
-rw-r--r--drivers/media/dvb/pluto2/pluto2.c2
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c2
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c4
-rw-r--r--drivers/media/radio/radio-gemtek-pci.c2
-rw-r--r--drivers/media/video/Kconfig2
-rw-r--r--drivers/media/video/arv.c2
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c2
-rw-r--r--drivers/media/video/cpia2/cpia2_usb.c4
-rw-r--r--drivers/media/video/cpia_usb.c2
-rw-r--r--drivers/media/video/cx25840/cx25840-vbi.c25
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c2
-rw-r--r--drivers/media/video/cx88/cx88-cards.c21
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c17
-rw-r--r--drivers/media/video/cx88/cx88-input.c2
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c2
-rw-r--r--drivers/media/video/cx88/cx88-video.c2
-rw-r--r--drivers/media/video/dabusb.c2
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c6
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c2
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c39
-rw-r--r--drivers/media/video/meye.c2
-rw-r--r--drivers/media/video/ov511.c60
-rw-r--r--drivers/media/video/planb.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-io.c2
-rw-r--r--drivers/media/video/pwc/pwc-if.c43
-rw-r--r--drivers/media/video/saa7115.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c35
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c44
-rw-r--r--drivers/media/video/saa7134/saa7134-oss.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c93
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c66
-rw-r--r--drivers/media/video/saa7134/saa7134.h2
-rw-r--r--drivers/media/video/se401.c4
-rw-r--r--drivers/media/video/sn9c102/sn9c102_core.c73
-rw-r--r--drivers/media/video/stradis.c2
-rw-r--r--drivers/media/video/stv680.c55
-rw-r--r--drivers/media/video/tuner-types.c1
-rw-r--r--drivers/media/video/tveeprom.c4
-rw-r--r--drivers/media/video/usbvideo/konicawc.c2
-rw-r--r--drivers/media/video/usbvideo/quickcam_messenger.c4
-rw-r--r--drivers/media/video/usbvideo/usbvideo.c2
-rw-r--r--drivers/media/video/videodev.c16
-rw-r--r--drivers/media/video/vino.c2
-rw-r--r--drivers/media/video/vivi.c12
-rw-r--r--drivers/media/video/w9968cf.c4
-rw-r--r--drivers/media/video/zc0301/zc0301_core.c2
-rw-r--r--drivers/media/video/zoran_card.c10
-rw-r--r--drivers/media/video/zoran_device.c5
-rw-r--r--drivers/media/video/zoran_device.h4
-rw-r--r--drivers/media/video/zr36120.c25
70 files changed, 595 insertions, 213 deletions
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index ed4aa4e7912c..9f7e1fe8c97e 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -54,6 +54,7 @@ config VIDEO_V4L1_COMPAT
54 54
55config VIDEO_V4L2 55config VIDEO_V4L2
56 bool 56 bool
57 depends on VIDEO_DEV
57 default y 58 default y
58 59
59source "drivers/media/video/Kconfig" 60source "drivers/media/video/Kconfig"
diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c
index b88451e33c09..86cbdbcf9d7d 100644
--- a/drivers/media/common/saa7146_core.c
+++ b/drivers/media/common/saa7146_core.c
@@ -230,7 +230,7 @@ int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt
230 230
231/********************************************************************************/ 231/********************************************************************************/
232/* interrupt handler */ 232/* interrupt handler */
233static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) 233static irqreturn_t interrupt_hw(int irq, void *dev_id)
234{ 234{
235 struct saa7146_dev *dev = dev_id; 235 struct saa7146_dev *dev = dev_id;
236 u32 isr = 0; 236 u32 isr = 0;
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c
index eb2e6432c8c2..06893243f3d4 100644
--- a/drivers/media/dvb/b2c2/flexcop-pci.c
+++ b/drivers/media/dvb/b2c2/flexcop-pci.c
@@ -122,7 +122,7 @@ static void flexcop_pci_irq_check_work(void *data)
122/* When PID filtering is turned on, we use the timer IRQ, because small amounts 122/* When PID filtering is turned on, we use the timer IRQ, because small amounts
123 * of data need to be passed to the user space instantly as well. When PID 123 * of data need to be passed to the user space instantly as well. When PID
124 * filtering is turned off, we use the page-change-IRQ */ 124 * filtering is turned off, we use the page-change-IRQ */
125static irqreturn_t flexcop_pci_isr(int irq, void *dev_id, struct pt_regs *regs) 125static irqreturn_t flexcop_pci_isr(int irq, void *dev_id)
126{ 126{
127 struct flexcop_pci *fc_pci = dev_id; 127 struct flexcop_pci *fc_pci = dev_id;
128 struct flexcop_device *fc = fc_pci->fc_dev; 128 struct flexcop_device *fc = fc_pci->fc_dev;
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c
index 515954f96c9a..2853ea1bdaf1 100644
--- a/drivers/media/dvb/b2c2/flexcop-usb.c
+++ b/drivers/media/dvb/b2c2/flexcop-usb.c
@@ -328,7 +328,7 @@ static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb, u8 *buffer, in
328 fc_usb->tmp_buffer_length = l; 328 fc_usb->tmp_buffer_length = l;
329} 329}
330 330
331static void flexcop_usb_urb_complete(struct urb *urb, struct pt_regs *ptregs) 331static void flexcop_usb_urb_complete(struct urb *urb)
332{ 332{
333 struct flexcop_usb *fc_usb = urb->context; 333 struct flexcop_usb *fc_usb = urb->context;
334 int i; 334 int i;
diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c
index 755822ee6e9b..329a51c18562 100644
--- a/drivers/media/dvb/bt8xx/bt878.c
+++ b/drivers/media/dvb/bt8xx/bt878.c
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(bt878_stop);
266/* Interrupt service routine */ 266/* Interrupt service routine */
267/*****************************/ 267/*****************************/
268 268
269static irqreturn_t bt878_irq(int irq, void *dev_id, struct pt_regs *regs) 269static irqreturn_t bt878_irq(int irq, void *dev_id)
270{ 270{
271 u32 stat, astat, mask; 271 u32 stat, astat, mask;
272 int count; 272 int count;
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index fb6c4cc8477d..14e69a736eda 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
665 case BTTV_BOARD_TWINHAN_DST: 665 case BTTV_BOARD_TWINHAN_DST:
666 /* DST is not a frontend driver !!! */ 666 /* DST is not a frontend driver !!! */
667 state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL); 667 state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL);
668 if (!state) {
669 printk("dvb_bt8xx: No memory\n");
670 break;
671 }
668 /* Setup the Card */ 672 /* Setup the Card */
669 state->config = &dst_config; 673 state->config = &dst_config;
670 state->i2c = card->i2c_adapter; 674 state->i2c = card->i2c_adapter;
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index 410fa6d620ff..ff7d4f56ced3 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -238,7 +238,7 @@ static void cinergyt2_sleep (struct cinergyt2 *cinergyt2, int sleep)
238 cinergyt2->sleeping = sleep; 238 cinergyt2->sleeping = sleep;
239} 239}
240 240
241static void cinergyt2_stream_irq (struct urb *urb, struct pt_regs *regs); 241static void cinergyt2_stream_irq (struct urb *urb);
242 242
243static int cinergyt2_submit_stream_urb (struct cinergyt2 *cinergyt2, struct urb *urb) 243static int cinergyt2_submit_stream_urb (struct cinergyt2 *cinergyt2, struct urb *urb)
244{ 244{
@@ -258,7 +258,7 @@ static int cinergyt2_submit_stream_urb (struct cinergyt2 *cinergyt2, struct urb
258 return err; 258 return err;
259} 259}
260 260
261static void cinergyt2_stream_irq (struct urb *urb, struct pt_regs *regs) 261static void cinergyt2_stream_irq (struct urb *urb)
262{ 262{
263 struct cinergyt2 *cinergyt2 = urb->context; 263 struct cinergyt2 *cinergyt2 = urb->context;
264 264
diff --git a/drivers/media/dvb/dvb-core/Kconfig b/drivers/media/dvb/dvb-core/Kconfig
index e46eae3b9be2..1990eda10c46 100644
--- a/drivers/media/dvb/dvb-core/Kconfig
+++ b/drivers/media/dvb/dvb-core/Kconfig
@@ -19,6 +19,6 @@ config DVB_CORE_ATTACH
19 allow the card drivers to only load the frontend modules 19 allow the card drivers to only load the frontend modules
20 they require. This saves several KBytes of memory. 20 they require. This saves several KBytes of memory.
21 21
22 Note: You will need moudule-init-tools v3.2 or later for this feature. 22 Note: You will need module-init-tools v3.2 or later for this feature.
23 23
24 If unsure say Y. 24 If unsure say Y.
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index 67cefdd2334a..2cc5caa26a0a 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -69,7 +69,6 @@ config DVB_USB_DIBUSB_MC
69config DVB_USB_DIB0700 69config DVB_USB_DIB0700
70 tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)" 70 tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)"
71 depends on DVB_USB 71 depends on DVB_USB
72 select DVB_DIB7000M
73 select DVB_DIB3000MC 72 select DVB_DIB3000MC
74 select DVB_TUNER_MT2060 73 select DVB_TUNER_MT2060
75 help 74 help
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c
index fd3a9902f98d..5143e426d283 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-common.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-common.c
@@ -169,7 +169,7 @@ EXPORT_SYMBOL(dibusb_read_eeprom_byte);
169// Config Adjacent channels Perf -cal22 169// Config Adjacent channels Perf -cal22
170static struct dibx000_agc_config dib3000p_mt2060_agc_config = { 170static struct dibx000_agc_config dib3000p_mt2060_agc_config = {
171 .band_caps = BAND_VHF | BAND_UHF, 171 .band_caps = BAND_VHF | BAND_UHF,
172 .setup = (0 << 15) | (0 << 14) | (1 << 13) | (1 << 12) | (29 << 0), 172 .setup = (1 << 8) | (5 << 5) | (1 << 4) | (1 << 3) | (0 << 2) | (2 << 0),
173 173
174 .agc1_max = 48497, 174 .agc1_max = 48497,
175 .agc1_min = 23593, 175 .agc1_min = 23593,
@@ -196,10 +196,14 @@ static struct dib3000mc_config stk3000p_dib3000p_config = {
196 .ln_adc_level = 0x1cc7, 196 .ln_adc_level = 0x1cc7,
197 197
198 .output_mpeg2_in_188_bytes = 1, 198 .output_mpeg2_in_188_bytes = 1,
199
200 .agc_command1 = 1,
201 .agc_command2 = 1,
199}; 202};
200 203
201static struct dibx000_agc_config dib3000p_panasonic_agc_config = { 204static struct dibx000_agc_config dib3000p_panasonic_agc_config = {
202 .setup = (0 << 15) | (0 << 14) | (1 << 13) | (1 << 12) | (29 << 0), 205 .band_caps = BAND_VHF | BAND_UHF,
206 .setup = (1 << 8) | (5 << 5) | (1 << 4) | (1 << 3) | (0 << 2) | (2 << 0),
203 207
204 .agc1_max = 56361, 208 .agc1_max = 56361,
205 .agc1_min = 22282, 209 .agc1_min = 22282,
@@ -226,6 +230,9 @@ static struct dib3000mc_config mod3000p_dib3000p_config = {
226 .ln_adc_level = 0x1cc7, 230 .ln_adc_level = 0x1cc7,
227 231
228 .output_mpeg2_in_188_bytes = 1, 232 .output_mpeg2_in_188_bytes = 1,
233
234 .agc_command1 = 1,
235 .agc_command2 = 1,
229}; 236};
230 237
231int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap) 238int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap)
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h
index 5153fb943da1..b60781032742 100644
--- a/drivers/media/dvb/dvb-usb/dibusb.h
+++ b/drivers/media/dvb/dvb-usb/dibusb.h
@@ -99,7 +99,9 @@
99struct dibusb_state { 99struct dibusb_state {
100 struct dib_fe_xfer_ops ops; 100 struct dib_fe_xfer_ops ops;
101 int mt2060_present; 101 int mt2060_present;
102};
102 103
104struct dibusb_device_state {
103 /* for RC5 remote control */ 105 /* for RC5 remote control */
104 int old_toggle; 106 int old_toggle;
105 int last_repeat_count; 107 int last_repeat_count;
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
index a9219bf69b89..a58874c790b2 100644
--- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -75,7 +75,7 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
75 u8 key[5],cmd[2] = { DIBUSB_REQ_POLL_REMOTE, 0x35 }, data,toggle,custom; 75 u8 key[5],cmd[2] = { DIBUSB_REQ_POLL_REMOTE, 0x35 }, data,toggle,custom;
76 u16 raw; 76 u16 raw;
77 int i; 77 int i;
78 struct dibusb_state *st = d->priv; 78 struct dibusb_device_state *st = d->priv;
79 79
80 dvb_usb_generic_rw(d,cmd,2,key,5,0); 80 dvb_usb_generic_rw(d,cmd,2,key,5,0);
81 81
@@ -184,6 +184,7 @@ static struct dvb_usb_device_properties nova_t_properties = {
184 .size_of_priv = sizeof(struct dibusb_state), 184 .size_of_priv = sizeof(struct dibusb_state),
185 } 185 }
186 }, 186 },
187 .size_of_priv = sizeof(struct dibusb_device_state),
187 188
188 .power_ctrl = dibusb2_0_power_ctrl, 189 .power_ctrl = dibusb2_0_power_ctrl,
189 .read_mac_address = nova_t_read_mac_address, 190 .read_mac_address = nova_t_read_mac_address,
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index 8728cf347a71..78035ee824ca 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -11,7 +11,7 @@
11#include "dvb-usb-common.h" 11#include "dvb-usb-common.h"
12 12
13/* URB stuff for streaming */ 13/* URB stuff for streaming */
14static void usb_urb_complete(struct urb *urb, struct pt_regs *ptregs) 14static void usb_urb_complete(struct urb *urb)
15{ 15{
16 struct usb_data_stream *stream = urb->context; 16 struct usb_data_stream *stream = urb->context;
17 int ptype = usb_pipetype(urb->pipe); 17 int ptype = usb_pipetype(urb->pipe);
@@ -122,8 +122,9 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
122 usb_free_stream_buffers(stream); 122 usb_free_stream_buffers(stream);
123 return -ENOMEM; 123 return -ENOMEM;
124 } 124 }
125 deb_mem("buffer %d: %p (dma: %u)\n", 125 deb_mem("buffer %d: %p (dma: %Lu)\n",
126 stream->buf_num, stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]); 126 stream->buf_num,
127stream->buf_list[stream->buf_num], (long long)stream->dma_addr[stream->buf_num]);
127 memset(stream->buf_list[stream->buf_num],0,size); 128 memset(stream->buf_list[stream->buf_num],0,size);
128 stream->state |= USB_STATE_URB_BUF; 129 stream->state |= USB_STATE_URB_BUF;
129 } 130 }
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index ccc813b525d6..3561a777568c 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -345,7 +345,7 @@ static int dib3000mc_init(struct dvb_frontend *demod)
345 345
346 /* agc */ 346 /* agc */
347 dib3000mc_write_word(state, 36, state->cfg->max_time); 347 dib3000mc_write_word(state, 36, state->cfg->max_time);
348 dib3000mc_write_word(state, 37, agc->setup); 348 dib3000mc_write_word(state, 37, (state->cfg->agc_command1 << 13) | (state->cfg->agc_command2 << 12) | (0x1d << 0));
349 dib3000mc_write_word(state, 38, state->cfg->pwm3_value); 349 dib3000mc_write_word(state, 38, state->cfg->pwm3_value);
350 dib3000mc_write_word(state, 39, state->cfg->ln_adc_level); 350 dib3000mc_write_word(state, 39, state->cfg->ln_adc_level);
351 351
diff --git a/drivers/media/dvb/frontends/dib3000mc.h b/drivers/media/dvb/frontends/dib3000mc.h
index b198cd5b1843..0d6fdef77538 100644
--- a/drivers/media/dvb/frontends/dib3000mc.h
+++ b/drivers/media/dvb/frontends/dib3000mc.h
@@ -28,6 +28,9 @@ struct dib3000mc_config {
28 u16 max_time; 28 u16 max_time;
29 u16 ln_adc_level; 29 u16 ln_adc_level;
30 30
31 u8 agc_command1 :1;
32 u8 agc_command2 :1;
33
31 u8 mobile_mode; 34 u8 mobile_mode;
32 35
33 u8 output_mpeg2_in_188_bytes; 36 u8 output_mpeg2_in_188_bytes;
diff --git a/drivers/media/dvb/frontends/tda10086.h b/drivers/media/dvb/frontends/tda10086.h
index e8061db11123..18457adee30b 100644
--- a/drivers/media/dvb/frontends/tda10086.h
+++ b/drivers/media/dvb/frontends/tda10086.h
@@ -35,7 +35,16 @@ struct tda10086_config
35 u8 invert; 35 u8 invert;
36}; 36};
37 37
38#if defined(CONFIG_DVB_TDA10086) || defined(CONFIG_DVB_TDA10086_MODULE)
38extern struct dvb_frontend* tda10086_attach(const struct tda10086_config* config, 39extern struct dvb_frontend* tda10086_attach(const struct tda10086_config* config,
39 struct i2c_adapter* i2c); 40 struct i2c_adapter* i2c);
41#else
42static inline struct dvb_frontend* tda10086_attach(const struct tda10086_config* config,
43 struct i2c_adapter* i2c)
44{
45 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
46 return NULL;
47}
48#endif // CONFIG_DVB_TDA10086
40 49
41#endif // TDA10086_H 50#endif // TDA10086_H
diff --git a/drivers/media/dvb/frontends/tda826x.h b/drivers/media/dvb/frontends/tda826x.h
index 3307607632b0..83998c001196 100644
--- a/drivers/media/dvb/frontends/tda826x.h
+++ b/drivers/media/dvb/frontends/tda826x.h
@@ -35,6 +35,19 @@
35 * @param has_loopthrough Set to 1 if the card has a loopthrough RF connector. 35 * @param has_loopthrough Set to 1 if the card has a loopthrough RF connector.
36 * @return FE pointer on success, NULL on failure. 36 * @return FE pointer on success, NULL on failure.
37 */ 37 */
38extern struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c, int has_loopthrough); 38#if defined(CONFIG_DVB_TDA826X) || defined(CONFIG_DVB_TDA826X_MODULE)
39 39extern struct dvb_frontend* tda826x_attach(struct dvb_frontend *fe, int addr,
40#endif 40 struct i2c_adapter *i2c,
41 int has_loopthrough);
42#else
43static inline struct dvb_frontend* tda826x_attach(struct dvb_frontend *fe,
44 int addr,
45 struct i2c_adapter *i2c,
46 int has_loopthrough)
47{
48 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
49 return NULL;
50}
51#endif // CONFIG_DVB_TDA826X
52
53#endif // __DVB_TDA826X_H__
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c
index 2310b2bfed4e..8e4ce101eb22 100644
--- a/drivers/media/dvb/pluto2/pluto2.c
+++ b/drivers/media/dvb/pluto2/pluto2.c
@@ -306,7 +306,7 @@ static void pluto_dma_end(struct pluto *pluto, unsigned int nbpackets)
306 TS_DMA_BYTES, PCI_DMA_FROMDEVICE); 306 TS_DMA_BYTES, PCI_DMA_FROMDEVICE);
307} 307}
308 308
309static irqreturn_t pluto_irq(int irq, void *dev_id, struct pt_regs *regs) 309static irqreturn_t pluto_irq(int irq, void *dev_id)
310{ 310{
311 struct pluto *pluto = dev_id; 311 struct pluto *pluto = dev_id;
312 u32 tscr; 312 u32 tscr;
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 234199875f53..60820deb900b 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -732,7 +732,7 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
732 } 732 }
733} 733}
734 734
735static void ttusb_iso_irq(struct urb *urb, struct pt_regs *ptregs) 735static void ttusb_iso_irq(struct urb *urb)
736{ 736{
737 struct ttusb *ttusb = urb->context; 737 struct ttusb *ttusb = urb->context;
738 738
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index de077a757192..a1c9fa9919ea 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -203,7 +203,7 @@ static u16 rc_keys[] = {
203static void ttusb_dec_set_model(struct ttusb_dec *dec, 203static void ttusb_dec_set_model(struct ttusb_dec *dec,
204 enum ttusb_dec_model model); 204 enum ttusb_dec_model model);
205 205
206static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs) 206static void ttusb_dec_handle_irq( struct urb *urb)
207{ 207{
208 struct ttusb_dec * dec = urb->context; 208 struct ttusb_dec * dec = urb->context;
209 char *buffer = dec->irq_buffer; 209 char *buffer = dec->irq_buffer;
@@ -755,7 +755,7 @@ static void ttusb_dec_process_urb_frame_list(unsigned long data)
755 } 755 }
756} 756}
757 757
758static void ttusb_dec_process_urb(struct urb *urb, struct pt_regs *ptregs) 758static void ttusb_dec_process_urb(struct urb *urb)
759{ 759{
760 struct ttusb_dec *dec = urb->context; 760 struct ttusb_dec *dec = urb->context;
761 761
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
index cfab57d6bc4a..eb14106f66fa 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -449,7 +449,7 @@ static int __init gemtek_pci_init_module( void )
449 449
450static void __exit gemtek_pci_cleanup_module( void ) 450static void __exit gemtek_pci_cleanup_module( void )
451{ 451{
452 return pci_unregister_driver( &gemtek_pci_driver ); 452 pci_unregister_driver(&gemtek_pci_driver);
453} 453}
454 454
455MODULE_AUTHOR( "Vladimir Shebordaev <vshebordaev@mail.ru>" ); 455MODULE_AUTHOR( "Vladimir Shebordaev <vshebordaev@mail.ru>" );
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index afb734df6e05..fbe5b6168cc2 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -677,6 +677,8 @@ config VIDEO_M32R_AR_M64278
677menu "V4L USB devices" 677menu "V4L USB devices"
678 depends on USB && VIDEO_DEV 678 depends on USB && VIDEO_DEV
679 679
680source "drivers/media/video/pvrusb2/Kconfig"
681
680source "drivers/media/video/em28xx/Kconfig" 682source "drivers/media/video/em28xx/Kconfig"
681 683
682source "drivers/media/video/usbvideo/Kconfig" 684source "drivers/media/video/usbvideo/Kconfig"
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index 5c5e682a3004..4861799eb430 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -549,7 +549,7 @@ static int ar_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
549/* 549/*
550 * Interrupt handler 550 * Interrupt handler
551 */ 551 */
552static void ar_interrupt(int irq, void *dev, struct pt_regs *regs) 552static void ar_interrupt(int irq, void *dev)
553{ 553{
554 struct ar_device *ar = dev; 554 struct ar_device *ar = dev;
555 unsigned int line_count; 555 unsigned int line_count;
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 50dde82844ec..6e1ddad9f0c1 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3753,7 +3753,7 @@ bttv_irq_switch_vbi(struct bttv *btv)
3753 spin_unlock(&btv->s_lock); 3753 spin_unlock(&btv->s_lock);
3754} 3754}
3755 3755
3756static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs) 3756static irqreturn_t bttv_irq(int irq, void *dev_id)
3757{ 3757{
3758 u32 stat,astat; 3758 u32 stat,astat;
3759 u32 dstat; 3759 u32 dstat;
diff --git a/drivers/media/video/cpia2/cpia2_usb.c b/drivers/media/video/cpia2/cpia2_usb.c
index f4da02941493..28dc6a1a1e43 100644
--- a/drivers/media/video/cpia2/cpia2_usb.c
+++ b/drivers/media/video/cpia2/cpia2_usb.c
@@ -49,7 +49,7 @@ static int frame_sizes[] = {
49#define FRAME_SIZE_PER_DESC frame_sizes[cam->cur_alt] 49#define FRAME_SIZE_PER_DESC frame_sizes[cam->cur_alt]
50 50
51static void process_frame(struct camera_data *cam); 51static void process_frame(struct camera_data *cam);
52static void cpia2_usb_complete(struct urb *urb, struct pt_regs *); 52static void cpia2_usb_complete(struct urb *urb);
53static int cpia2_usb_probe(struct usb_interface *intf, 53static int cpia2_usb_probe(struct usb_interface *intf,
54 const struct usb_device_id *id); 54 const struct usb_device_id *id);
55static void cpia2_usb_disconnect(struct usb_interface *intf); 55static void cpia2_usb_disconnect(struct usb_interface *intf);
@@ -199,7 +199,7 @@ static void add_COM(struct camera_data *cam)
199 * 199 *
200 * callback when incoming packet is received 200 * callback when incoming packet is received
201 *****************************************************************************/ 201 *****************************************************************************/
202static void cpia2_usb_complete(struct urb *urb, struct pt_regs *regs) 202static void cpia2_usb_complete(struct urb *urb)
203{ 203{
204 int i; 204 int i;
205 unsigned char *cdata; 205 unsigned char *cdata;
diff --git a/drivers/media/video/cpia_usb.c b/drivers/media/video/cpia_usb.c
index 2ee34a3b9280..9da4726eb9b9 100644
--- a/drivers/media/video/cpia_usb.c
+++ b/drivers/media/video/cpia_usb.c
@@ -109,7 +109,7 @@ static struct cpia_camera_ops cpia_usb_ops = {
109static LIST_HEAD(cam_list); 109static LIST_HEAD(cam_list);
110static spinlock_t cam_list_lock_usb; 110static spinlock_t cam_list_lock_usb;
111 111
112static void cpia_usb_complete(struct urb *urb, struct pt_regs *regs) 112static void cpia_usb_complete(struct urb *urb)
113{ 113{
114 int i; 114 int i;
115 char *cdata; 115 char *cdata;
diff --git a/drivers/media/video/cx25840/cx25840-vbi.c b/drivers/media/video/cx25840/cx25840-vbi.c
index 48014a254e15..f85f2084324f 100644
--- a/drivers/media/video/cx25840/cx25840-vbi.c
+++ b/drivers/media/video/cx25840/cx25840-vbi.c
@@ -235,6 +235,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
235 0, 0, V4L2_SLICED_VPS, 0, 0, /* 9 */ 235 0, 0, V4L2_SLICED_VPS, 0, 0, /* 9 */
236 0, 0, 0, 0 236 0, 0, 0, 0
237 }; 237 };
238 int is_pal = !(cx25840_get_v4lstd(client) & V4L2_STD_525_60);
238 int i; 239 int i;
239 240
240 fmt = arg; 241 fmt = arg;
@@ -246,13 +247,25 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
246 if ((cx25840_read(client, 0x404) & 0x10) == 0) 247 if ((cx25840_read(client, 0x404) & 0x10) == 0)
247 break; 248 break;
248 249
249 for (i = 7; i <= 23; i++) { 250 if (is_pal) {
250 u8 v = cx25840_read(client, 0x424 + i - 7); 251 for (i = 7; i <= 23; i++) {
252 u8 v = cx25840_read(client, 0x424 + i - 7);
253
254 svbi->service_lines[0][i] = lcr2vbi[v >> 4];
255 svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
256 svbi->service_set |=
257 svbi->service_lines[0][i] | svbi->service_lines[1][i];
258 }
259 }
260 else {
261 for (i = 10; i <= 21; i++) {
262 u8 v = cx25840_read(client, 0x424 + i - 10);
251 263
252 svbi->service_lines[0][i] = lcr2vbi[v >> 4]; 264 svbi->service_lines[0][i] = lcr2vbi[v >> 4];
253 svbi->service_lines[1][i] = lcr2vbi[v & 0xf]; 265 svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
254 svbi->service_set |= 266 svbi->service_set |=
255 svbi->service_lines[0][i] | svbi->service_lines[1][i]; 267 svbi->service_lines[0][i] | svbi->service_lines[1][i];
268 }
256 } 269 }
257 break; 270 break;
258 } 271 }
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index f0340662e078..e4355fdc3b6d 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -262,7 +262,7 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip)
262/* 262/*
263 * BOARD Specific: Handles IRQ calls 263 * BOARD Specific: Handles IRQ calls
264 */ 264 */
265static irqreturn_t cx8801_irq(int irq, void *dev_id, struct pt_regs *regs) 265static irqreturn_t cx8801_irq(int irq, void *dev_id)
266{ 266{
267 snd_cx88_card_t *chip = dev_id; 267 snd_cx88_card_t *chip = dev_id;
268 struct cx88_core *core = chip->core; 268 struct cx88_core *core = chip->core;
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index af71d4225c76..f764a57c56be 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1230,6 +1230,7 @@ struct cx88_board cx88_boards[] = {
1230 .vmux = 2, 1230 .vmux = 2,
1231 .gpio0 = 0x84bf, 1231 .gpio0 = 0x84bf,
1232 }}, 1232 }},
1233 .mpeg = CX88_MPEG_DVB,
1233 }, 1234 },
1234 [CX88_BOARD_NORWOOD_MICRO] = { 1235 [CX88_BOARD_NORWOOD_MICRO] = {
1235 .name = "Norwood Micro TV Tuner", 1236 .name = "Norwood Micro TV Tuner",
@@ -1590,6 +1591,18 @@ struct cx88_subid cx88_subids[] = {
1590 .subvendor = 0x0070, 1591 .subvendor = 0x0070,
1591 .subdevice = 0x9000, 1592 .subdevice = 0x9000,
1592 .card = CX88_BOARD_HAUPPAUGE_DVB_T1, 1593 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
1594 },{
1595 .subvendor = 0x0070,
1596 .subdevice = 0x1400,
1597 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1598 },{
1599 .subvendor = 0x0070,
1600 .subdevice = 0x1401,
1601 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1602 },{
1603 .subvendor = 0x0070,
1604 .subdevice = 0x1402,
1605 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1593 }, 1606 },
1594}; 1607};
1595const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); 1608const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
@@ -1633,7 +1646,15 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
1633 /* Make sure we support the board model */ 1646 /* Make sure we support the board model */
1634 switch (tv.model) 1647 switch (tv.model)
1635 { 1648 {
1649 case 14009: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in) */
1650 case 14019: /* WinTV-HVR3000 (Retail, IR Blaster, b/panel video, 3.5mm audio in) */
1651 case 14029: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge) */
1652 case 14109: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - low profile) */
1653 case 14129: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge - LP) */
1654 case 14559: /* WinTV-HVR3000 (OEM, no IR, b/panel video, 3.5mm audio in) */
1636 case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */ 1655 case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
1656 case 14659: /* WinTV-HVR3000 (OEM, no IR, b/panel video, RCA audio in - Low profile) */
1657 case 14669: /* WinTV-HVR3000 (OEM, no IR, no b/panel video - Low profile) */
1637 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */ 1658 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
1638 case 34519: /* WinTV-PCI-FM */ 1659 case 34519: /* WinTV-PCI-FM */
1639 case 90002: /* Nova-T-PCI (9002) */ 1660 case 90002: /* Nova-T-PCI (9002) */
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index bd0c8797f26d..0ef13e7efa2e 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -315,15 +315,22 @@ static struct cx22702_config hauppauge_novat_config = {
315 .demod_address = 0x43, 315 .demod_address = 0x43,
316 .output_mode = CX22702_SERIAL_OUTPUT, 316 .output_mode = CX22702_SERIAL_OUTPUT,
317}; 317};
318
318static struct cx22702_config hauppauge_hvr1100_config = { 319static struct cx22702_config hauppauge_hvr1100_config = {
319 .demod_address = 0x63, 320 .demod_address = 0x63,
320 .output_mode = CX22702_SERIAL_OUTPUT, 321 .output_mode = CX22702_SERIAL_OUTPUT,
321}; 322};
323
322static struct cx22702_config hauppauge_hvr1300_config = { 324static struct cx22702_config hauppauge_hvr1300_config = {
323 .demod_address = 0x63, 325 .demod_address = 0x63,
324 .output_mode = CX22702_SERIAL_OUTPUT, 326 .output_mode = CX22702_SERIAL_OUTPUT,
325}; 327};
326 328
329static struct cx22702_config hauppauge_hvr3000_config = {
330 .demod_address = 0x63,
331 .output_mode = CX22702_SERIAL_OUTPUT,
332};
333
327static int or51132_set_ts_param(struct dvb_frontend* fe, 334static int or51132_set_ts_param(struct dvb_frontend* fe,
328 int is_punctured) 335 int is_punctured)
329{ 336{
@@ -558,6 +565,16 @@ static int dvb_register(struct cx8802_dev *dev)
558 &dvb_pll_fmd1216me); 565 &dvb_pll_fmd1216me);
559 } 566 }
560 break; 567 break;
568 case CX88_BOARD_HAUPPAUGE_HVR3000:
569 dev->dvb.frontend = dvb_attach(cx22702_attach,
570 &hauppauge_hvr3000_config,
571 &dev->core->i2c_adap);
572 if (dev->dvb.frontend != NULL) {
573 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
574 &dev->core->i2c_adap,
575 &dvb_pll_fmd1216me);
576 }
577 break;
561 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: 578 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
562 dev->dvb.frontend = dvb_attach(mt352_attach, 579 dev->dvb.frontend = dvb_attach(mt352_attach,
563 &dvico_fusionhdtv, 580 &dvico_fusionhdtv,
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 83ebf7a3c054..ee48995a4ab5 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -196,6 +196,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
196 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: 196 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
197 case CX88_BOARD_HAUPPAUGE_HVR1100: 197 case CX88_BOARD_HAUPPAUGE_HVR1100:
198 case CX88_BOARD_HAUPPAUGE_HVR1300: 198 case CX88_BOARD_HAUPPAUGE_HVR1300:
199 case CX88_BOARD_HAUPPAUGE_HVR3000:
199 ir_codes = ir_codes_hauppauge_new; 200 ir_codes = ir_codes_hauppauge_new;
200 ir_type = IR_TYPE_RC5; 201 ir_type = IR_TYPE_RC5;
201 ir->sampling = 1; 202 ir->sampling = 1;
@@ -419,6 +420,7 @@ void cx88_ir_irq(struct cx88_core *core)
419 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: 420 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
420 case CX88_BOARD_HAUPPAUGE_HVR1100: 421 case CX88_BOARD_HAUPPAUGE_HVR1100:
421 case CX88_BOARD_HAUPPAUGE_HVR1300: 422 case CX88_BOARD_HAUPPAUGE_HVR1300:
423 case CX88_BOARD_HAUPPAUGE_HVR3000:
422 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); 424 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
423 ir_dprintk("biphase decoded: %x\n", ircode); 425 ir_dprintk("biphase decoded: %x\n", ircode);
424 if ((ircode & 0xfffff000) != 0x3000) 426 if ((ircode & 0xfffff000) != 0x3000)
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index d6d980774c21..6b23a4e6f66d 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -376,7 +376,7 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
376 376
377#define MAX_IRQ_LOOP 10 377#define MAX_IRQ_LOOP 10
378 378
379static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) 379static irqreturn_t cx8802_irq(int irq, void *dev_id)
380{ 380{
381 struct cx8802_dev *dev = dev_id; 381 struct cx8802_dev *dev = dev_id;
382 struct cx88_core *core = dev->core; 382 struct cx88_core *core = dev->core;
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index cb0c0eea20f9..90e298d074d1 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1744,7 +1744,7 @@ static void cx8800_vid_irq(struct cx8800_dev *dev)
1744 } 1744 }
1745} 1745}
1746 1746
1747static irqreturn_t cx8800_irq(int irq, void *dev_id, struct pt_regs *regs) 1747static irqreturn_t cx8800_irq(int irq, void *dev_id)
1748{ 1748{
1749 struct cx8800_dev *dev = dev_id; 1749 struct cx8800_dev *dev = dev_id;
1750 struct cx88_core *core = dev->core; 1750 struct cx88_core *core = dev->core;
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c
index b9ba95f5e026..b1012e92ee04 100644
--- a/drivers/media/video/dabusb.c
+++ b/drivers/media/video/dabusb.c
@@ -166,7 +166,7 @@ static int dabusb_free_buffers (pdabusb_t s)
166 return 0; 166 return 0;
167} 167}
168/*-------------------------------------------------------------------*/ 168/*-------------------------------------------------------------------*/
169static void dabusb_iso_complete (struct urb *purb, struct pt_regs *regs) 169static void dabusb_iso_complete (struct urb *purb)
170{ 170{
171 pbuff_t b = purb->context; 171 pbuff_t b = purb->context;
172 pdabusb_t s = b->s; 172 pdabusb_t s = b->s;
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index 4350cc75b025..255a47dfb84f 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -382,7 +382,7 @@ int em28xx_resolution_set(struct em28xx *dev)
382/******************* isoc transfer handling ****************************/ 382/******************* isoc transfer handling ****************************/
383 383
384#ifdef ENABLE_DEBUG_ISOC_FRAMES 384#ifdef ENABLE_DEBUG_ISOC_FRAMES
385static void em28xx_isoc_dump(struct urb *urb, struct pt_regs *regs) 385static void em28xx_isoc_dump(struct urb *urb)
386{ 386{
387 int len = 0; 387 int len = 0;
388 int ntrans = 0; 388 int ntrans = 0;
@@ -534,7 +534,7 @@ static inline void em28xx_isoc_video_copy(struct em28xx *dev,
534 * em28xx_isoIrq() 534 * em28xx_isoIrq()
535 * handles the incoming isoc urbs and fills the frames from our inqueue 535 * handles the incoming isoc urbs and fills the frames from our inqueue
536 */ 536 */
537static void em28xx_isocIrq(struct urb *urb, struct pt_regs *regs) 537static void em28xx_isocIrq(struct urb *urb)
538{ 538{
539 struct em28xx *dev = urb->context; 539 struct em28xx *dev = urb->context;
540 int i, status; 540 int i, status;
@@ -545,7 +545,7 @@ static void em28xx_isocIrq(struct urb *urb, struct pt_regs *regs)
545 return; 545 return;
546#ifdef ENABLE_DEBUG_ISOC_FRAMES 546#ifdef ENABLE_DEBUG_ISOC_FRAMES
547 if (isoc_debug>1) 547 if (isoc_debug>1)
548 em28xx_isoc_dump(urb, regs); 548 em28xx_isoc_dump(urb);
549#endif 549#endif
550 550
551 if (urb->status == -ENOENT) 551 if (urb->status == -ENOENT)
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 20df657b70c8..2a461dde480c 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -174,7 +174,7 @@ static void em28xx_config_i2c(struct em28xx *dev)
174 174
175 route.input = INPUT(dev->ctl_input)->vmux; 175 route.input = INPUT(dev->ctl_input)->vmux;
176 route.output = 0; 176 route.output = 0;
177 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, 0); 177 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL);
178 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); 178 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
179 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL); 179 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL);
180 180
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index 8992b6e62b9f..f786ab11d2cd 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -398,7 +398,7 @@ int et61x251_i2c_write(struct et61x251_device* cam, u8 address, u8 value)
398 398
399/*****************************************************************************/ 399/*****************************************************************************/
400 400
401static void et61x251_urb_complete(struct urb *urb, struct pt_regs* regs) 401static void et61x251_urb_complete(struct urb *urb)
402{ 402{
403 struct et61x251_device* cam = urb->context; 403 struct et61x251_device* cam = urb->context;
404 struct et61x251_frame_t** f; 404 struct et61x251_frame_t** f;
@@ -973,16 +973,32 @@ static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
973 et61x251_show_i2c_val, et61x251_store_i2c_val); 973 et61x251_show_i2c_val, et61x251_store_i2c_val);
974 974
975 975
976static void et61x251_create_sysfs(struct et61x251_device* cam) 976static int et61x251_create_sysfs(struct et61x251_device* cam)
977{ 977{
978 struct video_device *v4ldev = cam->v4ldev; 978 struct video_device *v4ldev = cam->v4ldev;
979 int rc;
979 980
980 video_device_create_file(v4ldev, &class_device_attr_reg); 981 rc = video_device_create_file(v4ldev, &class_device_attr_reg);
981 video_device_create_file(v4ldev, &class_device_attr_val); 982 if (rc) goto err;
983 rc = video_device_create_file(v4ldev, &class_device_attr_val);
984 if (rc) goto err_reg;
982 if (cam->sensor.sysfs_ops) { 985 if (cam->sensor.sysfs_ops) {
983 video_device_create_file(v4ldev, &class_device_attr_i2c_reg); 986 rc = video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
984 video_device_create_file(v4ldev, &class_device_attr_i2c_val); 987 if (rc) goto err_val;
988 rc = video_device_create_file(v4ldev, &class_device_attr_i2c_val);
989 if (rc) goto err_i2c_reg;
985 } 990 }
991
992 return 0;
993
994err_i2c_reg:
995 video_device_remove_file(v4ldev, &class_device_attr_i2c_reg);
996err_val:
997 video_device_remove_file(v4ldev, &class_device_attr_val);
998err_reg:
999 video_device_remove_file(v4ldev, &class_device_attr_reg);
1000err:
1001 return rc;
986} 1002}
987#endif /* CONFIG_VIDEO_ADV_DEBUG */ 1003#endif /* CONFIG_VIDEO_ADV_DEBUG */
988 1004
@@ -2534,7 +2550,9 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2534 dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0; 2550 dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0;
2535 2551
2536#ifdef CONFIG_VIDEO_ADV_DEBUG 2552#ifdef CONFIG_VIDEO_ADV_DEBUG
2537 et61x251_create_sysfs(cam); 2553 err = et61x251_create_sysfs(cam);
2554 if (err)
2555 goto fail2;
2538 DBG(2, "Optional device control through 'sysfs' interface ready"); 2556 DBG(2, "Optional device control through 'sysfs' interface ready");
2539#endif 2557#endif
2540 2558
@@ -2544,6 +2562,13 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2544 2562
2545 return 0; 2563 return 0;
2546 2564
2565#ifdef CONFIG_VIDEO_ADV_DEBUG
2566fail2:
2567 video_nr[dev_nr] = -1;
2568 dev_nr = (dev_nr < ET61X251_MAX_DEVICES-1) ? dev_nr+1 : 0;
2569 mutex_unlock(&cam->dev_mutex);
2570 video_unregister_device(cam->v4ldev);
2571#endif
2547fail: 2572fail:
2548 if (cam) { 2573 if (cam) {
2549 kfree(cam->control_buffer); 2574 kfree(cam->control_buffer);
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index e278753f8f25..b083338823df 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -786,7 +786,7 @@ static void mchip_cont_compression_start(void)
786/* Interrupt handling */ 786/* Interrupt handling */
787/****************************************************************************/ 787/****************************************************************************/
788 788
789static irqreturn_t meye_irq(int irq, void *dev_id, struct pt_regs *regs) 789static irqreturn_t meye_irq(int irq, void *dev_id)
790{ 790{
791 u32 v; 791 u32 v;
792 int reqnr; 792 int reqnr;
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index 5d8cd283fcd8..b4db2cbb5a84 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -3503,7 +3503,7 @@ check_middle:
3503} 3503}
3504 3504
3505static void 3505static void
3506ov51x_isoc_irq(struct urb *urb, struct pt_regs *regs) 3506ov51x_isoc_irq(struct urb *urb)
3507{ 3507{
3508 int i; 3508 int i;
3509 struct usb_ov511 *ov; 3509 struct usb_ov511 *ov;
@@ -5648,17 +5648,49 @@ static ssize_t show_exposure(struct class_device *cd, char *buf)
5648} 5648}
5649static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL); 5649static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL);
5650 5650
5651static void ov_create_sysfs(struct video_device *vdev) 5651static int ov_create_sysfs(struct video_device *vdev)
5652{ 5652{
5653 video_device_create_file(vdev, &class_device_attr_custom_id); 5653 int rc;
5654 video_device_create_file(vdev, &class_device_attr_model); 5654
5655 video_device_create_file(vdev, &class_device_attr_bridge); 5655 rc = video_device_create_file(vdev, &class_device_attr_custom_id);
5656 video_device_create_file(vdev, &class_device_attr_sensor); 5656 if (rc) goto err;
5657 video_device_create_file(vdev, &class_device_attr_brightness); 5657 rc = video_device_create_file(vdev, &class_device_attr_model);
5658 video_device_create_file(vdev, &class_device_attr_saturation); 5658 if (rc) goto err_id;
5659 video_device_create_file(vdev, &class_device_attr_contrast); 5659 rc = video_device_create_file(vdev, &class_device_attr_bridge);
5660 video_device_create_file(vdev, &class_device_attr_hue); 5660 if (rc) goto err_model;
5661 video_device_create_file(vdev, &class_device_attr_exposure); 5661 rc = video_device_create_file(vdev, &class_device_attr_sensor);
5662 if (rc) goto err_bridge;
5663 rc = video_device_create_file(vdev, &class_device_attr_brightness);
5664 if (rc) goto err_sensor;
5665 rc = video_device_create_file(vdev, &class_device_attr_saturation);
5666 if (rc) goto err_bright;
5667 rc = video_device_create_file(vdev, &class_device_attr_contrast);
5668 if (rc) goto err_sat;
5669 rc = video_device_create_file(vdev, &class_device_attr_hue);
5670 if (rc) goto err_contrast;
5671 rc = video_device_create_file(vdev, &class_device_attr_exposure);
5672 if (rc) goto err_hue;
5673
5674 return 0;
5675
5676err_hue:
5677 video_device_remove_file(vdev, &class_device_attr_hue);
5678err_contrast:
5679 video_device_remove_file(vdev, &class_device_attr_contrast);
5680err_sat:
5681 video_device_remove_file(vdev, &class_device_attr_saturation);
5682err_bright:
5683 video_device_remove_file(vdev, &class_device_attr_brightness);
5684err_sensor:
5685 video_device_remove_file(vdev, &class_device_attr_sensor);
5686err_bridge:
5687 video_device_remove_file(vdev, &class_device_attr_bridge);
5688err_model:
5689 video_device_remove_file(vdev, &class_device_attr_model);
5690err_id:
5691 video_device_remove_file(vdev, &class_device_attr_custom_id);
5692err:
5693 return rc;
5662} 5694}
5663 5695
5664/**************************************************************************** 5696/****************************************************************************
@@ -5817,7 +5849,11 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id)
5817 ov->vdev->minor); 5849 ov->vdev->minor);
5818 5850
5819 usb_set_intfdata(intf, ov); 5851 usb_set_intfdata(intf, ov);
5820 ov_create_sysfs(ov->vdev); 5852 if (ov_create_sysfs(ov->vdev)) {
5853 err("ov_create_sysfs failed");
5854 goto error;
5855 }
5856
5821 return 0; 5857 return 0;
5822 5858
5823error: 5859error:
diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c
index 3484e36b6801..368d6e219fa4 100644
--- a/drivers/media/video/planb.c
+++ b/drivers/media/video/planb.c
@@ -91,7 +91,7 @@ static void planb_close(struct video_device *);
91static int planb_ioctl(struct video_device *, unsigned int, void *); 91static int planb_ioctl(struct video_device *, unsigned int, void *);
92static int planb_init_done(struct video_device *); 92static int planb_init_done(struct video_device *);
93static int planb_mmap(struct video_device *, const char *, unsigned long); 93static int planb_mmap(struct video_device *, const char *, unsigned long);
94static void planb_irq(int, void *, struct pt_regs *); 94static void planb_irq(int, void *);
95static void release_planb(void); 95static void release_planb(void);
96int init_planbs(struct video_init *); 96int init_planbs(struct video_init *);
97 97
@@ -1316,7 +1316,7 @@ cmd_tab_data_end:
1316 return c1; 1316 return c1;
1317} 1317}
1318 1318
1319static void planb_irq(int irq, void *dev_id, struct pt_regs * regs) 1319static void planb_irq(int irq, void *dev_id)
1320{ 1320{
1321 unsigned int stat, astat; 1321 unsigned int stat, astat;
1322 struct planb *pb = (struct planb *)dev_id; 1322 struct planb *pb = (struct planb *)dev_id;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 3d8cd0daf6a9..f920e0ccacd3 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2552,7 +2552,7 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v)
2552} 2552}
2553 2553
2554 2554
2555static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) 2555static void pvr2_ctl_write_complete(struct urb *urb)
2556{ 2556{
2557 struct pvr2_hdw *hdw = urb->context; 2557 struct pvr2_hdw *hdw = urb->context;
2558 hdw->ctl_write_pend_flag = 0; 2558 hdw->ctl_write_pend_flag = 0;
@@ -2561,7 +2561,7 @@ static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs)
2561} 2561}
2562 2562
2563 2563
2564static void pvr2_ctl_read_complete(struct urb *urb, struct pt_regs *regs) 2564static void pvr2_ctl_read_complete(struct urb *urb)
2565{ 2565{
2566 struct pvr2_hdw *hdw = urb->context; 2566 struct pvr2_hdw *hdw = urb->context;
2567 hdw->ctl_read_pend_flag = 0; 2567 hdw->ctl_read_pend_flag = 0;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c
index 1e393762546c..70aa63eba0cb 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-io.c
@@ -429,7 +429,7 @@ static void pvr2_stream_done(struct pvr2_stream *sp)
429 } while (0); mutex_unlock(&sp->mutex); 429 } while (0); mutex_unlock(&sp->mutex);
430} 430}
431 431
432static void buffer_complete(struct urb *urb, struct pt_regs *regs) 432static void buffer_complete(struct urb *urb)
433{ 433{
434 struct pvr2_buffer *bp = urb->context; 434 struct pvr2_buffer *bp = urb->context;
435 struct pvr2_stream *sp; 435 struct pvr2_stream *sp;
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 53c4b5790d5c..46c114830884 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -682,7 +682,7 @@ static int pwc_rcv_short_packet(struct pwc_device *pdev, const struct pwc_frame_
682/* This gets called for the Isochronous pipe (video). This is done in 682/* This gets called for the Isochronous pipe (video). This is done in
683 * interrupt time, so it has to be fast, not crash, and not stall. Neat. 683 * interrupt time, so it has to be fast, not crash, and not stall. Neat.
684 */ 684 */
685static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs) 685static void pwc_isoc_handler(struct urb *urb)
686{ 686{
687 struct pwc_device *pdev; 687 struct pwc_device *pdev;
688 int i, fst, flen; 688 int i, fst, flen;
@@ -1024,12 +1024,25 @@ static ssize_t show_snapshot_button_status(struct class_device *class_dev, char
1024static CLASS_DEVICE_ATTR(button, S_IRUGO | S_IWUSR, show_snapshot_button_status, 1024static CLASS_DEVICE_ATTR(button, S_IRUGO | S_IWUSR, show_snapshot_button_status,
1025 NULL); 1025 NULL);
1026 1026
1027static void pwc_create_sysfs_files(struct video_device *vdev) 1027static int pwc_create_sysfs_files(struct video_device *vdev)
1028{ 1028{
1029 struct pwc_device *pdev = video_get_drvdata(vdev); 1029 struct pwc_device *pdev = video_get_drvdata(vdev);
1030 if (pdev->features & FEATURE_MOTOR_PANTILT) 1030 int rc;
1031 video_device_create_file(vdev, &class_device_attr_pan_tilt); 1031
1032 video_device_create_file(vdev, &class_device_attr_button); 1032 rc = video_device_create_file(vdev, &class_device_attr_button);
1033 if (rc)
1034 goto err;
1035 if (pdev->features & FEATURE_MOTOR_PANTILT) {
1036 rc = video_device_create_file(vdev,&class_device_attr_pan_tilt);
1037 if (rc) goto err_button;
1038 }
1039
1040 return 0;
1041
1042err_button:
1043 video_device_remove_file(vdev, &class_device_attr_button);
1044err:
1045 return rc;
1033} 1046}
1034 1047
1035static void pwc_remove_sysfs_files(struct video_device *vdev) 1048static void pwc_remove_sysfs_files(struct video_device *vdev)
@@ -1408,7 +1421,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1408 struct usb_device *udev = interface_to_usbdev(intf); 1421 struct usb_device *udev = interface_to_usbdev(intf);
1409 struct pwc_device *pdev = NULL; 1422 struct pwc_device *pdev = NULL;
1410 int vendor_id, product_id, type_id; 1423 int vendor_id, product_id, type_id;
1411 int i, hint; 1424 int i, hint, rc;
1412 int features = 0; 1425 int features = 0;
1413 int video_nr = -1; /* default: use next available device */ 1426 int video_nr = -1; /* default: use next available device */
1414 char serial_number[30], *name; 1427 char serial_number[30], *name;
@@ -1709,9 +1722,8 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1709 i = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr); 1722 i = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr);
1710 if (i < 0) { 1723 if (i < 0) {
1711 PWC_ERROR("Failed to register as video device (%d).\n", i); 1724 PWC_ERROR("Failed to register as video device (%d).\n", i);
1712 video_device_release(pdev->vdev); /* Drip... drip... drip... */ 1725 rc = i;
1713 kfree(pdev); /* Oops, no memory leaks please */ 1726 goto err;
1714 return -EIO;
1715 } 1727 }
1716 else { 1728 else {
1717 PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F); 1729 PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F);
@@ -1723,13 +1735,24 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1723 1735
1724 PWC_DEBUG_PROBE("probe() function returning struct at 0x%p.\n", pdev); 1736 PWC_DEBUG_PROBE("probe() function returning struct at 0x%p.\n", pdev);
1725 usb_set_intfdata (intf, pdev); 1737 usb_set_intfdata (intf, pdev);
1726 pwc_create_sysfs_files(pdev->vdev); 1738 rc = pwc_create_sysfs_files(pdev->vdev);
1739 if (rc)
1740 goto err_unreg;
1727 1741
1728 /* Set the leds off */ 1742 /* Set the leds off */
1729 pwc_set_leds(pdev, 0, 0); 1743 pwc_set_leds(pdev, 0, 0);
1730 pwc_camera_power(pdev, 0); 1744 pwc_camera_power(pdev, 0);
1731 1745
1732 return 0; 1746 return 0;
1747
1748err_unreg:
1749 if (hint < MAX_DEV_HINTS)
1750 device_hint[hint].pdev = NULL;
1751 video_unregister_device(pdev->vdev);
1752err:
1753 video_device_release(pdev->vdev); /* Drip... drip... drip... */
1754 kfree(pdev); /* Oops, no memory leaks please */
1755 return rc;
1733} 1756}
1734 1757
1735/* The user janked out the cable... */ 1758/* The user janked out the cable... */
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 974179d4d389..c5719f7bd1ac 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -960,6 +960,8 @@ static void saa711x_set_v4lstd(struct i2c_client *client, v4l2_std_id std)
960 reg |= 0x10; 960 reg |= 0x10;
961 } else if (std == V4L2_STD_NTSC_M_JP) { 961 } else if (std == V4L2_STD_NTSC_M_JP) {
962 reg |= 0x40; 962 reg |= 0x40;
963 } else if (std == V4L2_STD_SECAM) {
964 reg |= 0x50;
963 } 965 }
964 saa711x_write(client, R_0E_CHROMA_CNTL_1, reg); 966 saa711x_write(client, R_0E_CHROMA_CNTL_1, reg);
965 } else { 967 } else {
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index a39e0136ce3b..4abf5c03a740 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -212,7 +212,7 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,
212 * 212 *
213 */ 213 */
214 214
215static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id, struct pt_regs *regs) 215static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id)
216{ 216{
217 struct saa7134_dmasound *dmasound = dev_id; 217 struct saa7134_dmasound *dmasound = dev_id;
218 struct saa7134_dev *dev = dmasound->priv_data; 218 struct saa7134_dev *dev = dmasound->priv_data;
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index fe3c83ca3de3..c9d8e3b9cc37 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2994,6 +2994,34 @@ struct saa7134_board saa7134_boards[] = {
2994 .amux = LINE1, 2994 .amux = LINE1,
2995 }, 2995 },
2996 }, 2996 },
2997 [SAA7134_BOARD_ASUS_EUROPA2_HYBRID] = {
2998 .name = "Asus Europa2 OEM",
2999 .audio_clock = 0x00187de7,
3000 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
3001 .radio_type = UNSET,
3002 .tuner_addr = ADDR_UNSET,
3003 .radio_addr = ADDR_UNSET,
3004 .tda9887_conf = TDA9887_PRESENT| TDA9887_PORT1_ACTIVE | TDA9887_PORT2_ACTIVE,
3005 .mpeg = SAA7134_MPEG_DVB,
3006 .inputs = {{
3007 .name = name_tv,
3008 .vmux = 3,
3009 .amux = TV,
3010 .tv = 1,
3011 },{
3012 .name = name_comp1,
3013 .vmux = 4,
3014 .amux = LINE2,
3015 },{
3016 .name = name_svideo,
3017 .vmux = 8,
3018 .amux = LINE2,
3019 }},
3020 .radio = {
3021 .name = name_radio,
3022 .amux = LINE1,
3023 },
3024 },
2997}; 3025};
2998 3026
2999const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); 3027const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -3597,6 +3625,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
3597 .subdevice = 0x2c00, 3625 .subdevice = 0x2c00,
3598 .driver_data = SAA7134_BOARD_AVERMEDIA_A16AR, 3626 .driver_data = SAA7134_BOARD_AVERMEDIA_A16AR,
3599 },{ 3627 },{
3628 .vendor = PCI_VENDOR_ID_PHILIPS,
3629 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
3630 .subvendor = 0x1043,
3631 .subdevice = 0x4860,
3632 .driver_data = SAA7134_BOARD_ASUS_EUROPA2_HYBRID,
3633 },{
3600 /* --- boards without eeprom + subsystem ID --- */ 3634 /* --- boards without eeprom + subsystem ID --- */
3601 .vendor = PCI_VENDOR_ID_PHILIPS, 3635 .vendor = PCI_VENDOR_ID_PHILIPS,
3602 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 3636 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -3871,6 +3905,7 @@ int saa7134_board_init2(struct saa7134_dev *dev)
3871 break; 3905 break;
3872 case SAA7134_BOARD_PHILIPS_EUROPA: 3906 case SAA7134_BOARD_PHILIPS_EUROPA:
3873 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 3907 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
3908 case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
3874 /* The Philips EUROPA based hybrid boards have the tuner connected through 3909 /* The Philips EUROPA based hybrid boards have the tuner connected through
3875 * the channel decoder. We have to make it transparent to find it 3910 * the channel decoder. We have to make it transparent to find it
3876 */ 3911 */
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 09aa62f61af7..5c9e63dfbea6 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -495,7 +495,7 @@ static void print_irqstatus(struct saa7134_dev *dev, int loop,
495 printk("\n"); 495 printk("\n");
496} 496}
497 497
498static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) 498static irqreturn_t saa7134_irq(int irq, void *dev_id)
499{ 499{
500 struct saa7134_dev *dev = (struct saa7134_dev*) dev_id; 500 struct saa7134_dev *dev = (struct saa7134_dev*) dev_id;
501 unsigned long report,status; 501 unsigned long report,status;
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index fb741fa465a5..1ba53b525ad2 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -874,6 +874,34 @@ static struct tda1004x_config philips_tiger_config = {
874 874
875/* ------------------------------------------------------------------ */ 875/* ------------------------------------------------------------------ */
876 876
877static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe)
878{
879 struct saa7134_dev *dev = fe->dvb->priv;
880 static u8 data[] = { 0x3c, 0x33, 0x6a};
881 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
882
883 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
884 return -EIO;
885 /* make sure the DVB-T antenna input is set */
886 saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000);
887 return 0;
888}
889
890static int asus_p7131_dual_tuner_sleep(struct dvb_frontend *fe)
891{
892 struct saa7134_dev *dev = fe->dvb->priv;
893 static u8 data[] = { 0x3c, 0x33, 0x68};
894 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
895
896 i2c_transfer(&dev->i2c_adap, &msg, 1);
897 philips_tda827xa_tuner_sleep( 0x61, fe);
898 /* reset antenna inputs for analog usage */
899 saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000);
900 return 0;
901}
902
903/* ------------------------------------------------------------------ */
904
877static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 905static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
878{ 906{
879 int ret; 907 int ret;
@@ -1148,8 +1176,8 @@ static int dvb_init(struct saa7134_dev *dev)
1148 &philips_tiger_config, 1176 &philips_tiger_config,
1149 &dev->i2c_adap); 1177 &dev->i2c_adap);
1150 if (dev->dvb.frontend) { 1178 if (dev->dvb.frontend) {
1151 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init; 1179 dev->dvb.frontend->ops.tuner_ops.init = asus_p7131_dual_tuner_init;
1152 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep; 1180 dev->dvb.frontend->ops.tuner_ops.sleep = asus_p7131_dual_tuner_sleep;
1153 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params; 1181 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
1154 } 1182 }
1155 break; 1183 break;
@@ -1240,6 +1268,18 @@ static int dvb_init(struct saa7134_dev *dev)
1240 } 1268 }
1241 } 1269 }
1242 break; 1270 break;
1271 case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
1272 dev->dvb.frontend = tda10046_attach(&medion_cardbus,
1273 &dev->i2c_adap);
1274 if (dev->dvb.frontend) {
1275 dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
1276 dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
1277 dev->dvb.frontend->ops.tuner_ops.init = philips_fmd1216_tuner_init;
1278 dev->dvb.frontend->ops.tuner_ops.sleep = philips_fmd1216_tuner_sleep;
1279 dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
1280 }
1281 break;
1282
1243 default: 1283 default:
1244 printk("%s: Huh? unknown DVB card?\n",dev->name); 1284 printk("%s: Huh? unknown DVB card?\n",dev->name);
1245 break; 1285 break;
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
index 2e3ba5f31453..bfcb860d14cc 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -814,7 +814,7 @@ struct file_operations saa7134_mixer_fops = {
814 814
815/* ------------------------------------------------------------------ */ 815/* ------------------------------------------------------------------ */
816 816
817static irqreturn_t saa7134_oss_irq(int irq, void *dev_id, struct pt_regs *regs) 817static irqreturn_t saa7134_oss_irq(int irq, void *dev_id)
818{ 818{
819 struct saa7134_dmasound *dmasound = dev_id; 819 struct saa7134_dmasound *dmasound = dev_id;
820 struct saa7134_dev *dev = dmasound->priv_data; 820 struct saa7134_dev *dev = dmasound->priv_data;
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index d31220d20495..dd759d6d8d25 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -72,12 +72,12 @@ static struct mainscan {
72 int carr; 72 int carr;
73} mainscan[] = { 73} mainscan[] = {
74 { 74 {
75 .name = "M", 75 .name = "MN",
76 .std = V4L2_STD_NTSC | V4L2_STD_PAL_M, 76 .std = V4L2_STD_MN,
77 .carr = 4500, 77 .carr = 4500,
78 },{ 78 },{
79 .name = "BG", 79 .name = "BGH",
80 .std = V4L2_STD_PAL_BG, 80 .std = V4L2_STD_B | V4L2_STD_GH,
81 .carr = 5500, 81 .carr = 5500,
82 },{ 82 },{
83 .name = "I", 83 .name = "I",
@@ -85,7 +85,7 @@ static struct mainscan {
85 .carr = 6000, 85 .carr = 6000,
86 },{ 86 },{
87 .name = "DKL", 87 .name = "DKL",
88 .std = V4L2_STD_PAL_DK | V4L2_STD_SECAM, 88 .std = V4L2_STD_DK | V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC,
89 .carr = 6500, 89 .carr = 6500,
90 } 90 }
91}; 91};
@@ -93,76 +93,70 @@ static struct mainscan {
93static struct saa7134_tvaudio tvaudio[] = { 93static struct saa7134_tvaudio tvaudio[] = {
94 { 94 {
95 .name = "PAL-B/G FM-stereo", 95 .name = "PAL-B/G FM-stereo",
96 .std = V4L2_STD_PAL, 96 .std = V4L2_STD_PAL_BG,
97 .mode = TVAUDIO_FM_BG_STEREO, 97 .mode = TVAUDIO_FM_BG_STEREO,
98 .carr1 = 5500, 98 .carr1 = 5500,
99 .carr2 = 5742, 99 .carr2 = 5742,
100 },{ 100 },{
101 .name = "PAL-D/K1 FM-stereo", 101 .name = "PAL-D/K1 FM-stereo",
102 .std = V4L2_STD_PAL, 102 .std = V4L2_STD_PAL_DK,
103 .carr1 = 6500, 103 .carr1 = 6500,
104 .carr2 = 6258, 104 .carr2 = 6258,
105 .mode = TVAUDIO_FM_BG_STEREO, 105 .mode = TVAUDIO_FM_BG_STEREO,
106 },{ 106 },{
107 .name = "PAL-D/K2 FM-stereo", 107 .name = "PAL-D/K2 FM-stereo",
108 .std = V4L2_STD_PAL, 108 .std = V4L2_STD_PAL_DK,
109 .carr1 = 6500, 109 .carr1 = 6500,
110 .carr2 = 6742, 110 .carr2 = 6742,
111 .mode = TVAUDIO_FM_BG_STEREO, 111 .mode = TVAUDIO_FM_BG_STEREO,
112 },{ 112 },{
113 .name = "PAL-D/K3 FM-stereo", 113 .name = "PAL-D/K3 FM-stereo",
114 .std = V4L2_STD_PAL, 114 .std = V4L2_STD_PAL_DK,
115 .carr1 = 6500, 115 .carr1 = 6500,
116 .carr2 = 5742, 116 .carr2 = 5742,
117 .mode = TVAUDIO_FM_BG_STEREO, 117 .mode = TVAUDIO_FM_BG_STEREO,
118 },{ 118 },{
119 .name = "PAL-B/G NICAM", 119 .name = "PAL-B/G NICAM",
120 .std = V4L2_STD_PAL, 120 .std = V4L2_STD_PAL_BG,
121 .carr1 = 5500, 121 .carr1 = 5500,
122 .carr2 = 5850, 122 .carr2 = 5850,
123 .mode = TVAUDIO_NICAM_FM, 123 .mode = TVAUDIO_NICAM_FM,
124 },{ 124 },{
125 .name = "PAL-I NICAM", 125 .name = "PAL-I NICAM",
126 .std = V4L2_STD_PAL, 126 .std = V4L2_STD_PAL_I,
127 .carr1 = 6000, 127 .carr1 = 6000,
128 .carr2 = 6552, 128 .carr2 = 6552,
129 .mode = TVAUDIO_NICAM_FM, 129 .mode = TVAUDIO_NICAM_FM,
130 },{ 130 },{
131 .name = "PAL-D/K NICAM", 131 .name = "PAL-D/K NICAM",
132 .std = V4L2_STD_PAL, 132 .std = V4L2_STD_PAL_DK,
133 .carr1 = 6500, 133 .carr1 = 6500,
134 .carr2 = 5850, 134 .carr2 = 5850,
135 .mode = TVAUDIO_NICAM_FM, 135 .mode = TVAUDIO_NICAM_FM,
136 },{ 136 },{
137 .name = "SECAM-L NICAM", 137 .name = "SECAM-L NICAM",
138 .std = V4L2_STD_SECAM, 138 .std = V4L2_STD_SECAM_L,
139 .carr1 = 6500, 139 .carr1 = 6500,
140 .carr2 = 5850, 140 .carr2 = 5850,
141 .mode = TVAUDIO_NICAM_AM, 141 .mode = TVAUDIO_NICAM_AM,
142 },{ 142 },{
143 .name = "SECAM-L MONO", 143 .name = "SECAM-D/K NICAM",
144 .std = V4L2_STD_SECAM, 144 .std = V4L2_STD_SECAM_DK,
145 .carr1 = 6500, 145 .carr1 = 6500,
146 .carr2 = -1, 146 .carr2 = 5850,
147 .mode = TVAUDIO_AM_MONO, 147 .mode = TVAUDIO_NICAM_FM,
148 },{ 148 },{
149 .name = "SECAM-D/K", 149 .name = "NTSC-A2 FM-stereo",
150 .std = V4L2_STD_SECAM, 150 .std = V4L2_STD_NTSC,
151 .carr1 = 6500, 151 .carr1 = 4500,
152 .carr2 = -1, 152 .carr2 = 4724,
153 .mode = TVAUDIO_FM_MONO, 153 .mode = TVAUDIO_FM_K_STEREO,
154 },{ 154 },{
155 .name = "NTSC-M", 155 .name = "NTSC-M",
156 .std = V4L2_STD_NTSC, 156 .std = V4L2_STD_NTSC,
157 .carr1 = 4500, 157 .carr1 = 4500,
158 .carr2 = -1, 158 .carr2 = -1,
159 .mode = TVAUDIO_FM_MONO, 159 .mode = TVAUDIO_FM_MONO,
160 },{
161 .name = "NTSC-A2 FM-stereo",
162 .std = V4L2_STD_NTSC,
163 .carr1 = 4500,
164 .carr2 = 4724,
165 .mode = TVAUDIO_FM_K_STEREO,
166 } 160 }
167}; 161};
168#define TVAUDIO (sizeof(tvaudio)/sizeof(struct saa7134_tvaudio)) 162#define TVAUDIO (sizeof(tvaudio)/sizeof(struct saa7134_tvaudio))
@@ -340,12 +334,6 @@ static void tvaudio_setmode(struct saa7134_dev *dev,
340 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa1); 334 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa1);
341 saa_writeb(SAA7134_NICAM_CONFIG, 0x00); 335 saa_writeb(SAA7134_NICAM_CONFIG, 0x00);
342 break; 336 break;
343 case TVAUDIO_AM_MONO:
344 saa_writeb(SAA7134_DEMODULATOR, 0x12);
345 saa_writeb(SAA7134_DCXO_IDENT_CTRL, 0x00);
346 saa_writeb(SAA7134_FM_DEEMPHASIS, 0x44);
347 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa0);
348 break;
349 case TVAUDIO_FM_SAT_STEREO: 337 case TVAUDIO_FM_SAT_STEREO:
350 /* not implemented (yet) */ 338 /* not implemented (yet) */
351 break; 339 break;
@@ -390,7 +378,6 @@ static int tvaudio_checkcarrier(struct saa7134_dev *dev, struct mainscan *scan)
390 } 378 }
391 printk("\n"); 379 printk("\n");
392 } 380 }
393
394 if (dev->tvnorm->id & scan->std) { 381 if (dev->tvnorm->id & scan->std) {
395 tvaudio_setcarrier(dev,scan->carr-90,scan->carr-90); 382 tvaudio_setcarrier(dev,scan->carr-90,scan->carr-90);
396 saa_readl(SAA7134_LEVEL_READOUT1 >> 2); 383 saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
@@ -426,7 +413,6 @@ static int tvaudio_getstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
426 413
427 switch (audio->mode) { 414 switch (audio->mode) {
428 case TVAUDIO_FM_MONO: 415 case TVAUDIO_FM_MONO:
429 case TVAUDIO_AM_MONO:
430 return V4L2_TUNER_SUB_MONO; 416 return V4L2_TUNER_SUB_MONO;
431 case TVAUDIO_FM_K_STEREO: 417 case TVAUDIO_FM_K_STEREO:
432 case TVAUDIO_FM_BG_STEREO: 418 case TVAUDIO_FM_BG_STEREO:
@@ -495,7 +481,6 @@ static int tvaudio_setstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
495 481
496 switch (audio->mode) { 482 switch (audio->mode) {
497 case TVAUDIO_FM_MONO: 483 case TVAUDIO_FM_MONO:
498 case TVAUDIO_AM_MONO:
499 /* nothing to do ... */ 484 /* nothing to do ... */
500 break; 485 break;
501 case TVAUDIO_FM_K_STEREO: 486 case TVAUDIO_FM_K_STEREO:
@@ -556,6 +541,7 @@ static int tvaudio_thread(void *data)
556 541
557 if (1 == nscan) { 542 if (1 == nscan) {
558 /* only one candidate -- skip scan ;) */ 543 /* only one candidate -- skip scan ;) */
544 dprintk("only one main carrier candidate - skipping scan\n");
559 max1 = 12345; 545 max1 = 12345;
560 carrier = default_carrier; 546 carrier = default_carrier;
561 } else { 547 } else {
@@ -603,7 +589,6 @@ static int tvaudio_thread(void *data)
603 dev->automute = 0; 589 dev->automute = 0;
604 saa_andorb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0x30, 0x00); 590 saa_andorb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0x30, 0x00);
605 saa7134_tvaudio_setmute(dev); 591 saa7134_tvaudio_setmute(dev);
606
607 /* find the exact tv audio norm */ 592 /* find the exact tv audio norm */
608 for (audio = UNSET, i = 0; i < TVAUDIO; i++) { 593 for (audio = UNSET, i = 0; i < TVAUDIO; i++) {
609 if (dev->tvnorm->id != UNSET && 594 if (dev->tvnorm->id != UNSET &&
@@ -611,7 +596,7 @@ static int tvaudio_thread(void *data)
611 continue; 596 continue;
612 if (tvaudio[i].carr1 != carrier) 597 if (tvaudio[i].carr1 != carrier)
613 continue; 598 continue;
614 599 /* Note: at least the primary carrier is right here */
615 if (UNSET == audio) 600 if (UNSET == audio)
616 audio = i; 601 audio = i;
617 tvaudio_setmode(dev,&tvaudio[i],"trying"); 602 tvaudio_setmode(dev,&tvaudio[i],"trying");
@@ -626,6 +611,7 @@ static int tvaudio_thread(void *data)
626 if (UNSET == audio) 611 if (UNSET == audio)
627 continue; 612 continue;
628 tvaudio_setmode(dev,&tvaudio[audio],"using"); 613 tvaudio_setmode(dev,&tvaudio[audio],"using");
614
629 tvaudio_setstereo(dev,&tvaudio[audio],V4L2_TUNER_MODE_MONO); 615 tvaudio_setstereo(dev,&tvaudio[audio],V4L2_TUNER_MODE_MONO);
630 dev->tvaudio = &tvaudio[audio]; 616 dev->tvaudio = &tvaudio[audio];
631 617
@@ -750,7 +736,6 @@ static int mute_input_7133(struct saa7134_dev *dev)
750 int mask; 736 int mask;
751 struct saa7134_input *in; 737 struct saa7134_input *in;
752 738
753 /* Hac 0506 route OSS sound simultanously */
754 xbarin = 0x03; 739 xbarin = 0x03;
755 switch (dev->input->amux) { 740 switch (dev->input->amux) {
756 case TV: 741 case TV:
@@ -834,18 +819,16 @@ static int tvaudio_thread_ddep(void *data)
834 } else { 819 } else {
835 /* (let chip) scan for sound carrier */ 820 /* (let chip) scan for sound carrier */
836 norms = 0; 821 norms = 0;
837 if (dev->tvnorm->id & V4L2_STD_PAL) { 822 if (dev->tvnorm->id & (V4L2_STD_B | V4L2_STD_GH))
838 dprintk("PAL scan\n"); 823 norms |= 0x04;
839 norms |= 0x2c; /* B/G + D/K + I */ 824 if (dev->tvnorm->id & V4L2_STD_PAL_I)
840 } 825 norms |= 0x20;
841 if (dev->tvnorm->id & V4L2_STD_NTSC) { 826 if (dev->tvnorm->id & V4L2_STD_DK)
842 dprintk("NTSC scan\n"); 827 norms |= 0x08;
843 norms |= 0x40; /* M */ 828 if (dev->tvnorm->id & V4L2_STD_MN)
844 } 829 norms |= 0x40;
845 if (dev->tvnorm->id & V4L2_STD_SECAM) { 830 if (dev->tvnorm->id & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC))
846 dprintk("SECAM scan\n"); 831 norms |= 0x10;
847 norms |= 0x18; /* L + D/K */
848 }
849 if (0 == norms) 832 if (0 == norms)
850 norms = 0x7c; /* all */ 833 norms = 0x7c; /* all */
851 dprintk("scanning:%s%s%s%s%s\n", 834 dprintk("scanning:%s%s%s%s%s\n",
@@ -1034,7 +1017,11 @@ int saa7134_tvaudio_fini(struct saa7134_dev *dev)
1034 1017
1035int saa7134_tvaudio_do_scan(struct saa7134_dev *dev) 1018int saa7134_tvaudio_do_scan(struct saa7134_dev *dev)
1036{ 1019{
1037 if (dev->thread.pid >= 0) { 1020 if (dev->input->amux != TV) {
1021 dprintk("sound IF not in use, skipping scan\n");
1022 dev->automute = 0;
1023 saa7134_tvaudio_setmute(dev);
1024 } else if (dev->thread.pid >= 0) {
1038 dev->thread.mode = UNSET; 1025 dev->thread.mode = UNSET;
1039 dev->thread.scan2++; 1026 dev->thread.scan2++;
1040 wake_up_interruptible(&dev->thread.wq); 1027 wake_up_interruptible(&dev->thread.wq);
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 2c171af9a9f2..830617ea81cc 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -43,12 +43,16 @@ static unsigned int gbuffers = 8;
43static unsigned int noninterlaced = 1; 43static unsigned int noninterlaced = 1;
44static unsigned int gbufsize = 720*576*4; 44static unsigned int gbufsize = 720*576*4;
45static unsigned int gbufsize_max = 720*576*4; 45static unsigned int gbufsize_max = 720*576*4;
46static char secam[] = "--";
46module_param(video_debug, int, 0644); 47module_param(video_debug, int, 0644);
47MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); 48MODULE_PARM_DESC(video_debug,"enable debug messages [video]");
48module_param(gbuffers, int, 0444); 49module_param(gbuffers, int, 0444);
49MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32"); 50MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32");
50module_param(noninterlaced, int, 0644); 51module_param(noninterlaced, int, 0644);
51MODULE_PARM_DESC(noninterlaced,"capture non interlaced video"); 52MODULE_PARM_DESC(noninterlaced,"capture non interlaced video");
53module_param_string(secam, secam, sizeof(secam), 0644);
54MODULE_PARM_DESC(secam, "force SECAM variant, either DK,L or Lc");
55
52 56
53#define dprintk(fmt, arg...) if (video_debug) \ 57#define dprintk(fmt, arg...) if (video_debug) \
54 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg) 58 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
@@ -279,7 +283,43 @@ static struct saa7134_tvnorm tvnorms[] = {
279 .id = V4L2_STD_SECAM, 283 .id = V4L2_STD_SECAM,
280 NORM_625_50, 284 NORM_625_50,
281 285
282 .sync_control = 0x18, /* old: 0x58, */ 286 .sync_control = 0x18,
287 .luma_control = 0x1b,
288 .chroma_ctrl1 = 0xd1,
289 .chroma_gain = 0x80,
290 .chroma_ctrl2 = 0x00,
291 .vgate_misc = 0x1c,
292
293 },{
294 .name = "SECAM-DK",
295 .id = V4L2_STD_SECAM_DK,
296 NORM_625_50,
297
298 .sync_control = 0x18,
299 .luma_control = 0x1b,
300 .chroma_ctrl1 = 0xd1,
301 .chroma_gain = 0x80,
302 .chroma_ctrl2 = 0x00,
303 .vgate_misc = 0x1c,
304
305 },{
306 .name = "SECAM-L",
307 .id = V4L2_STD_SECAM_L,
308 NORM_625_50,
309
310 .sync_control = 0x18,
311 .luma_control = 0x1b,
312 .chroma_ctrl1 = 0xd1,
313 .chroma_gain = 0x80,
314 .chroma_ctrl2 = 0x00,
315 .vgate_misc = 0x1c,
316
317 },{
318 .name = "SECAM-Lc",
319 .id = V4L2_STD_SECAM_LC,
320 NORM_625_50,
321
322 .sync_control = 0x18,
283 .luma_control = 0x1b, 323 .luma_control = 0x1b,
284 .chroma_ctrl1 = 0xd1, 324 .chroma_ctrl1 = 0xd1,
285 .chroma_gain = 0x80, 325 .chroma_gain = 0x80,
@@ -1769,6 +1809,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1769 { 1809 {
1770 v4l2_std_id *id = arg; 1810 v4l2_std_id *id = arg;
1771 unsigned int i; 1811 unsigned int i;
1812 v4l2_std_id fixup;
1772 1813
1773 for (i = 0; i < TVNORMS; i++) 1814 for (i = 0; i < TVNORMS; i++)
1774 if (*id == tvnorms[i].id) 1815 if (*id == tvnorms[i].id)
@@ -1779,7 +1820,22 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1779 break; 1820 break;
1780 if (i == TVNORMS) 1821 if (i == TVNORMS)
1781 return -EINVAL; 1822 return -EINVAL;
1782 1823 if ((*id & V4L2_STD_SECAM) && (secam[0] != '-')) {
1824 if (secam[0] == 'L' || secam[0] == 'l') {
1825 if (secam[1] == 'C' || secam[1] == 'c')
1826 fixup = V4L2_STD_SECAM_LC;
1827 else
1828 fixup = V4L2_STD_SECAM_L;
1829 } else {
1830 if (secam[0] == 'D' || secam[0] == 'd')
1831 fixup = V4L2_STD_SECAM_DK;
1832 else
1833 fixup = V4L2_STD_SECAM;
1834 }
1835 for (i = 0; i < TVNORMS; i++)
1836 if (fixup == tvnorms[i].id)
1837 break;
1838 }
1783 mutex_lock(&dev->lock); 1839 mutex_lock(&dev->lock);
1784 if (res_check(fh, RESOURCE_OVERLAY)) { 1840 if (res_check(fh, RESOURCE_OVERLAY)) {
1785 spin_lock_irqsave(&dev->slock,flags); 1841 spin_lock_irqsave(&dev->slock,flags);
@@ -2192,7 +2248,11 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
2192 t->type = V4L2_TUNER_RADIO; 2248 t->type = V4L2_TUNER_RADIO;
2193 2249
2194 saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t); 2250 saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t);
2195 2251 if (dev->input->amux == TV) {
2252 t->signal = 0xf800 - ((saa_readb(0x581) & 0x1f) << 11);
2253 t->rxsubchans = (saa_readb(0x529) & 0x08) ?
2254 V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
2255 }
2196 return 0; 2256 return 0;
2197 } 2257 }
2198 case VIDIOC_S_TUNER: 2258 case VIDIOC_S_TUNER:
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 701a90942108..7cf96b430250 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -61,7 +61,6 @@ enum saa7134_tvaudio_mode {
61 TVAUDIO_FM_K_STEREO = 4, 61 TVAUDIO_FM_K_STEREO = 4,
62 TVAUDIO_NICAM_AM = 5, 62 TVAUDIO_NICAM_AM = 5,
63 TVAUDIO_NICAM_FM = 6, 63 TVAUDIO_NICAM_FM = 6,
64 TVAUDIO_AM_MONO = 7
65}; 64};
66 65
67enum saa7134_audio_in { 66enum saa7134_audio_in {
@@ -227,6 +226,7 @@ struct saa7134_format {
227#define SAA7134_BOARD_FLYDVBS_LR300 97 226#define SAA7134_BOARD_FLYDVBS_LR300 97
228#define SAA7134_BOARD_PROTEUS_2309 98 227#define SAA7134_BOARD_PROTEUS_2309 98
229#define SAA7134_BOARD_AVERMEDIA_A16AR 99 228#define SAA7134_BOARD_AVERMEDIA_A16AR 99
229#define SAA7134_BOARD_ASUS_EUROPA2_HYBRID 100
230 230
231#define SAA7134_MAXBOARDS 8 231#define SAA7134_MAXBOARDS 8
232#define SAA7134_INPUT_MAX 8 232#define SAA7134_INPUT_MAX 8
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index 67987baee77a..7aeec574d7ce 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -282,7 +282,7 @@ static void se401_auto_resetlevel(struct usb_se401 *se401)
282} 282}
283 283
284/* irq handler for snapshot button */ 284/* irq handler for snapshot button */
285static void se401_button_irq(struct urb *urb, struct pt_regs *regs) 285static void se401_button_irq(struct urb *urb)
286{ 286{
287 struct usb_se401 *se401 = urb->context; 287 struct usb_se401 *se401 = urb->context;
288 int status; 288 int status;
@@ -318,7 +318,7 @@ exit:
318 __FUNCTION__, status); 318 __FUNCTION__, status);
319} 319}
320 320
321static void se401_video_irq(struct urb *urb, struct pt_regs *regs) 321static void se401_video_irq(struct urb *urb)
322{ 322{
323 struct usb_se401 *se401 = urb->context; 323 struct usb_se401 *se401 = urb->context;
324 int length = urb->actual_length; 324 int length = urb->actual_length;
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index 48d138a7c723..a4702d3c2aca 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -518,7 +518,7 @@ sn9c102_find_eof_header(struct sn9c102_device* cam, void* mem, size_t len)
518} 518}
519 519
520 520
521static void sn9c102_urb_complete(struct urb *urb, struct pt_regs* regs) 521static void sn9c102_urb_complete(struct urb *urb)
522{ 522{
523 struct sn9c102_device* cam = urb->context; 523 struct sn9c102_device* cam = urb->context;
524 struct sn9c102_frame_t** f; 524 struct sn9c102_frame_t** f;
@@ -1240,23 +1240,53 @@ static CLASS_DEVICE_ATTR(frame_header, S_IRUGO,
1240 sn9c102_show_frame_header, NULL); 1240 sn9c102_show_frame_header, NULL);
1241 1241
1242 1242
1243static void sn9c102_create_sysfs(struct sn9c102_device* cam) 1243static int sn9c102_create_sysfs(struct sn9c102_device* cam)
1244{ 1244{
1245 struct video_device *v4ldev = cam->v4ldev; 1245 struct video_device *v4ldev = cam->v4ldev;
1246 int rc;
1247
1248 rc = video_device_create_file(v4ldev, &class_device_attr_reg);
1249 if (rc) goto err;
1250 rc = video_device_create_file(v4ldev, &class_device_attr_val);
1251 if (rc) goto err_reg;
1252 rc = video_device_create_file(v4ldev, &class_device_attr_frame_header);
1253 if (rc) goto err_val;
1246 1254
1247 video_device_create_file(v4ldev, &class_device_attr_reg);
1248 video_device_create_file(v4ldev, &class_device_attr_val);
1249 video_device_create_file(v4ldev, &class_device_attr_frame_header);
1250 if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102)
1251 video_device_create_file(v4ldev, &class_device_attr_green);
1252 else if (cam->bridge == BRIDGE_SN9C103) {
1253 video_device_create_file(v4ldev, &class_device_attr_blue);
1254 video_device_create_file(v4ldev, &class_device_attr_red);
1255 }
1256 if (cam->sensor.sysfs_ops) { 1255 if (cam->sensor.sysfs_ops) {
1257 video_device_create_file(v4ldev, &class_device_attr_i2c_reg); 1256 rc = video_device_create_file(v4ldev, &class_device_attr_i2c_reg);
1258 video_device_create_file(v4ldev, &class_device_attr_i2c_val); 1257 if (rc) goto err_frhead;
1258 rc = video_device_create_file(v4ldev, &class_device_attr_i2c_val);
1259 if (rc) goto err_i2c_reg;
1260 }
1261
1262 if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) {
1263 rc = video_device_create_file(v4ldev, &class_device_attr_green);
1264 if (rc) goto err_i2c_val;
1265 } else if (cam->bridge == BRIDGE_SN9C103) {
1266 rc = video_device_create_file(v4ldev, &class_device_attr_blue);
1267 if (rc) goto err_i2c_val;
1268 rc = video_device_create_file(v4ldev, &class_device_attr_red);
1269 if (rc) goto err_blue;
1259 } 1270 }
1271
1272 return 0;
1273
1274err_blue:
1275 video_device_remove_file(v4ldev, &class_device_attr_blue);
1276err_i2c_val:
1277 if (cam->sensor.sysfs_ops)
1278 video_device_remove_file(v4ldev, &class_device_attr_i2c_val);
1279err_i2c_reg:
1280 if (cam->sensor.sysfs_ops)
1281 video_device_remove_file(v4ldev, &class_device_attr_i2c_reg);
1282err_frhead:
1283 video_device_remove_file(v4ldev, &class_device_attr_frame_header);
1284err_val:
1285 video_device_remove_file(v4ldev, &class_device_attr_val);
1286err_reg:
1287 video_device_remove_file(v4ldev, &class_device_attr_reg);
1288err:
1289 return rc;
1260} 1290}
1261#endif /* CONFIG_VIDEO_ADV_DEBUG */ 1291#endif /* CONFIG_VIDEO_ADV_DEBUG */
1262 1292
@@ -2809,10 +2839,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2809 DBG(1, "V4L2 device registration failed"); 2839 DBG(1, "V4L2 device registration failed");
2810 if (err == -ENFILE && video_nr[dev_nr] == -1) 2840 if (err == -ENFILE && video_nr[dev_nr] == -1)
2811 DBG(1, "Free /dev/videoX node not found"); 2841 DBG(1, "Free /dev/videoX node not found");
2812 video_nr[dev_nr] = -1; 2842 goto fail2;
2813 dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0;
2814 mutex_unlock(&cam->dev_mutex);
2815 goto fail;
2816 } 2843 }
2817 2844
2818 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor); 2845 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
@@ -2823,7 +2850,9 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2823 dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0; 2850 dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0;
2824 2851
2825#ifdef CONFIG_VIDEO_ADV_DEBUG 2852#ifdef CONFIG_VIDEO_ADV_DEBUG
2826 sn9c102_create_sysfs(cam); 2853 err = sn9c102_create_sysfs(cam);
2854 if (err)
2855 goto fail3;
2827 DBG(2, "Optional device control through 'sysfs' interface ready"); 2856 DBG(2, "Optional device control through 'sysfs' interface ready");
2828#endif 2857#endif
2829 2858
@@ -2833,6 +2862,14 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2833 2862
2834 return 0; 2863 return 0;
2835 2864
2865#ifdef CONFIG_VIDEO_ADV_DEBUG
2866fail3:
2867 video_unregister_device(cam->v4ldev);
2868#endif
2869fail2:
2870 video_nr[dev_nr] = -1;
2871 dev_nr = (dev_nr < SN9C102_MAX_DEVICES-1) ? dev_nr+1 : 0;
2872 mutex_unlock(&cam->dev_mutex);
2836fail: 2873fail:
2837 if (cam) { 2874 if (cam) {
2838 kfree(cam->control_buffer); 2875 kfree(cam->control_buffer);
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 5686547ba76a..525d81288d55 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -406,7 +406,7 @@ static void send_osd_data(struct saa7146 *saa)
406 } 406 }
407} 407}
408 408
409static irqreturn_t saa7146_irq(int irq, void *dev_id, struct pt_regs *regs) 409static irqreturn_t saa7146_irq(int irq, void *dev_id)
410{ 410{
411 struct saa7146 *saa = dev_id; 411 struct saa7146 *saa = dev_id;
412 u32 stat, astat; 412 u32 stat, astat;
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 2ba2991a214f..6d1ef1e2e8ef 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -516,16 +516,45 @@ stv680_file(frames_read, framecount, "%d\n");
516stv680_file(packets_dropped, dropped, "%d\n"); 516stv680_file(packets_dropped, dropped, "%d\n");
517stv680_file(decoding_errors, error, "%d\n"); 517stv680_file(decoding_errors, error, "%d\n");
518 518
519static void stv680_create_sysfs_files(struct video_device *vdev) 519static int stv680_create_sysfs_files(struct video_device *vdev)
520{ 520{
521 video_device_create_file(vdev, &class_device_attr_model); 521 int rc;
522 video_device_create_file(vdev, &class_device_attr_in_use); 522
523 video_device_create_file(vdev, &class_device_attr_streaming); 523 rc = video_device_create_file(vdev, &class_device_attr_model);
524 video_device_create_file(vdev, &class_device_attr_palette); 524 if (rc) goto err;
525 video_device_create_file(vdev, &class_device_attr_frames_total); 525 rc = video_device_create_file(vdev, &class_device_attr_in_use);
526 video_device_create_file(vdev, &class_device_attr_frames_read); 526 if (rc) goto err_model;
527 video_device_create_file(vdev, &class_device_attr_packets_dropped); 527 rc = video_device_create_file(vdev, &class_device_attr_streaming);
528 video_device_create_file(vdev, &class_device_attr_decoding_errors); 528 if (rc) goto err_inuse;
529 rc = video_device_create_file(vdev, &class_device_attr_palette);
530 if (rc) goto err_stream;
531 rc = video_device_create_file(vdev, &class_device_attr_frames_total);
532 if (rc) goto err_pal;
533 rc = video_device_create_file(vdev, &class_device_attr_frames_read);
534 if (rc) goto err_framtot;
535 rc = video_device_create_file(vdev, &class_device_attr_packets_dropped);
536 if (rc) goto err_framread;
537 rc = video_device_create_file(vdev, &class_device_attr_decoding_errors);
538 if (rc) goto err_dropped;
539
540 return 0;
541
542err_dropped:
543 video_device_remove_file(vdev, &class_device_attr_packets_dropped);
544err_framread:
545 video_device_remove_file(vdev, &class_device_attr_frames_read);
546err_framtot:
547 video_device_remove_file(vdev, &class_device_attr_frames_total);
548err_pal:
549 video_device_remove_file(vdev, &class_device_attr_palette);
550err_stream:
551 video_device_remove_file(vdev, &class_device_attr_streaming);
552err_inuse:
553 video_device_remove_file(vdev, &class_device_attr_in_use);
554err_model:
555 video_device_remove_file(vdev, &class_device_attr_model);
556err:
557 return rc;
529} 558}
530 559
531static void stv680_remove_sysfs_files(struct video_device *vdev) 560static void stv680_remove_sysfs_files(struct video_device *vdev)
@@ -582,7 +611,7 @@ static int stv680_set_pict (struct usb_stv *stv680, struct video_picture *p)
582 return 0; 611 return 0;
583} 612}
584 613
585static void stv680_video_irq (struct urb *urb, struct pt_regs *regs) 614static void stv680_video_irq (struct urb *urb)
586{ 615{
587 struct usb_stv *stv680 = urb->context; 616 struct usb_stv *stv680 = urb->context;
588 int length = urb->actual_length; 617 int length = urb->actual_length;
@@ -1418,9 +1447,13 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
1418 PDEBUG (0, "STV(i): registered new video device: video%d", stv680->vdev->minor); 1447 PDEBUG (0, "STV(i): registered new video device: video%d", stv680->vdev->minor);
1419 1448
1420 usb_set_intfdata (intf, stv680); 1449 usb_set_intfdata (intf, stv680);
1421 stv680_create_sysfs_files(stv680->vdev); 1450 retval = stv680_create_sysfs_files(stv680->vdev);
1451 if (retval)
1452 goto error_unreg;
1422 return 0; 1453 return 0;
1423 1454
1455error_unreg:
1456 video_unregister_device(stv680->vdev);
1424error_vdev: 1457error_vdev:
1425 video_device_release(stv680->vdev); 1458 video_device_release(stv680->vdev);
1426error: 1459error:
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c
index 8fff642fad56..781682373b61 100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
@@ -1046,7 +1046,6 @@ static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = {
1046 .type = TUNER_PARAM_TYPE_NTSC, 1046 .type = TUNER_PARAM_TYPE_NTSC,
1047 .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges, 1047 .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges,
1048 .count = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges), 1048 .count = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges),
1049 .has_tda9887 = 1,
1050 }, 1049 },
1051}; 1050};
1052 1051
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index cd1502ac9560..e6baaee038bf 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -222,8 +222,8 @@ hauppauge_tuner[] =
222 { TUNER_TCL_2002MB, "TCL M2523_3DB_E"}, 222 { TUNER_TCL_2002MB, "TCL M2523_3DB_E"},
223 { TUNER_ABSENT, "Philips 8275A"}, 223 { TUNER_ABSENT, "Philips 8275A"},
224 { TUNER_ABSENT, "Microtune MT2060"}, 224 { TUNER_ABSENT, "Microtune MT2060"},
225 { TUNER_ABSENT, "Philips FM1236 MK5"}, 225 { TUNER_PHILIPS_FM1236_MK3, "Philips FM1236 MK5"},
226 { TUNER_ABSENT, "Philips FM1216ME MK5"}, 226 { TUNER_PHILIPS_FM1216ME_MK3, "Philips FM1216ME MK5"},
227 { TUNER_ABSENT, "TCL M2523_3DI_E"}, 227 { TUNER_ABSENT, "TCL M2523_3DI_E"},
228 { TUNER_ABSENT, "Samsung THPD5222FG30A"}, 228 { TUNER_ABSENT, "Samsung THPD5222FG30A"},
229 /* 120-129 */ 229 /* 120-129 */
diff --git a/drivers/media/video/usbvideo/konicawc.c b/drivers/media/video/usbvideo/konicawc.c
index 4eee8be88314..abe214619092 100644
--- a/drivers/media/video/usbvideo/konicawc.c
+++ b/drivers/media/video/usbvideo/konicawc.c
@@ -387,7 +387,7 @@ static void resubmit_urb(struct uvd *uvd, struct urb *urb)
387} 387}
388 388
389 389
390static void konicawc_isoc_irq(struct urb *urb, struct pt_regs *regs) 390static void konicawc_isoc_irq(struct urb *urb)
391{ 391{
392 struct uvd *uvd = urb->context; 392 struct uvd *uvd = urb->context;
393 struct konicawc *cam = (struct konicawc *)uvd->user_data; 393 struct konicawc *cam = (struct konicawc *)uvd->user_data;
diff --git a/drivers/media/video/usbvideo/quickcam_messenger.c b/drivers/media/video/usbvideo/quickcam_messenger.c
index 56e01b622417..9a26b9484aae 100644
--- a/drivers/media/video/usbvideo/quickcam_messenger.c
+++ b/drivers/media/video/usbvideo/quickcam_messenger.c
@@ -125,7 +125,7 @@ static void qcm_report_buttonstat(struct qcm *cam)
125 } 125 }
126} 126}
127 127
128static void qcm_int_irq(struct urb *urb, struct pt_regs *regs) 128static void qcm_int_irq(struct urb *urb)
129{ 129{
130 int ret; 130 int ret;
131 struct uvd *uvd = urb->context; 131 struct uvd *uvd = urb->context;
@@ -606,7 +606,7 @@ static void resubmit_urb(struct uvd *uvd, struct urb *urb)
606 err("usb_submit_urb error (%d)", ret); 606 err("usb_submit_urb error (%d)", ret);
607} 607}
608 608
609static void qcm_isoc_irq(struct urb *urb, struct pt_regs *regs) 609static void qcm_isoc_irq(struct urb *urb)
610{ 610{
611 int len; 611 int len;
612 struct uvd *uvd = urb->context; 612 struct uvd *uvd = urb->context;
diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c
index 13b37c8c0d56..d8b88024bc2f 100644
--- a/drivers/media/video/usbvideo/usbvideo.c
+++ b/drivers/media/video/usbvideo/usbvideo.c
@@ -1680,7 +1680,7 @@ static int usbvideo_CompressIsochronous(struct uvd *uvd, struct urb *urb)
1680 return totlen; 1680 return totlen;
1681} 1681}
1682 1682
1683static void usbvideo_IsocIrq(struct urb *urb, struct pt_regs *regs) 1683static void usbvideo_IsocIrq(struct urb *urb)
1684{ 1684{
1685 int i, ret, len; 1685 int i, ret, len;
1686 struct uvd *uvd = urb->context; 1686 struct uvd *uvd = urb->context;
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 479a0675cf60..d424a4129d69 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -17,10 +17,11 @@
17 */ 17 */
18 18
19#define dbgarg(cmd, fmt, arg...) \ 19#define dbgarg(cmd, fmt, arg...) \
20 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ 20 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { \
21 printk (KERN_DEBUG "%s: ", vfd->name); \ 21 printk (KERN_DEBUG "%s: ", vfd->name); \
22 v4l_printk_ioctl(cmd); \ 22 v4l_printk_ioctl(cmd); \
23 printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg); 23 printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg); \
24 }
24 25
25#define dbgarg2(fmt, arg...) \ 26#define dbgarg2(fmt, arg...) \
26 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ 27 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \
@@ -1287,6 +1288,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
1287 ret=vfd->vidioc_g_parm(file, fh, p); 1288 ret=vfd->vidioc_g_parm(file, fh, p);
1288 } else { 1289 } else {
1289 struct v4l2_standard s; 1290 struct v4l2_standard s;
1291 int i;
1290 1292
1291 if (!vfd->tvnormsize) { 1293 if (!vfd->tvnormsize) {
1292 printk (KERN_WARNING "%s: no TV norms defined!\n", 1294 printk (KERN_WARNING "%s: no TV norms defined!\n",
@@ -1297,8 +1299,14 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
1297 if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 1299 if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1298 return -EINVAL; 1300 return -EINVAL;
1299 1301
1300 v4l2_video_std_construct(&s, vfd->tvnorms[vfd->current_norm].id, 1302 for (i = 0; i < vfd->tvnormsize; i++)
1301 vfd->tvnorms[vfd->current_norm].name); 1303 if (vfd->tvnorms[i].id == vfd->current_norm)
1304 break;
1305 if (i >= vfd->tvnormsize)
1306 return -EINVAL;
1307
1308 v4l2_video_std_construct(&s, vfd->current_norm,
1309 vfd->tvnorms[i].name);
1302 1310
1303 memset(p,0,sizeof(*p)); 1311 memset(p,0,sizeof(*p));
1304 1312
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
index d1e04f7c530b..6b6dff4d236a 100644
--- a/drivers/media/video/vino.c
+++ b/drivers/media/video/vino.c
@@ -2325,7 +2325,7 @@ static void vino_capture_tasklet(unsigned long channel) {
2325 } 2325 }
2326} 2326}
2327 2327
2328static irqreturn_t vino_interrupt(int irq, void *dev_id, struct pt_regs *regs) 2328static irqreturn_t vino_interrupt(int irq, void *dev_id)
2329{ 2329{
2330 u32 ctrl, intr; 2330 u32 ctrl, intr;
2331 unsigned int fc_a, fc_b; 2331 unsigned int fc_a, fc_b;
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index e7c01d560b64..3c8dc72dc8e9 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -272,7 +272,7 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
272 272
273 /* Get first addr pointed to pixel position */ 273 /* Get first addr pointed to pixel position */
274 oldpg=get_addr_pos(pos,pages,to_addr); 274 oldpg=get_addr_pos(pos,pages,to_addr);
275 pg=pfn_to_page(to_addr[oldpg].sg->dma_address >> PAGE_SHIFT); 275 pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg) >> PAGE_SHIFT);
276 basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset; 276 basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset;
277 277
278 /* We will just duplicate the second pixel at the packet */ 278 /* We will just duplicate the second pixel at the packet */
@@ -287,7 +287,7 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
287 for (color=0;color<4;color++) { 287 for (color=0;color<4;color++) {
288 pgpos=get_addr_pos(pos,pages,to_addr); 288 pgpos=get_addr_pos(pos,pages,to_addr);
289 if (pgpos!=oldpg) { 289 if (pgpos!=oldpg) {
290 pg=pfn_to_page(to_addr[pgpos].sg->dma_address >> PAGE_SHIFT); 290 pg=pfn_to_page(sg_dma_address(to_addr[pgpos].sg) >> PAGE_SHIFT);
291 kunmap_atomic(basep, KM_BOUNCE_READ); 291 kunmap_atomic(basep, KM_BOUNCE_READ);
292 basep= kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[pgpos].sg->offset; 292 basep= kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[pgpos].sg->offset;
293 oldpg=pgpos; 293 oldpg=pgpos;
@@ -339,8 +339,8 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
339 for (color=0;color<4;color++) { 339 for (color=0;color<4;color++) {
340 pgpos=get_addr_pos(pos,pages,to_addr); 340 pgpos=get_addr_pos(pos,pages,to_addr);
341 if (pgpos!=oldpg) { 341 if (pgpos!=oldpg) {
342 pg=pfn_to_page(to_addr[pgpos]. 342 pg=pfn_to_page(sg_dma_address(
343 sg->dma_address 343 to_addr[pgpos].sg)
344 >> PAGE_SHIFT); 344 >> PAGE_SHIFT);
345 kunmap_atomic(basep, 345 kunmap_atomic(basep,
346 KM_BOUNCE_READ); 346 KM_BOUNCE_READ);
@@ -386,7 +386,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
386 struct timeval ts; 386 struct timeval ts;
387 387
388 /* Test if DMA mapping is ready */ 388 /* Test if DMA mapping is ready */
389 if (!vb->dma.sglist[0].dma_address) 389 if (!sg_dma_address(&vb->dma.sglist[0]))
390 return; 390 return;
391 391
392 prep_to_addr(to_addr,vb); 392 prep_to_addr(to_addr,vb);
@@ -783,7 +783,7 @@ static int vivi_map_sg(void *dev, struct scatterlist *sg, int nents,
783 for (i = 0; i < nents; i++ ) { 783 for (i = 0; i < nents; i++ ) {
784 BUG_ON(!sg[i].page); 784 BUG_ON(!sg[i].page);
785 785
786 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; 786 sg_dma_address(&sg[i]) = page_to_phys(sg[i].page) + sg[i].offset;
787 } 787 }
788 788
789 return nents; 789 return nents;
diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
index 2912326a5aef..ddce2fb83424 100644
--- a/drivers/media/video/w9968cf.c
+++ b/drivers/media/video/w9968cf.c
@@ -417,7 +417,7 @@ static int w9968cf_write_fsb(struct w9968cf_device*, u16* data);
417static int w9968cf_write_sb(struct w9968cf_device*, u16 value); 417static int w9968cf_write_sb(struct w9968cf_device*, u16 value);
418static int w9968cf_read_sb(struct w9968cf_device*); 418static int w9968cf_read_sb(struct w9968cf_device*);
419static int w9968cf_upload_quantizationtables(struct w9968cf_device*); 419static int w9968cf_upload_quantizationtables(struct w9968cf_device*);
420static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs); 420static void w9968cf_urb_complete(struct urb *urb);
421 421
422/* Low-level I2C (SMBus) I/O */ 422/* Low-level I2C (SMBus) I/O */
423static int w9968cf_smbus_start(struct w9968cf_device*); 423static int w9968cf_smbus_start(struct w9968cf_device*);
@@ -781,7 +781,7 @@ static int w9968cf_allocate_memory(struct w9968cf_device* cam)
781 If there are no requested frames in the FIFO list, packets are collected into 781 If there are no requested frames in the FIFO list, packets are collected into
782 a temporary buffer. 782 a temporary buffer.
783 --------------------------------------------------------------------------*/ 783 --------------------------------------------------------------------------*/
784static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs) 784static void w9968cf_urb_complete(struct urb *urb)
785{ 785{
786 struct w9968cf_device* cam = (struct w9968cf_device*)urb->context; 786 struct w9968cf_device* cam = (struct w9968cf_device*)urb->context;
787 struct w9968cf_frame_t** f; 787 struct w9968cf_frame_t** f;
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index 1b2be2d2a3ec..5b5563424422 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -303,7 +303,7 @@ int zc0301_i2c_write(struct zc0301_device* cam, u16 address, u16 value)
303 303
304/*****************************************************************************/ 304/*****************************************************************************/
305 305
306static void zc0301_urb_complete(struct urb *urb, struct pt_regs* regs) 306static void zc0301_urb_complete(struct urb *urb)
307{ 307{
308 struct zc0301_device* cam = urb->context; 308 struct zc0301_device* cam = urb->context;
309 struct zc0301_frame_t** f; 309 struct zc0301_frame_t** f;
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c
index 9f21d0ba0f0f..653822ce391c 100644
--- a/drivers/media/video/zoran_card.c
+++ b/drivers/media/video/zoran_card.c
@@ -1278,9 +1278,7 @@ find_zr36057 (void)
1278 1278
1279 zoran_num = 0; 1279 zoran_num = 0;
1280 while (zoran_num < BUZ_MAX && 1280 while (zoran_num < BUZ_MAX &&
1281 (dev = 1281 (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
1282 pci_find_device(PCI_VENDOR_ID_ZORAN,
1283 PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
1284 card_num = card[zoran_num]; 1282 card_num = card[zoran_num];
1285 zr = &zoran[zoran_num]; 1283 zr = &zoran[zoran_num];
1286 memset(zr, 0, sizeof(struct zoran)); // Just in case if previous cycle failed 1284 memset(zr, 0, sizeof(struct zoran)); // Just in case if previous cycle failed
@@ -1541,7 +1539,8 @@ find_zr36057 (void)
1541 goto zr_detach_vfe; 1539 goto zr_detach_vfe;
1542 } 1540 }
1543 } 1541 }
1544 1542 /* Success so keep the pci_dev referenced */
1543 pci_dev_get(zr->pci_dev);
1545 zoran_num++; 1544 zoran_num++;
1546 continue; 1545 continue;
1547 1546
@@ -1563,6 +1562,9 @@ find_zr36057 (void)
1563 iounmap(zr->zr36057_mem); 1562 iounmap(zr->zr36057_mem);
1564 continue; 1563 continue;
1565 } 1564 }
1565 if (dev) /* Clean up ref count on early exit */
1566 pci_dev_put(dev);
1567
1566 if (zoran_num == 0) { 1568 if (zoran_num == 0) {
1567 dprintk(1, KERN_INFO "No known MJPEG cards found.\n"); 1569 dprintk(1, KERN_INFO "No known MJPEG cards found.\n");
1568 } 1570 }
diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c
index 3cbac2e8aed3..168e431d7c71 100644
--- a/drivers/media/video/zoran_device.c
+++ b/drivers/media/video/zoran_device.c
@@ -1408,15 +1408,14 @@ error_handler (struct zoran *zr,
1408 1408
1409irqreturn_t 1409irqreturn_t
1410zoran_irq (int irq, 1410zoran_irq (int irq,
1411 void *dev_id, 1411 void *dev_id)
1412 struct pt_regs *regs)
1413{ 1412{
1414 u32 stat, astat; 1413 u32 stat, astat;
1415 int count; 1414 int count;
1416 struct zoran *zr; 1415 struct zoran *zr;
1417 unsigned long flags; 1416 unsigned long flags;
1418 1417
1419 zr = (struct zoran *) dev_id; 1418 zr = dev_id;
1420 count = 0; 1419 count = 0;
1421 1420
1422 if (zr->testing) { 1421 if (zr->testing) {
diff --git a/drivers/media/video/zoran_device.h b/drivers/media/video/zoran_device.h
index f19705cbdb39..37fa86a34083 100644
--- a/drivers/media/video/zoran_device.h
+++ b/drivers/media/video/zoran_device.h
@@ -64,9 +64,7 @@ extern int wait_grab_pending(struct zoran *zr);
64/* interrupts */ 64/* interrupts */
65extern void print_interrupts(struct zoran *zr); 65extern void print_interrupts(struct zoran *zr);
66extern void clear_interrupt_counters(struct zoran *zr); 66extern void clear_interrupt_counters(struct zoran *zr);
67extern irqreturn_t zoran_irq(int irq, 67extern irqreturn_t zoran_irq(int irq, void *dev_id);
68 void *dev_id,
69 struct pt_regs *regs);
70 68
71/* JPEG codec access */ 69/* JPEG codec access */
72extern void jpeg_start(struct zoran *zr); 70extern void jpeg_start(struct zoran *zr);
diff --git a/drivers/media/video/zr36120.c b/drivers/media/video/zr36120.c
index 9240638a0134..0cbf564388a6 100644
--- a/drivers/media/video/zr36120.c
+++ b/drivers/media/video/zr36120.c
@@ -335,13 +335,13 @@ DEBUG(printk(CARD_DEBUG "turning off\n",CARD));
335} 335}
336 336
337static 337static
338void zoran_irq(int irq, void *dev_id, struct pt_regs * regs) 338void zoran_irq(int irq, void *dev_id)
339{ 339{
340 u32 stat,estat; 340 u32 stat,estat;
341 int count = 0; 341 int count = 0;
342 struct zoran *ztv = dev_id; 342 struct zoran *ztv = dev_id;
343 343
344 UNUSED(irq); UNUSED(regs); 344 UNUSED(irq);
345 for (;;) { 345 for (;;) {
346 /* get/clear interrupt status bits */ 346 /* get/clear interrupt status bits */
347 stat=zrread(ZORAN_ISR); 347 stat=zrread(ZORAN_ISR);
@@ -1840,16 +1840,16 @@ int __init find_zoran(void)
1840 struct zoran *ztv; 1840 struct zoran *ztv;
1841 struct pci_dev *dev = NULL; 1841 struct pci_dev *dev = NULL;
1842 unsigned char revision; 1842 unsigned char revision;
1843 int zoran_num=0; 1843 int zoran_num = 0;
1844 1844
1845 while ((dev = pci_find_device(PCI_VENDOR_ID_ZORAN,PCI_DEVICE_ID_ZORAN_36120, dev))) 1845 while ((dev = pci_get_device(PCI_VENDOR_ID_ZORAN,PCI_DEVICE_ID_ZORAN_36120, dev)))
1846 { 1846 {
1847 /* Ok, a ZR36120/ZR36125 found! */ 1847 /* Ok, a ZR36120/ZR36125 found! */
1848 ztv = &zorans[zoran_num]; 1848 ztv = &zorans[zoran_num];
1849 ztv->dev = dev; 1849 ztv->dev = dev;
1850 1850
1851 if (pci_enable_device(dev)) 1851 if (pci_enable_device(dev))
1852 return -EIO; 1852 continue;
1853 1853
1854 pci_read_config_byte(dev, PCI_CLASS_REVISION, &revision); 1854 pci_read_config_byte(dev, PCI_CLASS_REVISION, &revision);
1855 printk(KERN_INFO "zoran: Zoran %x (rev %d) ", 1855 printk(KERN_INFO "zoran: Zoran %x (rev %d) ",
@@ -1867,17 +1867,18 @@ int __init find_zoran(void)
1867 { 1867 {
1868 iounmap(ztv->zoran_mem); 1868 iounmap(ztv->zoran_mem);
1869 printk(KERN_ERR "zoran: Bad irq number or handler\n"); 1869 printk(KERN_ERR "zoran: Bad irq number or handler\n");
1870 return -EINVAL; 1870 continue;
1871 } 1871 }
1872 if (result==-EBUSY) 1872 if (result==-EBUSY)
1873 printk(KERN_ERR "zoran: IRQ %d busy, change your PnP config in BIOS\n",dev->irq); 1873 printk(KERN_ERR "zoran: IRQ %d busy, change your PnP config in BIOS\n",dev->irq);
1874 if (result < 0) { 1874 if (result < 0) {
1875 iounmap(ztv->zoran_mem); 1875 iounmap(ztv->zoran_mem);
1876 return result; 1876 continue;
1877 } 1877 }
1878 /* Enable bus-mastering */ 1878 /* Enable bus-mastering */
1879 pci_set_master(dev); 1879 pci_set_master(dev);
1880 1880 /* Keep a reference */
1881 pci_dev_get(dev);
1881 zoran_num++; 1882 zoran_num++;
1882 } 1883 }
1883 if(zoran_num) 1884 if(zoran_num)
@@ -2041,6 +2042,9 @@ void release_zoran(int max)
2041 if (ztv->zoran_mem) 2042 if (ztv->zoran_mem)
2042 iounmap(ztv->zoran_mem); 2043 iounmap(ztv->zoran_mem);
2043 2044
2045 /* Drop PCI device */
2046 pci_dev_put(ztv->dev);
2047
2044 video_unregister_device(&ztv->video_dev); 2048 video_unregister_device(&ztv->video_dev);
2045 video_unregister_device(&ztv->vbi_dev); 2049 video_unregister_device(&ztv->vbi_dev);
2046 } 2050 }
@@ -2057,13 +2061,12 @@ int __init zr36120_init(void)
2057 2061
2058 handle_chipset(); 2062 handle_chipset();
2059 zoran_cards = find_zoran(); 2063 zoran_cards = find_zoran();
2060 if (zoran_cards<0) 2064 if (zoran_cards <= 0)
2061 /* no cards found, no need for a driver */
2062 return -EIO; 2065 return -EIO;
2063 2066
2064 /* initialize Zorans */ 2067 /* initialize Zorans */
2065 for (card=0; card<zoran_cards; card++) { 2068 for (card=0; card<zoran_cards; card++) {
2066 if (init_zoran(card)<0) { 2069 if (init_zoran(card) < 0) {
2067 /* only release the zorans we have registered */ 2070 /* only release the zorans we have registered */
2068 release_zoran(card); 2071 release_zoran(card);
2069 return -EIO; 2072 return -EIO;