aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-dvb.c
diff options
context:
space:
mode:
authorChris Pascoe <c.pascoe@itee.uq.edu.au>2006-01-09 12:25:35 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:35 -0500
commitfc40b261db15d010455ad0a4e2ac59da2ced730f (patch)
treed91b96cb35c8b2e978d6ff1be5bdf3aad1993709 /drivers/media/video/cx88/cx88-dvb.c
parent50c25fff5385c6baf3114f7c369b0f75a29ac1e8 (diff)
V4L/DVB (3220): Add support for VP-3054 HDTV board
- Added support for VP-3054 (aka DigitalNow DNTV Live! DVB-T Pro!). - This board has a secondary I2C bus and remote control. - Added a new module to handle secondary I2C bus on this board. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c92
1 files changed, 89 insertions, 3 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index ed5cfe5f5c0e..201050478711 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -3,7 +3,7 @@
3 * device driver for Conexant 2388x based TV cards 3 * device driver for Conexant 2388x based TV cards
4 * MPEG Transport Stream (DVB) routines 4 * MPEG Transport Stream (DVB) routines
5 * 5 *
6 * (c) 2004 Chris Pascoe <c.pascoe@itee.uq.edu.au> 6 * (c) 2004, 2005 Chris Pascoe <c.pascoe@itee.uq.edu.au>
7 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] 7 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -35,6 +35,9 @@
35#ifdef HAVE_MT352 35#ifdef HAVE_MT352
36# include "mt352.h" 36# include "mt352.h"
37# include "mt352_priv.h" 37# include "mt352_priv.h"
38# ifdef HAVE_VP3054_I2C
39# include "cx88-vp3054-i2c.h"
40# endif
38#endif 41#endif
39#ifdef HAVE_CX22702 42#ifdef HAVE_CX22702
40# include "cx22702.h" 43# include "cx22702.h"
@@ -108,7 +111,7 @@ static struct videobuf_queue_ops dvb_qops = {
108/* ------------------------------------------------------------------ */ 111/* ------------------------------------------------------------------ */
109 112
110#ifdef HAVE_MT352 113#ifdef HAVE_MT352
111static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) 114static int generic_mt352_demod_init(struct dvb_frontend* fe)
112{ 115{
113 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 }; 116 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
114 static u8 reset [] = { RESET, 0x80 }; 117 static u8 reset [] = { RESET, 0x80 };
@@ -166,7 +169,7 @@ static int mt352_pll_set(struct dvb_frontend* fe,
166 169
167static struct mt352_config dvico_fusionhdtv = { 170static struct mt352_config dvico_fusionhdtv = {
168 .demod_address = 0x0F, 171 .demod_address = 0x0F,
169 .demod_init = dvico_fusionhdtv_demod_init, 172 .demod_init = generic_mt352_demod_init,
170 .pll_set = mt352_pll_set, 173 .pll_set = mt352_pll_set,
171}; 174};
172 175
@@ -175,6 +178,69 @@ static struct mt352_config dntv_live_dvbt_config = {
175 .demod_init = dntv_live_dvbt_demod_init, 178 .demod_init = dntv_live_dvbt_demod_init,
176 .pll_set = mt352_pll_set, 179 .pll_set = mt352_pll_set,
177}; 180};
181
182#ifdef HAVE_VP3054_I2C
183static int philips_fmd1216_pll_init(struct dvb_frontend *fe)
184{
185 struct cx8802_dev *dev= fe->dvb->priv;
186
187 /* this message is to set up ATC and ALC */
188 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 };
189 struct i2c_msg msg =
190 { .addr = dev->core->pll_addr, .flags = 0,
191 .buf = fmd1216_init, .len = sizeof(fmd1216_init) };
192 int err;
193
194 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
195 if (err < 0)
196 return err;
197 else
198 return -EREMOTEIO;
199 }
200
201 return 0;
202}
203
204static int dntv_live_dvbt_pro_pll_set(struct dvb_frontend* fe,
205 struct dvb_frontend_parameters* params,
206 u8* pllbuf)
207{
208 struct cx8802_dev *dev= fe->dvb->priv;
209 struct i2c_msg msg =
210 { .addr = dev->core->pll_addr, .flags = 0,
211 .buf = pllbuf+1, .len = 4 };
212 int err;
213
214 /* Switch PLL to DVB mode */
215 err = philips_fmd1216_pll_init(fe);
216 if (err)
217 return err;
218
219 /* Tune PLL */
220 pllbuf[0] = dev->core->pll_addr << 1;
221 dvb_pll_configure(dev->core->pll_desc, pllbuf+1,
222 params->frequency,
223 params->u.ofdm.bandwidth);
224 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
225 printk(KERN_WARNING "cx88-dvb: %s error "
226 "(addr %02x <- %02x, err = %i)\n",
227 __FUNCTION__, pllbuf[0], pllbuf[1], err);
228 if (err < 0)
229 return err;
230 else
231 return -EREMOTEIO;
232 }
233
234 return 0;
235}
236
237static struct mt352_config dntv_live_dvbt_pro_config = {
238 .demod_address = 0x0f,
239 .no_tuner = 1,
240 .demod_init = generic_mt352_demod_init,
241 .pll_set = dntv_live_dvbt_pro_pll_set,
242};
243#endif
178#endif 244#endif
179 245
180#ifdef HAVE_CX22702 246#ifdef HAVE_CX22702
@@ -403,6 +469,16 @@ static int dvb_register(struct cx8802_dev *dev)
403 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config, 469 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config,
404 &dev->core->i2c_adap); 470 &dev->core->i2c_adap);
405 break; 471 break;
472 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
473#ifdef HAVE_VP3054_I2C
474 dev->core->pll_addr = 0x61;
475 dev->core->pll_desc = &dvb_pll_fmd1216me;
476 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_pro_config,
477 &((struct vp3054_i2c_state *)dev->card_priv)->adap);
478#else
479 printk("%s: built without vp3054 support\n", dev->core->name);
480#endif
481 break;
406#endif 482#endif
407#ifdef HAVE_OR51132 483#ifdef HAVE_OR51132
408 case CX88_BOARD_PCHDTV_HD3000: 484 case CX88_BOARD_PCHDTV_HD3000:
@@ -532,6 +608,12 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev,
532 if (0 != err) 608 if (0 != err)
533 goto fail_free; 609 goto fail_free;
534 610
611#ifdef HAVE_VP3054_I2C
612 err = vp3054_i2c_probe(dev);
613 if (0 != err)
614 goto fail_free;
615#endif
616
535 /* dvb stuff */ 617 /* dvb stuff */
536 printk("%s/2: cx2388x based dvb card\n", core->name); 618 printk("%s/2: cx2388x based dvb card\n", core->name);
537 videobuf_queue_init(&dev->dvb.dvbq, &dvb_qops, 619 videobuf_queue_init(&dev->dvb.dvbq, &dvb_qops,
@@ -567,6 +649,10 @@ static void __devexit dvb_remove(struct pci_dev *pci_dev)
567 /* dvb */ 649 /* dvb */
568 videobuf_dvb_unregister(&dev->dvb); 650 videobuf_dvb_unregister(&dev->dvb);
569 651
652#ifdef HAVE_VP3054_I2C
653 vp3054_i2c_remove(dev);
654#endif
655
570 /* common */ 656 /* common */
571 cx8802_fini_common(dev); 657 cx8802_fini_common(dev);
572 cx88_core_put(dev->core,dev->pci); 658 cx88_core_put(dev->core,dev->pci);