* [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx
@ 2013-03-03 15:58 Mauro Carvalho Chehab
2013-03-03 15:58 ` [PATCH 01/11] [media] mb86a20s: don't pollute dmesg with debug messages Mauro Carvalho Chehab
` (10 more replies)
0 siblings, 11 replies; 13+ messages in thread
From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
Alfredo Jesús Delaiti
While working to add support for a new device, I discovered a
series of issues with mb86a20s and one with em28xx.
While here, I also changed cx231xx to improve its signal
detection, by using a different IF frequency and increasing the
IF signal level from the tuner by 12dB.
Mauro Carvalho Chehab (11):
[media] mb86a20s: don't pollute dmesg with debug messages
[media] mb86a20s: adjust IF based on what's set on the tuner
[media] mb86a20s: provide CNR stats before FE_HAS_SYNC
[media] mb86a20s: Fix signal strength calculus
[media] mb86a20s: don't allow updating signal strength too fast
[media] mb86a20s: change AGC tuning parameters
[media] mb86a20s: Always reset the frontend with set_frontend
[media] mb86a20s: Don't reset strength with the other stats
[media] mb86a20s: cleanup the status at set_frontend()
[media] cx231xx: Improve signal reception for PV SBTVD
[media] em28xx-dvb: Don't put device in suspend mode at feed stop
drivers/media/dvb-core/dmxdev.c | 3 +-
drivers/media/dvb-frontends/mb86a20s.c | 200 +++++++++++++++++++++-----------
drivers/media/usb/cx231xx/cx231xx-dvb.c | 4 +-
drivers/media/usb/em28xx/em28xx-dvb.c | 2 -
4 files changed, 136 insertions(+), 73 deletions(-)
--
1.8.1.4
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 01/11] [media] mb86a20s: don't pollute dmesg with debug messages 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 02/11] [media] mb86a20s: adjust IF based on what's set on the tuner Mauro Carvalho Chehab ` (9 subsequent siblings) 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List There are a few debug tests that are shown with dev_err() or dev_info(). Replace them by dev_dbg(). Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index f19cd73..44bfb88 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -1095,7 +1095,7 @@ static int mb86a20s_get_blk_error(struct dvb_frontend *fe, if (rc < 0) return rc; *error |= rc; - dev_err(&state->i2c->dev, "%s: block error for layer %c: %d.\n", + dev_dbg(&state->i2c->dev, "%s: block error for layer %c: %d.\n", __func__, 'A' + layer, *error); /* Read Bit Count */ @@ -1386,7 +1386,7 @@ static int mb86a20s_get_main_CNR(struct dvb_frontend *fe) return rc; if (!(rc & 0x40)) { - dev_info(&state->i2c->dev, "%s: CNR is not available yet.\n", + dev_dbg(&state->i2c->dev, "%s: CNR is not available yet.\n", __func__); return -EBUSY; } @@ -1441,7 +1441,7 @@ static int mb86a20s_get_blk_error_layer_CNR(struct dvb_frontend *fe) /* Check if data is available */ if (!(rc & 0x01)) { - dev_info(&state->i2c->dev, + dev_dbg(&state->i2c->dev, "%s: MER measures aren't available yet.\n", __func__); return -EBUSY; } -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 02/11] [media] mb86a20s: adjust IF based on what's set on the tuner 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 01/11] [media] mb86a20s: don't pollute dmesg with debug messages Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 03/11] [media] mb86a20s: provide CNR stats before FE_HAS_SYNC Mauro Carvalho Chehab ` (8 subsequent siblings) 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List Instead of hardcoding a fixed IF frequency of 3.3 MHz, use the IF frequency provided by the tuner driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 57 +++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 44bfb88..daeee81 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -31,6 +31,8 @@ struct mb86a20s_state { struct dvb_frontend frontend; + u32 if_freq; + u32 estimated_rate[3]; bool need_init; @@ -47,7 +49,7 @@ struct regdata { * Initialization sequence: Use whatevere default values that PV SBTVD * does on its initialisation, obtained via USB snoop */ -static struct regdata mb86a20s_init[] = { +static struct regdata mb86a20s_init1[] = { { 0x70, 0x0f }, { 0x70, 0xff }, { 0x08, 0x01 }, @@ -56,7 +58,9 @@ static struct regdata mb86a20s_init[] = { { 0x39, 0x01 }, { 0x71, 0x00 }, { 0x28, 0x2a }, { 0x29, 0x00 }, { 0x2a, 0xff }, { 0x2b, 0x80 }, - { 0x28, 0x20 }, { 0x29, 0x33 }, { 0x2a, 0xdf }, { 0x2b, 0xa9 }, +}; + +static struct regdata mb86a20s_init2[] = { { 0x28, 0x22 }, { 0x29, 0x00 }, { 0x2a, 0x1f }, { 0x2b, 0xf0 }, { 0x3b, 0x21 }, { 0x3c, 0x3a }, @@ -1737,6 +1741,7 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe) static int mb86a20s_initfe(struct dvb_frontend *fe) { struct mb86a20s_state *state = fe->demodulator_priv; + u64 pll; int rc; u8 regD5 = 1; @@ -1746,10 +1751,35 @@ static int mb86a20s_initfe(struct dvb_frontend *fe) fe->ops.i2c_gate_ctrl(fe, 0); /* Initialize the frontend */ - rc = mb86a20s_writeregdata(state, mb86a20s_init); + rc = mb86a20s_writeregdata(state, mb86a20s_init1); if (rc < 0) goto err; + /* Adjust IF frequency to match tuner */ + if (fe->ops.tuner_ops.get_if_frequency) + fe->ops.tuner_ops.get_if_frequency(fe, &state->if_freq); + + if (!state->if_freq) + state->if_freq = 3300000; + + /* pll = freq[Hz] * 2^24/10^6 / 16.285714286 */ + pll = state->if_freq * 1677721600L; + do_div(pll, 1628571429L); + rc = mb86a20s_writereg(state, 0x28, 0x20); + if (rc < 0) + goto err; + rc = mb86a20s_writereg(state, 0x29, (pll >> 16) & 0xff); + if (rc < 0) + goto err; + rc = mb86a20s_writereg(state, 0x2a, (pll >> 8) & 0xff); + if (rc < 0) + goto err; + rc = mb86a20s_writereg(state, 0x2b, pll & 0xff); + if (rc < 0) + goto err; + dev_dbg(&state->i2c->dev, "%s: IF=%d, PLL=0x%06llx\n", + __func__, state->if_freq, (long long)pll); + if (!state->config->is_serial) { regD5 &= ~1; @@ -1761,6 +1791,11 @@ static int mb86a20s_initfe(struct dvb_frontend *fe) goto err; } + rc = mb86a20s_writeregdata(state, mb86a20s_init2); + if (rc < 0) + goto err; + + err: if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); @@ -1779,7 +1814,7 @@ err: static int mb86a20s_set_frontend(struct dvb_frontend *fe) { struct mb86a20s_state *state = fe->demodulator_priv; - int rc; + int rc, if_freq; #if 0 /* * FIXME: Properly implement the set frontend properties @@ -1796,6 +1831,18 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe) fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.tuner_ops.set_params(fe); + if (fe->ops.tuner_ops.get_if_frequency) { + fe->ops.tuner_ops.get_if_frequency(fe, &if_freq); + + /* + * If the IF frequency changed, re-initialize the + * frontend. This is needed by some drivers like tda18271, + * that only sets the IF after receiving a set_params() call + */ + if (if_freq != state->if_freq) + state->need_init = true; + } + /* * Make it more reliable: if, for some reason, the initial * device initialization doesn't happen, initialize it when @@ -1805,6 +1852,8 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe) * the agc callback logic is not called during DVB attach time, * causing mb86a20s to not be initialized with Kworld SBTVD. * So, this hack is needed, in order to make Kworld SBTVD to work. + * + * It is also needed to change the IF after the initial init. */ if (state->need_init) mb86a20s_initfe(fe); -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 03/11] [media] mb86a20s: provide CNR stats before FE_HAS_SYNC 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 01/11] [media] mb86a20s: don't pollute dmesg with debug messages Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 02/11] [media] mb86a20s: adjust IF based on what's set on the tuner Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-04 11:23 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 04/11] [media] mb86a20s: Fix signal strength calculus Mauro Carvalho Chehab ` (7 subsequent siblings) 10 siblings, 1 reply; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List State 9 means TS started to be output, and it should be associated with FE_HAS_SYNC. The mb86a20scan get CNR statistics at state 7, when frame sync is obtained. As CNR may help to adjust the antenna, provide it earlier. A latter patch could eventually start outputing MER measures earlier, but that would require a bigger change, and probably won't be better than the current way, as the time between changing from state 8 to 9 is generally lower than the time to get the stats collected. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index daeee81..e222e55 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -312,7 +312,7 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status) dev_dbg(&state->i2c->dev, "%s: Status = 0x%02x (state = %d)\n", __func__, *status, val); - return 0; + return val; } static int mb86a20s_read_signal_strength(struct dvb_frontend *fe) @@ -1564,7 +1564,7 @@ static void mb86a20s_stats_not_ready(struct dvb_frontend *fe) } } -static int mb86a20s_get_stats(struct dvb_frontend *fe) +static int mb86a20s_get_stats(struct dvb_frontend *fe, int status_nr) { struct mb86a20s_state *state = fe->demodulator_priv; struct dtv_frontend_properties *c = &fe->dtv_property_cache; @@ -1584,6 +1584,14 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe) /* Get per-layer stats */ mb86a20s_get_blk_error_layer_CNR(fe); + /* + * At state 7, only CNR is available + * For BER measures, state=9 is required + * FIXME: we may get MER measures with state=8 + */ + if (status_nr < 9) + return 0; + for (i = 0; i < 3; i++) { if (c->isdbt_layer_enabled & (1 << i)) { /* Layer is active and has rc segments */ @@ -1875,7 +1883,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, { struct mb86a20s_state *state = fe->demodulator_priv; struct dtv_frontend_properties *c = &fe->dtv_property_cache; - int rc; + int rc, status_nr; dev_dbg(&state->i2c->dev, "%s called.\n", __func__); @@ -1883,12 +1891,12 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, fe->ops.i2c_gate_ctrl(fe, 0); /* Get lock */ - rc = mb86a20s_read_status(fe, status); - if (!(*status & FE_HAS_LOCK)) { + status_nr = mb86a20s_read_status(fe, status); + if (status_nr < 7) { mb86a20s_stats_not_ready(fe); mb86a20s_reset_frontend_cache(fe); } - if (rc < 0) { + if (state < 0) { dev_err(&state->i2c->dev, "%s: Can't read frontend lock status\n", __func__); goto error; @@ -1908,7 +1916,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, /* Fill signal strength */ c->strength.stat[0].uvalue = rc; - if (*status & FE_HAS_LOCK) { + if (status_nr >= 7) { /* Get TMCC info*/ rc = mb86a20s_get_frontend(fe); if (rc < 0) { @@ -1919,7 +1927,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, } /* Get statistics */ - rc = mb86a20s_get_stats(fe); + rc = mb86a20s_get_stats(fe, status_nr); if (rc < 0 && rc != -EBUSY) { dev_err(&state->i2c->dev, "%s: Can't get FE statistics.\n", __func__); -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 03/11] [media] mb86a20s: provide CNR stats before FE_HAS_SYNC 2013-03-03 15:58 ` [PATCH 03/11] [media] mb86a20s: provide CNR stats before FE_HAS_SYNC Mauro Carvalho Chehab @ 2013-03-04 11:23 ` Mauro Carvalho Chehab 0 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-04 11:23 UTC (permalink / raw) To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List Em Sun, 3 Mar 2013 12:58:43 -0300 Mauro Carvalho Chehab <mchehab@redhat.com> escreveu: > State 9 means TS started to be output, and it should be > associated with FE_HAS_SYNC. > > The mb86a20scan get CNR statistics at state 7, when frame sync > is obtained. > > As CNR may help to adjust the antenna, provide it earlier. > > A latter patch could eventually start outputing MER measures > earlier, but that would require a bigger change, and probably > won't be better than the current way, as the time between > changing from state 8 to 9 is generally lower than the time > to get the stats collected. > > Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> > --- > drivers/media/dvb-frontends/mb86a20s.c | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > > diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c > index daeee81..e222e55 100644 > --- a/drivers/media/dvb-frontends/mb86a20s.c > +++ b/drivers/media/dvb-frontends/mb86a20s.c > @@ -312,7 +312,7 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status) > dev_dbg(&state->i2c->dev, "%s: Status = 0x%02x (state = %d)\n", > __func__, *status, val); > > - return 0; > + return val; > } > > static int mb86a20s_read_signal_strength(struct dvb_frontend *fe) > @@ -1564,7 +1564,7 @@ static void mb86a20s_stats_not_ready(struct dvb_frontend *fe) > } > } > > -static int mb86a20s_get_stats(struct dvb_frontend *fe) > +static int mb86a20s_get_stats(struct dvb_frontend *fe, int status_nr) > { > struct mb86a20s_state *state = fe->demodulator_priv; > struct dtv_frontend_properties *c = &fe->dtv_property_cache; > @@ -1584,6 +1584,14 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe) > /* Get per-layer stats */ > mb86a20s_get_blk_error_layer_CNR(fe); > > + /* > + * At state 7, only CNR is available > + * For BER measures, state=9 is required > + * FIXME: we may get MER measures with state=8 > + */ > + if (status_nr < 9) > + return 0; > + > for (i = 0; i < 3; i++) { > if (c->isdbt_layer_enabled & (1 << i)) { > /* Layer is active and has rc segments */ > @@ -1875,7 +1883,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, > { > struct mb86a20s_state *state = fe->demodulator_priv; > struct dtv_frontend_properties *c = &fe->dtv_property_cache; > - int rc; > + int rc, status_nr; > > dev_dbg(&state->i2c->dev, "%s called.\n", __func__); > > @@ -1883,12 +1891,12 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, > fe->ops.i2c_gate_ctrl(fe, 0); > > /* Get lock */ > - rc = mb86a20s_read_status(fe, status); > - if (!(*status & FE_HAS_LOCK)) { > + status_nr = mb86a20s_read_status(fe, status); > + if (status_nr < 7) { > mb86a20s_stats_not_ready(fe); > mb86a20s_reset_frontend_cache(fe); > } > - if (rc < 0) { > + if (state < 0) { This is obviously wrong ;) Patch with fixup enclosed. Cheers, Mauro - [PATCH 03/11v2] [media] mb86a20s: provide CNR stats before FE_HAS_SYNC State 9 means TS started to be output, and it should be associated with FE_HAS_SYNC. The mb86a20scan get CNR statistics at state 7, when frame sync is obtained. As CNR may help to adjust the antenna, provide it earlier. A latter patch could eventually start outputing MER measures earlier, but that would require a bigger change, and probably won't be better than the current way, as the time between changing from state 8 to 9 is generally lower than the time to get the stats collected. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index daeee81..2720b82 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -312,7 +312,7 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status) dev_dbg(&state->i2c->dev, "%s: Status = 0x%02x (state = %d)\n", __func__, *status, val); - return 0; + return val; } static int mb86a20s_read_signal_strength(struct dvb_frontend *fe) @@ -1564,7 +1564,7 @@ static void mb86a20s_stats_not_ready(struct dvb_frontend *fe) } } -static int mb86a20s_get_stats(struct dvb_frontend *fe) +static int mb86a20s_get_stats(struct dvb_frontend *fe, int status_nr) { struct mb86a20s_state *state = fe->demodulator_priv; struct dtv_frontend_properties *c = &fe->dtv_property_cache; @@ -1584,6 +1584,14 @@ static int mb86a20s_get_stats(struct dvb_frontend *fe) /* Get per-layer stats */ mb86a20s_get_blk_error_layer_CNR(fe); + /* + * At state 7, only CNR is available + * For BER measures, state=9 is required + * FIXME: we may get MER measures with state=8 + */ + if (status_nr < 9) + return 0; + for (i = 0; i < 3; i++) { if (c->isdbt_layer_enabled & (1 << i)) { /* Layer is active and has rc segments */ @@ -1875,7 +1883,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, { struct mb86a20s_state *state = fe->demodulator_priv; struct dtv_frontend_properties *c = &fe->dtv_property_cache; - int rc; + int rc, status_nr; dev_dbg(&state->i2c->dev, "%s called.\n", __func__); @@ -1883,12 +1891,12 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, fe->ops.i2c_gate_ctrl(fe, 0); /* Get lock */ - rc = mb86a20s_read_status(fe, status); - if (!(*status & FE_HAS_LOCK)) { + status_nr = mb86a20s_read_status(fe, status); + if (status_nr < 7) { mb86a20s_stats_not_ready(fe); mb86a20s_reset_frontend_cache(fe); } - if (rc < 0) { + if (status_nr < 0) { dev_err(&state->i2c->dev, "%s: Can't read frontend lock status\n", __func__); goto error; @@ -1908,7 +1916,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, /* Fill signal strength */ c->strength.stat[0].uvalue = rc; - if (*status & FE_HAS_LOCK) { + if (status_nr >= 7) { /* Get TMCC info*/ rc = mb86a20s_get_frontend(fe); if (rc < 0) { @@ -1919,7 +1927,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, } /* Get statistics */ - rc = mb86a20s_get_stats(fe); + rc = mb86a20s_get_stats(fe, status_nr); if (rc < 0 && rc != -EBUSY) { dev_err(&state->i2c->dev, "%s: Can't get FE statistics.\n", __func__); ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 04/11] [media] mb86a20s: Fix signal strength calculus 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (2 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 03/11] [media] mb86a20s: provide CNR stats before FE_HAS_SYNC Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 05/11] [media] mb86a20s: don't allow updating signal strength too fast Mauro Carvalho Chehab ` (6 subsequent siblings) 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List A register typo made the calculation to not work. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index e222e55..983fb3b 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -335,7 +335,7 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe) rc = mb86a20s_writereg(state, 0x04, 0x20); if (rc < 0) return rc; - rc = mb86a20s_writereg(state, 0x04, rf); + rc = mb86a20s_writereg(state, 0x05, rf); if (rc < 0) return rc; -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 05/11] [media] mb86a20s: don't allow updating signal strength too fast 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (3 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 04/11] [media] mb86a20s: Fix signal strength calculus Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 06/11] [media] mb86a20s: change AGC tuning parameters Mauro Carvalho Chehab ` (5 subsequent siblings) 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List Getting signal strength requires some loop poking with I2C. Don't let it happen too fast. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 983fb3b..82fa2af 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -34,6 +34,7 @@ struct mb86a20s_state { u32 if_freq; u32 estimated_rate[3]; + unsigned long get_strength_time; bool need_init; }; @@ -318,9 +319,17 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status) static int mb86a20s_read_signal_strength(struct dvb_frontend *fe) { struct mb86a20s_state *state = fe->demodulator_priv; + struct dtv_frontend_properties *c = &fe->dtv_property_cache; int rc; unsigned rf_max, rf_min, rf; + if (state->get_strength_time && + (!time_after(jiffies, state->get_strength_time))) + return c->strength.stat[0].uvalue; + + /* Reset its value if an error happen */ + c->strength.stat[0].uvalue = 0; + /* Does a binary search to get RF strength */ rf_max = 0xfff; rf_min = 0; @@ -350,15 +359,19 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe) rf = (rf_max + rf_min) / 2; /* Rescale it from 2^12 (4096) to 2^16 */ - rf <<= (16 - 12); + rf = rf << (16 - 12); + if (rf) + rf |= (1 << 12) - 1; + dev_dbg(&state->i2c->dev, "%s: signal strength = %d (%d < RF=%d < %d)\n", __func__, rf, rf_min, rf >> 4, rf_max); - return rf; + c->strength.stat[0].uvalue = rf; + state->get_strength_time = jiffies + + msecs_to_jiffies(1000); + return 0; } } while (1); - - return 0; } static int mb86a20s_get_modulation(struct mb86a20s_state *state, @@ -1882,7 +1895,6 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, fe_status_t *status) { struct mb86a20s_state *state = fe->demodulator_priv; - struct dtv_frontend_properties *c = &fe->dtv_property_cache; int rc, status_nr; dev_dbg(&state->i2c->dev, "%s called.\n", __func__); @@ -1913,8 +1925,6 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe, rc = 0; /* Status is OK */ goto error; } - /* Fill signal strength */ - c->strength.stat[0].uvalue = rc; if (status_nr >= 7) { /* Get TMCC info*/ -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 06/11] [media] mb86a20s: change AGC tuning parameters 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (4 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 05/11] [media] mb86a20s: don't allow updating signal strength too fast Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 07/11] [media] mb86a20s: Always reset the frontend with set_frontend Mauro Carvalho Chehab ` (4 subsequent siblings) 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List Use the AGC settings present on a newer device. The initial settings were taken from one of the first devices with mb86a20s, and there are several reports that this is not working properly on some places. So, instead of keeping using it, get the parameters taken from a newer device. Tests are welcomed. Tested also with cx231xx PixelView SBTVD Hybrid with no regressions noticed so far. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-core/dmxdev.c | 3 +- drivers/media/dvb-frontends/mb86a20s.c | 86 +++++++++++++++++----------------- 2 files changed, 46 insertions(+), 43 deletions(-) diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index d81dbb2..8896993 100644 --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -852,7 +852,8 @@ static int dvb_dmxdev_filter_set(struct dmxdev *dmxdev, struct dmxdev_filter *dmxdevfilter, struct dmx_sct_filter_params *params) { - dprintk("function : %s\n", __func__); + dprintk("function : %s, PID=0x%04x, flags=%02x, timeout=%d\n", + __func__, params->pid, params->flags, params->timeout); dvb_dmxdev_filter_stop(dmxdevfilter); diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 82fa2af..c552300 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -55,7 +55,7 @@ static struct regdata mb86a20s_init1[] = { { 0x70, 0xff }, { 0x08, 0x01 }, { 0x09, 0x3e }, - { 0x50, 0xd1 }, { 0x51, 0x22 }, + { 0x50, 0xd1 }, { 0x51, 0x20 }, { 0x39, 0x01 }, { 0x71, 0x00 }, { 0x28, 0x2a }, { 0x29, 0x00 }, { 0x2a, 0xff }, { 0x2b, 0x80 }, @@ -64,23 +64,23 @@ static struct regdata mb86a20s_init1[] = { static struct regdata mb86a20s_init2[] = { { 0x28, 0x22 }, { 0x29, 0x00 }, { 0x2a, 0x1f }, { 0x2b, 0xf0 }, { 0x3b, 0x21 }, - { 0x3c, 0x3a }, + { 0x3c, 0x38 }, { 0x01, 0x0d }, - { 0x04, 0x08 }, { 0x05, 0x05 }, + { 0x04, 0x08 }, { 0x05, 0x03 }, { 0x04, 0x0e }, { 0x05, 0x00 }, - { 0x04, 0x0f }, { 0x05, 0x14 }, - { 0x04, 0x0b }, { 0x05, 0x8c }, + { 0x04, 0x0f }, { 0x05, 0x37 }, + { 0x04, 0x0b }, { 0x05, 0x78 }, { 0x04, 0x00 }, { 0x05, 0x00 }, - { 0x04, 0x01 }, { 0x05, 0x07 }, - { 0x04, 0x02 }, { 0x05, 0x0f }, - { 0x04, 0x03 }, { 0x05, 0xa0 }, + { 0x04, 0x01 }, { 0x05, 0x1e }, + { 0x04, 0x02 }, { 0x05, 0x07 }, + { 0x04, 0x03 }, { 0x05, 0xd0 }, { 0x04, 0x09 }, { 0x05, 0x00 }, { 0x04, 0x0a }, { 0x05, 0xff }, - { 0x04, 0x27 }, { 0x05, 0x64 }, + { 0x04, 0x27 }, { 0x05, 0x00 }, { 0x04, 0x28 }, { 0x05, 0x00 }, - { 0x04, 0x1e }, { 0x05, 0xff }, - { 0x04, 0x29 }, { 0x05, 0x0a }, - { 0x04, 0x32 }, { 0x05, 0x0a }, + { 0x04, 0x1e }, { 0x05, 0x00 }, + { 0x04, 0x29 }, { 0x05, 0x64 }, + { 0x04, 0x32 }, { 0x05, 0x02 }, { 0x04, 0x14 }, { 0x05, 0x02 }, { 0x04, 0x04 }, { 0x05, 0x00 }, { 0x04, 0x05 }, { 0x05, 0x22 }, @@ -147,39 +147,39 @@ static struct regdata mb86a20s_init2[] = { { 0x50, 0xd5 }, { 0x51, 0x01 }, /* Serial */ { 0x50, 0xd6 }, { 0x51, 0x1f }, { 0x50, 0xd2 }, { 0x51, 0x03 }, - { 0x50, 0xd7 }, { 0x51, 0x3f }, - { 0x28, 0x74 }, { 0x29, 0x00 }, { 0x28, 0x74 }, { 0x29, 0x40 }, - { 0x28, 0x46 }, { 0x29, 0x2c }, { 0x28, 0x46 }, { 0x29, 0x0c }, + { 0x50, 0xd7 }, { 0x51, 0xbf }, + { 0x28, 0x74 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0xff }, + { 0x28, 0x46 }, { 0x29, 0x00 }, { 0x2a, 0x1a }, { 0x2b, 0x0c }, { 0x04, 0x40 }, { 0x05, 0x00 }, - { 0x28, 0x00 }, { 0x29, 0x10 }, - { 0x28, 0x05 }, { 0x29, 0x02 }, + { 0x28, 0x00 }, { 0x2b, 0x08 }, + { 0x28, 0x05 }, { 0x2b, 0x00 }, { 0x1c, 0x01 }, - { 0x28, 0x06 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x03 }, - { 0x28, 0x07 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0d }, - { 0x28, 0x08 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x02 }, - { 0x28, 0x09 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x01 }, - { 0x28, 0x0a }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x21 }, - { 0x28, 0x0b }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x29 }, - { 0x28, 0x0c }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x16 }, - { 0x28, 0x0d }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x31 }, - { 0x28, 0x0e }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0e }, - { 0x28, 0x0f }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x4e }, - { 0x28, 0x10 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x46 }, - { 0x28, 0x11 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0f }, - { 0x28, 0x12 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x56 }, - { 0x28, 0x13 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x35 }, - { 0x28, 0x14 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xbe }, - { 0x28, 0x15 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0x84 }, - { 0x28, 0x16 }, { 0x29, 0x00 }, { 0x2a, 0x03 }, { 0x2b, 0xee }, - { 0x28, 0x17 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x98 }, - { 0x28, 0x18 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x9f }, - { 0x28, 0x19 }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0xb2 }, - { 0x28, 0x1a }, { 0x29, 0x00 }, { 0x2a, 0x06 }, { 0x2b, 0xc2 }, - { 0x28, 0x1b }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0x4a }, - { 0x28, 0x1c }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xbc }, - { 0x28, 0x1d }, { 0x29, 0x00 }, { 0x2a, 0x04 }, { 0x2b, 0xba }, - { 0x28, 0x1e }, { 0x29, 0x00 }, { 0x2a, 0x06 }, { 0x2b, 0x14 }, + { 0x28, 0x06 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x1f }, + { 0x28, 0x07 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x18 }, + { 0x28, 0x08 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x12 }, + { 0x28, 0x09 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x30 }, + { 0x28, 0x0a }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x37 }, + { 0x28, 0x0b }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x02 }, + { 0x28, 0x0c }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x09 }, + { 0x28, 0x0d }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x06 }, + { 0x28, 0x0e }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x7b }, + { 0x28, 0x0f }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x76 }, + { 0x28, 0x10 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x7d }, + { 0x28, 0x11 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x08 }, + { 0x28, 0x12 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0b }, + { 0x28, 0x13 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, + { 0x28, 0x14 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xf2 }, + { 0x28, 0x15 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xf3 }, + { 0x28, 0x16 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x05 }, + { 0x28, 0x17 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x16 }, + { 0x28, 0x18 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0f }, + { 0x28, 0x19 }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0xef }, + { 0x28, 0x1a }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0xd8 }, + { 0x28, 0x1b }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0xf1 }, + { 0x28, 0x1c }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x3d }, + { 0x28, 0x1d }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x94 }, + { 0x28, 0x1e }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0xba }, { 0x50, 0x1e }, { 0x51, 0x5d }, { 0x50, 0x22 }, { 0x51, 0x00 }, { 0x50, 0x23 }, { 0x51, 0xc8 }, @@ -188,6 +188,8 @@ static struct regdata mb86a20s_init2[] = { { 0x50, 0x26 }, { 0x51, 0x00 }, { 0x50, 0x27 }, { 0x51, 0xc3 }, { 0x50, 0x39 }, { 0x51, 0x02 }, + { 0xec, 0x0f }, + { 0xeb, 0x1f }, { 0x28, 0x6a }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0xd0, 0x00 }, }; -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 07/11] [media] mb86a20s: Always reset the frontend with set_frontend 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (5 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 06/11] [media] mb86a20s: change AGC tuning parameters Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 08/11] [media] mb86a20s: Don't reset strength with the other stats Mauro Carvalho Chehab ` (3 subsequent siblings) 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List Always init the frontend when set_frontend is called. The rationale is: it was noticed that, on some devices, it fails to lock with a different channel. It seems that some other registers need to be restored to its initial state, when the channel changes. As it is better to reset everything, even wasting a few more miliseconds than to loose channel lock, let's change the logic to always reset. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index c552300..1589662 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -1854,18 +1854,9 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe) fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.tuner_ops.set_params(fe); - if (fe->ops.tuner_ops.get_if_frequency) { + if (fe->ops.tuner_ops.get_if_frequency) fe->ops.tuner_ops.get_if_frequency(fe, &if_freq); - /* - * If the IF frequency changed, re-initialize the - * frontend. This is needed by some drivers like tda18271, - * that only sets the IF after receiving a set_params() call - */ - if (if_freq != state->if_freq) - state->need_init = true; - } - /* * Make it more reliable: if, for some reason, the initial * device initialization doesn't happen, initialize it when @@ -1877,9 +1868,13 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe) * So, this hack is needed, in order to make Kworld SBTVD to work. * * It is also needed to change the IF after the initial init. + * + * HACK: Always init the frontend when set_frontend is called: + * it was noticed that, on some devices, it fails to lock on a + * different channel. So, it is better to reset everything, even + * wasting some time, than to loose channel lock. */ - if (state->need_init) - mb86a20s_initfe(fe); + mb86a20s_initfe(fe); if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 08/11] [media] mb86a20s: Don't reset strength with the other stats 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (6 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 07/11] [media] mb86a20s: Always reset the frontend with set_frontend Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 09/11] [media] mb86a20s: cleanup the status at set_frontend() Mauro Carvalho Chehab ` (2 subsequent siblings) 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List Signal strength is always available. There's no reason to reset it, as it has its own logic to reset it already. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 1589662..7238947 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -754,7 +754,6 @@ static int mb86a20s_reset_counters(struct dvb_frontend *fe) /* Reset the counters, if the channel changed */ if (state->last_frequency != c->frequency) { - memset(&c->strength, 0, sizeof(c->strength)); memset(&c->cnr, 0, sizeof(c->cnr)); memset(&c->pre_bit_error, 0, sizeof(c->pre_bit_error)); memset(&c->pre_bit_count, 0, sizeof(c->pre_bit_count)); -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 09/11] [media] mb86a20s: cleanup the status at set_frontend() 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (7 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 08/11] [media] mb86a20s: Don't reset strength with the other stats Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 10/11] [media] cx231xx: Improve signal reception for PV SBTVD Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 11/11] [media] em28xx-dvb: Don't put device in suspend mode at feed stop Mauro Carvalho Chehab 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List As the device got re-initialized, the stats should vanish until the device gets lock again. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/dvb-frontends/mb86a20s.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 7238947..2d85131 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -1880,6 +1880,7 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe) rc = mb86a20s_writeregdata(state, mb86a20s_reset_reception); mb86a20s_reset_counters(fe); + mb86a20s_stats_not_ready(fe); if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 10/11] [media] cx231xx: Improve signal reception for PV SBTVD 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (8 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 09/11] [media] mb86a20s: cleanup the status at set_frontend() Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 11/11] [media] em28xx-dvb: Don't put device in suspend mode at feed stop Mauro Carvalho Chehab 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List Instead of using 3.3 MHz IF, use 4MHz. That's the standard value for the demod, and, while it can be adjusted, 3.3 MHz is out of the recommended range. So, let's stick with the default. With regards to the IF voltage level, instead of using 0.5 V(p-p) for IF, use 2V, giving a 12dB gain. The rationale is that, on PixelView SBTVD Hybrid, even 2V(p-p) would be in the nominal range for IF, as the maximum range on this particular device is 3V. A higher gain here should help to improve reception under weak signals. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/usb/cx231xx/cx231xx-dvb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 7c4e360..14e2610 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -89,8 +89,8 @@ static struct tda18271_std_map cnxt_rde253s_tda18271_std_map = { }; static struct tda18271_std_map mb86a20s_tda18271_config = { - .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4, - .if_lvl = 7, .rfagc_top = 0x37, }, + .dvbt_6 = { .if_freq = 4000, .agc_mode = 3, .std = 4, + .if_lvl = 0, .rfagc_top = 0x37, }, }; static struct tda18271_config cnxt_rde253s_tunerconfig = { -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 11/11] [media] em28xx-dvb: Don't put device in suspend mode at feed stop 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab ` (9 preceding siblings ...) 2013-03-03 15:58 ` [PATCH 10/11] [media] cx231xx: Improve signal reception for PV SBTVD Mauro Carvalho Chehab @ 2013-03-03 15:58 ` Mauro Carvalho Chehab 10 siblings, 0 replies; 13+ messages in thread From: Mauro Carvalho Chehab @ 2013-03-03 15:58 UTC (permalink / raw) Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Devin Heitmueller Putting em28xx in suspend mode when a feed stops is just plain wrong. Every time a new PES filter is changed, the DVB demux code will stop the current feed, and then start a new one. If are there any code that switches off the frontend, via some GPIO setting, this would make the DVB fail. This condition was actually trigged with one device, during DVB scan, as, during scan, it is common that userspace apps to change the filter several times, in order to get all tables. Also, this is not needed at all, since the em28xx code already hooks into ops.ts_bus_ctrl(). This warrants that em28xx can check there if DVB frontend is in usage or not. The code there already puts the device on suspend mode, if the DVB frontend is not used (closed). Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- drivers/media/usb/em28xx/em28xx-dvb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index a81ec2e..7200dfe 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -220,8 +220,6 @@ static int em28xx_stop_streaming(struct em28xx_dvb *dvb) em28xx_stop_urbs(dev); - em28xx_set_mode(dev, EM28XX_SUSPEND); - return 0; } -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2013-03-04 11:23 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-03-03 15:58 [PATCH 00/11] Do some improvements/fixups on mb86a20s, cx231xx and em28xx Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 01/11] [media] mb86a20s: don't pollute dmesg with debug messages Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 02/11] [media] mb86a20s: adjust IF based on what's set on the tuner Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 03/11] [media] mb86a20s: provide CNR stats before FE_HAS_SYNC Mauro Carvalho Chehab 2013-03-04 11:23 ` Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 04/11] [media] mb86a20s: Fix signal strength calculus Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 05/11] [media] mb86a20s: don't allow updating signal strength too fast Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 06/11] [media] mb86a20s: change AGC tuning parameters Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 07/11] [media] mb86a20s: Always reset the frontend with set_frontend Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 08/11] [media] mb86a20s: Don't reset strength with the other stats Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 09/11] [media] mb86a20s: cleanup the status at set_frontend() Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 10/11] [media] cx231xx: Improve signal reception for PV SBTVD Mauro Carvalho Chehab 2013-03-03 15:58 ` [PATCH 11/11] [media] em28xx-dvb: Don't put device in suspend mode at feed stop Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).