01 Jun, 2011
1 commit
-
The name 'entity' is used twice in the macro body, once as the macro
argument, and once as a structure field name. This breaks compilation if
the macro is called with its argument not named 'entity'.Fix this by renaming the macro argument '__e'. This should avoid
namespace clashes.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab
20 May, 2011
1 commit
-
This reverts commit c29fcff3daafbf46d64a543c1950bbd206ad8c1c.
Signed-off-by: Bob Liu
Signed-off-by: Mauro Carvalho Chehab
23 Mar, 2011
3 commits
-
Rather than guess which driver supports core priority handling, require drivers
that do to explicitly set the V4L2_FL_USE_FH_PRIO flag in video_device.Updated the core prio handling accordingly and set the flag in the three
drivers that do.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Integrate the v4l2_prio_state into the core, ready for use.
One struct v4l2_prio_state is added to v4l2_device and a pointer
to a prio state is added to video_device.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
We are going to move priority handling into the v4l2 core. As a consequence
the v4l2_prio helper functions need to be moved into the core videodev
module as well to prevent circular dependencies.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
22 Mar, 2011
2 commits
-
V4L2 devices are media entities. As such they need to inherit from
(include) the media_entity structure.When registering/unregistering the device, the media entity is
automatically registered/unregistered. The entity is acquired on device
open and released on device close.Signed-off-by: Laurent Pinchart
Signed-off-by: Sakari Ailus
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Create a device node named subdevX for every registered subdev.
As the device node is registered before the subdev core::s_config
function is called, return -EGAIN on open until initialization
completes.Signed-off-by: Laurent Pinchart
Signed-off-by: Vimarsh Zutshi
Acked-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
21 Oct, 2010
3 commits
-
Drivers can optionally set a pointer to a mutex in struct video_device.
The core will use that to lock before calling open, read, write, unlocked_ioctl,
poll, mmap or release.Updated the documentation as well and ensure that v4l2-event knows about the
lock: it will unlock it before doing a blocking wait on an event and relock it
afterwards.Ensure that the 'video_is_registered' check is done when the lock is held:
a typical disconnect will take the lock as well before unregistering the
device nodes, so to prevent race conditions the video_is_registered check
should also be done with the lock held.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The get_unmapped_area file operation is unused. Remove.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Remove the vtx (aka videotext aka teletext) API from the v4l2 core.
This API was scheduled for removal in kernel 2.6.35.The vtx device nodes have been superseded by vbi device nodes
for many years. No applications exist that use the vtx support.
Of the two i2c drivers that actually support this API the saa5249
has been impossible to use for a year now and no known hardware
that supports this device exists. The saa5246a is theoretically
supported by the old mxb boards, but it never actually worked.In summary: there is no hardware that can use this API and there
are no applications actually implementing this API.The vtx support still reserves minors 192-223 and we would really
like to reuse those for upcoming new functionality. In the unlikely
event that new hardware appears that wants to use the functionality
provided by the vtx API, then that functionality should be build
around the sliced VBI API instead.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
09 Aug, 2010
1 commit
-
Add a new framework to handle controls which makes life for driver
developers much easier.Note that this patch moves some of the control support that used to be in
v4l2-common.c to v4l2-ctrls.c. The tables were copied unchanged. The body
of v4l2_ctrl_query_fill() was copied to a new v4l2_ctrl_fill() function
in v4l2-ctrls.c. This new function doesn't use the v4l2_queryctrl
struct anymore, which makes it more general.The remainder of v4l2-ctrls.c is all new. Highlights include:
- No need to implement VIDIOC_QUERYCTRL, QUERYMENU, S_CTRL, G_CTRL,
S_EXT_CTRLS, G_EXT_CTRLS or TRY_EXT_CTRLS in either bridge drivers
or subdevs. New wrapper functions are provided that can just be plugged in.
Once everything has been converted these wrapper functions can be removed as well.- When subdevices are added their controls can be automatically merged
with the bridge driver's controls.- Most drivers just need to implement s_ctrl to set the controls.
The framework handles the locking and tries to be as 'atomic' as possible.- Ready for the subdev device nodes: the same mechanism applies to subdevs
and their device nodes as well. Sub-device drivers can make controls
local, preventing them from being merged with bridge drivers.- Takes care of backwards compatibility handling of VIDIOC_S_CTRL and
VIDIOC_G_CTRL. Handling of V4L2_CID_PRIVATE_BASE is fully transparent.
CTRL_CLASS controls are automatically added.Signed-off-by: Hans Verkuil
Reviewed-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab
19 May, 2010
1 commit
-
This patch adds a list of v4l2_fh structures to every video_device.
It allows using file handle related information in V4L2. The event interface
is one example of such use.The use of v4l2_fh is not mandatory for drivers.
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab
16 Dec, 2009
2 commits
-
Replace the video_is_unregistered function by a video_is_registered
function. The V4L2_FL_UNREGISTERED flag is replaced by a
V4L2_FL_REGISTERED flag.This change makes the video_is_registered function return coherent
results when called on an initialize but not yet registered video_device
instance. The function can now be used instead of checking
video_device::minor.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab -
Many drivers access the device number (video_device::v4l2_devnode::num)
in order to print the video device node name. Add and use a helper
function to retrieve the video_device node name.Signed-off-by: Laurent Pinchart
Signed-off-by: Mauro Carvalho Chehab
19 Sep, 2009
2 commits
-
Warn when the desired device node number is already in use, except when
the new video_register_device_no_warn function is called since in some
use-cases that warning is not relevant.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
video_register_device_index is never actually called, instead the
stream index number is always calculated automatically.This patch removes this function and simplifies the internal get_index
function since that can now always just return the first free index.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
30 Mar, 2009
1 commit
-
Shared memory mappings on nommu machines require a get_unmapped_area
file operation that suggests an address for the mapping. This patch
adds a way for v4l2 drivers to provide this callback.Signed-off-by: Daniel Glöckner
Signed-off-by: Mauro Carvalho Chehab
03 Jan, 2009
2 commits
-
Since internal to v4l2 the ioctl prototype is the same regardless of it
being called through .ioctl or .unlocked_ioctl, we need to convert it all
to the long return type of unlocked_ioctl.Thanks to Jean-Francois Moine for posting an initial patch for this and
thus bringing it to our attention.Cc: Jean-Francois Moine
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Introduce a struct v4l2_file_operations for v4l2 drivers.
Remove the unnecessary inode argument.
Move compat32 handling (and llseek) into the v4l2-dev core: this is now
handled in the v4l2 core and no longer in the drivers themselves.Note that this changeset reverts an earlier patch that changed the return
type of__video_ioctl2 from int to long. This change will be reinstated
later in a much improved version.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
30 Dec, 2008
2 commits
-
Drivers that use v4l2_device can set that as parent pointer in the v4l2_dev
field instead of using the struct device parent field.This allows v4l2-dev.c to check whether this driver is v4l2_device based,
and if so then it can offer additional services.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Instead of relying on the cdev release callback we should rely on the
release callback from the device struct. This requires that we use
get_device/put_device to do proper refcounting. In order to do this
safely v4l2-dev.c now sets up its own file_operations that call
out to the driver's ops.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
12 Oct, 2008
7 commits
-
The v4l core creates four different video devices (video, vbi, radio, vtx)
and each has its own range of minor numbers. However, modern devices keep
increasing the number of devices that they need so a maximum of 64 video
devices will not be enough in the future. In addition this scheme makes
it very hard to add new device types.This patch disconnects the kernel number allocation (e.g. video0, video1,
etc.) from the actual minor number (just pick the first free minor).This allows for much more flexibility in the future. However, it does
require the use of udev. For those who cannot use udev a new CONFIG option
was created that changes the allocation scheme back to the old behavior.Thanks to Greg KH for suggesting this approach during the 2008 LPC.
In addition, several bugs were fixed in the ivtv and cx18 drivers: these
drivers try to allocate specific kernel numbers but that scheme contained
a bug which caused what should have been e.g. video17 to appear as e.g.
video2.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Replace the old register_chrdev with the more flexible register_chrdev_region.
Ensure that the release() is called when the very last chardev usage was
released, and not when the sysfs devices were removed. This should simplify
hotpluggable drivers considerably.Tested-by: Mike Isely
Tested-by: Laurent Pinchart
Signed-off-by: Hans Verkuil
Acked-by: David Ellingsworth
Reviewed-by: Hans de Goede
Signed-off-by: Mauro Carvalho Chehab -
Cleanup v4l2-dev.[ch], add/improve comments and add a new helper
function: video_drvdata() that can get the private driver data from
a file struct.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Remove the priv field and let video_get/set_drvdata use dev_get_drvdata
and dev_set_drvdata instead.Convert all drivers that still used priv directly.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Add a second release function: video_device_release_empty
It can be used by drivers that have statically allocated
video_device structs.Its use usually, but not always, indicates laziness on the
part of the driver programmer.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
27 Jul, 2008
3 commits
-
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The type and type2 fields were unused and so could be removed.
Instead add a vfl_type field that contains the type of the video
device.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The video_device_create_file and video_device_remove_file functions can be
removed from v4l2-dev.h, removing the dependency on videodev.h in v4l2-dev.h.Also removed a few more videodev.h includes that should have been videodev2.h.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
26 Jul, 2008
2 commits
-
According to an old comment this should have been removed in 2.6.15.
Better late than never...Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in
a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it.This ensures a clean separation between the const ops struct and the non-const
video_device struct.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
24 Jul, 2008
3 commits
-
The functions in a header should not belong to another module. The prio functions
belong to v4l2-common.c, so move them to v4l2-common.h.The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header
and move those functions to it.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The class_dev field is a normal device, not a class device. This is very
confusing and now that the old 'dev' field has been renamed to 'parent'
we can rename 'class_dev' to just 'dev'.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The field 'dev' is not the video device, but the parent of the video device.
Rename accordingly.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
20 Jul, 2008
4 commits
-
Those changes, together with some proper patches, will allow out-of-tree
compilation for for kernels < 2.6.19Signed-off-by: Mauro Carvalho Chehab
-
Various ioctl debugging fixes and improvements:
- use %x rather than %d for control IDs and bitmask fields
- make two arrays const
- show the whole control array for the ext_ctrl ioctls
- print pix_fmt for V4L2_BUF_TYPE_VIDEO_OUTPUT
- show full type name rather than an integer
- fix CROPCAP debugging
- fix G/S_TUNER debugging
- show error code in case of an error
- other small cleanupsSigned-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
A number of V4L drivers have a mod param to specify their preferred minors.
This is because it is often desirable for applications to have a static /dev
name for a particular device. However, using minors has several disadvantages:1) the requested minor may already be taken
2) using a mod param is driver specific
3) it requires every driver to add a param
4) requires configuration by handThis patch introduces an "index" attribute that when combined with udev rules
can create static device paths like this:/dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video0
/dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video1
/dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video2$ ls -la /dev/v4l/by-path/pci-0000\:00\:1d.2-usb-0\:1\:1.0-video0
lrwxrwxrwx 1 root root 12 2008-04-28 00:02 /dev/v4l/by-path/pci-0000:00:1d.2-usb-0:1:1.0-video0 -> ../../video1These paths are steady across reboots and should be resistant to rearranging
across Kernel versions.video_register_device_index is available to drivers to request a
specific index number.Signed-off-by: Brandon Philips
Signed-off-by: Kees Cook
Signed-off-by: Kay Sievers
Signed-off-by: Mauro Carvalho Chehab -
The naming for the callbacks that handle the VIDIOC_ENUM_FMT and
VIDIOC_S/G/TRY_FMT ioctls was very confusing. Renamed it to match
the v4l2_buf_type name.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab