summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/stv090x.c
diff options
context:
space:
mode:
authorAthanasios Oikonomou <athoik@gmail.com>2017-12-16 07:23:39 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-19 07:12:59 -0500
commit93314453a976c2c78950b86bcd74bc01a3a86651 (patch)
treeb7023b6720a5f86c3f63b79e8b207c490f50a235 /drivers/media/dvb-frontends/stv090x.c
parentf9d79126195374c285035777b9d6abd24ceba363 (diff)
media: stv090x: add physical layer scrambling support
This commit uses the new property scrambling_sequence_index to control PLS. By default we are using the gold sequence 0 and only gold sequences expected on the new property. Please note that all services use PLS, just most with the default sequence 0 and many demods only support gold 0. Signed-off-by: Athanasios Oikonomou <athoik@gmail.com> Acked-by: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-frontends/stv090x.c')
-rw-r--r--drivers/media/dvb-frontends/stv090x.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c
index 77510bc95dcf..e33fb656b7a5 100644
--- a/drivers/media/dvb-frontends/stv090x.c
+++ b/drivers/media/dvb-frontends/stv090x.c
@@ -3430,6 +3430,21 @@ err:
return -1;
}
+static int stv090x_set_pls(struct stv090x_state *state, u32 pls_code)
+{
+ dprintk(FE_DEBUG, 1, "Set Gold PLS code %d", pls_code);
+ if (STV090x_WRITE_DEMOD(state, PLROOT0, pls_code & 0xff) < 0)
+ goto err;
+ if (STV090x_WRITE_DEMOD(state, PLROOT1, (pls_code >> 8) & 0xff) < 0)
+ goto err;
+ if (STV090x_WRITE_DEMOD(state, PLROOT2, 0x04 | (pls_code >> 16)) < 0)
+ goto err;
+ return 0;
+err:
+ dprintk(FE_ERROR, 1, "I/O error");
+ return -1;
+}
+
static int stv090x_set_mis(struct stv090x_state *state, int mis)
{
u32 reg;
@@ -3492,6 +3507,7 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe)
state->search_range = 5000000;
}
+ stv090x_set_pls(state, props->scrambling_sequence_index);
stv090x_set_mis(state, props->stream_id);
if (stv090x_algo(state) == STV090x_RANGEOK) {