Commit 7069018e authored by Daniel Scheller's avatar Daniel Scheller Committed by Mauro Carvalho Chehab

media: dvb-frontends/stv0910: make TS speed configurable

Add a tsspeed config option to struct stv0910_cfg which can be used by
users of the driver to set the (parallel) TS speed (higher speeds enable
support for higher bitrate transponders). If tsspeed isn't set in the
config, it'll default to a sane value.

This commit also updates the two consumers of the stv0910 driver (ngene
and ddbridge) to have a default tsspeed in their stv0910_cfg templates.
Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
Tested-by: default avatarRichard Scobie <rascobie@slingshot.co.nz>
Tested-by: default avatarHelmut Auer <post@helmutauer.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent caf2827c
...@@ -1200,7 +1200,6 @@ static int probe(struct stv *state) ...@@ -1200,7 +1200,6 @@ static int probe(struct stv *state)
write_reg(state, RSTV0910_P1_TSCFGM, 0xC0); /* Manual speed */ write_reg(state, RSTV0910_P1_TSCFGM, 0xC0); /* Manual speed */
write_reg(state, RSTV0910_P1_TSCFGL, 0x20); write_reg(state, RSTV0910_P1_TSCFGL, 0x20);
/* Speed = 67.5 MHz */
write_reg(state, RSTV0910_P1_TSSPEED, state->tsspeed); write_reg(state, RSTV0910_P1_TSSPEED, state->tsspeed);
write_reg(state, RSTV0910_P2_TSCFGH, state->tscfgh | 0x01); write_reg(state, RSTV0910_P2_TSCFGH, state->tscfgh | 0x01);
...@@ -1208,7 +1207,6 @@ static int probe(struct stv *state) ...@@ -1208,7 +1207,6 @@ static int probe(struct stv *state)
write_reg(state, RSTV0910_P2_TSCFGM, 0xC0); /* Manual speed */ write_reg(state, RSTV0910_P2_TSCFGM, 0xC0); /* Manual speed */
write_reg(state, RSTV0910_P2_TSCFGL, 0x20); write_reg(state, RSTV0910_P2_TSCFGL, 0x20);
/* Speed = 67.5 MHz */
write_reg(state, RSTV0910_P2_TSSPEED, state->tsspeed); write_reg(state, RSTV0910_P2_TSSPEED, state->tsspeed);
/* Reset stream merger */ /* Reset stream merger */
...@@ -1790,7 +1788,8 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c, ...@@ -1790,7 +1788,8 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c,
state->tscfgh = 0x20 | (cfg->parallel ? 0 : 0x40); state->tscfgh = 0x20 | (cfg->parallel ? 0 : 0x40);
state->tsgeneral = (cfg->parallel == 2) ? 0x02 : 0x00; state->tsgeneral = (cfg->parallel == 2) ? 0x02 : 0x00;
state->i2crpt = 0x0A | ((cfg->rptlvl & 0x07) << 4); state->i2crpt = 0x0A | ((cfg->rptlvl & 0x07) << 4);
state->tsspeed = 0x28; /* use safe tsspeed value if unspecified through stv0910_cfg */
state->tsspeed = (cfg->tsspeed ? cfg->tsspeed : 0x28);
state->nr = nr; state->nr = nr;
state->regoff = state->nr ? 0 : 0x200; state->regoff = state->nr ? 0 : 0x200;
state->search_range = 16000000; state->search_range = 16000000;
......
...@@ -10,6 +10,7 @@ struct stv0910_cfg { ...@@ -10,6 +10,7 @@ struct stv0910_cfg {
u8 parallel; u8 parallel;
u8 rptlvl; u8 rptlvl;
u8 single; u8 single;
u8 tsspeed;
}; };
#if IS_REACHABLE(CONFIG_DVB_STV0910) #if IS_REACHABLE(CONFIG_DVB_STV0910)
......
...@@ -1183,6 +1183,7 @@ static const struct stv0910_cfg stv0910_p = { ...@@ -1183,6 +1183,7 @@ static const struct stv0910_cfg stv0910_p = {
.parallel = 1, .parallel = 1,
.rptlvl = 4, .rptlvl = 4,
.clk = 30000000, .clk = 30000000,
.tsspeed = 0x28,
}; };
static const struct lnbh25_config lnbh25_cfg = { static const struct lnbh25_config lnbh25_cfg = {
......
...@@ -327,6 +327,7 @@ static struct stv0910_cfg stv0910_p = { ...@@ -327,6 +327,7 @@ static struct stv0910_cfg stv0910_p = {
.parallel = 1, .parallel = 1,
.rptlvl = 4, .rptlvl = 4,
.clk = 30000000, .clk = 30000000,
.tsspeed = 0x28,
}; };
static struct lnbh25_config lnbh25_cfg = { static struct lnbh25_config lnbh25_cfg = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment