path: root/drivers/media/v4l2-core/v4l2-device.c
AgeCommit message (Collapse)AuthorFilesLines
2015-11-17[media] v4l2-device: Don't unregister ACPI/Device Tree based devicesTommi Franttila1-6/+15
When a V4L2 sub-device backed by a DT or ACPI based device was removed, the device was unregistered as well which certainly was not intentional, as the client device would not be re-created by simply reinstating the V4L2 sub-device (indeed the device would have to be there first!). Skip unregistering the device in case it has non-NULL of_node or fwnode. Signed-off-by: Tommi Franttila <tommi.franttila@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02[media] v4l2-core: remove the old .ioctl BKL replacementHans Verkuil1-1/+0
To keep V4L2 drivers that did not yet convert to unlocked_ioctl happy, the v4l2 core had a .ioctl file operation that took a V4L2 lock. The last drivers are now converted to unlocked_ioctl, so all this old code can now be removed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-13[media] media: Fix DVB devnode representation at media controllerMauro Carvalho Chehab1-2/+2
The previous provision for DVB media controller support were to define an ID (likely meaning the adapter number) for the DVB devnodes. This is just plain wrong. Just like V4L, DVB devices (and any other device node)) are uniquely identified via a (major, minor) tuple. This is enough to uniquely identify a devnode, no matter what API it implements. So, before we go too far, let's mark the old v4l, fb, dvb and alsa "devnode" info as deprecated, and just call it as "dev". We can latter add fields specific to each API if needed. As we don't want to break compilation on already existing apps, let's just keep the old definitions as-is, adding a note that those are deprecated at media-entity.h. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-05-13[media] v4l: Only get module if it's different than the driver for v4l2_devSakari Ailus1-3/+15
When the sub-device is registered, increment the use count of the sub-device owner only if it's different from the owner of the driver for the media device. This avoids increasing the use count by the module itself and thus making it possible to unload it when it's not in use. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-21[media] v4l2-device: check if already unregisteredHans Verkuil1-2/+7
It was possible to unregister an already unregistered v4l2_device struct. Add a check whether that already happened and just return if that was the case. Also refuse to register a v4l2_device if both the dev and name fields are empty. A warning was already produced in that case, but since the name field is now used to detect whether or not the v4l2_device was already unregistered this particular combination should be rejected. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-19[media] V4L: Remove all links of the media entity when unregistering subdevSylwester Nawrocki1-1/+3
Remove all links of the subdev's media entity after internal_ops 'unregistered' call and right before unregistering the entity from a media device. It is assumed here that an unregistered (orphan) media entity cannot have links to other entities registered to a media device. It is also assumed the media links should be created/removed with the media graph's mutex held. The above implies that the caller of v4l2_device_unregister_subdev() must not hold the graph's mutex. Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06[media] use IS_ENABLED() macroPeter Senna Tschudin1-1/+1
This patch introduces the use of IS_ENABLED() macro. For example, replacing: #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE)) with: #if IS_ENABLED(CONFIG_I2C) All changes made by this patch respect the same replacement pattern. Reported-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Acked-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-05[media] v4l: Reset subdev v4l2_dev field to NULL if registration failsLaurent Pinchart1-16/+14
When subdev registration fails the subdev v4l2_dev field is left to a non-NULL value. Later calls to v4l2_device_unregister_subdev() will consider the subdev as registered and will module_put() the subdev module without any matching module_get(). Fix this by setting the subdev v4l2_dev field to NULL in v4l2_device_register_subdev() when the function fails. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: stable@vger.kernel.org Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-01[media] v4l2-ctrls: add a filter function to v4l2_ctrl_add_handlerHans Verkuil1-1/+1
With a filter function you can control more precisely which controls are added. This is useful in particular for radio device nodes for combined TV/Radio cards where you want to show just the radio-specific controls and not controls like brightness. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13[media] v4l: move v4l2 core into a separate directoryMauro Carvalho Chehab1-0/+280
Currently, the v4l2 core is mixed together with other non-core drivers. Move them into a separate directory. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Privacy Policy