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@xxxxxxxxxxxxxxx> diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 1071d31b7f1d..3aaffb319688 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; -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html