aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
commit0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch)
treedcced72d230d69fd0c5816ac6dd03ab84799a93e /drivers/media
parente138a5d2356729b8752e88520cc1525fae9794ac (diff)
parentf26b90440cd74c78fe10c9bd5160809704a9627c (diff)
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/saa7146_i2c.c10
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.c2
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c4
-rw-r--r--drivers/media/dvb/dvb-core/Kconfig2
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig12
-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/frontends/Kconfig2
-rw-r--r--drivers/media/dvb/frontends/bcm3510.h2
-rw-r--r--drivers/media/dvb/frontends/cx22700.h2
-rw-r--r--drivers/media/dvb/frontends/cx22702.h2
-rw-r--r--drivers/media/dvb/frontends/cx24110.h2
-rw-r--r--drivers/media/dvb/frontends/cx24123.h2
-rw-r--r--drivers/media/dvb/frontends/dib3000.h2
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c2
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.h5
-rw-r--r--drivers/media/dvb/frontends/isl6421.h2
-rw-r--r--drivers/media/dvb/frontends/l64781.h2
-rw-r--r--drivers/media/dvb/frontends/lgdt330x.h2
-rw-r--r--drivers/media/dvb/frontends/lnbp21.h2
-rw-r--r--drivers/media/dvb/frontends/mt2060.h8
-rw-r--r--drivers/media/dvb/frontends/mt312.h2
-rw-r--r--drivers/media/dvb/frontends/mt352.h2
-rw-r--r--drivers/media/dvb/frontends/nxt200x.h2
-rw-r--r--drivers/media/dvb/frontends/nxt6000.h2
-rw-r--r--drivers/media/dvb/frontends/or51132.h2
-rw-r--r--drivers/media/dvb/frontends/or51211.h2
-rw-r--r--drivers/media/dvb/frontends/s5h1420.h2
-rw-r--r--drivers/media/dvb/frontends/sp8870.h2
-rw-r--r--drivers/media/dvb/frontends/sp887x.h2
-rw-r--r--drivers/media/dvb/frontends/stv0297.h2
-rw-r--r--drivers/media/dvb/frontends/stv0299.h2
-rw-r--r--drivers/media/dvb/frontends/tda10021.h2
-rw-r--r--drivers/media/dvb/frontends/tda1004x.h2
-rw-r--r--drivers/media/dvb/frontends/tda10086.h9
-rw-r--r--drivers/media/dvb/frontends/tda8083.h2
-rw-r--r--drivers/media/dvb/frontends/tda826x.c2
-rw-r--r--drivers/media/dvb/frontends/tda826x.h19
-rw-r--r--drivers/media/dvb/frontends/tua6100.h2
-rw-r--r--drivers/media/dvb/frontends/ves1820.h2
-rw-r--r--drivers/media/dvb/frontends/ves1x93.h2
-rw-r--r--drivers/media/dvb/frontends/zl10353.h2
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c10
-rw-r--r--drivers/media/video/Kconfig4
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c2
-rw-r--r--drivers/media/video/cx25840/cx25840-vbi.c25
-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.c12
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c37
-rw-r--r--drivers/media/video/ov511.c58
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c6
-rw-r--r--drivers/media/video/pwc/pwc-if.c41
-rw-r--r--drivers/media/video/saa7115.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c5
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c11
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c6
-rw-r--r--drivers/media/video/sn9c102/sn9c102_core.c71
-rw-r--r--drivers/media/video/stv680.c53
-rw-r--r--drivers/media/video/tuner-types.c1
-rw-r--r--drivers/media/video/tveeprom.c2
-rw-r--r--drivers/media/video/videodev.c16
-rw-r--r--drivers/media/video/vivi.c12
66 files changed, 430 insertions, 135 deletions
diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c
index d9953f7a8b6b..5297a365c928 100644
--- a/drivers/media/common/saa7146_i2c.c
+++ b/drivers/media/common/saa7146_i2c.c
@@ -217,11 +217,9 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
217 } 217 }
218 /* wait until we get a transfer done or error */ 218 /* wait until we get a transfer done or error */
219 timeout = jiffies + HZ/100 + 1; /* 10ms */ 219 timeout = jiffies + HZ/100 + 1; /* 10ms */
220 /* first read usually delivers bogus results... */
221 saa7146_i2c_status(dev);
220 while(1) { 222 while(1) {
221 /**
222 * first read usually delivers bogus results...
223 */
224 saa7146_i2c_status(dev);
225 status = saa7146_i2c_status(dev); 223 status = saa7146_i2c_status(dev);
226 if ((status & 0x3) != 1) 224 if ((status & 0x3) != 1)
227 break; 225 break;
@@ -232,10 +230,10 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d
232 DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n")); 230 DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n"));
233 return -EIO; 231 return -EIO;
234 } 232 }
235 if ((++trial < 20) && short_delay) 233 if (++trial < 50 && short_delay)
236 udelay(10); 234 udelay(10);
237 else 235 else
238 msleep(1); 236 msleep(1);
239 } 237 }
240 } 238 }
241 239
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c
index 2853ea1bdaf1..87fb75f0d1cf 100644
--- a/drivers/media/dvb/b2c2/flexcop-usb.c
+++ b/drivers/media/dvb/b2c2/flexcop-usb.c
@@ -246,7 +246,7 @@ static int flexcop_usb_i2c_req(struct flexcop_usb *fc_usb,
246 wIndex = (chipaddr << 8 ) | addr; 246 wIndex = (chipaddr << 8 ) | addr;
247 247
248 deb_i2c("i2c %2d: %02x %02x %02x %02x %02x %02x\n",func,request_type,req, 248 deb_i2c("i2c %2d: %02x %02x %02x %02x %02x %02x\n",func,request_type,req,
249 ((wValue && 0xff) << 8),wValue >> 8,((wIndex && 0xff) << 8),wIndex >> 8); 249 wValue & 0xff, wValue >> 8, wIndex & 0xff, wIndex >> 8);
250 250
251 len = usb_control_msg(fc_usb->udev,pipe, 251 len = usb_control_msg(fc_usb->udev,pipe,
252 req, 252 req,
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/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 2cc5caa26a0a..a263b3f3c21d 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -26,7 +26,7 @@ config DVB_USB_A800
26 tristate "AVerMedia AverTV DVB-T USB 2.0 (A800)" 26 tristate "AVerMedia AverTV DVB-T USB 2.0 (A800)"
27 depends on DVB_USB 27 depends on DVB_USB
28 select DVB_DIB3000MC 28 select DVB_DIB3000MC
29 select DVB_TUNER_MT2060 29 select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
30 help 30 help
31 Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver. 31 Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver.
32 32
@@ -34,7 +34,7 @@ config DVB_USB_DIBUSB_MB
34 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-B) (see help for device list)" 34 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-B) (see help for device list)"
35 depends on DVB_USB 35 depends on DVB_USB
36 select DVB_DIB3000MB 36 select DVB_DIB3000MB
37 select DVB_TUNER_MT2060 37 select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
38 help 38 help
39 Support for USB 1.1 and 2.0 DVB-T receivers based on reference designs made by 39 Support for USB 1.1 and 2.0 DVB-T receivers based on reference designs made by
40 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator. 40 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator.
@@ -55,7 +55,7 @@ config DVB_USB_DIBUSB_MC
55 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)" 55 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)"
56 depends on DVB_USB 56 depends on DVB_USB
57 select DVB_DIB3000MC 57 select DVB_DIB3000MC
58 select DVB_TUNER_MT2060 58 select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
59 help 59 help
60 Support for USB2.0 DVB-T receivers based on reference designs made by 60 Support for USB2.0 DVB-T receivers based on reference designs made by
61 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator. 61 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator.
@@ -70,7 +70,7 @@ config 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_DIB3000MC 72 select DVB_DIB3000MC
73 select DVB_TUNER_MT2060 73 select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
74 help 74 help
75 Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The 75 Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The
76 USB bridge is also present in devices having the DiB7700 DVB-T-USB 76 USB bridge is also present in devices having the DiB7700 DVB-T-USB
@@ -87,7 +87,7 @@ config DVB_USB_UMT_010
87 tristate "HanfTek UMT-010 DVB-T USB2.0 support" 87 tristate "HanfTek UMT-010 DVB-T USB2.0 support"
88 depends on DVB_USB 88 depends on DVB_USB
89 select DVB_DIB3000MC 89 select DVB_DIB3000MC
90 select DVB_TUNER_MT2060 90 select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
91 help 91 help
92 Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver. 92 Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver.
93 93
@@ -153,7 +153,7 @@ config DVB_USB_NOVA_T_USB2
153 tristate "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support" 153 tristate "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support"
154 depends on DVB_USB 154 depends on DVB_USB
155 select DVB_DIB3000MC 155 select DVB_DIB3000MC
156 select DVB_TUNER_MT2060 156 select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
157 help 157 help
158 Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver. 158 Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver.
159 159
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/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig
index 080fa257a0bc..aebb8d6f26f8 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -276,6 +276,8 @@ config DVB_TDA826X
276 276
277config DVB_TUNER_MT2060 277config DVB_TUNER_MT2060
278 tristate "Microtune MT2060 silicon IF tuner" 278 tristate "Microtune MT2060 silicon IF tuner"
279 depends on I2C
280 default m if DVB_FE_CUSTOMISE
279 help 281 help
280 A driver for the silicon IF tuner MT2060 from Microtune. 282 A driver for the silicon IF tuner MT2060 from Microtune.
281 283
diff --git a/drivers/media/dvb/frontends/bcm3510.h b/drivers/media/dvb/frontends/bcm3510.h
index 6dfa839a7022..7e4f95e1734b 100644
--- a/drivers/media/dvb/frontends/bcm3510.h
+++ b/drivers/media/dvb/frontends/bcm3510.h
@@ -34,7 +34,7 @@ struct bcm3510_config
34 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name); 34 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
35}; 35};
36 36
37#if defined(CONFIG_DVB_BCM3510) || defined(CONFIG_DVB_BCM3510_MODULE) 37#if defined(CONFIG_DVB_BCM3510) || (defined(CONFIG_DVB_BCM3510_MODULE) && defined(MODULE))
38extern struct dvb_frontend* bcm3510_attach(const struct bcm3510_config* config, 38extern struct dvb_frontend* bcm3510_attach(const struct bcm3510_config* config,
39 struct i2c_adapter* i2c); 39 struct i2c_adapter* i2c);
40#else 40#else
diff --git a/drivers/media/dvb/frontends/cx22700.h b/drivers/media/dvb/frontends/cx22700.h
index 10286cc29fb4..7ac33690cdcc 100644
--- a/drivers/media/dvb/frontends/cx22700.h
+++ b/drivers/media/dvb/frontends/cx22700.h
@@ -31,7 +31,7 @@ struct cx22700_config
31 u8 demod_address; 31 u8 demod_address;
32}; 32};
33 33
34#if defined(CONFIG_DVB_CX22700) || defined(CONFIG_DVB_CX22700_MODULE) 34#if defined(CONFIG_DVB_CX22700) || (defined(CONFIG_DVB_CX22700_MODULE) && defined(MODULE))
35extern struct dvb_frontend* cx22700_attach(const struct cx22700_config* config, 35extern struct dvb_frontend* cx22700_attach(const struct cx22700_config* config,
36 struct i2c_adapter* i2c); 36 struct i2c_adapter* i2c);
37#else 37#else
diff --git a/drivers/media/dvb/frontends/cx22702.h b/drivers/media/dvb/frontends/cx22702.h
index bc217ddf02c0..9cd64da6ee40 100644
--- a/drivers/media/dvb/frontends/cx22702.h
+++ b/drivers/media/dvb/frontends/cx22702.h
@@ -41,7 +41,7 @@ struct cx22702_config
41 u8 output_mode; 41 u8 output_mode;
42}; 42};
43 43
44#if defined(CONFIG_DVB_CX22702) || defined(CONFIG_DVB_CX22702_MODULE) 44#if defined(CONFIG_DVB_CX22702) || (defined(CONFIG_DVB_CX22702_MODULE) && defined(MODULE))
45extern struct dvb_frontend* cx22702_attach(const struct cx22702_config* config, 45extern struct dvb_frontend* cx22702_attach(const struct cx22702_config* config,
46 struct i2c_adapter* i2c); 46 struct i2c_adapter* i2c);
47#else 47#else
diff --git a/drivers/media/dvb/frontends/cx24110.h b/drivers/media/dvb/frontends/cx24110.h
index c9d5ae250ebb..0ca3af4db513 100644
--- a/drivers/media/dvb/frontends/cx24110.h
+++ b/drivers/media/dvb/frontends/cx24110.h
@@ -41,7 +41,7 @@ static inline int cx24110_pll_write(struct dvb_frontend *fe, u32 val) {
41 return r; 41 return r;
42} 42}
43 43
44#if defined(CONFIG_DVB_CX24110) || defined(CONFIG_DVB_CX24110_MODULE) 44#if defined(CONFIG_DVB_CX24110) || (defined(CONFIG_DVB_CX24110_MODULE) && defined(MODULE))
45extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config, 45extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
46 struct i2c_adapter* i2c); 46 struct i2c_adapter* i2c);
47#else 47#else
diff --git a/drivers/media/dvb/frontends/cx24123.h b/drivers/media/dvb/frontends/cx24123.h
index 57a1dae1dc40..84f9e4f5c15e 100644
--- a/drivers/media/dvb/frontends/cx24123.h
+++ b/drivers/media/dvb/frontends/cx24123.h
@@ -35,7 +35,7 @@ struct cx24123_config
35 int lnb_polarity; 35 int lnb_polarity;
36}; 36};
37 37
38#if defined(CONFIG_DVB_CX24123) || defined(CONFIG_DVB_CX24123_MODULE) 38#if defined(CONFIG_DVB_CX24123) || (defined(CONFIG_DVB_CX24123_MODULE) && defined(MODULE))
39extern struct dvb_frontend* cx24123_attach(const struct cx24123_config* config, 39extern struct dvb_frontend* cx24123_attach(const struct cx24123_config* config,
40 struct i2c_adapter* i2c); 40 struct i2c_adapter* i2c);
41#else 41#else
diff --git a/drivers/media/dvb/frontends/dib3000.h b/drivers/media/dvb/frontends/dib3000.h
index 0caac3f0f279..a6d3854a67bc 100644
--- a/drivers/media/dvb/frontends/dib3000.h
+++ b/drivers/media/dvb/frontends/dib3000.h
@@ -41,7 +41,7 @@ struct dib_fe_xfer_ops
41 int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl); 41 int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl);
42}; 42};
43 43
44#if defined(CONFIG_DVB_DIB3000MB) || defined(CONFIG_DVB_DIB3000MB_MODULE) 44#if defined(CONFIG_DVB_DIB3000MB) || (defined(CONFIG_DVB_DIB3000MB_MODULE) && defined(MODULE))
45extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, 45extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
46 struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); 46 struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops);
47#else 47#else
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..72d4757601d8 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;
@@ -36,7 +39,7 @@ struct dib3000mc_config {
36#define DEFAULT_DIB3000MC_I2C_ADDRESS 16 39#define DEFAULT_DIB3000MC_I2C_ADDRESS 16
37#define DEFAULT_DIB3000P_I2C_ADDRESS 24 40#define DEFAULT_DIB3000P_I2C_ADDRESS 24
38 41
39#if defined(CONFIG_DVB_DIB3000MC) || defined(CONFIG_DVB_DIB3000MC_MODULE) 42#if defined(CONFIG_DVB_DIB3000MC) || (defined(CONFIG_DVB_DIB3000MC_MODULE) && defined(MODULE))
40extern struct dvb_frontend * dib3000mc_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib3000mc_config *cfg); 43extern struct dvb_frontend * dib3000mc_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib3000mc_config *cfg);
41#else 44#else
42static inline struct dvb_frontend * dib3000mc_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib3000mc_config *cfg) 45static inline struct dvb_frontend * dib3000mc_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib3000mc_config *cfg)
diff --git a/drivers/media/dvb/frontends/isl6421.h b/drivers/media/dvb/frontends/isl6421.h
index 1916e3eb2df3..ea7f78a7d3cd 100644
--- a/drivers/media/dvb/frontends/isl6421.h
+++ b/drivers/media/dvb/frontends/isl6421.h
@@ -39,7 +39,7 @@
39#define ISL6421_ISEL1 0x20 39#define ISL6421_ISEL1 0x20
40#define ISL6421_DCL 0x40 40#define ISL6421_DCL 0x40
41 41
42#if defined(CONFIG_DVB_ISL6421) || defined(CONFIG_DVB_ISL6421_MODULE) 42#if defined(CONFIG_DVB_ISL6421) || (defined(CONFIG_DVB_ISL6421_MODULE) && defined(MODULE))
43/* override_set and override_clear control which system register bits (above) to always set & clear */ 43/* override_set and override_clear control which system register bits (above) to always set & clear */
44extern struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, 44extern struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr,
45 u8 override_set, u8 override_clear); 45 u8 override_set, u8 override_clear);
diff --git a/drivers/media/dvb/frontends/l64781.h b/drivers/media/dvb/frontends/l64781.h
index 21ba4a230760..cd15f76ff28d 100644
--- a/drivers/media/dvb/frontends/l64781.h
+++ b/drivers/media/dvb/frontends/l64781.h
@@ -31,7 +31,7 @@ struct l64781_config
31 u8 demod_address; 31 u8 demod_address;
32}; 32};
33 33
34#if defined(CONFIG_DVB_L64781) || defined(CONFIG_DVB_L64781_MODULE) 34#if defined(CONFIG_DVB_L64781) || (defined(CONFIG_DVB_L64781_MODULE) && defined(MODULE))
35extern struct dvb_frontend* l64781_attach(const struct l64781_config* config, 35extern struct dvb_frontend* l64781_attach(const struct l64781_config* config,
36 struct i2c_adapter* i2c); 36 struct i2c_adapter* i2c);
37#else 37#else
diff --git a/drivers/media/dvb/frontends/lgdt330x.h b/drivers/media/dvb/frontends/lgdt330x.h
index 3f96b485584c..995059004b10 100644
--- a/drivers/media/dvb/frontends/lgdt330x.h
+++ b/drivers/media/dvb/frontends/lgdt330x.h
@@ -52,7 +52,7 @@ struct lgdt330x_config
52 int clock_polarity_flip; 52 int clock_polarity_flip;
53}; 53};
54 54
55#if defined(CONFIG_DVB_LGDT330X) || defined(CONFIG_DVB_LGDT330X_MODULE) 55#if defined(CONFIG_DVB_LGDT330X) || (defined(CONFIG_DVB_LGDT330X_MODULE) && defined(MODULE))
56extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, 56extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
57 struct i2c_adapter* i2c); 57 struct i2c_adapter* i2c);
58#else 58#else
diff --git a/drivers/media/dvb/frontends/lnbp21.h b/drivers/media/dvb/frontends/lnbp21.h
index 1fe1dd179312..68906acf7d63 100644
--- a/drivers/media/dvb/frontends/lnbp21.h
+++ b/drivers/media/dvb/frontends/lnbp21.h
@@ -39,7 +39,7 @@
39 39
40#include <linux/dvb/frontend.h> 40#include <linux/dvb/frontend.h>
41 41
42#if defined(CONFIG_DVB_LNBP21) || defined(CONFIG_DVB_LNBP21_MODULE) 42#if defined(CONFIG_DVB_LNBP21) || (defined(CONFIG_DVB_LNBP21_MODULE) && defined(MODULE))
43/* override_set and override_clear control which system register bits (above) to always set & clear */ 43/* override_set and override_clear control which system register bits (above) to always set & clear */
44extern struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 override_set, u8 override_clear); 44extern struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 override_set, u8 override_clear);
45#else 45#else
diff --git a/drivers/media/dvb/frontends/mt2060.h b/drivers/media/dvb/frontends/mt2060.h
index 34a37c2b556f..0a86eab3a954 100644
--- a/drivers/media/dvb/frontends/mt2060.h
+++ b/drivers/media/dvb/frontends/mt2060.h
@@ -30,6 +30,14 @@ struct mt2060_config {
30 u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */ 30 u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
31}; 31};
32 32
33#if defined(CONFIG_DVB_TUNER_MT2060) || (defined(CONFIG_DVB_TUNER_MT2060_MODULE) && defined(MODULE))
33extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1); 34extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1);
35#else
36static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1)
37{
38 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
39 return NULL;
40}
41#endif // CONFIG_DVB_TUNER_MT2060
34 42
35#endif 43#endif
diff --git a/drivers/media/dvb/frontends/mt312.h b/drivers/media/dvb/frontends/mt312.h
index 7112fb4d58ac..cf9a1505ad4b 100644
--- a/drivers/media/dvb/frontends/mt312.h
+++ b/drivers/media/dvb/frontends/mt312.h
@@ -34,7 +34,7 @@ struct mt312_config
34 u8 demod_address; 34 u8 demod_address;
35}; 35};
36 36
37#if defined(CONFIG_DVB_MT312) || defined(CONFIG_DVB_MT312_MODULE) 37#if defined(CONFIG_DVB_MT312) || (defined(CONFIG_DVB_MT312_MODULE) && defined(MODULE))
38struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config, 38struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
39 struct i2c_adapter* i2c); 39 struct i2c_adapter* i2c);
40#else 40#else
diff --git a/drivers/media/dvb/frontends/mt352.h b/drivers/media/dvb/frontends/mt352.h
index 0035c2e2d7c2..e9964081fd84 100644
--- a/drivers/media/dvb/frontends/mt352.h
+++ b/drivers/media/dvb/frontends/mt352.h
@@ -51,7 +51,7 @@ struct mt352_config
51 int (*demod_init)(struct dvb_frontend* fe); 51 int (*demod_init)(struct dvb_frontend* fe);
52}; 52};
53 53
54#if defined(CONFIG_DVB_MT352) || defined(CONFIG_DVB_MT352_MODULE) 54#if defined(CONFIG_DVB_MT352) || (defined(CONFIG_DVB_MT352_MODULE) && defined(MODULE))
55extern struct dvb_frontend* mt352_attach(const struct mt352_config* config, 55extern struct dvb_frontend* mt352_attach(const struct mt352_config* config,
56 struct i2c_adapter* i2c); 56 struct i2c_adapter* i2c);
57#else 57#else
diff --git a/drivers/media/dvb/frontends/nxt200x.h b/drivers/media/dvb/frontends/nxt200x.h
index 2eb220e98062..28bc5591b319 100644
--- a/drivers/media/dvb/frontends/nxt200x.h
+++ b/drivers/media/dvb/frontends/nxt200x.h
@@ -45,7 +45,7 @@ struct nxt200x_config
45 int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); 45 int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
46}; 46};
47 47
48#if defined(CONFIG_DVB_NXT200X) || defined(CONFIG_DVB_NXT200X_MODULE) 48#if defined(CONFIG_DVB_NXT200X) || (defined(CONFIG_DVB_NXT200X_MODULE) && defined(MODULE))
49extern struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config, 49extern struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,
50 struct i2c_adapter* i2c); 50 struct i2c_adapter* i2c);
51#else 51#else
diff --git a/drivers/media/dvb/frontends/nxt6000.h b/drivers/media/dvb/frontends/nxt6000.h
index 9397393a6bd1..13d22518356e 100644
--- a/drivers/media/dvb/frontends/nxt6000.h
+++ b/drivers/media/dvb/frontends/nxt6000.h
@@ -33,7 +33,7 @@ struct nxt6000_config
33 u8 clock_inversion:1; 33 u8 clock_inversion:1;
34}; 34};
35 35
36#if defined(CONFIG_DVB_NXT6000) || defined(CONFIG_DVB_NXT6000_MODULE) 36#if defined(CONFIG_DVB_NXT6000) || (defined(CONFIG_DVB_NXT6000_MODULE) && defined(MODULE))
37extern struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, 37extern struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config,
38 struct i2c_adapter* i2c); 38 struct i2c_adapter* i2c);
39#else 39#else
diff --git a/drivers/media/dvb/frontends/or51132.h b/drivers/media/dvb/frontends/or51132.h
index 9718be4fb835..add24f0a743b 100644
--- a/drivers/media/dvb/frontends/or51132.h
+++ b/drivers/media/dvb/frontends/or51132.h
@@ -34,7 +34,7 @@ struct or51132_config
34 int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); 34 int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
35}; 35};
36 36
37#if defined(CONFIG_DVB_OR51132) || defined(CONFIG_DVB_OR51132_MODULE) 37#if defined(CONFIG_DVB_OR51132) || (defined(CONFIG_DVB_OR51132_MODULE) && defined(MODULE))
38extern struct dvb_frontend* or51132_attach(const struct or51132_config* config, 38extern struct dvb_frontend* or51132_attach(const struct or51132_config* config,
39 struct i2c_adapter* i2c); 39 struct i2c_adapter* i2c);
40#else 40#else
diff --git a/drivers/media/dvb/frontends/or51211.h b/drivers/media/dvb/frontends/or51211.h
index 10a5419f9e00..8aad8402d615 100644
--- a/drivers/media/dvb/frontends/or51211.h
+++ b/drivers/media/dvb/frontends/or51211.h
@@ -37,7 +37,7 @@ struct or51211_config
37 void (*sleep)(struct dvb_frontend * fe); 37 void (*sleep)(struct dvb_frontend * fe);
38}; 38};
39 39
40#if defined(CONFIG_DVB_OR51211) || defined(CONFIG_DVB_OR51211_MODULE) 40#if defined(CONFIG_DVB_OR51211) || (defined(CONFIG_DVB_OR51211_MODULE) && defined(MODULE))
41extern struct dvb_frontend* or51211_attach(const struct or51211_config* config, 41extern struct dvb_frontend* or51211_attach(const struct or51211_config* config,
42 struct i2c_adapter* i2c); 42 struct i2c_adapter* i2c);
43#else 43#else
diff --git a/drivers/media/dvb/frontends/s5h1420.h b/drivers/media/dvb/frontends/s5h1420.h
index efc54d7f3c55..1555870f7226 100644
--- a/drivers/media/dvb/frontends/s5h1420.h
+++ b/drivers/media/dvb/frontends/s5h1420.h
@@ -34,7 +34,7 @@ struct s5h1420_config
34 u8 invert:1; 34 u8 invert:1;
35}; 35};
36 36
37#if defined(CONFIG_DVB_S5H1420) || defined(CONFIG_DVB_S5H1420_MODULE) 37#if defined(CONFIG_DVB_S5H1420) || (defined(CONFIG_DVB_S5H1420_MODULE) && defined(MODULE))
38extern struct dvb_frontend* s5h1420_attach(const struct s5h1420_config* config, 38extern struct dvb_frontend* s5h1420_attach(const struct s5h1420_config* config,
39 struct i2c_adapter* i2c); 39 struct i2c_adapter* i2c);
40#else 40#else
diff --git a/drivers/media/dvb/frontends/sp8870.h b/drivers/media/dvb/frontends/sp8870.h
index 4cf27d3b10f2..909cefe7139e 100644
--- a/drivers/media/dvb/frontends/sp8870.h
+++ b/drivers/media/dvb/frontends/sp8870.h
@@ -35,7 +35,7 @@ struct sp8870_config
35 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name); 35 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
36}; 36};
37 37
38#if defined(CONFIG_DVB_SP8870) || defined(CONFIG_DVB_SP8870_MODULE) 38#if defined(CONFIG_DVB_SP8870) || (defined(CONFIG_DVB_SP8870_MODULE) && defined(MODULE))
39extern struct dvb_frontend* sp8870_attach(const struct sp8870_config* config, 39extern struct dvb_frontend* sp8870_attach(const struct sp8870_config* config,
40 struct i2c_adapter* i2c); 40 struct i2c_adapter* i2c);
41#else 41#else
diff --git a/drivers/media/dvb/frontends/sp887x.h b/drivers/media/dvb/frontends/sp887x.h
index cab7ea644dfa..7ee78d7d916d 100644
--- a/drivers/media/dvb/frontends/sp887x.h
+++ b/drivers/media/dvb/frontends/sp887x.h
@@ -17,7 +17,7 @@ struct sp887x_config
17 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name); 17 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
18}; 18};
19 19
20#if defined(CONFIG_DVB_SP887X) || defined(CONFIG_DVB_SP887X_MODULE) 20#if defined(CONFIG_DVB_SP887X) || (defined(CONFIG_DVB_SP887X_MODULE) && defined(MODULE))
21extern struct dvb_frontend* sp887x_attach(const struct sp887x_config* config, 21extern struct dvb_frontend* sp887x_attach(const struct sp887x_config* config,
22 struct i2c_adapter* i2c); 22 struct i2c_adapter* i2c);
23#else 23#else
diff --git a/drivers/media/dvb/frontends/stv0297.h b/drivers/media/dvb/frontends/stv0297.h
index 760b80db43a5..69f4515df2b9 100644
--- a/drivers/media/dvb/frontends/stv0297.h
+++ b/drivers/media/dvb/frontends/stv0297.h
@@ -42,7 +42,7 @@ struct stv0297_config
42 u8 stop_during_read:1; 42 u8 stop_during_read:1;
43}; 43};
44 44
45#if defined(CONFIG_DVB_STV0297) || defined(CONFIG_DVB_STV0297_MODULE) 45#if defined(CONFIG_DVB_STV0297) || (defined(CONFIG_DVB_STV0297_MODULE) && defined(MODULE))
46extern struct dvb_frontend* stv0297_attach(const struct stv0297_config* config, 46extern struct dvb_frontend* stv0297_attach(const struct stv0297_config* config,
47 struct i2c_adapter* i2c); 47 struct i2c_adapter* i2c);
48#else 48#else
diff --git a/drivers/media/dvb/frontends/stv0299.h b/drivers/media/dvb/frontends/stv0299.h
index 7ef25207081d..33df9495908f 100644
--- a/drivers/media/dvb/frontends/stv0299.h
+++ b/drivers/media/dvb/frontends/stv0299.h
@@ -89,7 +89,7 @@ struct stv0299_config
89 int (*set_symbol_rate)(struct dvb_frontend* fe, u32 srate, u32 ratio); 89 int (*set_symbol_rate)(struct dvb_frontend* fe, u32 srate, u32 ratio);
90}; 90};
91 91
92#if defined(CONFIG_DVB_STV0299) || defined(CONFIG_DVB_STV0299_MODULE) 92#if defined(CONFIG_DVB_STV0299) || (defined(CONFIG_DVB_STV0299_MODULE) && defined(MODULE))
93extern struct dvb_frontend* stv0299_attach(const struct stv0299_config* config, 93extern struct dvb_frontend* stv0299_attach(const struct stv0299_config* config,
94 struct i2c_adapter* i2c); 94 struct i2c_adapter* i2c);
95#else 95#else
diff --git a/drivers/media/dvb/frontends/tda10021.h b/drivers/media/dvb/frontends/tda10021.h
index d68ae20c8412..e3da780108f6 100644
--- a/drivers/media/dvb/frontends/tda10021.h
+++ b/drivers/media/dvb/frontends/tda10021.h
@@ -32,7 +32,7 @@ struct tda10021_config
32 u8 demod_address; 32 u8 demod_address;
33}; 33};
34 34
35#if defined(CONFIG_DVB_TDA10021) || defined(CONFIG_DVB_TDA10021_MODULE) 35#if defined(CONFIG_DVB_TDA10021) || (defined(CONFIG_DVB_TDA10021_MODULE) && defined(MODULE))
36extern struct dvb_frontend* tda10021_attach(const struct tda10021_config* config, 36extern struct dvb_frontend* tda10021_attach(const struct tda10021_config* config,
37 struct i2c_adapter* i2c, u8 pwm); 37 struct i2c_adapter* i2c, u8 pwm);
38#else 38#else
diff --git a/drivers/media/dvb/frontends/tda1004x.h b/drivers/media/dvb/frontends/tda1004x.h
index e28fca05734c..605ad2dfc09d 100644
--- a/drivers/media/dvb/frontends/tda1004x.h
+++ b/drivers/media/dvb/frontends/tda1004x.h
@@ -71,7 +71,7 @@ struct tda1004x_config
71 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name); 71 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
72}; 72};
73 73
74#if defined(CONFIG_DVB_TDA1004X) || defined(CONFIG_DVB_TDA1004X_MODULE) 74#if defined(CONFIG_DVB_TDA1004X) || (defined(CONFIG_DVB_TDA1004X_MODULE) && defined(MODULE))
75extern struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, 75extern struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
76 struct i2c_adapter* i2c); 76 struct i2c_adapter* i2c);
77 77
diff --git a/drivers/media/dvb/frontends/tda10086.h b/drivers/media/dvb/frontends/tda10086.h
index e8061db11123..ed584a8f4a89 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) && defined(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/tda8083.h b/drivers/media/dvb/frontends/tda8083.h
index aae15bdce6eb..2d3307999f21 100644
--- a/drivers/media/dvb/frontends/tda8083.h
+++ b/drivers/media/dvb/frontends/tda8083.h
@@ -35,7 +35,7 @@ struct tda8083_config
35 u8 demod_address; 35 u8 demod_address;
36}; 36};
37 37
38#if defined(CONFIG_DVB_TDA8083) || defined(CONFIG_DVB_TDA8083_MODULE) 38#if defined(CONFIG_DVB_TDA8083) || (defined(CONFIG_DVB_TDA8083_MODULE) && defined(MODULE))
39extern struct dvb_frontend* tda8083_attach(const struct tda8083_config* config, 39extern struct dvb_frontend* tda8083_attach(const struct tda8083_config* config,
40 struct i2c_adapter* i2c); 40 struct i2c_adapter* i2c);
41#else 41#else
diff --git a/drivers/media/dvb/frontends/tda826x.c b/drivers/media/dvb/frontends/tda826x.c
index eeab26bd36ed..34815b0b97e4 100644
--- a/drivers/media/dvb/frontends/tda826x.c
+++ b/drivers/media/dvb/frontends/tda826x.c
@@ -121,7 +121,7 @@ static struct dvb_tuner_ops tda826x_tuner_ops = {
121 .info = { 121 .info = {
122 .name = "Philips TDA826X", 122 .name = "Philips TDA826X",
123 .frequency_min = 950000, 123 .frequency_min = 950000,
124 .frequency_min = 2175000 124 .frequency_max = 2175000
125 }, 125 },
126 .release = tda826x_release, 126 .release = tda826x_release,
127 .sleep = tda826x_sleep, 127 .sleep = tda826x_sleep,
diff --git a/drivers/media/dvb/frontends/tda826x.h b/drivers/media/dvb/frontends/tda826x.h
index 3307607632b0..ad9981195961 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) && defined(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/frontends/tua6100.h b/drivers/media/dvb/frontends/tua6100.h
index 8f98033ffa7b..03a665e7df6d 100644
--- a/drivers/media/dvb/frontends/tua6100.h
+++ b/drivers/media/dvb/frontends/tua6100.h
@@ -34,7 +34,7 @@
34#include <linux/i2c.h> 34#include <linux/i2c.h>
35#include "dvb_frontend.h" 35#include "dvb_frontend.h"
36 36
37#if defined(CONFIG_DVB_TUA6100) || defined(CONFIG_DVB_TUA6100_MODULE) 37#if defined(CONFIG_DVB_TUA6100) || (defined(CONFIG_DVB_TUA6100_MODULE) && defined(MODULE))
38extern struct dvb_frontend *tua6100_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c); 38extern struct dvb_frontend *tua6100_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c);
39#else 39#else
40static inline struct dvb_frontend* tua6100_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c) 40static inline struct dvb_frontend* tua6100_attach(struct dvb_frontend *fe, int addr, struct i2c_adapter *i2c)
diff --git a/drivers/media/dvb/frontends/ves1820.h b/drivers/media/dvb/frontends/ves1820.h
index f0c9dded39d7..e4a2a324046a 100644
--- a/drivers/media/dvb/frontends/ves1820.h
+++ b/drivers/media/dvb/frontends/ves1820.h
@@ -41,7 +41,7 @@ struct ves1820_config
41 u8 selagc:1; 41 u8 selagc:1;
42}; 42};
43 43
44#if defined(CONFIG_DVB_VES1820) || defined(CONFIG_DVB_VES1820_MODULE) 44#if defined(CONFIG_DVB_VES1820) || (defined(CONFIG_DVB_VES1820_MODULE) && defined(MODULE))
45extern struct dvb_frontend* ves1820_attach(const struct ves1820_config* config, 45extern struct dvb_frontend* ves1820_attach(const struct ves1820_config* config,
46 struct i2c_adapter* i2c, u8 pwm); 46 struct i2c_adapter* i2c, u8 pwm);
47#else 47#else
diff --git a/drivers/media/dvb/frontends/ves1x93.h b/drivers/media/dvb/frontends/ves1x93.h
index 395fed39b286..d507f8966f81 100644
--- a/drivers/media/dvb/frontends/ves1x93.h
+++ b/drivers/media/dvb/frontends/ves1x93.h
@@ -40,7 +40,7 @@ struct ves1x93_config
40 u8 invert_pwm:1; 40 u8 invert_pwm:1;
41}; 41};
42 42
43#if defined(CONFIG_DVB_VES1X93) || defined(CONFIG_DVB_VES1X93_MODULE) 43#if defined(CONFIG_DVB_VES1X93) || (defined(CONFIG_DVB_VES1X93_MODULE) && defined(MODULE))
44extern struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, 44extern struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config,
45 struct i2c_adapter* i2c); 45 struct i2c_adapter* i2c);
46#else 46#else
diff --git a/drivers/media/dvb/frontends/zl10353.h b/drivers/media/dvb/frontends/zl10353.h
index 79a947215c4d..0bc0109737f1 100644
--- a/drivers/media/dvb/frontends/zl10353.h
+++ b/drivers/media/dvb/frontends/zl10353.h
@@ -36,7 +36,7 @@ struct zl10353_config
36 int parallel_ts; 36 int parallel_ts;
37}; 37};
38 38
39#if defined(CONFIG_DVB_ZL10353) || defined(CONFIG_DVB_ZL10353_MODULE) 39#if defined(CONFIG_DVB_ZL10353) || (defined(CONFIG_DVB_ZL10353_MODULE) && defined(MODULE))
40extern struct dvb_frontend* zl10353_attach(const struct zl10353_config *config, 40extern struct dvb_frontend* zl10353_attach(const struct zl10353_config *config,
41 struct i2c_adapter *i2c); 41 struct i2c_adapter *i2c);
42#else 42#else
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 2a2e9b400613..cd5ec489af1c 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -46,7 +46,14 @@
46#include "bsbe1.h" 46#include "bsbe1.h"
47#include "bsru6.h" 47#include "bsru6.h"
48 48
49#define DEBIADDR_IR 0x1234 49/*
50 * Regarding DEBIADDR_IR:
51 * Some CI modules hang if random addresses are read.
52 * Using address 0x4000 for the IR read means that we
53 * use the same address as for CI version, which should
54 * be a safe default.
55 */
56#define DEBIADDR_IR 0x4000
50#define DEBIADDR_CICONTROL 0x0000 57#define DEBIADDR_CICONTROL 0x0000
51#define DEBIADDR_CIVERSION 0x4000 58#define DEBIADDR_CIVERSION 0x4000
52#define DEBIADDR_IO 0x1000 59#define DEBIADDR_IO 0x1000
@@ -1028,6 +1035,7 @@ static void frontend_init(struct budget_ci *budget_ci)
1028 1035
1029 case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt)) 1036 case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt))
1030 budget_ci->tuner_pll_address = 0x60; 1037 budget_ci->tuner_pll_address = 0x60;
1038 philips_tdm1316l_config.invert = 1;
1031 budget_ci->budget.dvb_frontend = 1039 budget_ci->budget.dvb_frontend =
1032 dvb_attach(tda10046_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap); 1040 dvb_attach(tda10046_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
1033 if (budget_ci->budget.dvb_frontend) { 1041 if (budget_ci->budget.dvb_frontend) {
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index afb734df6e05..bf267552941f 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -186,7 +186,7 @@ config VIDEO_KS0127
186 186
187config VIDEO_SAA7110 187config VIDEO_SAA7110
188 tristate "Philips SAA7110 video decoder" 188 tristate "Philips SAA7110 video decoder"
189 depends on VIDEO_V4L1 189 depends on VIDEO_V4L1 && I2C
190 ---help--- 190 ---help---
191 Support for the Philips SAA7110 video decoders. 191 Support for the Philips SAA7110 video decoders.
192 192
@@ -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/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index a84903e0d810..21ebe8f13815 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -4001,7 +4001,7 @@ static void __devinit init_PXC200(struct bttv *btv)
4001 * - sleep 1ms 4001 * - sleep 1ms
4002 * - write 0x0E 4002 * - write 0x0E
4003 * read from GPIO_DATA into buf (uint_32) 4003 * read from GPIO_DATA into buf (uint_32)
4004 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 ) 4004 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
4005 * error. ERROR_CPLD_Check_Failed. 4005 * error. ERROR_CPLD_Check_Failed.
4006 */ 4006 */
4007/* ----------------------------------------------------------------------- */ 4007/* ----------------------------------------------------------------------- */
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-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..57e1c024a547 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -196,18 +196,25 @@ 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;
202 break; 203 break;
203 case CX88_BOARD_WINFAST_DTV2000H: 204 case CX88_BOARD_WINFAST_DTV2000H:
204 case CX88_BOARD_WINFAST2000XP_EXPERT:
205 ir_codes = ir_codes_winfast; 205 ir_codes = ir_codes_winfast;
206 ir->gpio_addr = MO_GP0_IO; 206 ir->gpio_addr = MO_GP0_IO;
207 ir->mask_keycode = 0x8f8; 207 ir->mask_keycode = 0x8f8;
208 ir->mask_keyup = 0x100; 208 ir->mask_keyup = 0x100;
209 ir->polling = 50; /* ms */ 209 ir->polling = 50; /* ms */
210 break; 210 break;
211 case CX88_BOARD_WINFAST2000XP_EXPERT:
212 ir_codes = ir_codes_winfast;
213 ir->gpio_addr = MO_GP0_IO;
214 ir->mask_keycode = 0x8f8;
215 ir->mask_keyup = 0x100;
216 ir->polling = 1; /* ms */
217 break;
211 case CX88_BOARD_IODATA_GVBCTV7E: 218 case CX88_BOARD_IODATA_GVBCTV7E:
212 ir_codes = ir_codes_iodata_bctv7e; 219 ir_codes = ir_codes_iodata_bctv7e;
213 ir->gpio_addr = MO_GP0_IO; 220 ir->gpio_addr = MO_GP0_IO;
@@ -215,7 +222,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
215 ir->mask_keydown = 0x02; 222 ir->mask_keydown = 0x02;
216 ir->polling = 5; /* ms */ 223 ir->polling = 5; /* ms */
217 break; 224 break;
218 case CX88_BOARD_PROLINK_PLAYTVPVR: 225 case CX88_BOARD_PROLINK_PLAYTVPVR:
219 case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO: 226 case CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO:
220 ir_codes = ir_codes_pixelview; 227 ir_codes = ir_codes_pixelview;
221 ir->gpio_addr = MO_GP1_IO; 228 ir->gpio_addr = MO_GP1_IO;
@@ -419,6 +426,7 @@ void cx88_ir_irq(struct cx88_core *core)
419 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: 426 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
420 case CX88_BOARD_HAUPPAUGE_HVR1100: 427 case CX88_BOARD_HAUPPAUGE_HVR1100:
421 case CX88_BOARD_HAUPPAUGE_HVR1300: 428 case CX88_BOARD_HAUPPAUGE_HVR1300:
429 case CX88_BOARD_HAUPPAUGE_HVR3000:
422 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); 430 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
423 ir_dprintk("biphase decoded: %x\n", ircode); 431 ir_dprintk("biphase decoded: %x\n", ircode);
424 if ((ircode & 0xfffff000) != 0x3000) 432 if ((ircode & 0xfffff000) != 0x3000)
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index bc544cc7ccb8..f786ab11d2cd 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -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/ov511.c b/drivers/media/video/ov511.c
index ce4886f1528d..b4db2cbb5a84 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -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/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
index df8feac16aee..c80c26be6e4d 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
@@ -221,7 +221,7 @@ static unsigned int decoder_describe(struct pvr2_v4l_cx2584x *ctxt,
221static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt) 221static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt)
222{ 222{
223 int ret; 223 int ret;
224 ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0); 224 ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL);
225 pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret); 225 pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret);
226} 226}
227 227
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 97e974d9b9c3..bb40e9085977 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -711,8 +711,8 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
711 dip->devbase.minor,pvr2_config_get_name(dip->config)); 711 dip->devbase.minor,pvr2_config_get_name(dip->config));
712 712
713 /* Paranoia */ 713 /* Paranoia */
714 dip->v4lp = 0; 714 dip->v4lp = NULL;
715 dip->stream = 0; 715 dip->stream = NULL;
716 716
717 /* Actual deallocation happens later when all internal references 717 /* Actual deallocation happens later when all internal references
718 are gone. */ 718 are gone. */
@@ -1076,7 +1076,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
1076 vp->vdev = kmalloc(sizeof(*vp->vdev),GFP_KERNEL); 1076 vp->vdev = kmalloc(sizeof(*vp->vdev),GFP_KERNEL);
1077 if (!vp->vdev) { 1077 if (!vp->vdev) {
1078 kfree(vp); 1078 kfree(vp);
1079 return 0; 1079 return NULL;
1080 } 1080 }
1081 memset(vp->vdev,0,sizeof(*vp->vdev)); 1081 memset(vp->vdev,0,sizeof(*vp->vdev));
1082 pvr2_channel_init(&vp->channel,mnp); 1082 pvr2_channel_init(&vp->channel,mnp);
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index c77b85cf3d80..46c114830884 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -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-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index c9d8e3b9cc37..51f0cfdcb680 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2969,7 +2969,7 @@ struct saa7134_board saa7134_boards[] = {
2969 /* Petr Baudis <pasky@ucw.cz> */ 2969 /* Petr Baudis <pasky@ucw.cz> */
2970 .name = "AVerMedia TV Hybrid A16AR", 2970 .name = "AVerMedia TV Hybrid A16AR",
2971 .audio_clock = 0x187de7, 2971 .audio_clock = 0x187de7,
2972 .tuner_type = TUNER_PHILIPS_TDA8290, /* untested */ 2972 .tuner_type = TUNER_PHILIPS_TD1316, /* untested */
2973 .radio_type = TUNER_TEA5767, /* untested */ 2973 .radio_type = TUNER_TEA5767, /* untested */
2974 .tuner_addr = ADDR_UNSET, 2974 .tuner_addr = ADDR_UNSET,
2975 .radio_addr = ADDR_UNSET, 2975 .radio_addr = ADDR_UNSET,
@@ -3718,6 +3718,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3718 case SAA7134_BOARD_AVERMEDIA_STUDIO_307: 3718 case SAA7134_BOARD_AVERMEDIA_STUDIO_307:
3719 case SAA7134_BOARD_AVERMEDIA_307: 3719 case SAA7134_BOARD_AVERMEDIA_307:
3720 case SAA7134_BOARD_AVERMEDIA_GO_007_FM: 3720 case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
3721 case SAA7134_BOARD_AVERMEDIA_777:
3721/* case SAA7134_BOARD_SABRENT_SBTTVFM: */ /* not finished yet */ 3722/* case SAA7134_BOARD_SABRENT_SBTTVFM: */ /* not finished yet */
3722 case SAA7134_BOARD_VIDEOMATE_TV_PVR: 3723 case SAA7134_BOARD_VIDEOMATE_TV_PVR:
3723 case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS: 3724 case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS:
@@ -3734,6 +3735,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3734 case SAA7134_BOARD_FLYDVBT_LR301: 3735 case SAA7134_BOARD_FLYDVBT_LR301:
3735 case SAA7134_BOARD_FLYDVBTDUO: 3736 case SAA7134_BOARD_FLYDVBTDUO:
3736 case SAA7134_BOARD_PROTEUS_2309: 3737 case SAA7134_BOARD_PROTEUS_2309:
3738 case SAA7134_BOARD_AVERMEDIA_A16AR:
3737 dev->has_remote = SAA7134_REMOTE_GPIO; 3739 dev->has_remote = SAA7134_REMOTE_GPIO;
3738 break; 3740 break;
3739 case SAA7134_BOARD_FLYDVBS_LR300: 3741 case SAA7134_BOARD_FLYDVBS_LR300:
@@ -3772,7 +3774,6 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3772 saa_writeb(SAA7134_GPIO_GPMODE3, 0x08); 3774 saa_writeb(SAA7134_GPIO_GPMODE3, 0x08);
3773 saa_writeb(SAA7134_GPIO_GPSTATUS3, 0x00); 3775 saa_writeb(SAA7134_GPIO_GPSTATUS3, 0x00);
3774 break; 3776 break;
3775 case SAA7134_BOARD_AVERMEDIA_A16AR:
3776 case SAA7134_BOARD_AVERMEDIA_CARDBUS: 3777 case SAA7134_BOARD_AVERMEDIA_CARDBUS:
3777 /* power-up tuner chip */ 3778 /* power-up tuner chip */
3778 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0xffffffff, 0xffffffff); 3779 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0xffffffff, 0xffffffff);
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 1ba53b525ad2..6b61d9b2fcb5 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -1147,6 +1147,8 @@ static int dvb_init(struct saa7134_dev *dev)
1147 &philips_europa_config, 1147 &philips_europa_config,
1148 &dev->i2c_adap); 1148 &dev->i2c_adap);
1149 if (dev->dvb.frontend) { 1149 if (dev->dvb.frontend) {
1150 dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
1151 dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
1150 dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init; 1152 dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init;
1151 dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep; 1153 dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep;
1152 dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params; 1154 dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index ff5991136f4e..dee83552e681 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -185,7 +185,6 @@ int saa7134_input_init1(struct saa7134_dev *dev)
185 case SAA7134_BOARD_AVERMEDIA_STUDIO_305: 185 case SAA7134_BOARD_AVERMEDIA_STUDIO_305:
186 case SAA7134_BOARD_AVERMEDIA_STUDIO_307: 186 case SAA7134_BOARD_AVERMEDIA_STUDIO_307:
187 case SAA7134_BOARD_AVERMEDIA_GO_007_FM: 187 case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
188 case SAA7134_BOARD_AVERMEDIA_A16AR:
189 ir_codes = ir_codes_avermedia; 188 ir_codes = ir_codes_avermedia;
190 mask_keycode = 0x0007C8; 189 mask_keycode = 0x0007C8;
191 mask_keydown = 0x000010; 190 mask_keydown = 0x000010;
@@ -194,6 +193,16 @@ int saa7134_input_init1(struct saa7134_dev *dev)
194 saa_setb(SAA7134_GPIO_GPMODE0, 0x4); 193 saa_setb(SAA7134_GPIO_GPMODE0, 0x4);
195 saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); 194 saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4);
196 break; 195 break;
196 case SAA7134_BOARD_AVERMEDIA_777:
197 case SAA7134_BOARD_AVERMEDIA_A16AR:
198 ir_codes = ir_codes_avermedia;
199 mask_keycode = 0x02F200;
200 mask_keydown = 0x000400;
201 polling = 50; // ms
202 /* Without this we won't receive key up events */
203 saa_setb(SAA7134_GPIO_GPMODE1, 0x1);
204 saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1);
205 break;
197 case SAA7134_BOARD_KWORLD_TERMINATOR: 206 case SAA7134_BOARD_KWORLD_TERMINATOR:
198 ir_codes = ir_codes_pixelview; 207 ir_codes = ir_codes_pixelview;
199 mask_keycode = 0x00001f; 208 mask_keycode = 0x00001f;
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 203302f21827..830617ea81cc 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -2248,7 +2248,11 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
2248 t->type = V4L2_TUNER_RADIO; 2248 t->type = V4L2_TUNER_RADIO;
2249 2249
2250 saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t); 2250 saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t);
2251 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 }
2252 return 0; 2256 return 0;
2253 } 2257 }
2254 case VIDIOC_S_TUNER: 2258 case VIDIOC_S_TUNER:
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index 3e0ff8a78468..a4702d3c2aca 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -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/stv680.c b/drivers/media/video/stv680.c
index 87e11300181d..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)
@@ -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 e6baaee038bf..6b9ef731b83a 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -468,7 +468,7 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
468 (eeprom_data[i+6] << 8) + 468 (eeprom_data[i+6] << 8) +
469 (eeprom_data[i+7] << 16); 469 (eeprom_data[i+7] << 16);
470 470
471 if ( (eeprom_data[i + 8] && 0xf0) && 471 if ( (eeprom_data[i + 8] & 0xf0) &&
472 (tvee->serial_number < 0xffffff) ) { 472 (tvee->serial_number < 0xffffff) ) {
473 tvee->MAC_address[0] = 0x00; 473 tvee->MAC_address[0] = 0x00;
474 tvee->MAC_address[1] = 0x0D; 474 tvee->MAC_address[1] = 0x0D;
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/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;