aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-01-03 13:22:26 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-13 18:10:15 -0500
commitd35a9855a8b6e675013bce6946e36c13db66b765 (patch)
treede3633aa326c77f0d07e4a5a07c7f31990f60188 /drivers/media
parentb6a40e728099aa645d0d35896532e4f0f6f31e69 (diff)
[media] cx231xx: create media links for analog mode
Now that we have entities and pads, let's create media links between them, for analog setup. We may not have all the links for digital yet, as the dvb extention may not be loaded yet. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-cards.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c
index d357e8c0c485..dfc7010cff7f 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -1159,6 +1159,42 @@ static void cx231xx_media_device_register(struct cx231xx *dev,
1159#endif 1159#endif
1160} 1160}
1161 1161
1162static void cx231xx_create_media_graph(struct cx231xx *dev)
1163{
1164#ifdef CONFIG_MEDIA_CONTROLLER
1165 struct media_device *mdev = dev->media_dev;
1166 struct media_entity *entity;
1167 struct media_entity *tuner = NULL, *decoder = NULL;
1168
1169 if (!mdev)
1170 return;
1171
1172 media_device_for_each_entity(entity, mdev) {
1173 switch (entity->type) {
1174 case MEDIA_ENT_T_V4L2_SUBDEV_TUNER:
1175 tuner = entity;
1176 break;
1177 case MEDIA_ENT_T_V4L2_SUBDEV_DECODER:
1178 decoder = entity;
1179 break;
1180 }
1181 }
1182
1183 /* Analog setup, using tuner as a link */
1184
1185 if (!decoder)
1186 return;
1187
1188 if (tuner)
1189 media_entity_create_link(tuner, 0, decoder, 0,
1190 MEDIA_LNK_FL_ENABLED);
1191 media_entity_create_link(decoder, 1, &dev->vdev->entity, 0,
1192 MEDIA_LNK_FL_ENABLED);
1193 media_entity_create_link(decoder, 2, &dev->vbi_dev->entity, 0,
1194 MEDIA_LNK_FL_ENABLED);
1195#endif
1196}
1197
1162/* 1198/*
1163 * cx231xx_init_dev() 1199 * cx231xx_init_dev()
1164 * allocates and inits the device structs, registers i2c bus and v4l device 1200 * allocates and inits the device structs, registers i2c bus and v4l device
@@ -1616,6 +1652,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1616 /* load other modules required */ 1652 /* load other modules required */
1617 request_modules(dev); 1653 request_modules(dev);
1618 1654
1655 cx231xx_create_media_graph(dev);
1656
1619 return 0; 1657 return 0;
1620err_video_alt: 1658err_video_alt:
1621 /* cx231xx_uninit_dev: */ 1659 /* cx231xx_uninit_dev: */