From: Mauro Carvalho Chehab Date: Sat, 3 Jan 2015 19:35:53 +0000 (-0300) Subject: [media] dvbdev: represent frontend with two pads X-Git-Tag: firefly_0821_release~176^2~795^2~1388 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3bde1b78408b7b1136cd64722b6cd8b2eb70b217;p=firefly-linux-kernel-4.4.55.git [media] dvbdev: represent frontend with two pads While on some devices the tuner is bound inside the frontend, other devices use a separate subdevice for it. So, in order to be more generic, better to map it with two pads. That will allows to use the media controller to lock the tuner between the DVB and the V4L2 sub-drivers, on hybrid devices. While here, change the logic to use pad 0 as sink for devices with both sink and source pads. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 79c96edf71ef..c5de02455b17 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -200,6 +200,7 @@ static void dvb_register_media_device(struct dvb_device *dvbdev, switch (type) { case DVB_DEVICE_CA: case DVB_DEVICE_DEMUX: + case DVB_DEVICE_FRONTEND: npads = 2; break; case DVB_DEVICE_NET: @@ -221,12 +222,13 @@ static void dvb_register_media_device(struct dvb_device *dvbdev, switch (type) { case DVB_DEVICE_FRONTEND: dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_FE; - dvbdev->pads[0].flags = MEDIA_PAD_FL_SOURCE; + dvbdev->pads[0].flags = MEDIA_PAD_FL_SINK; + dvbdev->pads[1].flags = MEDIA_PAD_FL_SOURCE; break; case DVB_DEVICE_DEMUX: dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_DEMUX; - dvbdev->pads[0].flags = MEDIA_PAD_FL_SOURCE; - dvbdev->pads[1].flags = MEDIA_PAD_FL_SINK; + dvbdev->pads[0].flags = MEDIA_PAD_FL_SINK; + dvbdev->pads[1].flags = MEDIA_PAD_FL_SOURCE; break; case DVB_DEVICE_DVR: dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_DVR; @@ -234,8 +236,8 @@ static void dvb_register_media_device(struct dvb_device *dvbdev, break; case DVB_DEVICE_CA: dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_CA; - dvbdev->pads[0].flags = MEDIA_PAD_FL_SOURCE; - dvbdev->pads[1].flags = MEDIA_PAD_FL_SINK; + dvbdev->pads[0].flags = MEDIA_PAD_FL_SINK; + dvbdev->pads[1].flags = MEDIA_PAD_FL_SOURCE; break; case DVB_DEVICE_NET: dvbdev->entity->type = MEDIA_ENT_T_DEVNODE_DVB_NET;