aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c90
1 files changed, 55 insertions, 35 deletions
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;