Skip to content

Commit

Permalink
[media] dvb-frontends/cxd2841er: sleep on delivery system switch
Browse files Browse the repository at this point in the history
Again, maybe depending on the hardware constellation (demod/tuner combo),
the demodulator might be needed to put to sleep when the requested
delivery system differs from the last used one (this is for example the
case when tuning from a DVB-T to a DVB-T2 mux or vice versa), else
proper tuning and TS delivery will fail for the "new" delivery system.
This is the case at least with Digital Devices hardware, so add a
flag to toggle this behaviour.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
  • Loading branch information
herrnst committed Mar 26, 2017
1 parent 31d4fb5 commit 16f8987
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/media/dvb-frontends/cxd2841er.c
Original file line number Diff line number Diff line change
Expand Up @@ -3405,6 +3405,30 @@ static int cxd2841er_set_frontend_tc(struct dvb_frontend *fe)
dev_dbg(&priv->i2c->dev, "%s() delivery_system=%d bandwidth_hz=%d\n",
__func__, p->delivery_system, p->bandwidth_hz);

if ((priv->flags & CXD2841ER_SLEEPONSWITCH)
&& (priv->state == STATE_ACTIVE_TC)) {
if (priv->system != p->delivery_system) {
dev_dbg(&priv->i2c->dev, "%s(): sleep due to delivery system switch (%d != %d)\n",
__func__, priv->system, p->delivery_system);
switch (priv->system) {
case SYS_DVBT:
cxd2841er_active_t_to_sleep_tc(priv);
break;
case SYS_DVBT2:
cxd2841er_active_t2_to_sleep_tc(priv);
break;
case SYS_ISDBT:
cxd2841er_active_i_to_sleep_tc(priv);
break;
case SYS_DVBC_ANNEX_A:
cxd2841er_active_c_to_sleep_tc(priv);
break;
default:
break;
}
}
}

if (priv->flags & CXD2841ER_EARLY_TUNE)
cxd2841er_tuner_set(fe);

Expand Down
1 change: 1 addition & 0 deletions drivers/media/dvb-frontends/cxd2841er.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define CXD2841ER_TS_SERIAL 4 /* bit 2 */
#define CXD2841ER_ASCOT 8 /* bit 3 */
#define CXD2841ER_EARLY_TUNE 16 /* bit 4 */
#define CXD2841ER_SLEEPONSWITCH 32 /* bit 5 */
#define CXD2841ER_HW_DDB 8388608 /* bit 23 */

enum cxd2841er_xtal {
Expand Down

0 comments on commit 16f8987

Please sign in to comment.