diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2008-04-10 01:07:11 +0200 |
---|---|---|
committer | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2008-04-10 01:07:11 +0200 |
commit | 300d332d50fea15849aa641486728d160708b9cf (patch) | |
tree | 802905fd81e92ce2cd756f1cb2daa81f08cd887a /linux | |
parent | cfff1cb68e96dcce0c0880af6db1b4461e19ba9b (diff) | |
download | mediapointer-dvb-s2-300d332d50fea15849aa641486728d160708b9cf.tar.gz mediapointer-dvb-s2-300d332d50fea15849aa641486728d160708b9cf.tar.bz2 |
tda10086: make the xtal frequency a configuration option
From: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Some DVB-S boards, i.e. with the SD1878 tuner, use a 4 MHz reference frequency.
This reqires a different setup of the clock PLL.
This patch adds an enum to the tda10086_config struct and sets the proper
values for the boards.
This patch also fixes the DVB-S section of the MD7134_BRIDGE_2
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/ttusb2.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda10086.c | 11 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda10086.h | 8 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-dvb.c | 10 |
5 files changed, 27 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/ttusb2.c b/linux/drivers/media/dvb/dvb-usb/ttusb2.c index dd11a1fee..e79a26473 100644 --- a/linux/drivers/media/dvb/dvb-usb/ttusb2.c +++ b/linux/drivers/media/dvb/dvb-usb/ttusb2.c @@ -153,6 +153,7 @@ static struct tda10086_config tda10086_config = { .demod_address = 0x0e, .invert = 0, .diseqc_tone = 1, + .xtal_freq = TDA10086_XTAL_16M, }; static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap) diff --git a/linux/drivers/media/dvb/frontends/tda10086.c b/linux/drivers/media/dvb/frontends/tda10086.c index 61ea88519..be989275d 100644 --- a/linux/drivers/media/dvb/frontends/tda10086.c +++ b/linux/drivers/media/dvb/frontends/tda10086.c @@ -129,10 +129,15 @@ static int tda10086_init(struct dvb_frontend* fe) tda10086_write_byte(state, 0x32, 0x00); // irq off tda10086_write_byte(state, 0x31, 0x56); // setup AFC - // setup PLL (assumes 16Mhz XIN) + // setup PLL (this assumes SACLK = 96MHz) tda10086_write_byte(state, 0x55, 0x2c); // misc PLL setup - tda10086_write_byte(state, 0x3a, 0x0b); // M=12 - tda10086_write_byte(state, 0x3b, 0x01); // P=2 + if (state->config->xtal_freq == TDA10086_XTAL_16M) { + tda10086_write_byte(state, 0x3a, 0x0b); // M=12 + tda10086_write_byte(state, 0x3b, 0x01); // P=2 + } else { + tda10086_write_byte(state, 0x3a, 0x17); // M=24 + tda10086_write_byte(state, 0x3b, 0x00); // P=1 + } tda10086_write_mask(state, 0x55, 0x20, 0x00); // powerup PLL // setup TS interface diff --git a/linux/drivers/media/dvb/frontends/tda10086.h b/linux/drivers/media/dvb/frontends/tda10086.h index 197c237e5..f25d5ea38 100644 --- a/linux/drivers/media/dvb/frontends/tda10086.h +++ b/linux/drivers/media/dvb/frontends/tda10086.h @@ -26,6 +26,11 @@ #include <linux/dvb/frontend.h> #include <linux/firmware.h> +enum tda10086_xtal { + TDA10086_XTAL_16M, + TDA10086_XTAL_4M +}; + struct tda10086_config { /* the demodulator's i2c address */ @@ -36,6 +41,9 @@ struct tda10086_config /* do we need the diseqc signal with carrier? */ u8 diseqc_tone; + + /* frequency of the reference xtal */ + enum tda10086_xtal xtal_freq; }; #if defined(CONFIG_DVB_TDA10086) || (defined(CONFIG_DVB_TDA10086_MODULE) && defined(MODULE)) diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c index 829576dc2..108788bf0 100644 --- a/linux/drivers/media/dvb/ttpci/budget.c +++ b/linux/drivers/media/dvb/ttpci/budget.c @@ -364,6 +364,7 @@ static struct tda10086_config tda10086_config = { .demod_address = 0x0e, .invert = 0, .diseqc_tone = 1, + .xtal_freq = TDA10086_XTAL_16M, }; static u8 read_pwm(struct budget* budget) diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c index 19f5b1d34..fd92ef654 100644 --- a/linux/drivers/media/video/saa7134/saa7134-dvb.c +++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c @@ -854,6 +854,14 @@ static struct tda10086_config flydvbs = { .demod_address = 0x0e, .invert = 0, .diseqc_tone = 0, + .xtal_freq = TDA10086_XTAL_16M, +}; + +static struct tda10086_config sd1878_4m = { + .demod_address = 0x0e, + .invert = 0, + .diseqc_tone = 0, + .xtal_freq = TDA10086_XTAL_4M, }; /* ------------------------------------------------------------------ @@ -1213,7 +1221,7 @@ static int dvb_init(struct saa7134_dev *dev) break; case SAA7134_BOARD_MD7134_BRIDGE_2: dev->dvb.frontend = dvb_attach(tda10086_attach, - &flydvbs, &dev->i2c_adap); + &sd1878_4m, &dev->i2c_adap); if (dev->dvb.frontend) { struct dvb_frontend *fe; if (dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |