[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 <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab 2015-01-03 16:35:53 -03:00
parent d35a9855a8
commit 3bde1b7840
1 changed files with 7 additions and 5 deletions

View File

@ -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;