aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/Kconfig4
-rw-r--r--drivers/media/dvb/frontends/Makefile2
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c11
-rw-r--r--drivers/media/dvb/frontends/lgdt330x.c (renamed from drivers/media/dvb/frontends/lgdt3302.c)193
-rw-r--r--drivers/media/dvb/frontends/lgdt330x.h (renamed from drivers/media/dvb/frontends/lgdt3302.h)20
-rw-r--r--drivers/media/dvb/frontends/lgdt330x_priv.h (renamed from drivers/media/dvb/frontends/lgdt3302_priv.h)10
-rw-r--r--drivers/media/radio/radio-maestro.c4
-rw-r--r--drivers/media/radio/radio-maxiradio.c2
-rw-r--r--drivers/media/video/Kconfig4
-rw-r--r--drivers/media/video/bttv-cards.c4
-rw-r--r--drivers/media/video/cx88/Makefile12
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c90
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c4
-rw-r--r--drivers/media/video/mxb.c39
-rw-r--r--drivers/media/video/saa7134/Makefile6
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c20
-rw-r--r--drivers/media/video/tvaudio.c1
-rw-r--r--drivers/media/video/tveeprom.c6
18 files changed, 233 insertions, 199 deletions
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig
index d847c62bd837..e83256d0fd14 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -187,8 +187,8 @@ config DVB_BCM3510
187 An ATSC 8VSB/16VSB and QAM64/256 tuner module. Say Y when you want to 187 An ATSC 8VSB/16VSB and QAM64/256 tuner module. Say Y when you want to
188 support this frontend. 188 support this frontend.
189 189
190config DVB_LGDT3302 190config DVB_LGDT330X
191 tristate "LGDT3302 based (DViCO FusionHDTV3 Gold)" 191 tristate "LGDT3302 or LGDT3303 based (DViCO FusionHDTV Gold)"
192 depends on DVB_CORE 192 depends on DVB_CORE
193 help 193 help
194 An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want 194 An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
diff --git a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile
index de5e240cba7f..ad8658ffd60a 100644
--- a/drivers/media/dvb/frontends/Makefile
+++ b/drivers/media/dvb/frontends/Makefile
@@ -30,4 +30,4 @@ obj-$(CONFIG_DVB_OR51211) += or51211.o
30obj-$(CONFIG_DVB_OR51132) += or51132.o 30obj-$(CONFIG_DVB_OR51132) += or51132.o
31obj-$(CONFIG_DVB_BCM3510) += bcm3510.o 31obj-$(CONFIG_DVB_BCM3510) += bcm3510.o
32obj-$(CONFIG_DVB_S5H1420) += s5h1420.o 32obj-$(CONFIG_DVB_S5H1420) += s5h1420.o
33obj-$(CONFIG_DVB_LGDT3302) += lgdt3302.o 33obj-$(CONFIG_DVB_LGDT330X) += lgdt330x.o
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 5afeaa9b43b4..5264310c070e 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -82,13 +82,14 @@ struct dvb_pll_desc dvb_pll_lg_z201 = {
82 .name = "LG z201", 82 .name = "LG z201",
83 .min = 174000000, 83 .min = 174000000,
84 .max = 862000000, 84 .max = 862000000,
85 .count = 5, 85 .count = 6,
86 .entries = { 86 .entries = {
87 { 0, 36166667, 166666, 0xbc, 0x03 }, 87 { 0, 36166667, 166666, 0xbc, 0x03 },
88 { 443250000, 36166667, 166666, 0xbc, 0x01 }, 88 { 157500000, 36166667, 166666, 0xbc, 0x01 },
89 { 542000000, 36166667, 166666, 0xbc, 0x02 }, 89 { 443250000, 36166667, 166666, 0xbc, 0x02 },
90 { 830000000, 36166667, 166666, 0xf4, 0x02 }, 90 { 542000000, 36166667, 166666, 0xbc, 0x04 },
91 { 999999999, 36166667, 166666, 0xfc, 0x02 }, 91 { 830000000, 36166667, 166666, 0xf4, 0x04 },
92 { 999999999, 36166667, 166666, 0xfc, 0x04 },
92 }, 93 },
93}; 94};
94EXPORT_SYMBOL(dvb_pll_lg_z201); 95EXPORT_SYMBOL(dvb_pll_lg_z201);
diff --git a/drivers/media/dvb/frontends/lgdt3302.c b/drivers/media/dvb/frontends/lgdt330x.c
index c85a2a99df42..e94dee50eecd 100644
--- a/drivers/media/dvb/frontends/lgdt3302.c
+++ b/drivers/media/dvb/frontends/lgdt330x.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Support for LGDT3302 (DViCO FustionHDTV 3 Gold) - VSB/QAM 2 * Support for LGDT3302 & LGDT3303 (DViCO FusionHDTV Gold) - VSB/QAM
3 * 3 *
4 * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> 4 * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
5 * 5 *
@@ -25,10 +25,11 @@
25/* 25/*
26 * NOTES ABOUT THIS DRIVER 26 * NOTES ABOUT THIS DRIVER
27 * 27 *
28 * This driver supports DViCO FusionHDTV 3 Gold under Linux. 28 * This driver supports DViCO FusionHDTV Gold under Linux.
29 * 29 *
30 * TODO: 30 * TODO:
31 * BER and signal strength always return 0. 31 * BER and signal strength always return 0.
32 * Include support for LGDT3303
32 * 33 *
33 */ 34 */
34 35
@@ -41,24 +42,24 @@
41 42
42#include "dvb_frontend.h" 43#include "dvb_frontend.h"
43#include "dvb-pll.h" 44#include "dvb-pll.h"
44#include "lgdt3302_priv.h" 45#include "lgdt330x_priv.h"
45#include "lgdt3302.h" 46#include "lgdt330x.h"
46 47
47static int debug = 0; 48static int debug = 0;
48module_param(debug, int, 0644); 49module_param(debug, int, 0644);
49MODULE_PARM_DESC(debug,"Turn on/off lgdt3302 frontend debugging (default:off)."); 50MODULE_PARM_DESC(debug,"Turn on/off lgdt330x frontend debugging (default:off).");
50#define dprintk(args...) \ 51#define dprintk(args...) \
51do { \ 52do { \
52if (debug) printk(KERN_DEBUG "lgdt3302: " args); \ 53if (debug) printk(KERN_DEBUG "lgdt330x: " args); \
53} while (0) 54} while (0)
54 55
55struct lgdt3302_state 56struct lgdt330x_state
56{ 57{
57 struct i2c_adapter* i2c; 58 struct i2c_adapter* i2c;
58 struct dvb_frontend_ops ops; 59 struct dvb_frontend_ops ops;
59 60
60 /* Configuration settings */ 61 /* Configuration settings */
61 const struct lgdt3302_config* config; 62 const struct lgdt330x_config* config;
62 63
63 struct dvb_frontend frontend; 64 struct dvb_frontend frontend;
64 65
@@ -69,45 +70,33 @@ struct lgdt3302_state
69 u32 current_frequency; 70 u32 current_frequency;
70}; 71};
71 72
72static int i2c_writebytes (struct lgdt3302_state* state, 73static int i2c_writebytes (struct lgdt330x_state* state,
73 u8 addr, /* demod_address or pll_address */ 74 u8 addr, /* demod_address or pll_address */
74 u8 *buf, /* data bytes to send */ 75 u8 *buf, /* data bytes to send */
75 int len /* number of bytes to send */ ) 76 int len /* number of bytes to send */ )
76{ 77{
77 if (addr == state->config->pll_address) { 78 u8 tmp[] = { buf[0], buf[1] };
78 struct i2c_msg msg = 79 struct i2c_msg msg =
79 { .addr = addr, .flags = 0, .buf = buf, .len = len }; 80 { .addr = addr, .flags = 0, .buf = tmp, .len = 2 };
80 int err; 81 int err;
82 int i;
81 83
84 for (i=1; i<len; i++) {
85 tmp[1] = buf[i];
82 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { 86 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
83 printk(KERN_WARNING "lgdt3302: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err); 87 printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err);
84 if (err < 0) 88 if (err < 0)
85 return err; 89 return err;
86 else 90 else
87 return -EREMOTEIO; 91 return -EREMOTEIO;
88 } 92 }
89 } else { 93 tmp[0]++;
90 u8 tmp[] = { buf[0], buf[1] };
91 struct i2c_msg msg =
92 { .addr = addr, .flags = 0, .buf = tmp, .len = 2 };
93 int err;
94 int i;
95
96 for (i=1; i<len; i++) {
97 tmp[1] = buf[i];
98 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
99 printk(KERN_WARNING "lgdt3302: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err);
100 if (err < 0)
101 return err;
102 else
103 return -EREMOTEIO;
104 }
105 tmp[0]++;
106 }
107 } 94 }
108 return 0; 95 return 0;
109} 96}
110static int i2c_readbytes (struct lgdt3302_state* state, 97
98#if 0
99static int i2c_readbytes (struct lgdt330x_state* state,
111 u8 addr, /* demod_address or pll_address */ 100 u8 addr, /* demod_address or pll_address */
112 u8 *buf, /* holds data bytes read */ 101 u8 *buf, /* holds data bytes read */
113 int len /* number of bytes to read */ ) 102 int len /* number of bytes to read */ )
@@ -117,18 +106,19 @@ static int i2c_readbytes (struct lgdt3302_state* state,
117 int err; 106 int err;
118 107
119 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { 108 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
120 printk(KERN_WARNING "lgdt3302: %s error (addr %02x, err == %i)\n", __FUNCTION__, addr, err); 109 printk(KERN_WARNING "lgdt330x: %s error (addr %02x, err == %i)\n", __FUNCTION__, addr, err);
121 return -EREMOTEIO; 110 return -EREMOTEIO;
122 } 111 }
123 return 0; 112 return 0;
124} 113}
114#endif
125 115
126/* 116/*
127 * This routine writes the register (reg) to the demod bus 117 * This routine writes the register (reg) to the demod bus
128 * then reads the data returned for (len) bytes. 118 * then reads the data returned for (len) bytes.
129 */ 119 */
130 120
131static u8 i2c_selectreadbytes (struct lgdt3302_state* state, 121static u8 i2c_selectreadbytes (struct lgdt330x_state* state,
132 enum I2C_REG reg, u8* buf, int len) 122 enum I2C_REG reg, u8* buf, int len)
133{ 123{
134 u8 wr [] = { reg }; 124 u8 wr [] = { reg };
@@ -141,7 +131,7 @@ static u8 i2c_selectreadbytes (struct lgdt3302_state* state,
141 int ret; 131 int ret;
142 ret = i2c_transfer(state->i2c, msg, 2); 132 ret = i2c_transfer(state->i2c, msg, 2);
143 if (ret != 2) { 133 if (ret != 2) {
144 printk(KERN_WARNING "lgdt3302: %s: addr 0x%02x select 0x%02x error (ret == %i)\n", __FUNCTION__, state->config->demod_address, reg, ret); 134 printk(KERN_WARNING "lgdt330x: %s: addr 0x%02x select 0x%02x error (ret == %i)\n", __FUNCTION__, state->config->demod_address, reg, ret);
145 } else { 135 } else {
146 ret = 0; 136 ret = 0;
147 } 137 }
@@ -149,7 +139,7 @@ static u8 i2c_selectreadbytes (struct lgdt3302_state* state,
149} 139}
150 140
151/* Software reset */ 141/* Software reset */
152int lgdt3302_SwReset(struct lgdt3302_state* state) 142int lgdt330x_SwReset(struct lgdt330x_state* state)
153{ 143{
154 u8 ret; 144 u8 ret;
155 u8 reset[] = { 145 u8 reset[] = {
@@ -175,7 +165,7 @@ int lgdt3302_SwReset(struct lgdt3302_state* state)
175 return ret; 165 return ret;
176} 166}
177 167
178static int lgdt3302_init(struct dvb_frontend* fe) 168static int lgdt330x_init(struct dvb_frontend* fe)
179{ 169{
180 /* Hardware reset is done using gpio[0] of cx23880x chip. 170 /* Hardware reset is done using gpio[0] of cx23880x chip.
181 * I'd like to do it here, but don't know how to find chip address. 171 * I'd like to do it here, but don't know how to find chip address.
@@ -184,18 +174,18 @@ static int lgdt3302_init(struct dvb_frontend* fe)
184 * the caller of this function needs to do it. */ 174 * the caller of this function needs to do it. */
185 175
186 dprintk("%s entered\n", __FUNCTION__); 176 dprintk("%s entered\n", __FUNCTION__);
187 return lgdt3302_SwReset((struct lgdt3302_state*) fe->demodulator_priv); 177 return lgdt330x_SwReset((struct lgdt330x_state*) fe->demodulator_priv);
188} 178}
189 179
190static int lgdt3302_read_ber(struct dvb_frontend* fe, u32* ber) 180static int lgdt330x_read_ber(struct dvb_frontend* fe, u32* ber)
191{ 181{
192 *ber = 0; /* Dummy out for now */ 182 *ber = 0; /* Dummy out for now */
193 return 0; 183 return 0;
194} 184}
195 185
196static int lgdt3302_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) 186static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
197{ 187{
198 struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv; 188 struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv;
199 u8 buf[2]; 189 u8 buf[2];
200 190
201 i2c_selectreadbytes(state, PACKET_ERR_COUNTER1, buf, sizeof(buf)); 191 i2c_selectreadbytes(state, PACKET_ERR_COUNTER1, buf, sizeof(buf));
@@ -204,12 +194,11 @@ static int lgdt3302_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
204 return 0; 194 return 0;
205} 195}
206 196
207static int lgdt3302_set_parameters(struct dvb_frontend* fe, 197static int lgdt330x_set_parameters(struct dvb_frontend* fe,
208 struct dvb_frontend_parameters *param) 198 struct dvb_frontend_parameters *param)
209{ 199{
210 u8 buf[4]; 200 struct lgdt330x_state* state =
211 struct lgdt3302_state* state = 201 (struct lgdt330x_state*) fe->demodulator_priv;
212 (struct lgdt3302_state*) fe->demodulator_priv;
213 202
214 /* Use 50MHz parameter values from spec sheet since xtal is 50 */ 203 /* Use 50MHz parameter values from spec sheet since xtal is 50 */
215 static u8 top_ctrl_cfg[] = { TOP_CONTROL, 0x03 }; 204 static u8 top_ctrl_cfg[] = { TOP_CONTROL, 0x03 };
@@ -228,6 +217,10 @@ static int lgdt3302_set_parameters(struct dvb_frontend* fe,
228 217
229 /* Select VSB mode and serial MPEG interface */ 218 /* Select VSB mode and serial MPEG interface */
230 top_ctrl_cfg[1] = 0x07; 219 top_ctrl_cfg[1] = 0x07;
220
221 /* Select ANT connector if supported by card */
222 if (state->config->pll_rf_set)
223 state->config->pll_rf_set(fe, 1);
231 break; 224 break;
232 225
233 case QAM_64: 226 case QAM_64:
@@ -235,6 +228,10 @@ static int lgdt3302_set_parameters(struct dvb_frontend* fe,
235 228
236 /* Select QAM_64 mode and serial MPEG interface */ 229 /* Select QAM_64 mode and serial MPEG interface */
237 top_ctrl_cfg[1] = 0x04; 230 top_ctrl_cfg[1] = 0x04;
231
232 /* Select CABLE connector if supported by card */
233 if (state->config->pll_rf_set)
234 state->config->pll_rf_set(fe, 0);
238 break; 235 break;
239 236
240 case QAM_256: 237 case QAM_256:
@@ -242,9 +239,13 @@ static int lgdt3302_set_parameters(struct dvb_frontend* fe,
242 239
243 /* Select QAM_256 mode and serial MPEG interface */ 240 /* Select QAM_256 mode and serial MPEG interface */
244 top_ctrl_cfg[1] = 0x05; 241 top_ctrl_cfg[1] = 0x05;
242
243 /* Select CABLE connector if supported by card */
244 if (state->config->pll_rf_set)
245 state->config->pll_rf_set(fe, 0);
245 break; 246 break;
246 default: 247 default:
247 printk(KERN_WARNING "lgdt3302: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation); 248 printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation);
248 return -1; 249 return -1;
249 } 250 }
250 /* Initializations common to all modes */ 251 /* Initializations common to all modes */
@@ -290,44 +291,50 @@ static int lgdt3302_set_parameters(struct dvb_frontend* fe,
290 291
291 /* Change only if we are actually changing the channel */ 292 /* Change only if we are actually changing the channel */
292 if (state->current_frequency != param->frequency) { 293 if (state->current_frequency != param->frequency) {
293 dvb_pll_configure(state->config->pll_desc, buf, 294 u8 buf[5];
294 param->frequency, 0); 295 struct i2c_msg msg = { .flags = 0, .buf = &buf[1], .len = 4 };
295 dprintk("%s: tuner bytes: 0x%02x 0x%02x " 296 int err;
296 "0x%02x 0x%02x\n", __FUNCTION__, buf[0],buf[1],buf[2],buf[3]);
297 i2c_writebytes(state, state->config->pll_address ,buf, 4);
298 297
299 /* Check the status of the tuner pll */ 298 state->config->pll_set(fe, param, buf);
300 i2c_readbytes(state, state->config->pll_address, buf, 1); 299 msg.addr = buf[0];
301 dprintk("%s: tuner status byte = 0x%02x\n", __FUNCTION__, buf[0]);
302 300
301 dprintk("%s: tuner at 0x%02x bytes: 0x%02x 0x%02x "
302 "0x%02x 0x%02x\n", __FUNCTION__,
303 buf[0],buf[1],buf[2],buf[3],buf[4]);
304 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
305 printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, buf[0], buf[1], err);
306 if (err < 0)
307 return err;
308 else
309 return -EREMOTEIO;
310 }
311#if 0
312 /* Check the status of the tuner pll */
313 i2c_readbytes(state, buf[0], &buf[1], 1);
314 dprintk("%s: tuner status byte = 0x%02x\n", __FUNCTION__, buf[1]);
315#endif
303 /* Update current frequency */ 316 /* Update current frequency */
304 state->current_frequency = param->frequency; 317 state->current_frequency = param->frequency;
305 } 318 }
306 lgdt3302_SwReset(state); 319 lgdt330x_SwReset(state);
307 return 0; 320 return 0;
308} 321}
309 322
310static int lgdt3302_get_frontend(struct dvb_frontend* fe, 323static int lgdt330x_get_frontend(struct dvb_frontend* fe,
311 struct dvb_frontend_parameters* param) 324 struct dvb_frontend_parameters* param)
312{ 325{
313 struct lgdt3302_state *state = fe->demodulator_priv; 326 struct lgdt330x_state *state = fe->demodulator_priv;
314 param->frequency = state->current_frequency; 327 param->frequency = state->current_frequency;
315 return 0; 328 return 0;
316} 329}
317 330
318static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status) 331static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status)
319{ 332{
320 struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv; 333 struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv;
321 u8 buf[3]; 334 u8 buf[3];
322 335
323 *status = 0; /* Reset status result */ 336 *status = 0; /* Reset status result */
324 337
325 /* Check the status of the tuner pll */
326 i2c_readbytes(state, state->config->pll_address, buf, 1);
327 dprintk("%s: tuner status byte = 0x%02x\n", __FUNCTION__, buf[0]);
328 if ((buf[0] & 0xc0) != 0x40)
329 return 0; /* Tuner PLL not locked or not powered on */
330
331 /* 338 /*
332 * You must set the Mask bits to 1 in the IRQ_MASK in order 339 * You must set the Mask bits to 1 in the IRQ_MASK in order
333 * to see that status bit in the IRQ_STATUS register. 340 * to see that status bit in the IRQ_STATUS register.
@@ -383,19 +390,19 @@ static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status)
383 *status |= FE_HAS_CARRIER; 390 *status |= FE_HAS_CARRIER;
384 break; 391 break;
385 default: 392 default:
386 printk("KERN_WARNING lgdt3302: %s: Modulation set to unsupported value\n", __FUNCTION__); 393 printk("KERN_WARNING lgdt330x: %s: Modulation set to unsupported value\n", __FUNCTION__);
387 } 394 }
388 395
389 return 0; 396 return 0;
390} 397}
391 398
392static int lgdt3302_read_signal_strength(struct dvb_frontend* fe, u16* strength) 399static int lgdt330x_read_signal_strength(struct dvb_frontend* fe, u16* strength)
393{ 400{
394 /* not directly available. */ 401 /* not directly available. */
395 return 0; 402 return 0;
396} 403}
397 404
398static int lgdt3302_read_snr(struct dvb_frontend* fe, u16* snr) 405static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr)
399{ 406{
400#ifdef SNR_IN_DB 407#ifdef SNR_IN_DB
401 /* 408 /*
@@ -450,7 +457,7 @@ static int lgdt3302_read_snr(struct dvb_frontend* fe, u16* snr)
450 static u8 buf[5];/* read data buffer */ 457 static u8 buf[5];/* read data buffer */
451 static u32 noise; /* noise value */ 458 static u32 noise; /* noise value */
452 static u32 snr_db; /* index into SNR_EQ[] */ 459 static u32 snr_db; /* index into SNR_EQ[] */
453 struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv; 460 struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv;
454 461
455 /* read both equalizer and pase tracker noise data */ 462 /* read both equalizer and pase tracker noise data */
456 i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf)); 463 i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf));
@@ -486,7 +493,7 @@ static int lgdt3302_read_snr(struct dvb_frontend* fe, u16* snr)
486 /* Return the raw noise value */ 493 /* Return the raw noise value */
487 static u8 buf[5];/* read data buffer */ 494 static u8 buf[5];/* read data buffer */
488 static u32 noise; /* noise value */ 495 static u32 noise; /* noise value */
489 struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv; 496 struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv;
490 497
491 /* read both equalizer and pase tracker noise data */ 498 /* read both equalizer and pase tracker noise data */
492 i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf)); 499 i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf));
@@ -509,7 +516,7 @@ static int lgdt3302_read_snr(struct dvb_frontend* fe, u16* snr)
509 return 0; 516 return 0;
510} 517}
511 518
512static int lgdt3302_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings) 519static int lgdt330x_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings)
513{ 520{
514 /* I have no idea about this - it may not be needed */ 521 /* I have no idea about this - it may not be needed */
515 fe_tune_settings->min_delay_ms = 500; 522 fe_tune_settings->min_delay_ms = 500;
@@ -518,22 +525,22 @@ static int lgdt3302_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronte
518 return 0; 525 return 0;
519} 526}
520 527
521static void lgdt3302_release(struct dvb_frontend* fe) 528static void lgdt330x_release(struct dvb_frontend* fe)
522{ 529{
523 struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv; 530 struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv;
524 kfree(state); 531 kfree(state);
525} 532}
526 533
527static struct dvb_frontend_ops lgdt3302_ops; 534static struct dvb_frontend_ops lgdt330x_ops;
528 535
529struct dvb_frontend* lgdt3302_attach(const struct lgdt3302_config* config, 536struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
530 struct i2c_adapter* i2c) 537 struct i2c_adapter* i2c)
531{ 538{
532 struct lgdt3302_state* state = NULL; 539 struct lgdt330x_state* state = NULL;
533 u8 buf[1]; 540 u8 buf[1];
534 541
535 /* Allocate memory for the internal state */ 542 /* Allocate memory for the internal state */
536 state = (struct lgdt3302_state*) kmalloc(sizeof(struct lgdt3302_state), GFP_KERNEL); 543 state = (struct lgdt330x_state*) kmalloc(sizeof(struct lgdt330x_state), GFP_KERNEL);
537 if (state == NULL) 544 if (state == NULL)
538 goto error; 545 goto error;
539 memset(state,0,sizeof(*state)); 546 memset(state,0,sizeof(*state));
@@ -541,7 +548,7 @@ struct dvb_frontend* lgdt3302_attach(const struct lgdt3302_config* config,
541 /* Setup the state */ 548 /* Setup the state */
542 state->config = config; 549 state->config = config;
543 state->i2c = i2c; 550 state->i2c = i2c;
544 memcpy(&state->ops, &lgdt3302_ops, sizeof(struct dvb_frontend_ops)); 551 memcpy(&state->ops, &lgdt330x_ops, sizeof(struct dvb_frontend_ops));
545 /* Verify communication with demod chip */ 552 /* Verify communication with demod chip */
546 if (i2c_selectreadbytes(state, 2, buf, 1)) 553 if (i2c_selectreadbytes(state, 2, buf, 1))
547 goto error; 554 goto error;
@@ -561,9 +568,9 @@ error:
561 return NULL; 568 return NULL;
562} 569}
563 570
564static struct dvb_frontend_ops lgdt3302_ops = { 571static struct dvb_frontend_ops lgdt330x_ops = {
565 .info = { 572 .info = {
566 .name= "LG Electronics LGDT3302 VSB/QAM Frontend", 573 .name= "LG Electronics lgdt330x VSB/QAM Frontend",
567 .type = FE_ATSC, 574 .type = FE_ATSC,
568 .frequency_min= 54000000, 575 .frequency_min= 54000000,
569 .frequency_max= 858000000, 576 .frequency_max= 858000000,
@@ -573,23 +580,23 @@ static struct dvb_frontend_ops lgdt3302_ops = {
573 .symbol_rate_max = 10762000, 580 .symbol_rate_max = 10762000,
574 .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB 581 .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
575 }, 582 },
576 .init = lgdt3302_init, 583 .init = lgdt330x_init,
577 .set_frontend = lgdt3302_set_parameters, 584 .set_frontend = lgdt330x_set_parameters,
578 .get_frontend = lgdt3302_get_frontend, 585 .get_frontend = lgdt330x_get_frontend,
579 .get_tune_settings = lgdt3302_get_tune_settings, 586 .get_tune_settings = lgdt330x_get_tune_settings,
580 .read_status = lgdt3302_read_status, 587 .read_status = lgdt330x_read_status,
581 .read_ber = lgdt3302_read_ber, 588 .read_ber = lgdt330x_read_ber,
582 .read_signal_strength = lgdt3302_read_signal_strength, 589 .read_signal_strength = lgdt330x_read_signal_strength,
583 .read_snr = lgdt3302_read_snr, 590 .read_snr = lgdt330x_read_snr,
584 .read_ucblocks = lgdt3302_read_ucblocks, 591 .read_ucblocks = lgdt330x_read_ucblocks,
585 .release = lgdt3302_release, 592 .release = lgdt330x_release,
586}; 593};
587 594
588MODULE_DESCRIPTION("LGDT3302 [DViCO FusionHDTV 3 Gold] (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); 595MODULE_DESCRIPTION("lgdt330x [DViCO FusionHDTV 3 Gold] (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver");
589MODULE_AUTHOR("Wilson Michaels"); 596MODULE_AUTHOR("Wilson Michaels");
590MODULE_LICENSE("GPL"); 597MODULE_LICENSE("GPL");
591 598
592EXPORT_SYMBOL(lgdt3302_attach); 599EXPORT_SYMBOL(lgdt330x_attach);
593 600
594/* 601/*
595 * Local variables: 602 * Local variables:
diff --git a/drivers/media/dvb/frontends/lgdt3302.h b/drivers/media/dvb/frontends/lgdt330x.h
index 81587a40032b..04986f8e7565 100644
--- a/drivers/media/dvb/frontends/lgdt3302.h
+++ b/drivers/media/dvb/frontends/lgdt330x.h
@@ -1,7 +1,5 @@
1/* 1/*
2 * $Id: lgdt3302.h,v 1.2 2005/06/28 23:50:48 mkrufky Exp $ 2 * Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM
3 *
4 * Support for LGDT3302 (DViCO FustionHDTV 3 Gold) - VSB/QAM
5 * 3 *
6 * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> 4 * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
7 * 5 *
@@ -21,26 +19,28 @@
21 * 19 *
22 */ 20 */
23 21
24#ifndef LGDT3302_H 22#ifndef LGDT330X_H
25#define LGDT3302_H 23#define LGDT330X_H
26 24
27#include <linux/dvb/frontend.h> 25#include <linux/dvb/frontend.h>
28 26
29struct lgdt3302_config 27struct lgdt330x_config
30{ 28{
31 /* The demodulator's i2c address */ 29 /* The demodulator's i2c address */
32 u8 demod_address; 30 u8 demod_address;
33 u8 pll_address; 31
34 struct dvb_pll_desc *pll_desc; 32 /* PLL interface */
33 int (*pll_rf_set) (struct dvb_frontend* fe, int index);
34 int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pll_address);
35 35
36 /* Need to set device param for start_dma */ 36 /* Need to set device param for start_dma */
37 int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); 37 int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
38}; 38};
39 39
40extern struct dvb_frontend* lgdt3302_attach(const struct lgdt3302_config* config, 40extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
41 struct i2c_adapter* i2c); 41 struct i2c_adapter* i2c);
42 42
43#endif /* LGDT3302_H */ 43#endif /* LGDT330X_H */
44 44
45/* 45/*
46 * Local variables: 46 * Local variables:
diff --git a/drivers/media/dvb/frontends/lgdt3302_priv.h b/drivers/media/dvb/frontends/lgdt330x_priv.h
index 6193fa7a569d..4143ce8f1a95 100644
--- a/drivers/media/dvb/frontends/lgdt3302_priv.h
+++ b/drivers/media/dvb/frontends/lgdt330x_priv.h
@@ -1,7 +1,5 @@
1/* 1/*
2 * $Id: lgdt3302_priv.h,v 1.2 2005/06/28 23:50:48 mkrufky Exp $ 2 * Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM
3 *
4 * Support for LGDT3302 (DViCO FustionHDTV 3 Gold) - VSB/QAM
5 * 3 *
6 * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> 4 * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
7 * 5 *
@@ -21,8 +19,8 @@
21 * 19 *
22 */ 20 */
23 21
24#ifndef _LGDT3302_PRIV_ 22#ifndef _LGDT330X_PRIV_
25#define _LGDT3302_PRIV_ 23#define _LGDT330X_PRIV_
26 24
27/* i2c control register addresses */ 25/* i2c control register addresses */
28enum I2C_REG { 26enum I2C_REG {
@@ -63,7 +61,7 @@ enum I2C_REG {
63 PACKET_ERR_COUNTER2= 0x6b, 61 PACKET_ERR_COUNTER2= 0x6b,
64}; 62};
65 63
66#endif /* _LGDT3302_PRIV_ */ 64#endif /* _LGDT330X_PRIV_ */
67 65
68/* 66/*
69 * Local variables: 67 * Local variables:
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c
index e62147e4ed1b..e5e2021a7312 100644
--- a/drivers/media/radio/radio-maestro.c
+++ b/drivers/media/radio/radio-maestro.c
@@ -154,7 +154,7 @@ static void radio_bits_set(struct radio_device *dev, __u32 data)
154 msleep(125); 154 msleep(125);
155} 155}
156 156
157inline static int radio_function(struct inode *inode, struct file *file, 157static inline int radio_function(struct inode *inode, struct file *file,
158 unsigned int cmd, void *arg) 158 unsigned int cmd, void *arg)
159{ 159{
160 struct video_device *dev = video_devdata(file); 160 struct video_device *dev = video_devdata(file);
@@ -283,7 +283,7 @@ static int __init maestro_radio_init(void)
283module_init(maestro_radio_init); 283module_init(maestro_radio_init);
284module_exit(maestro_radio_exit); 284module_exit(maestro_radio_exit);
285 285
286inline static __u16 radio_power_on(struct radio_device *dev) 286static inline __u16 radio_power_on(struct radio_device *dev)
287{ 287{
288 register __u16 io=dev->io; 288 register __u16 io=dev->io;
289 register __u32 ofreq; 289 register __u32 ofreq;
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
index 5b748a48ce72..02d39a50d5ed 100644
--- a/drivers/media/radio/radio-maxiradio.c
+++ b/drivers/media/radio/radio-maxiradio.c
@@ -166,7 +166,7 @@ static int get_tune(__u16 io)
166} 166}
167 167
168 168
169inline static int radio_function(struct inode *inode, struct file *file, 169static inline int radio_function(struct inode *inode, struct file *file,
170 unsigned int cmd, void *arg) 170 unsigned int cmd, void *arg)
171{ 171{
172 struct video_device *dev = video_devdata(file); 172 struct video_device *dev = video_devdata(file);
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index f461750c7646..ac81e5e01a9a 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -236,7 +236,7 @@ config VIDEO_MEYE
236 236
237config VIDEO_SAA7134 237config VIDEO_SAA7134
238 tristate "Philips SAA7134 support" 238 tristate "Philips SAA7134 support"
239 depends on VIDEO_DEV && PCI && I2C 239 depends on VIDEO_DEV && PCI && I2C && SOUND
240 select VIDEO_BUF 240 select VIDEO_BUF
241 select VIDEO_IR 241 select VIDEO_IR
242 select VIDEO_TUNER 242 select VIDEO_TUNER
@@ -331,7 +331,7 @@ config VIDEO_CX88_DVB
331 select DVB_MT352 331 select DVB_MT352
332 select DVB_OR51132 332 select DVB_OR51132
333 select DVB_CX22702 333 select DVB_CX22702
334 select DVB_LGDT3302 334 select DVB_LGDT330X
335 ---help--- 335 ---help---
336 This adds support for DVB/ATSC cards based on the 336 This adds support for DVB/ATSC cards based on the
337 Connexant 2388x chip. 337 Connexant 2388x chip.
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index 2dbf5ec43abd..6c52fd0bb7df 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: bttv-cards.c,v 1.53 2005/07/05 17:37:35 nsh Exp $ 2 $Id: bttv-cards.c,v 1.54 2005/07/19 18:26:46 mkrufky Exp $
3 3
4 bttv-cards.c 4 bttv-cards.c
5 5
@@ -2772,8 +2772,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
2772 } 2772 }
2773 btv->pll.pll_current = -1; 2773 btv->pll.pll_current = -1;
2774 2774
2775 bttv_reset_audio(btv);
2776
2777 /* tuner configuration (from card list / autodetect / insmod option) */ 2775 /* tuner configuration (from card list / autodetect / insmod option) */
2778 if (UNSET != bttv_tvcards[btv->c.type].tuner_type) 2776 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
2779 if(UNSET == btv->tuner_type) 2777 if(UNSET == btv->tuner_type)
diff --git a/drivers/media/video/cx88/Makefile b/drivers/media/video/cx88/Makefile
index 606d0348da2c..107e48645e3a 100644
--- a/drivers/media/video/cx88/Makefile
+++ b/drivers/media/video/cx88/Makefile
@@ -9,3 +9,15 @@ obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o
9EXTRA_CFLAGS += -I$(src)/.. 9EXTRA_CFLAGS += -I$(src)/..
10EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core 10EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
11EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends 11EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends
12ifneq ($(CONFIG_DVB_CX22702),n)
13 EXTRA_CFLAGS += -DHAVE_CX22702=1
14endif
15ifneq ($(CONFIG_DVB_OR51132),n)
16 EXTRA_CFLAGS += -DHAVE_OR51132=1
17endif
18ifneq ($(CONFIG_DVB_LGDT330X),n)
19 EXTRA_CFLAGS += -DHAVE_LGDT330X=1
20endif
21ifneq ($(CONFIG_DVB_MT352),n)
22 EXTRA_CFLAGS += -DHAVE_MT352=1
23endif
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 6ad1458ab652..ef0e9a85c359 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-dvb.c,v 1.42 2005/07/12 15:44:55 mkrufky Exp $ 2 * $Id: cx88-dvb.c,v 1.54 2005/07/25 05:13:50 mkrufky Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * MPEG Transport Stream (DVB) routines 5 * MPEG Transport Stream (DVB) routines
@@ -29,27 +29,23 @@
29#include <linux/kthread.h> 29#include <linux/kthread.h>
30#include <linux/file.h> 30#include <linux/file.h>
31#include <linux/suspend.h> 31#include <linux/suspend.h>
32 32#include <linux/config.h>
33#define CONFIG_DVB_MT352 1
34#define CONFIG_DVB_CX22702 1
35#define CONFIG_DVB_OR51132 1
36#define CONFIG_DVB_LGDT3302 1
37 33
38#include "cx88.h" 34#include "cx88.h"
39#include "dvb-pll.h" 35#include "dvb-pll.h"
40 36
41#if CONFIG_DVB_MT352 37#ifdef HAVE_MT352
42# include "mt352.h" 38# include "mt352.h"
43# include "mt352_priv.h" 39# include "mt352_priv.h"
44#endif 40#endif
45#if CONFIG_DVB_CX22702 41#ifdef HAVE_CX22702
46# include "cx22702.h" 42# include "cx22702.h"
47#endif 43#endif
48#if CONFIG_DVB_OR51132 44#ifdef HAVE_OR51132
49# include "or51132.h" 45# include "or51132.h"
50#endif 46#endif
51#if CONFIG_DVB_LGDT3302 47#ifdef HAVE_LGDT330X
52# include "lgdt3302.h" 48# include "lgdt330x.h"
53#endif 49#endif
54 50
55MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); 51MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
@@ -107,7 +103,7 @@ static struct videobuf_queue_ops dvb_qops = {
107 103
108/* ------------------------------------------------------------------ */ 104/* ------------------------------------------------------------------ */
109 105
110#if CONFIG_DVB_MT352 106#ifdef HAVE_MT352
111static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) 107static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
112{ 108{
113 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 }; 109 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
@@ -177,7 +173,7 @@ static struct mt352_config dntv_live_dvbt_config = {
177}; 173};
178#endif 174#endif
179 175
180#if CONFIG_DVB_CX22702 176#ifdef HAVE_CX22702
181static struct cx22702_config connexant_refboard_config = { 177static struct cx22702_config connexant_refboard_config = {
182 .demod_address = 0x43, 178 .demod_address = 0x43,
183 .output_mode = CX22702_SERIAL_OUTPUT, 179 .output_mode = CX22702_SERIAL_OUTPUT,
@@ -193,7 +189,7 @@ static struct cx22702_config hauppauge_novat_config = {
193}; 189};
194#endif 190#endif
195 191
196#if CONFIG_DVB_OR51132 192#ifdef HAVE_OR51132
197static int or51132_set_ts_param(struct dvb_frontend* fe, 193static int or51132_set_ts_param(struct dvb_frontend* fe,
198 int is_punctured) 194 int is_punctured)
199{ 195{
@@ -210,8 +206,33 @@ static struct or51132_config pchdtv_hd3000 = {
210}; 206};
211#endif 207#endif
212 208
213#if CONFIG_DVB_LGDT3302 209#ifdef HAVE_LGDT330X
214static int lgdt3302_set_ts_param(struct dvb_frontend* fe, int is_punctured) 210static int lgdt330x_pll_set(struct dvb_frontend* fe,
211 struct dvb_frontend_parameters* params,
212 u8* pllbuf)
213{
214 struct cx8802_dev *dev= fe->dvb->priv;
215
216 pllbuf[0] = dev->core->pll_addr;
217 dvb_pll_configure(dev->core->pll_desc, &pllbuf[1],
218 params->frequency, 0);
219 return 0;
220}
221
222static int lgdt330x_pll_rf_set(struct dvb_frontend* fe, int index)
223{
224 struct cx8802_dev *dev= fe->dvb->priv;
225 struct cx88_core *core = dev->core;
226
227 dprintk(1, "%s: index = %d\n", __FUNCTION__, index);
228 if (index == 0)
229 cx_clear(MO_GP0_IO, 8);
230 else
231 cx_set(MO_GP0_IO, 8);
232 return 0;
233}
234
235static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
215{ 236{
216 struct cx8802_dev *dev= fe->dvb->priv; 237 struct cx8802_dev *dev= fe->dvb->priv;
217 if (is_punctured) 238 if (is_punctured)
@@ -221,18 +242,10 @@ static int lgdt3302_set_ts_param(struct dvb_frontend* fe, int is_punctured)
221 return 0; 242 return 0;
222} 243}
223 244
224static struct lgdt3302_config fusionhdtv_3_gold_q = { 245static struct lgdt330x_config fusionhdtv_3_gold = {
225 .demod_address = 0x0e, 246 .demod_address = 0x0e,
226 .pll_address = 0x61, 247 .pll_set = lgdt330x_pll_set,
227 .pll_desc = &dvb_pll_microtune_4042, 248 .set_ts_params = lgdt330x_set_ts_param,
228 .set_ts_params = lgdt3302_set_ts_param,
229};
230
231static struct lgdt3302_config fusionhdtv_3_gold_t = {
232 .demod_address = 0x0e,
233 .pll_address = 0x61,
234 .pll_desc = &dvb_pll_thomson_dtt7611,
235 .set_ts_params = lgdt3302_set_ts_param,
236}; 249};
237#endif 250#endif
238 251
@@ -244,7 +257,7 @@ static int dvb_register(struct cx8802_dev *dev)
244 257
245 /* init frontend */ 258 /* init frontend */
246 switch (dev->core->board) { 259 switch (dev->core->board) {
247#if CONFIG_DVB_CX22702 260#ifdef HAVE_CX22702
248 case CX88_BOARD_HAUPPAUGE_DVB_T1: 261 case CX88_BOARD_HAUPPAUGE_DVB_T1:
249 dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config, 262 dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config,
250 &dev->core->i2c_adap); 263 &dev->core->i2c_adap);
@@ -255,7 +268,7 @@ static int dvb_register(struct cx8802_dev *dev)
255 &dev->core->i2c_adap); 268 &dev->core->i2c_adap);
256 break; 269 break;
257#endif 270#endif
258#if CONFIG_DVB_MT352 271#ifdef HAVE_MT352
259 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: 272 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
260 dev->core->pll_addr = 0x61; 273 dev->core->pll_addr = 0x61;
261 dev->core->pll_desc = &dvb_pll_lg_z201; 274 dev->core->pll_desc = &dvb_pll_lg_z201;
@@ -277,13 +290,13 @@ static int dvb_register(struct cx8802_dev *dev)
277 &dev->core->i2c_adap); 290 &dev->core->i2c_adap);
278 break; 291 break;
279#endif 292#endif
280#if CONFIG_DVB_OR51132 293#ifdef HAVE_OR51132
281 case CX88_BOARD_PCHDTV_HD3000: 294 case CX88_BOARD_PCHDTV_HD3000:
282 dev->dvb.frontend = or51132_attach(&pchdtv_hd3000, 295 dev->dvb.frontend = or51132_attach(&pchdtv_hd3000,
283 &dev->core->i2c_adap); 296 &dev->core->i2c_adap);
284 break; 297 break;
285#endif 298#endif
286#if CONFIG_DVB_LGDT3302 299#ifdef HAVE_LGDT330X
287 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: 300 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:
288 dev->ts_gen_cntrl = 0x08; 301 dev->ts_gen_cntrl = 0x08;
289 { 302 {
@@ -292,9 +305,14 @@ static int dvb_register(struct cx8802_dev *dev)
292 305
293 cx_clear(MO_GP0_IO, 1); 306 cx_clear(MO_GP0_IO, 1);
294 mdelay(100); 307 mdelay(100);
295 cx_set(MO_GP0_IO, 9); // ANT connector too FIXME 308 cx_set(MO_GP0_IO, 1);
296 mdelay(200); 309 mdelay(200);
297 dev->dvb.frontend = lgdt3302_attach(&fusionhdtv_3_gold_q, 310
311 /* Select RF connector callback */
312 fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;
313 dev->core->pll_addr = 0x61;
314 dev->core->pll_desc = &dvb_pll_microtune_4042;
315 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
298 &dev->core->i2c_adap); 316 &dev->core->i2c_adap);
299 } 317 }
300 break; 318 break;
@@ -306,9 +324,11 @@ static int dvb_register(struct cx8802_dev *dev)
306 324
307 cx_clear(MO_GP0_IO, 1); 325 cx_clear(MO_GP0_IO, 1);
308 mdelay(100); 326 mdelay(100);
309 cx_set(MO_GP0_IO, 9); /* ANT connector too FIXME */ 327 cx_set(MO_GP0_IO, 9);
310 mdelay(200); 328 mdelay(200);
311 dev->dvb.frontend = lgdt3302_attach(&fusionhdtv_3_gold_t, 329 dev->core->pll_addr = 0x61;
330 dev->core->pll_desc = &dvb_pll_thomson_dtt7611;
331 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
312 &dev->core->i2c_adap); 332 &dev->core->i2c_adap);
313 } 333 }
314 break; 334 break;
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 8403c4e95050..a628a55299c6 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: cx88-i2c.c,v 1.28 2005/07/05 17:37:35 nsh Exp $ 2 $Id: cx88-i2c.c,v 1.30 2005/07/25 05:10:13 mkrufky Exp $
3 3
4 cx88-i2c.c -- all the i2c code is here 4 cx88-i2c.c -- all the i2c code is here
5 5
@@ -164,7 +164,7 @@ static struct i2c_client cx8800_i2c_client_template = {
164}; 164};
165 165
166static char *i2c_devs[128] = { 166static char *i2c_devs[128] = {
167 [ 0x1c >> 1 ] = "lgdt3302", 167 [ 0x1c >> 1 ] = "lgdt330x",
168 [ 0x86 >> 1 ] = "tda9887/cx22702", 168 [ 0x86 >> 1 ] = "tda9887/cx22702",
169 [ 0xa0 >> 1 ] = "eeprom", 169 [ 0xa0 >> 1 ] = "eeprom",
170 [ 0xc0 >> 1 ] = "tuner (analog)", 170 [ 0xc0 >> 1 ] = "tuner (analog)",
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index 486234d41b56..d04793fb80fc 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -142,8 +142,8 @@ struct mxb
142 142
143 int cur_mode; /* current audio mode (mono, stereo, ...) */ 143 int cur_mode; /* current audio mode (mono, stereo, ...) */
144 int cur_input; /* current input */ 144 int cur_input; /* current input */
145 int cur_freq; /* current frequency the tuner is tuned to */
146 int cur_mute; /* current mute status */ 145 int cur_mute; /* current mute status */
146 struct v4l2_frequency cur_freq; /* current frequency the tuner is tuned to */
147}; 147};
148 148
149static struct saa7146_extension extension; 149static struct saa7146_extension extension;
@@ -352,9 +352,15 @@ static int mxb_init_done(struct saa7146_dev* dev)
352 /* select a tuner type */ 352 /* select a tuner type */
353 tun_setup.mode_mask = T_ANALOG_TV; 353 tun_setup.mode_mask = T_ANALOG_TV;
354 tun_setup.addr = ADDR_UNSET; 354 tun_setup.addr = ADDR_UNSET;
355 tun_setup.type = 5; 355 tun_setup.type = TUNER_PHILIPS_PAL;
356 mxb->tuner->driver->command(mxb->tuner,TUNER_SET_TYPE_ADDR, &tun_setup); 356 mxb->tuner->driver->command(mxb->tuner,TUNER_SET_TYPE_ADDR, &tun_setup);
357 357 /* tune in some frequency on tuner */
358 mxb->cur_freq.tuner = 0;
359 mxb->cur_freq.type = V4L2_TUNER_ANALOG_TV;
360 mxb->cur_freq.frequency = freq;
361 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY,
362 &mxb->cur_freq);
363
358 /* mute audio on tea6420s */ 364 /* mute audio on tea6420s */
359 mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]); 365 mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]);
360 mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]); 366 mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]);
@@ -371,12 +377,8 @@ static int mxb_init_done(struct saa7146_dev* dev)
371 vm.out = 13; 377 vm.out = 13;
372 mxb->tea6415c->driver->command(mxb->tea6415c,TEA6415C_SWITCH, &vm); 378 mxb->tea6415c->driver->command(mxb->tea6415c,TEA6415C_SWITCH, &vm);
373 379
374 /* tune in some frequency on tuner */
375 mxb->tuner->driver->command(mxb->tuner, VIDIOCSFREQ, &freq);
376
377 /* the rest for mxb */ 380 /* the rest for mxb */
378 mxb->cur_input = 0; 381 mxb->cur_input = 0;
379 mxb->cur_freq = freq;
380 mxb->cur_mute = 1; 382 mxb->cur_mute = 1;
381 383
382 mxb->cur_mode = V4L2_TUNER_MODE_STEREO; 384 mxb->cur_mode = V4L2_TUNER_MODE_STEREO;
@@ -819,18 +821,14 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
819 return -EINVAL; 821 return -EINVAL;
820 } 822 }
821 823
822 memset(f,0,sizeof(*f)); 824 *f = mxb->cur_freq;
823 f->type = V4L2_TUNER_ANALOG_TV;
824 f->frequency = mxb->cur_freq;
825 825
826 DEB_EE(("VIDIOC_G_FREQ: freq:0x%08x.\n", mxb->cur_freq)); 826 DEB_EE(("VIDIOC_G_FREQ: freq:0x%08x.\n", mxb->cur_freq.frequency));
827 return 0; 827 return 0;
828 } 828 }
829 case VIDIOC_S_FREQUENCY: 829 case VIDIOC_S_FREQUENCY:
830 { 830 {
831 struct v4l2_frequency *f = arg; 831 struct v4l2_frequency *f = arg;
832 int t_locked = 0;
833 int v_byte = 0;
834 832
835 if (0 != f->tuner) 833 if (0 != f->tuner)
836 return -EINVAL; 834 return -EINVAL;
@@ -843,20 +841,11 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
843 return -EINVAL; 841 return -EINVAL;
844 } 842 }
845 843
846 DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n",f->frequency)); 844 mxb->cur_freq = *f;
847 845 DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n", mxb->cur_freq.frequency));
848 mxb->cur_freq = f->frequency;
849 846
850 /* tune in desired frequency */ 847 /* tune in desired frequency */
851 mxb->tuner->driver->command(mxb->tuner, VIDIOCSFREQ, &mxb->cur_freq); 848 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY, &mxb->cur_freq);
852
853 /* check if pll of tuner & saa7111a is locked */
854// mxb->tuner->driver->command(mxb->tuner,TUNER_IS_LOCKED, &t_locked);
855 mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_GET_STATUS, &v_byte);
856
857 /* not locked -- anything to do here ? */
858 if( 0 == t_locked || 0 == (v_byte & DECODER_STATUS_GOOD)) {
859 }
860 849
861 /* hack: changing the frequency should invalidate the vbi-counter (=> alevt) */ 850 /* hack: changing the frequency should invalidate the vbi-counter (=> alevt) */
862 spin_lock(&dev->slock); 851 spin_lock(&dev->slock);
diff --git a/drivers/media/video/saa7134/Makefile b/drivers/media/video/saa7134/Makefile
index e577a06b136b..b778ffd94e65 100644
--- a/drivers/media/video/saa7134/Makefile
+++ b/drivers/media/video/saa7134/Makefile
@@ -9,3 +9,9 @@ obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o
9EXTRA_CFLAGS += -I$(src)/.. 9EXTRA_CFLAGS += -I$(src)/..
10EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core 10EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
11EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends 11EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends
12ifneq ($(CONFIG_DVB_MT352),n)
13 EXTRA_CFLAGS += -DHAVE_MT352=1
14endif
15ifneq ($(CONFIG_DVB_TDA1004X),n)
16 EXTRA_CFLAGS += -DHAVE_TDA1004X=1
17endif
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 334bc1850092..8be6a90358c8 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: saa7134-dvb.c,v 1.18 2005/07/04 16:05:50 mkrufky Exp $ 2 * $Id: saa7134-dvb.c,v 1.23 2005/07/24 22:12:47 mkrufky Exp $
3 * 3 *
4 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] 4 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
5 * 5 *
@@ -29,18 +29,17 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/kthread.h> 30#include <linux/kthread.h>
31#include <linux/suspend.h> 31#include <linux/suspend.h>
32#include <linux/config.h>
32 33
33#define CONFIG_DVB_MT352 1
34#define CONFIG_DVB_TDA1004X 1
35 34
36#include "saa7134-reg.h" 35#include "saa7134-reg.h"
37#include "saa7134.h" 36#include "saa7134.h"
38 37
39#if CONFIG_DVB_MT352 38#ifdef HAVE_MT352
40# include "mt352.h" 39# include "mt352.h"
41# include "mt352_priv.h" /* FIXME */ 40# include "mt352_priv.h" /* FIXME */
42#endif 41#endif
43#if CONFIG_DVB_TDA1004X 42#ifdef HAVE_TDA1004X
44# include "tda1004x.h" 43# include "tda1004x.h"
45#endif 44#endif
46 45
@@ -54,7 +53,7 @@ MODULE_PARM_DESC(antenna_pwr,"enable antenna power (Pinnacle 300i)");
54 53
55/* ------------------------------------------------------------------ */ 54/* ------------------------------------------------------------------ */
56 55
57#if CONFIG_DVB_MT352 56#ifdef HAVE_MT352
58static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on) 57static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on)
59{ 58{
60 u32 ok; 59 u32 ok;
@@ -153,7 +152,7 @@ static struct mt352_config pinnacle_300i = {
153 152
154/* ------------------------------------------------------------------ */ 153/* ------------------------------------------------------------------ */
155 154
156#if CONFIG_DVB_TDA1004X 155#ifdef HAVE_TDA1004X
157static int philips_tu1216_pll_init(struct dvb_frontend *fe) 156static int philips_tu1216_pll_init(struct dvb_frontend *fe)
158{ 157{
159 struct saa7134_dev *dev = fe->dvb->priv; 158 struct saa7134_dev *dev = fe->dvb->priv;
@@ -385,7 +384,7 @@ static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
385 return 0; 384 return 0;
386} 385}
387 386
388 387#ifdef HAVE_TDA1004X
389static struct tda1004x_config medion_cardbus = { 388static struct tda1004x_config medion_cardbus = {
390 .demod_address = 0x08, 389 .demod_address = 0x08,
391 .invert = 1, 390 .invert = 1,
@@ -398,6 +397,7 @@ static struct tda1004x_config medion_cardbus = {
398 .pll_sleep = philips_fmd1216_analog, 397 .pll_sleep = philips_fmd1216_analog,
399 .request_firmware = NULL, 398 .request_firmware = NULL,
400}; 399};
400#endif
401 401
402/* ------------------------------------------------------------------ */ 402/* ------------------------------------------------------------------ */
403 403
@@ -547,14 +547,14 @@ static int dvb_init(struct saa7134_dev *dev)
547 dev); 547 dev);
548 548
549 switch (dev->board) { 549 switch (dev->board) {
550#if CONFIG_DVB_MT352 550#ifdef HAVE_MT352
551 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: 551 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
552 printk("%s: pinnacle 300i dvb setup\n",dev->name); 552 printk("%s: pinnacle 300i dvb setup\n",dev->name);
553 dev->dvb.frontend = mt352_attach(&pinnacle_300i, 553 dev->dvb.frontend = mt352_attach(&pinnacle_300i,
554 &dev->i2c_adap); 554 &dev->i2c_adap);
555 break; 555 break;
556#endif 556#endif
557#if CONFIG_DVB_TDA1004X 557#ifdef HAVE_TDA1004X
558 case SAA7134_BOARD_MD7134: 558 case SAA7134_BOARD_MD7134:
559 dev->dvb.frontend = tda10046_attach(&medion_cardbus, 559 dev->dvb.frontend = tda10046_attach(&medion_cardbus,
560 &dev->i2c_adap); 560 &dev->i2c_adap);
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index d8b78f1d686b..f42a1efa8fcf 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -285,6 +285,7 @@ static int chip_thread(void *data)
285 schedule(); 285 schedule();
286 } 286 }
287 remove_wait_queue(&chip->wq, &wait); 287 remove_wait_queue(&chip->wq, &wait);
288 try_to_freeze();
288 if (chip->done || signal_pending(current)) 289 if (chip->done || signal_pending(current))
289 break; 290 break;
290 dprintk("%s: thread wakeup\n", i2c_clientname(&chip->c)); 291 dprintk("%s: thread wakeup\n", i2c_clientname(&chip->c));
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index e8d9440977cb..62b03ef091e0 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -445,6 +445,7 @@ int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len)
445} 445}
446EXPORT_SYMBOL(tveeprom_read); 446EXPORT_SYMBOL(tveeprom_read);
447 447
448#if 0
448int tveeprom_dump(unsigned char *eedata, int len) 449int tveeprom_dump(unsigned char *eedata, int len)
449{ 450{
450 int i; 451 int i;
@@ -460,6 +461,7 @@ int tveeprom_dump(unsigned char *eedata, int len)
460 return 0; 461 return 0;
461} 462}
462EXPORT_SYMBOL(tveeprom_dump); 463EXPORT_SYMBOL(tveeprom_dump);
464#endif /* 0 */
463 465
464/* ----------------------------------------------------------------------- */ 466/* ----------------------------------------------------------------------- */
465/* needed for ivtv.sf.net at the moment. Should go away in the long */ 467/* needed for ivtv.sf.net at the moment. Should go away in the long */
@@ -477,7 +479,7 @@ static unsigned short normal_i2c[] = {
477 479
478I2C_CLIENT_INSMOD; 480I2C_CLIENT_INSMOD;
479 481
480struct i2c_driver i2c_driver_tveeprom; 482static struct i2c_driver i2c_driver_tveeprom;
481 483
482static int 484static int
483tveeprom_command(struct i2c_client *client, 485tveeprom_command(struct i2c_client *client,
@@ -549,7 +551,7 @@ tveeprom_detach_client (struct i2c_client *client)
549 return 0; 551 return 0;
550} 552}
551 553
552struct i2c_driver i2c_driver_tveeprom = { 554static struct i2c_driver i2c_driver_tveeprom = {
553 .owner = THIS_MODULE, 555 .owner = THIS_MODULE,
554 .name = "tveeprom", 556 .name = "tveeprom",
555 .id = I2C_DRIVERID_TVEEPROM, 557 .id = I2C_DRIVERID_TVEEPROM,