[PATCH] dvb: cx22702 frontend driver update
authorGerd Knorr <kraxel@bytesex.org>
Sun, 1 May 2005 15:59:20 +0000 (08:59 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 1 May 2005 15:59:20 +0000 (08:59 -0700)
update cx22702 fe driver, add support for using the dvb pll lib, enable
cx22702 support in cx88-dvb.

Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/dvb/frontends/cx22702.c
drivers/media/dvb/frontends/cx22702.h
drivers/media/video/Kconfig
drivers/media/video/cx88/cx88-dvb.c

index 1930b513eefadaac65c132e57a9f1360d9c18c35..011860ce36cc8b93894e2876f87c49ef2e12fa87 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include "dvb_frontend.h"
+#include "dvb-pll.h"
 #include "cx22702.h"
 
 
@@ -203,7 +204,19 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet
 
        /* set PLL */
         cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) &0xfe);
-       state->config->pll_set(fe, p);
+       if (state->config->pll_set) {
+               state->config->pll_set(fe, p);
+       } else if (state->config->pll_desc) {
+               u8 pllbuf[4];
+               struct i2c_msg msg = { .addr = state->config->pll_address,
+                                      .buf = pllbuf, .len = 4 };
+               dvb_pll_configure(state->config->pll_desc, pllbuf,
+                                 p->frequency,
+                                 p->u.ofdm.bandwidth);
+               i2c_transfer(state->i2c, &msg, 1);
+       } else {
+               BUG();
+       }
         cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) | 1);
 
        /* set inversion */
index 6e34f997aba239ad78d8e41df8f98617cd9be5f7..559fdb90666930f7d5219532c3e31ceb085567b3 100644 (file)
@@ -36,6 +36,9 @@ struct cx22702_config
        u8 demod_address;
 
        /* PLL maintenance */
+       u8 pll_address;
+       struct dvb_pll_desc *pll_desc;
+
        int (*pll_init)(struct dvb_frontend* fe);
        int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
 };
index c1b3542dad881f992c449c67f675fd2b03de8775..d3dd4228b72d46c72a2ee7bbe7c4e6a2dfd03ba0 100644 (file)
@@ -252,6 +252,7 @@ config VIDEO_SAA7134_DVB
        depends on VIDEO_SAA7134 && DVB_CORE
        select VIDEO_BUF_DVB
        select DVB_MT352
+       select DVB_CX22702
        ---help---
          This adds support for DVB cards based on the
          Philips saa7134 chip.
index 84d17435f503511727a170c6f27088616bec940e..1ca37315066ee4c05809e24b72d2b0a91a452fa5 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/suspend.h>
 
 /* those two frontends need merging via linuxtv cvs ... */
-#define HAVE_CX22702 0
+#define HAVE_CX22702 1
 #define HAVE_OR51132 1
 
 #include "cx88.h"