1
0
Fork 0
Commit Graph

255252 Commits (8318a64b892a4de629c3365b3acd8f7d2d7e6100)

Author SHA1 Message Date
Guennadi Liakhovetski 8318a64b89 [media] V4L: soc-camera: remove several now unused soc-camera client operations
This patch removes .enum_input(), .suspend() and .resume() soc-camera
client operations.

Functionality, provided by .enum_input(), if needed, can be implemented
using the v4l2-subdev API.

As for .suspend() and .resume(), the only client driver, implementing
these methods has been mt9m111, and the only host driver, using them
has been pxa-camera. Now that both those drivers have been converted
to the standard subdev .s_power() operation, .suspend() and .resume()
can be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:23 -03:00
Guennadi Liakhovetski 14c5ea9bb4 [media] V4L: mt9m111: switch to v4l2-subdev .s_power() method
Eliminate soc-camera specific .suspend() and .restore() methods in favour
of the standard v4l2-subdev .s_power() method

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 2768cbbba3 [media] V4L: mt9m111: propagate higher level abstraction down in functions
It is more convenient to propagate the higher level abstraction - the
struct mt9m111 object into functions and then retrieve a pointer to
the i2c client, if needed, than to do the reverse.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski b7ccdba02a [media] V4L: soc-camera: MIPI flags are not sensor flags
SOCAM_MIPI_[1234]LANE flags are not board-specific sensor flags, they
are bus configuration flags.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 4df4ada936 [media] V4L: tw9910: remove bogus ENUMINPUT implementation
tw9910 is a TV decoder, it doesn't have a tuner. Besides, the
.enum_input soc-camera operation is optional and normally not needed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski ff391d71bc [media] V4L: sh_mobile_ceu_camera: remove redundant calculations
soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 28281a71eb [media] V4L: mx2_camera: .try_fmt shouldn't fail
If the user is requesting too large a frame, instead of failing
select an acceptable geometry, preserving the requested aspect ratio.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 497833c681 [media] V4L: pxa-camera: switch to using subdev .s_power() core operation
soc-camera specific .suspend() and .resume() methods are deprecated
and should be replaced by the subdev standard .s_power() operation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Guennadi Liakhovetski 91401219c0 [media] V4L: pxa-camera: try to force progressive video format
The pxa-camera driver only supports progressive video so far. Passing
down to the client the same format, as what the user has requested can
result in interlaced video, even if the client supports both. This
patch avoids such cases.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Guennadi Liakhovetski a5c1cee0e6 [media] V4L: pxa_camera: remove redundant calculations
soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Guennadi Liakhovetski 6523208758 [media] V4L: mx3_camera: remove redundant calculations
soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Hans Verkuil 82a7c04944 [media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Hans Verkuil 2330fb8242 [media] v4l2-compat-ioctl32: add VIDIOC_DQEVENT support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil 5138870d68 [media] ivtv: add control event support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil c7a52f8dce [media] vivi: support control events
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil 85724983c4 [media] V4L2 spec: document control events
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil ce7275747b [media] v4l2-ctrls: simplify event subscription
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil 6e239399e5 [media] v4l2-ctrls: add control events
Whenever a control changes value or state an event is sent to anyone
that subscribed to it.

This functionality is useful for control panels but also for applications
that need to wait for (usually status) controls to change value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil ab892bac84 [media] v4l2-ctrls: add v4l2_fh pointer to the set control functions
When an application changes a control you want to generate an event.
However, you want to avoid sending such an event back to the application
(file handle) that caused the change.

Add the filehandle to the various set control functions.

The filehandle isn't used yet, but the control event patches will need
this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:19 -03:00
Hans Verkuil a1c894fba3 [media] vivi: add autogain/gain support to test the autocluster functionality
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:19 -03:00
Hans Verkuil c76cd63572 [media] Documentation: Improve cluster documentation and document the new autoclusters
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:19 -03:00
Hans Verkuil 72d877cac0 [media] v4l2-ctrls: add v4l2_ctrl_auto_cluster to simplify autogain/gain scenarios
It is a bit tricky to handle autogain/gain type scenerios correctly. Such
controls need to be clustered and the V4L2_CTRL_FLAG_UPDATE should be set on
the autofoo controls. In addition, the manual controls should be marked
inactive when the automatic mode is on, and active when the manual mode is on.
This also requires specialized volatile handling.

The chances of drivers doing all these things correctly are pretty remote.
So a new v4l2_ctrl_auto_cluster function was added that takes care of these
issues.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:18 -03:00
Hans Verkuil 78866efe8a [media] v4l2-controls.txt: update to latest v4l2-ctrl.c changes
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil ddac5c1079 [media] v4l2-ctrls: fix and improve volatile control handling
If you have a cluster of controls that is a mix of volatile and non-volatile
controls, then requesting the value of the volatile control would fail if the
master control of that cluster was non-volatile. The code assumed that the
volatile state of the master control was the same for all other controls in
the cluster.

This is now fixed.

In addition, it was clear from bugs in some drivers that it was confusing that
the ctrl->cur union had to be used in g_volatile_ctrl. Several drivers used the
'new' values instead. The framework was changed so that drivers now set the new
value instead of the current value.

This has an additional benefit as well: the volatile values are now only stored
in the 'new' value, leaving the current value alone. This is useful for
autofoo/foo control clusters where you want to have a 'foo' control act like a
volatile control if 'autofoo' is on, but as a normal control when it is off.

Since with this change the cur value is no longer overwritten when g_volatile_ctrl
is called, you can use it to remember the original 'foo' value. For example:

autofoo = 0, foo = 10 and foo is non-volatile.

Now autofoo is set to 1 and foo is marked volatile. Retrieving the foo value
will get the volatile value. Set autofoo back to 0, which marks foo as non-
volatile again, and retrieving foo will get the old current value of 10.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 18d171badf [media] v4l2-subdev: implement per-filehandle control handlers
To be consistent with v4l2-ioctl.c.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 2d28b686ad [media] v4l2-ioctl: add ctrl_handler to v4l2_fh
This is required to implement control events and is also needed to allow
for per-filehandle control handlers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 7ebbc39fa0 [media] v4l2-ctrls: drivers should be able to ignore the READ_ONLY flag
When applications try to set READ_ONLY controls an error should
be returned. However, when drivers do that it should be accepted.

Those controls could reflect some driver status which the application
can't change but the driver obviously has to be able to change it.

This is needed among others for future HDMI status controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 37cd3b7368 [media] v4l2-ctrls: simplify error_idx handling
The lower-level prepare functions just set error_idx for each control that
might have an error. The high-level functions will override this with
cs->count in the get and set cases. Only try will keep the error_idx.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Hans Verkuil 54c911eb91 [media] v4l2-ctrls: introduce call_op define
Add the call_op define to safely call the control ops. This also allows
for controls without any ops such as the 'control class' controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Mauro Carvalho Chehab c20eb18ce1 [media] DocBook/v4l: Document the new system-wide version behavior
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Mauro Carvalho Chehab 29834c1ac7 [media] radio: Use the subsystem version control for VIDIOC_QUERYCAP
Just like the video drivers, the right thing to do is to use
the per-subsystem version control.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Mauro Carvalho Chehab 64dc3c1a90 [media] Stop using linux/version.h on the remaining video drivers
Standardize the remaining video drivers to return the API version
for the VIDIOC_QUERYCAP version, instead of a per-driver version.

Those drivers had the version updated more recently or are SoC
drivers. Even so, it doesn't sound a good idea to keep a per-driver
version control, so, let's use the per-subsystem version control
instead.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Mauro Carvalho Chehab b0eaab7657 [media] gspca: don't include linux/version.h
Instead of handling a per-driver driver version, use the
per-subsystem one.

As reviewed by Jean-Francois Moine <moinejf@free.fr>:
	- the 'info' may be simplified:

Reviewed-by: Jean-Francois Moine <moinejf@free.fr>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab fd3e582482 [media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
uvcvideo doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 6c13b45e57 [media] sn9c102: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
sn9c102 doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 083774d8b1 [media] pvrusb2: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
pvrusb2 doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 5204cebadd [media] et61x251: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
et61x251 doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 3c2d464ee8 [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP
After discussing with Andy Walls on irc, we've agreed that this
is the best thing to do. No regressions will be introduced, as 3.x.y
is greater then the current versions for cx18 and ivtv.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:14 -03:00
Mauro Carvalho Chehab 880c35c585 [media] pwc: Use the default version for VIDIOC_QUERYCAP
After discussing with Hans, change pwc to use the default version
control.

The only version ever used for pwc driver is 10.0.12, due to
commit 2b455db6d4.

Changing it to 3.x.y won't conflict with the old version.
There's no namespace conflicts in any predictable future.

Even on the remote far-away case where we might have a conflict,
it will be on just one specific stable Kernel release (Kernel 10.0.12),
if we ever have such stable release.

So, it is safe and consistent on using 3.x.y numering schema for
it.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Mauro Carvalho Chehab 1990d50b58 [media] Stop using linux/version.h on most video drivers
All the modified drivers didn't have any version increment since
Jan, 1 2011. Several of them didn't have any version increment
for a long time, even having new features and important bug fixes
happening.

As we're now filling the QUERYCAP version with the current Kernel
Release, we don't need to maintain a per-driver version control
anymore. So, let's just use the default.

In order to preserve the Kernel module version history, a
KERNEL_VERSION() macro were added to all modified drivers, and
the extraver number were incremented.

I opted to preserve the per-driver version control to a few
pwc, pvrusb2, s2255, s5p-fimc and sh_vou.

A few drivers are still using the legacy way to handle ioctl's.
So, we can't do such change on them, otherwise, they'll break.
Those are: uvc, et61x251 and sn9c102.

The rationale is that the per-driver version control seems to be
actively maintained on those.

Yet, I think that the better for them would be to just use the
default version numbering, instead of doing that by themselves.

While here, removed a few uneeded include linux/version.h

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Mauro Carvalho Chehab d35ebf9558 [media] drxd, siano: Remove unused include linux/version.h
Both drxd and siano drivers were including linux/version.h without
any reason. Probably, this is due to some compatibility code that
used to exist before having their support added into the Linux
Kernel.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Mauro Carvalho Chehab ae6db51546 [media] v4l2-ioctl: Add a default value for kernel version
Most drivers don't increase kernel versions as newer features are added or
bug fixes are solved. So, vidioc_querycap returned value for cap->version is
meaningless. Instead of keeping this situation forever, let's add a default
value matching the current Linux version.

Drivers that want to keep their own version control can still do it, as they
can override the default value for cap->version.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Mauro Carvalho Chehab b6dc1bab05 [media] DocBook/v4l: Remove references to the old V4L1 compat layer
The old V4L1 Kernel copatibility layer was removed, but the API
spec still says that it is there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet a9b36e8507 [media] marvell-cam: implement contiguous DMA operation
The core driver can now operate in either vmalloc or dma-contig modes;
obviously the latter is preferable when it is supported.  Default is
currently vmalloc on all platforms; load the module with buffer_mode=1 for
contiguous DMA mode.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet 6c895d548c [media] marvell-cam: Don't spam the logs on frame loss
The sequence numbers already give that information if user space cares;
this is a frequent occurrence on slower machines, alas.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet 9d48a51c27 [media] marvell-cam: no need to initialize the DMA buffers
This was an old debugging thing from years ago.  It's only done at
initialization time, but it's still unnecessary; take it out.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet 362d45b23d [media] marvell-cam: include file cleanup
Put the includes into a slightly more readable ordering and get rid of a
few unneeded ones.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet b5210fd2c7 [media] marvell-cam: convert to videobuf2
This is a basic, naive conversion to the videobuf2 infrastructure, removing
a lot of code in the process.  For now, we're using vmalloc, which is
suboptimal, but it does match what the cafe driver did before.  In the cafe
case, it may have to stay that way just because memory is too tight to do
direct streaming; mmp-camera will be able to do better.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Sylwester Nawrocki 3751e32961 [media] v4l: Fix minor typos in the documentation
Signed-off-by: Sylwester Nawrocki <snjw23@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:10 -03:00
Manjunath Hadli af60313d6c [media] davinci vpbe: Readme text for Dm6446 vpbe
Please refer to this file for detailed documentation of
davinci vpbe v4l2 driver.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:10 -03:00