summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/stv090x.c
diff options
context:
space:
mode:
authorManu Abraham <manu@linuxtv.org>2009-04-07 23:08:26 +0400
committerManu Abraham <manu@linuxtv.org>2009-04-07 23:08:26 +0400
commitf9a56ea326e7bf2efc796a2a7bbbc376a332fa25 (patch)
tree562ade3e4d1b1af2800cdebfefc6724e5759e23c /linux/drivers/media/dvb/frontends/stv090x.c
parent028d9a0c9dfc2039314063233c47fef4905d9071 (diff)
downloadmediapointer-dvb-s2-f9a56ea326e7bf2efc796a2a7bbbc376a332fa25.tar.gz
mediapointer-dvb-s2-f9a56ea326e7bf2efc796a2a7bbbc376a332fa25.tar.bz2
Fix Undocumented Registers
From: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Manu Abraham <manu@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/stv090x.c')
-rw-r--r--linux/drivers/media/dvb/frontends/stv090x.c71
1 files changed, 8 insertions, 63 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv090x.c b/linux/drivers/media/dvb/frontends/stv090x.c
index 7d6cb0600..7267e21a4 100644
--- a/linux/drivers/media/dvb/frontends/stv090x.c
+++ b/linux/drivers/media/dvb/frontends/stv090x.c
@@ -179,9 +179,7 @@ static struct stv090x_reg stv090x_defval[] = {
{ STV090x_DACR1, 0x00 }, /* DACR1 */
{ STV090x_DACR2, 0x00 }, /* DACR2 */
{ STV090x_OUTCFG, 0x00 }, /* OUTCFG */
-#if 0
{ STV090x_MODECFG, 0xff }, /* MODECFG */
-#endif
{ STV090x_IRQSTATUS3, 0x00 }, /* IRQSTATUS3 */
{ STV090x_IRQSTATUS2, 0x00 }, /* IRQSTATUS2 */
{ STV090x_IRQSTATUS1, 0x00 }, /* IRQSTATUS1 */
@@ -314,24 +312,18 @@ static struct stv090x_reg stv090x_defval[] = {
{ STV090x_P2_DMDCFGMD, 0xf9 }, /* P2_DMDCFGMD */
{ STV090x_P2_DMDCFG2, 0x3b }, /* P2_DMDCFG2 */
{ STV090x_P2_DMDISTATE, 0x5c }, /* P2_DMDISTATE */
-#if 0
- { STV090x_P2_DMDT0M, 0x20 }, /* P2_DMDT0M */
-#endif
+ { STV090x_P2_DMDTOM, 0x20 }, /* P2_DMDT0M */
{ STV090x_P2_DMDSTATE, 0x1c }, /* P2_DMDSTATE */
{ STV090x_P2_DMDFLYW, 0x00 }, /* P2_DMDFLYW */
{ STV090x_P2_DSTATUS3, 0x00 }, /* P2_DSTATUS3 */
{ STV090x_P2_DMDCFG3, 0x68 }, /* P2_DMDCFG3 */
-#if 0
{ STV090x_P2_DMDCFG4, 0x10 }, /* P2_DMDCFG4 */
-#endif
{ STV090x_P2_CORRELMANT, 0x70 }, /* P2_CORRELMANT */
{ STV090x_P2_CORRELABS, 0x88 }, /* P2_CORRELABS */
{ STV090x_P2_CORRELEXP, 0xaa }, /* P2_CORRELEXP */
{ STV090x_P2_PLHMODCOD, 0x42 }, /* P2_PLHMODCOD */
-#if 0
{ STV090x_P2_AGCK32, 0x00 }, /* P2_AGCK32 */
{ STV090x_P2_AGC2O, 0x5b }, /* P2_AGC2O */
-#endif
{ STV090x_P2_AGC2REF, 0x38 }, /* P2_AGC2REF */
{ STV090x_P2_AGC1ADJ, 0x58 }, /* P2_AGC1ADJ */
{ STV090x_P2_AGC2I1, 0x00 }, /* P2_AGC2I1 */
@@ -591,24 +583,18 @@ static struct stv090x_reg stv090x_defval[] = {
{ STV090x_P1_DMDCFGMD, 0xf9 }, /* P1_DMDCFGMD */
{ STV090x_P1_DMDCFG2, 0x3b }, /* P1_DMDCFG2 */
{ STV090x_P1_DMDISTATE, 0x5c }, /* P1_DMDISTATE */
-#if 0
- { STV090x_P1_DMDT0M, 0x20 }, /* P1_DMDT0M */
-#endif
+ { STV090x_P1_DMDTOM, 0x20 }, /* P1_DMDT0M */
{ STV090x_P1_DMDSTATE, 0x1c }, /* P1_DMDSTATE */
{ STV090x_P1_DMDFLYW, 0x00 }, /* P1_DMDFLYW */
{ STV090x_P1_DSTATUS3, 0x00 }, /* P1_DSTATUS3 */
{ STV090x_P1_DMDCFG3, 0x68 }, /* P1_DMDCFG3 */
-#if 0
{ STV090x_P1_DMDCFG4, 0x10 }, /* P1_DMDCFG4 */
-#endif
{ STV090x_P1_CORRELMANT, 0x70 }, /* P1_CORRELMANT */
{ STV090x_P1_CORRELABS, 0x88 }, /* P1_CORRELABS */
{ STV090x_P1_CORRELEXP, 0xaa }, /* P1_CORRELEXP */
{ STV090x_P1_PLHMODCOD, 0x42 }, /* P1_PLHMODCOD */
-#if 0
{ STV090x_P1_AGCK32, 0x00 }, /* P1_AGCK32 */
{ STV090x_P1_AGC2O, 0x5b }, /* P1_AGC2O */
-#endif
{ STV090x_P1_AGC2REF, 0x38 }, /* P1_AGC2REF */
{ STV090x_P1_AGC1ADJ, 0x58 }, /* P1_AGC1ADJ */
{ STV090x_P1_AGC2I1, 0x00 }, /* P1_AGC2I1 */
@@ -848,13 +834,9 @@ static struct stv090x_reg stv090x_defval[] = {
{ STV090x_P1_FBERERR1, 0x00 }, /* P1_FBERERR1 */
{ STV090x_P1_FBERERR0, 0x00 }, /* P1_FBERERR0 */
{ STV090x_P1_FSPYBER, 0x10 }, /* P1_FSPYBER */
-#if 0
{ STV090x_RCCFGH, 0x20 }, /* RCCFGH */
-#endif
{ STV090x_TSGENERAL, 0x14 }, /* TSGENERAL */
-#if 0
{ STV090x_TSGENERAL1X, 0x00 }, /* TSGENERAL1X */
-#endif
{ STV090x_NBITER_NF4, 0x37 }, /* NBITER_NF4 */
{ STV090x_AGCRF2CFG, 0x13 },
@@ -887,9 +869,7 @@ static struct stv090x_reg stv090x_defval[] = {
{ STV090x_GAINLLR_NF15, 0x20 }, /* GAINLLR_NF15 */
{ STV090x_GAINLLR_NF16, 0x20 }, /* GAINLLR_NF16 */
{ STV090x_GAINLLR_NF17, 0x21 }, /* GAINLLR_NF17 */
-#if 0
{ STV090x_CFGEXT, 0x01 }, /* CFGEXT */
-#endif
{ STV090x_GENCFG, 0x1d }, /* GENCFG */
{ STV090x_P2_AGC2REF, 0x38 },
{ STV090x_LDPCERR1, 0x00 }, /* LDPCERR1 */
@@ -904,14 +884,10 @@ static struct stv090x_reg stv090x_defval[] = {
static struct stv090x_reg stv0900_initval[] = {
{ STV090x_OUTCFG, 0x00 },
-#if 0
{ STV090x_MODECFG, 0xff },
-#endif
{ STV090x_AGCRF1CFG, 0x11 },
{ STV090x_AGCRF2CFG, 0x13 },
-#if 0
{ STV090x_TSGENERAL1X, 0x14 },
-#endif
{ STV090x_TSTTNR2, 0x21 },
{ STV090x_TSTTNR4, 0x21 },
{ STV090x_P2_DISTXCTL, 0x22 },
@@ -945,14 +921,10 @@ static struct stv090x_reg stv0900_initval[] = {
{ STV090x_P2_ERRCTRL2, 0xc1 },
{ STV090x_P2_CFRICFG, 0xf8 },
{ STV090x_P2_NOSCFG, 0x1c },
-#if 0
- { STV090x_P2_DMDT0M, 0x20 },
-#endif
+ { STV090x_P2_DMDTOM, 0x20 },
{ STV090x_P2_CORRELMANT, 0x70 },
{ STV090x_P2_CORRELABS, 0x88 },
-#if 0
{ STV090x_P2_AGC2O, 0x5b },
-#endif
{ STV090x_P2_AGC2REF, 0x38 },
{ STV090x_P2_CARCFG, 0xe4 },
{ STV090x_P2_ACLC, 0x1A },
@@ -998,9 +970,7 @@ static struct stv090x_reg stv0900_initval[] = {
{ STV090x_P1_DMDCFGMD, 0xf9 },
{ STV090x_P1_DEMOD, 0x08 },
{ STV090x_P1_DMDCFG3, 0xc4 },
-#if 0
- { STV090x_P1_DMDT0M, 0x20 },
-#endif
+ { STV090x_P1_DMDTOM, 0x20 },
{ STV090x_P1_CARFREQ, 0xed },
#if 0
{ STV090x_P1_TNRCFG2, 0x82 },
@@ -1024,9 +994,7 @@ static struct stv090x_reg stv0900_initval[] = {
{ STV090x_P1_NOSCFG, 0x1c },
{ STV090x_P1_CORRELMANT, 0x70 },
{ STV090x_P1_CORRELABS, 0x88 },
-#if 0
{ STV090x_P1_AGC2O, 0x5b },
-#endif
{ STV090x_P1_AGC2REF, 0x38 },
{ STV090x_P1_CARCFG, 0xe4 },
{ STV090x_P1_ACLC, 0x1A },
@@ -1088,9 +1056,7 @@ static struct stv090x_reg stv0900_initval[] = {
{ STV090x_GAINLLR_NF15, 0x1A },
{ STV090x_GAINLLR_NF16, 0x1F },
{ STV090x_GAINLLR_NF17, 0x21 },
-#if 0
{ STV090x_RCCFGH, 0x20 },
-#endif
{ STV090x_P1_FECM, 0x01 }, /* disable DSS modes */
{ STV090x_P2_FECM, 0x01 }, /* disable DSS modes */
{ STV090x_P1_PRVIT, 0x2F }, /* disable PR 6/7 */
@@ -1136,18 +1102,14 @@ static struct stv090x_reg stv0903_initval[] = {
{ STV090x_P1_ERRCTRL2, 0xc1 },
{ STV090x_P1_CFRICFG, 0xf8 },
{ STV090x_P1_NOSCFG, 0x1c },
-#if 0
- { STV090x_P1_DMDT0M, 0x20 },
-#endif
+ { STV090x_P1_DMDTOM, 0x20 },
{ STV090x_P1_CORRELMANT, 0x70 },
{ STV090x_P1_CORRELABS, 0x88 },
-#if 0
{ STV090x_P1_AGC2O, 0x5b },
-#endif
- { STV090x_P1_AGC2REF, 0x38 } ,
+ { STV090x_P1_AGC2REF, 0x38 },
{ STV090x_P1_CARCFG, 0xe4 },
{ STV090x_P1_ACLC, 0x1A },
- { STV090x_P1_BCLC, 0x09 } ,
+ { STV090x_P1_BCLC, 0x09 },
{ STV090x_P1_CARHDR, 0x08 },
{ STV090x_P1_KREFTMG, 0xc1 },
{ STV090x_P1_SFRSTEP, 0x58 },
@@ -1205,9 +1167,7 @@ static struct stv090x_reg stv0903_initval[] = {
{ STV090x_GAINLLR_NF15, 0x1A },
{ STV090x_GAINLLR_NF16, 0x1F },
{ STV090x_GAINLLR_NF17, 0x21 },
-#if 0
{ STV090x_RCCFGH, 0x20 },
-#endif
{ STV090x_P1_FECM, 0x01 }, /*disable the DSS mode */
{ STV090x_P1_PRVIT, 0x2f } /*disable puncture rate 6/7*/
};
@@ -1215,9 +1175,7 @@ static struct stv090x_reg stv0903_initval[] = {
static struct stv090x_reg stv0900_cut20_val[] = {
{ STV090x_P2_DMDCFG3, 0xe8 },
-#if 0
{ STV090x_P2_DMDCFG4, 0x10 },
-#endif
{ STV090x_P2_CARFREQ, 0x38 },
{ STV090x_P2_CARHDR, 0x20 },
{ STV090x_P2_KREFTMG, 0x5a },
@@ -1226,9 +1184,7 @@ static struct stv090x_reg stv0900_cut20_val[] = {
{ STV090x_P2_SMAPCOEF5, 0x04 },
{ STV090x_P2_NOSCFG, 0x0c },
{ STV090x_P1_DMDCFG3, 0xe8 },
-#if 0
{ STV090x_P1_DMDCFG4, 0x10 },
-#endif
{ STV090x_P1_CARFREQ, 0x38 },
{ STV090x_P1_CARHDR, 0x20 },
{ STV090x_P1_KREFTMG, 0x5a },
@@ -1254,9 +1210,7 @@ static struct stv090x_reg stv0900_cut20_val[] = {
static struct stv090x_reg stv0903_cut20_val[] = {
{ STV090x_P1_DMDCFG3, 0xe8 },
-#if 0
{ STV090x_P1_DMDCFG4, 0x10 },
-#endif
{ STV090x_P1_CARFREQ, 0x38 },
{ STV090x_P1_CARHDR, 0x20 },
{ STV090x_P1_KREFTMG, 0x5a },
@@ -1484,11 +1438,9 @@ static int stv090x_write_reg(struct stv090x_state *state, unsigned int reg, u8 d
static int stv090x_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
struct stv090x_state *state = fe->demodulator_priv;
- const struct stv090x_config *config = state->config;
u32 reg;
reg = STV090x_READ_DEMOD(state, I2CRPT);
-// STV090x_SETFIELD_Px(reg, ENARPT_LEVEL_FIELD, config->repeater_level);
if (enable) {
dprintk(FE_DEBUG, 1, "Enable Gate");
STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 1);
@@ -4449,16 +4401,12 @@ static int stv090x_set_tspath(struct stv090x_state *state)
case STV090x_TSMODE_SERIAL_PUNCTURED:
case STV090x_TSMODE_SERIAL_CONTINUOUS:
default:
-#if 0
stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x10);
-#endif
break;
case STV090x_TSMODE_PARALLEL_PUNCTURED:
case STV090x_TSMODE_DVBCI:
-#if 0
stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x16);
-#endif
reg = stv090x_read_reg(state, STV090x_P1_TSCFGM);
STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3);
if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0)
@@ -4482,16 +4430,12 @@ static int stv090x_set_tspath(struct stv090x_state *state)
case STV090x_TSMODE_SERIAL_PUNCTURED:
case STV090x_TSMODE_SERIAL_CONTINUOUS:
default:
-#if 0
stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x14);
-#endif
break;
case STV090x_TSMODE_PARALLEL_PUNCTURED:
case STV090x_TSMODE_DVBCI:
-#if 0
stv090x_write_reg(state, STV090x_TSGENERAL1X, 0x12);
-#endif
break;
}
break;
@@ -4762,6 +4706,7 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
state->i2c = i2c;
state->frontend.ops = stv090x_ops;
state->frontend.demodulator_priv = state;
+ state->demod = demod;
state->demod_mode = config->demod_mode; /* Single or Dual mode */
state->device = config->device;
state->rolloff = 35; /* default */