summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-09-04 15:39:43 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:18:59 -0200
commit13f6e8887a1f61764a05a3348476d38071201f08 (patch)
treecece610e789c9f1f23202ffa404632ac73b862c9 /drivers/media
parent39d1ebc6092f8266fb788733ca92b8492b1d69f2 (diff)
downloadlinux-stable-13f6e8887a1f61764a05a3348476d38071201f08.tar.gz
linux-stable-13f6e8887a1f61764a05a3348476d38071201f08.tar.bz2
linux-stable-13f6e8887a1f61764a05a3348476d38071201f08.zip
[media] v4l2 core: enable all interface links at init
Interface links are normally enabled, meaning that the interfaces are bound to the entities. So, any ioctl send to the interface are reflected at the entities managed by the interface. However, when a device is used, other interfaces for the same hardware could be decoupled from the entities linked to them, because the hardware may have some parts busy. That's for example, what happens when an hybrid TV device is in use. If it is streaming analog TV or capturing signals from S-Video/Composite connectors, typically the digital part of the hardware can't be used and vice-versa. This is generally due to some internal hardware or firmware limitation, that it is not easily mapped via data pipelines. What the Kernel drivers do internally is that they decouple the hardware from the interface. So, all changes, if allowed, are done only at some interface cache, but not physically changed at the hardware. The usage is similar to the usage of the MEDIA_LNK_FL_ENABLED on data links. So, let's use the same flag to indicate if either the interface to entity link is bound/enabled or not. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/v4l2-core/v4l2-dev.c3
-rw-r--r--drivers/media/v4l2-core/v4l2-device.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 077cdc92778c..d36436582de9 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -797,7 +797,8 @@ static int video_register_media_controller(struct video_device *vdev, int type)
struct media_link *link;
link = media_create_intf_link(&vdev->entity,
- &vdev->intf_devnode->intf, 0);
+ &vdev->intf_devnode->intf,
+ MEDIA_LNK_FL_ENABLED);
if (!link) {
media_devnode_remove(vdev->intf_devnode);
media_device_unregister_entity(&vdev->entity);
diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
index 3c87307e56f0..85f724b53a14 100644
--- a/drivers/media/v4l2-core/v4l2-device.c
+++ b/drivers/media/v4l2-core/v4l2-device.c
@@ -265,7 +265,7 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev)
link = media_create_intf_link(&sd->entity,
&vdev->intf_devnode->intf,
- 0);
+ MEDIA_LNK_FL_ENABLED);
if (!link)
goto clean_up;
}