diff mbox

[v7,23/44,media] dvbdev: add support for indirect interface links

Message ID c3591e8e83b785ede03633be38cb601c6284542e.1440359643.git.mchehab@osg.samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Aug. 23, 2015, 8:17 p.m. UTC
Some interfaces indirectly control multiple entities.
Add support for those.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Comments

Hans Verkuil Aug. 25, 2015, 8:39 a.m. UTC | #1
On 08/23/15 22:17, Mauro Carvalho Chehab wrote:
> Some interfaces indirectly control multiple entities.
> Add support for those.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> 
> diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
> index 747372ba4fe1..5a2bd03f5dc0 100644
> --- a/drivers/media/dvb-core/dvbdev.c
> +++ b/drivers/media/dvb-core/dvbdev.c
> @@ -440,6 +440,7 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
>  	struct media_device *mdev = adap->mdev;
>  	struct media_entity *entity, *tuner = NULL, *fe = NULL;
>  	struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL;
> +	struct media_interface *intf;
>  
>  	if (!mdev)
>  		return;
> @@ -475,6 +476,17 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
>  
>  	if (demux && ca)
>  		media_create_pad_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
> +
> +	/* Create indirect interface links for DVR and tuner */
> +
> +	list_for_each_entry(intf, &mdev->interfaces, list) {
> +		if (intf->type == MEDIA_INTF_T_DVB_FE && tuner)
> +			media_create_intf_link(tuner, intf, 0);
> +		if (intf->type == MEDIA_INTF_T_DVB_DVR && demux)
> +			media_create_intf_link(demux, intf, 0);
> +	}

Shouldn't there also be a link between the CA entity and CA interface?

> +
> +

Spurious newlines at the end of the function.

>  }
>  EXPORT_SYMBOL_GPL(dvb_create_media_graph);
>  #endif
> 

Regards,

	Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mauro Carvalho Chehab Aug. 25, 2015, 10:17 a.m. UTC | #2
Em Tue, 25 Aug 2015 10:39:10 +0200
Hans Verkuil <hverkuil@xs4all.nl> escreveu:

> On 08/23/15 22:17, Mauro Carvalho Chehab wrote:
> > Some interfaces indirectly control multiple entities.
> > Add support for those.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > 
> > diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
> > index 747372ba4fe1..5a2bd03f5dc0 100644
> > --- a/drivers/media/dvb-core/dvbdev.c
> > +++ b/drivers/media/dvb-core/dvbdev.c
> > @@ -440,6 +440,7 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
> >  	struct media_device *mdev = adap->mdev;
> >  	struct media_entity *entity, *tuner = NULL, *fe = NULL;
> >  	struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL;
> > +	struct media_interface *intf;
> >  
> >  	if (!mdev)
> >  		return;
> > @@ -475,6 +476,17 @@ void dvb_create_media_graph(struct dvb_adapter *adap)
> >  
> >  	if (demux && ca)
> >  		media_create_pad_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
> > +
> > +	/* Create indirect interface links for DVR and tuner */
> > +
> > +	list_for_each_entry(intf, &mdev->interfaces, list) {
> > +		if (intf->type == MEDIA_INTF_T_DVB_FE && tuner)
> > +			media_create_intf_link(tuner, intf, 0);
> > +		if (intf->type == MEDIA_INTF_T_DVB_DVR && demux)
> > +			media_create_intf_link(demux, intf, 0);
> > +	}
> 
> Shouldn't there also be a link between the CA entity and CA interface?

Good catch!

I forgot it, because the hardware I'm using to test doesn't have it.

> 
> > +
> > +
> 
> Spurious newlines at the end of the function.
> 
> >  }
> >  EXPORT_SYMBOL_GPL(dvb_create_media_graph);
> >  #endif
> > 
> 
> Regards,
> 
> 	Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 747372ba4fe1..5a2bd03f5dc0 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -440,6 +440,7 @@  void dvb_create_media_graph(struct dvb_adapter *adap)
 	struct media_device *mdev = adap->mdev;
 	struct media_entity *entity, *tuner = NULL, *fe = NULL;
 	struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL;
+	struct media_interface *intf;
 
 	if (!mdev)
 		return;
@@ -475,6 +476,17 @@  void dvb_create_media_graph(struct dvb_adapter *adap)
 
 	if (demux && ca)
 		media_create_pad_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
+
+	/* Create indirect interface links for DVR and tuner */
+
+	list_for_each_entry(intf, &mdev->interfaces, list) {
+		if (intf->type == MEDIA_INTF_T_DVB_FE && tuner)
+			media_create_intf_link(tuner, intf, 0);
+		if (intf->type == MEDIA_INTF_T_DVB_DVR && demux)
+			media_create_intf_link(demux, intf, 0);
+	}
+
+
 }
 EXPORT_SYMBOL_GPL(dvb_create_media_graph);
 #endif