Skip to content

Commit

Permalink
stv090x: optimized TS sync control.
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycat69 committed Nov 15, 2015
1 parent f40d585 commit f2cacf0
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions frontends/spark_dvbapi5/stv090x.c
Original file line number Diff line number Diff line change
Expand Up @@ -4193,18 +4193,40 @@ static int stv090x_optimize_track(struct stv090x_state *state)
srate = stv090x_get_srate(state, state->mclk);
srate += stv090x_get_tmgoffst(state, srate);

switch (state->delsys)
if (state->delsys == STV090x_DVBS2 && srate > 10000000)
{
case STV090x_DVBS1:
case STV090x_DSS:

dprintk(50, "STV090x_DVBS1\n");
dprintk(50, "STV090x_NOTSSYNC\n");
reg = stv090x_read_reg(state, STV090x_P1_TSSTATEM);
STV090x_SETFIELD_Px(reg, TSOUT_NOSYNC, 1);
if (stv090x_write_reg(state, STV090x_P1_TSSTATEM, reg) < 0)
goto err;

reg = stv090x_read_reg(state, STV090x_P1_TSSYNC);
STV090x_SETFIELD_Px(reg, TSFIFO_SYNCMODE, 2);
if (stv090x_write_reg(state, STV090x_P1_TSSYNC, reg) < 0)
goto err;
}
else
{
dprintk(50, "STV090x_TSSYNC\n");
reg = stv090x_read_reg(state, STV090x_P1_TSSTATEM);
STV090x_SETFIELD_Px(reg, TSOUT_NOSYNC, 0);
if (stv090x_write_reg(state, STV090x_P1_TSSTATEM, reg) < 0)
goto err;

reg = stv090x_read_reg(state, STV090x_P1_TSSYNC);
STV090x_SETFIELD_Px(reg, TSFIFO_SYNCMODE, 0);
if (stv090x_write_reg(state, STV090x_P1_TSSYNC, reg) < 0)
goto err;
}

switch (state->delsys)
{
case STV090x_DVBS1:
case STV090x_DSS:

dprintk(50, "STV090x_DVBS1\n");

if (state->algo == (enum stv090x_algo)STV090x_SEARCH_AUTO)
{
reg = STV090x_READ_DEMOD(state, DMDCFGMD);
Expand Down Expand Up @@ -4246,16 +4268,6 @@ static int stv090x_optimize_track(struct stv090x_state *state)
case STV090x_DVBS2:
dprintk(50, "STV090x_DVBS2\n");

reg = stv090x_read_reg(state, STV090x_P1_TSSTATEM);
STV090x_SETFIELD_Px(reg, TSOUT_NOSYNC, 1);
if (stv090x_write_reg(state, STV090x_P1_TSSTATEM, reg) < 0)
goto err;

reg = stv090x_read_reg(state, STV090x_P1_TSSYNC);
STV090x_SETFIELD_Px(reg, TSFIFO_SYNCMODE, 2);
if (stv090x_write_reg(state, STV090x_P1_TSSYNC, reg) < 0)
goto err;

reg = STV090x_READ_DEMOD(state, DMDCFGMD);
STV090x_SETFIELD_Px(reg, DVBS1_ENABLE_FIELD, 0);
STV090x_SETFIELD_Px(reg, DVBS2_ENABLE_FIELD, 1);
Expand Down

0 comments on commit f2cacf0

Please sign in to comment.