diff options
author | 2015-01-06 17:53:15 -0300 | |
---|---|---|
committer | 2015-02-13 21:10:17 -0200 | |
commit | 135f9be9194cf7778eb73594aa55791b229cf27c (patch) | |
tree | f847f891dd28d9bc774605d46c9ac0a8c7e38a1e /drivers/media/dvb-core | |
parent | [media] cx231xx: enable tuner->decoder link at videobuf start (diff) | |
download | linux-135f9be9194cf7778eb73594aa55791b229cf27c.tar.gz linux-135f9be9194cf7778eb73594aa55791b229cf27c.tar.bz2 linux-135f9be9194cf7778eb73594aa55791b229cf27c.zip |
[media] dvb_frontend: start media pipeline while thread is running
While the DVB thread is running, the media pipeline should be
streaming. This should prevent any attempt of using the analog
TV while digital TV is working, and vice-versa.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r-- | drivers/media/dvb-core/dvb_frontend.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 50bc6056e914..aa5306908193 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -131,6 +131,11 @@ struct dvb_frontend_private { int quality; unsigned int check_wrapped; enum dvbfe_search algo_status; + +#if defined(CONFIG_MEDIA_CONTROLLER_DVB) + struct media_pipeline pipe; + struct media_entity *pipe_start_entity; +#endif }; static void dvb_frontend_wakeup(struct dvb_frontend *fe); @@ -608,9 +613,9 @@ static void dvb_frontend_wakeup(struct dvb_frontend *fe) * or 0 if everything is OK, if no tuner is linked to the frontend or if the * mdev is NULL. */ +#ifdef CONFIG_MEDIA_CONTROLLER_DVB static int dvb_enable_media_tuner(struct dvb_frontend *fe) { -#ifdef CONFIG_MEDIA_CONTROLLER_DVB struct dvb_frontend_private *fepriv = fe->frontend_priv; struct dvb_adapter *adapter = fe->dvb; struct media_device *mdev = adapter->mdev; @@ -618,10 +623,14 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe) struct media_link *link, *found_link = NULL; int i, ret, n_links = 0, active_links = 0; + fepriv->pipe_start_entity = NULL; + if (!mdev) return 0; entity = fepriv->dvbdev->entity; + fepriv->pipe_start_entity = entity; + for (i = 0; i < entity->num_links; i++) { link = &entity->links[i]; if (link->sink->entity == entity) { @@ -648,6 +657,7 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe) } source = found_link->source->entity; + fepriv->pipe_start_entity = source; for (i = 0; i < source->num_links; i++) { struct media_entity *sink; int flags = 0; @@ -672,9 +682,9 @@ static int dvb_enable_media_tuner(struct dvb_frontend *fe) source->name, sink->name, flags ? "ENABLED" : "disabled"); } -#endif return 0; } +#endif static int dvb_frontend_thread(void *data) { @@ -696,12 +706,19 @@ static int dvb_frontend_thread(void *data) fepriv->wakeup = 0; fepriv->reinitialise = 0; +#ifdef CONFIG_MEDIA_CONTROLLER_DVB ret = dvb_enable_media_tuner(fe); if (ret) { /* FIXME: return an error if it fails */ dev_info(fe->dvb->device, "proceeding with FE task\n"); + } else { + ret = media_entity_pipeline_start(fepriv->pipe_start_entity, + &fepriv->pipe); + if (ret) + return ret; } +#endif dvb_frontend_init(fe); @@ -812,6 +829,11 @@ restart: } } +#ifdef CONFIG_MEDIA_CONTROLLER_DVB + media_entity_pipeline_stop(fepriv->pipe_start_entity); + fepriv->pipe_start_entity = NULL; +#endif + if (dvb_powerdown_on_sleep) { if (fe->ops.set_voltage) fe->ops.set_voltage(fe, SEC_VOLTAGE_OFF); |