summaryrefslogtreecommitdiff
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorOlivier DANET <odanet@caramail.com>2006-08-08 22:48:09 +0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 18:53:41 +0400
commita16bf5d5603184dc1db88f37051881b2eeacfd17 (patch)
treedbb50cc4d2e8ec9d7e57853e391181735b2ae809 /drivers/media/dvb/frontends
parent47922e9c3f583adf05a23842ff98f3b0bf7eec6d (diff)
downloadlinux-a16bf5d5603184dc1db88f37051881b2eeacfd17.tar.xz
V4L/DVB: Adding support for MT2060 and thus for some DVB-USB-devices based on it
- MT2060 tuner driver - Added support for some USB DVB-T devices based on Dib3000P Signed-off-by: Olivier DANET <odanet@caramail.com> Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c21
-rw-r--r--drivers/media/dvb/frontends/dib3000mc_priv.h19
2 files changed, 29 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index 98673474a140..66b30edad2e4 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -20,6 +20,7 @@
* see Documentation/dvb/README.dibusb for more information
*
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
@@ -461,9 +462,8 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
int search_state,auto_val;
u16 val;
- if (tuner && fe->ops.tuner_ops.set_params) { /* initial call from dvb */
- fe->ops.tuner_ops.set_params(fe, fep);
- if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
+ if (tuner && state->config.pll_set) { /* initial call from dvb */
+ state->config.pll_set(fe,fep);
state->last_tuned_freq = fep->frequency;
// if (!scanboost) {
@@ -558,6 +558,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode)
{
struct dib3000_state *state = fe->demodulator_priv;
+ int AGCtuner=(int)fe->misc_priv;
deb_info("init start\n");
state->timing_offset = 0;
@@ -583,10 +584,11 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode)
/* mobile mode - portable reception */
wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]);
-/* TUNER_PANASONIC_ENV57H12D5: */
+/* TUNER_PANASONIC_ENV57H12D5 or TUNER_MICROTUNE_MT2060. Sets agc_tuner accordingly */
wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth);
wr_foreach(dib3000mc_reg_agc_bandwidth_general,dib3000mc_agc_bandwidth_general);
- wr_foreach(dib3000mc_reg_agc,dib3000mc_agc_tuner[1]);
+ if (AGCtuner<0 || AGCtuner>=DIB3000MC_AGC_TUNER_COUNT) AGCtuner=1;
+ wr_foreach(dib3000mc_reg_agc,dib3000mc_agc_tuner[AGCtuner]);
wr(DIB3000MC_REG_UNK_110,DIB3000MC_UNK_110);
wr(26,0x6680);
@@ -642,6 +644,9 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode)
set_or(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_DIV_IN_OFF);
+ if (state->config.pll_init)
+ state->config.pll_init(fe);
+
deb_info("init end\n");
return 0;
}
@@ -836,6 +841,7 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config,
/* setup the state */
state->i2c = i2c;
memcpy(&state->config,config,sizeof(struct dib3000_config));
+ memcpy(&state->ops, &dib3000mc_ops, sizeof(struct dvb_frontend_ops));
/* check for the correct demod */
if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM)
@@ -855,7 +861,7 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config,
}
/* create dvb_frontend */
- memcpy(&state->frontend.ops, &dib3000mc_ops, sizeof(struct dvb_frontend_ops));
+ state->frontend.ops = &state->ops;
state->frontend.demodulator_priv = state;
/* set the xfer operations */
@@ -872,7 +878,6 @@ error:
kfree(state);
return NULL;
}
-EXPORT_SYMBOL(dib3000mc_attach);
static struct dvb_frontend_ops dib3000mc_ops = {
@@ -911,3 +916,5 @@ static struct dvb_frontend_ops dib3000mc_ops = {
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
+
+EXPORT_SYMBOL(dib3000mc_attach);
diff --git a/drivers/media/dvb/frontends/dib3000mc_priv.h b/drivers/media/dvb/frontends/dib3000mc_priv.h
index 2930aac7591b..e1d0c98cf914 100644
--- a/drivers/media/dvb/frontends/dib3000mc_priv.h
+++ b/drivers/media/dvb/frontends/dib3000mc_priv.h
@@ -159,23 +159,34 @@ static u16 dib3000mc_imp_noise_ctl[][2] = {
static u16 dib3000mc_reg_agc[] = {
36,37,38,39,42,43,44,45,46,47,48,49
};
+/* AGC settings. Don't change the ordering of the entries */
+#define DIB3000MC_AGC_TUNER_COUNT 5
static u16 dib3000mc_agc_tuner[][12] = {
- { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xcf5c, 0x6666,
+/* 0*/ { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xcf5c, 0x6666,
0xbae1, 0xa148, 0x3b5e, 0x3c1c, 0x001a, 0x2019
}, /* TUNER_PANASONIC_ENV77H04D5, */
- { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xdc29, 0x570a,
+/* 1*/ { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xdc29, 0x570a,
0xbae1, 0x8ccd, 0x3b6d, 0x551d, 0x000a, 0x951e
}, /* TUNER_PANASONIC_ENV57H13D5, TUNER_PANASONIC_ENV57H12D5 */
- { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xffff, 0xffff,
+/* 2*/ { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xffff, 0xffff,
0xffff, 0x0000, 0xfdfd, 0x4040, 0x00fd, 0x4040
}, /* TUNER_SAMSUNG_DTOS333IH102, TUNER_RFAGCIN_UNKNOWN */
- { 0x0196, 0x301d, 0x0000, 0x1cc7, 0xbd71, 0x5c29,
+/* 3*/ { 0x0196, 0x301d, 0x0000, 0x1cc7, 0xbd71, 0x5c29,
0xb5c3, 0x6148, 0x6569, 0x5127, 0x0033, 0x3537
}, /* TUNER_PROVIDER_X */
+
+/* 4*/ { 0x0196, 0x301d, 0x0000, 0x1cc7, 0xffff, 0x5c29,
+ 0xa8f6, 0x5eb8, 0x65ff, 0x40ff, 0x008a, 0x1114
+ }, /* TUNER_MT2060 ( as in DibCom driver )*/
+
+/* { 0x0196, 0x301d, 0x0000, 0x1cc7, 0xbd71, 0x5c29,
+ 0xb5c3, 0x6148, 0x0045, 0x5127, 0x0033, 0x3437
+ },*//* TUNER_MT2060 ( as in LITE-ON driver )*/
+
/* TODO TUNER_PANASONIC_ENV57H10D8, TUNER_PANASONIC_ENV57H11D8 */
};