You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
3.7 KiB
93 lines
3.7 KiB
5 years ago
|
From 8cc2e0072bc2dfc9a64b569e2b7bb804bf82bc55 Mon Sep 17 00:00:00 2001
|
||
|
From: Athanasios Oikonomou <athoik@gmail.com>
|
||
|
Date: Thu, 17 Mar 2016 06:53:34 +0200
|
||
|
Subject: [PATCH] stv090x: optimized TS sync control
|
||
|
|
||
|
Based on crazycat commits:
|
||
|
stv090x: Minimum latence TS FIFO mode for DVB-S2.
|
||
|
https://github.com/Taapat/driver/commit/b831c1a22b96ece05d0af1cc1e55d5e34d2ca13b
|
||
|
stv090x: optimized TS sync control.
|
||
|
https://github.com/Taapat/driver/commit/f2cacf05651efe48bb5abb02df94646a0d712362
|
||
|
|
||
|
diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c
|
||
|
index 12fd3d0..396e0ab 100644
|
||
|
--- a/drivers/media/dvb-frontends/stv090x.c
|
||
|
+++ b/drivers/media/dvb-frontends/stv090x.c
|
||
|
@@ -3017,6 +3017,28 @@ static int stv090x_optimize_track(struct stv090x_state *state)
|
||
|
srate = stv090x_get_srate(state, state->internal->mclk);
|
||
|
srate += stv090x_get_tmgoffst(state, srate);
|
||
|
|
||
|
+ if (state->delsys == STV090x_DVBS2 && srate > 10000000) {
|
||
|
+ 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 {
|
||
|
+ 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:
|
||
|
@@ -4517,10 +4539,6 @@ static int stv0900_set_tspath(struct stv090x_state *state)
|
||
|
case STV090x_TSMODE_DVBCI:
|
||
|
if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x06) < 0) /* Mux'd stream mode */
|
||
|
goto err;
|
||
|
- 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)
|
||
|
- goto err;
|
||
|
reg = stv090x_read_reg(state, STV090x_P2_TSCFGM);
|
||
|
STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3);
|
||
|
if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0)
|
||
|
diff --git a/drivers/media/dvb-frontends/stv090x_reg.h b/drivers/media/dvb-frontends/stv090x_reg.h
|
||
|
index 93741ee..c1dac9c 100644
|
||
|
--- a/drivers/media/dvb-frontends/stv090x_reg.h
|
||
|
+++ b/drivers/media/dvb-frontends/stv090x_reg.h
|
||
|
@@ -2106,6 +2106,14 @@
|
||
|
#define STV090x_WIDTH_Px_TSDIL_ON_FIELD 1
|
||
|
#define STV090x_OFFST_Px_TSRS_ON_FIELD 5
|
||
|
#define STV090x_WIDTH_Px_TSRS_ON_FIELD 1
|
||
|
+#define STV090x_OFFST_Px_TSDESCRAMB_ON 4
|
||
|
+#define STV090x_WIDTH_Px_TSDESCRAMB_ON 1
|
||
|
+#define STV090x_OFFST_Px_TSFRAME_MODE 3
|
||
|
+#define STV090x_WIDTH_Px_TSFRAME_MODE 1
|
||
|
+#define STV090x_OFFST_Px_TS_DISABLE 2
|
||
|
+#define STV090x_WIDTH_Px_TS_DISABLE 1
|
||
|
+#define STV090x_OFFST_Px_TSOUT_NOSYNC 0
|
||
|
+#define STV090x_WIDTH_Px_TSOUT_NOSYNC 1
|
||
|
|
||
|
#define STV090x_Px_TSCFGH(__x) (0xF572 - (__x - 1) * 0x200)
|
||
|
#define STV090x_P1_TSCFGH STV090x_Px_TSCFGH(1)
|
||
|
@@ -2149,6 +2157,14 @@
|
||
|
#define STV090x_OFFST_Px_TSFIFO_DPUNACT_FIELD 1
|
||
|
#define STV090x_WIDTH_Px_TSFIFO_DPUNACT_FIELD 1
|
||
|
|
||
|
+#define STV090x_Px_TSSYNC(__x) (0xF575 - (__x - 1) * 0x200)
|
||
|
+#define STV090x_P1_TSSYNC STV090x_Px_TSSYNC(1)
|
||
|
+#define STV090x_P2_TSSYNC STV090x_Px_TSSYNC(2)
|
||
|
+#define STV090x_OFFST_Px_TSFIFO_FISCR3B 5
|
||
|
+#define STV090x_WIDTH_Px_TSFIFO_FISCR3B 2
|
||
|
+#define STV090x_OFFST_Px_TSFIFO_SYNCMODE 3
|
||
|
+#define STV090x_WIDTH_Px_TSFIFO_SYNCMODE 2
|
||
|
+
|
||
|
#define STV090x_Px_TSINSDELH(__x) (0xF576 - (__x - 1) * 0x200)
|
||
|
#define STV090x_P1_TSINSDELH STV090x_Px_TSINSDELH(1)
|
||
|
#define STV090x_P2_TSINSDELH STV090x_Px_TSINSDELH(2)
|
||
|
--
|
||
|
2.1.4
|
||
|
|