Sakari Ailus [Wed, 25 Jan 2012 00:05:34 +0000 (21:05 -0300)]
[media] v4l: Allow changing control handler lock
Allow choosing the lock used by the control handler. This may be handy
sometimes when a driver providing multiple subdevs does not want to use
several locks to serialise its functions.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
v4l2_subdev_link_validate() is the default op for validating a link. In V4L2
subdev context, it is used to call a pad op which performs the proper link
check without much extra work.
Sakari Ailus [Wed, 11 Jan 2012 09:25:15 +0000 (06:25 -0300)]
[media] media: Add link_validate() op to check links to the sink pad
The purpose of the link_validate() op is to allow an entity driver to ensure
that the properties of the pads at the both ends of the link are suitable
for starting the pipeline. link_validate is called on sink pads on active
links which belong to the active part of the graph.
Sakari Ailus [Thu, 2 Feb 2012 23:17:54 +0000 (20:17 -0300)]
[media] v4l: Image processing control class
Add control class for image processing controls. The control class deals
with controls processing image, for example digital gain or noise filtering,
which can be present in any part of the pipeline.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sakari Ailus [Tue, 4 Oct 2011 11:20:05 +0000 (08:20 -0300)]
[media] v4l: Image source control class
Add image source control class. This control class is intended to contain
low level controls which deal with control of the image capture process ---
the A/D converter in image sensors, for example.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sakari Ailus [Thu, 10 May 2012 05:02:07 +0000 (02:02 -0300)]
[media] v4l2: use __u32 rather than enums in ioctl() structs
V4L2 uses the enum type in IOCTL arguments in IOCTLs that were defined until
the use of enum was considered less than ideal. Recently Rémi Denis-Courmont
brought up the issue by proposing a patch to convert the enums to unsigned:
This sparked a long discussion where another solution to the issue was
proposed: two sets of IOCTL structures, one with __u32 and the other with
enums, and conversion code between the two:
Both approaches implement a complete solution that resolves the problem. The
first one is simple but requires assuming enums and __u32 are the same in
size (so we won't break the ABI) while the second one is more complex and
less clean but does not require making that assumption.
The issue boils down to whether enums are fundamentally different from __u32
or not, and can the former be substituted by the latter. During the
discussion it was concluded that the __u32 has the same size as enums on all
archs Linux is supported: it has not been shown that replacing those enums
in IOCTL arguments would break neither source or binary compatibility. If no
such reason is found, just replacing the enums with __u32s is the way to go.
This is what this patch does. This patch is slightly different from Remi's
first RFC (link above): it uses __u32 instead of unsigned and also changes
the arguments of VIDIOC_G_PRIORITY and VIDIOC_S_PRIORITY.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] media: videobuf2-dma-contig: include header for exported symbols
Include the header to pickup the definitions of the exported symbols.
Quiets the following sparse warnings:
warning: symbol 'vb2_dma_contig_memops' was not declared. Should it be static?
warning: symbol 'vb2_dma_contig_init_ctx' was not declared. Should it be static?
warning: symbol 'vb2_dma_contig_cleanup_ctx' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Pawel Osciak <pawel@osciak.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Shevchenko [Mon, 23 Apr 2012 13:02:42 +0000 (10:02 -0300)]
[media] as3645a: move relevant code under __devinit/__devexit
There is no needs to keep .remove under .exit.text. This driver is for a
standalone chip that could be on any board and connected to any i2c bus.
At the same time we don't need to keep the as3645a_probe() after initializing
the device. Therefore we mark it and relevant functions with __devinit tag.
When applications modify preview engine parameters, the new values are
applied to the hardware by the preview engine interrupt handler during
vertical blanking. If the parameters are being changed when the
interrupt handler is called, it just delays applying the parameters
until the next frame.
If an application modifies the parameters for every frame, and the
preview engine interrupt is triggerred synchronously, the parameters are
never applied to the hardware.
Fix this by storing new parameters in a shadow copy, and switch the
active parameters with the shadow values atomically.
Instead of using a large switch/case statement to return offsets to and
sizes of individual preview engine parameters in the parameters and
configuration structures, store the information in the update_attrs
table and use it at runtime.
[media] omap3isp: preview: Merge configuration and feature bits
The preview engine parameters are referenced by a value suitable for
being used in a bitmask. Two macros named OMAP3ISP_PREV_* and PREV_* are
declared for each parameter and are used interchangeably. Remove the
private macro.
Replace the configuration bit field in the parameter update attributes
structure with a boolean that indicates whether the parameter can be
updated through the preview engine configuration ioctl.
Laurent Pinchart [Mon, 26 Mar 2012 13:24:50 +0000 (10:24 -0300)]
[media] omap3isp: preview: Optimize parameters setup for the common case
If no parameter needs to be modified, make preview_config() and
preview_setup_hw() return immediately. This speeds up interrupt handling
in the common case.
Laurent Pinchart [Mon, 26 Mar 2012 11:54:26 +0000 (08:54 -0300)]
[media] omap3isp: preview: Skip brightness and contrast in configuration ioctl
Brightness and contrast are handled through V4L2 controls. Their
configuration bit in the preview engine update attributes table is set
to -1 to reflect that. However, the VIDIOC_OMAP3ISP_PRV_CFG ioctl
handler doesn't handle -1 correctly as a configuration bit value, and
erroneously considers that the parameter has been selected for update by
the ioctl caller. Fix this.
When propagating the frame number through the pipeline, the frame number
must be incremented at frame start by the appropriate IRQ handler. This
was properly handled for the CSI2 and CCP2 receivers, but not when the
CCDC parallel interface is used.
ADD frame number incrementation to the HS/VS interrupt handler. As the
HS/VS interrupt is also generated for frames received by the CSI2 and
CCP2 receivers, remove explicit propagation handling from the serial
receivers.
Sakari Ailus [Fri, 27 Jan 2012 10:18:51 +0000 (07:18 -0300)]
[media] omap3isp: Prevent crash at module unload
iommu_domain_free() was called in isp_remove() before omap3isp_put().
omap3isp_put() must not save the context if the IOMMU no longer is there.
Fix this.
Laurent Pinchart [Fri, 18 Nov 2011 14:28:24 +0000 (11:28 -0300)]
[media] omap3isp: Prevent pipelines that contain a crashed entity from starting
The OMAP3 ISP preview engine will violate the L4 bus protocol if we try
to write some of its internal registers after it failed to stop
properly. This generates an external abort on non-linefetch fault,
triggering a fatal kernel oops.
We can't always prevent preview engine stop failures (they can for
instance be caused by a sensor crash), but we can improve the system
reliability by refusing to start streaming on a pipeline that contains
the preview engine if it failed to stop. The driver will then eventually
reset the ISP (when all applications will have closed their file handles
related to OMAP3 ISP device nodes), making the ISP usable again.
Fixes: NB#291334 - camera: Recover gracefully from ISP crash instead of oopsing Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Reviewed-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mike Isely [Mon, 20 Feb 2012 05:40:56 +0000 (02:40 -0300)]
[media] pvrusb2: For querystd, start with list of hardware-supported standards
The V4L querystd implementation appears to want to narrow down the
list of available standards by starting with a hardware-supported list
and then attempting to detect which among those are actually
available. Prior to this change in the pvrusb2 driver we started with
all possible standards. With this change in place we instead narrow
to just the standards that we know the hardware can actually support.
For example, this removes the ATSC standards from the list if we
aren't dealing with a hybrid device...
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mike Isely [Mon, 20 Feb 2012 05:33:06 +0000 (02:33 -0300)]
[media] pvrusb2: Base available video standards on what hardware supports
With the transition to ioctl2, the pvrusb2 driver's own standards
enumeration is no longer used. Instead a generic algorithm internal
to v4l is used (which is a great idea - since the pvrusb2
implementation itself was generic anyway). This change ensures that
the v4l algorithm works with the correct set of hardware supported
standards. This resolves a FIXME left behind from the videodev_ioctl2
transition.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mike Isely [Mon, 20 Feb 2012 05:28:56 +0000 (02:28 -0300)]
[media] pvrusb2: Transform video standard detection result into read-only control ID
Other aspects of the pvrusb2 driver - including in particular those
dealing with video standards - all use internal control IDs for
uniform access by the interfaces. By exporting the querystd result as
another control ID, uniform access to it becomes available through the
sysfs interface.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Mon, 20 Feb 2012 05:21:00 +0000 (02:21 -0300)]
[media] pvrusb2: convert to video_ioctl2
Note: there is one FIXME remaining: the tvnorms field of struct
video_device should be set up correctly. I have used V4L2_STD_ALL for
now, but I'm sure this can be improved. This field is used by
video_ioctl2 to implement ENUMSTD.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mike Isely [Mon, 20 Feb 2012 05:03:39 +0000 (02:03 -0300)]
[media] pvrusb2: Stop statically initializing reserved struct fields to zero
In any statically initialized data structure, the compiler is going to
zero any part which is not already explicitly initialized. While we
can take that knowledge overboard and simply avoid initializing
anything that needs to be zero, it's at least a good idea not to
bother zeroing parts that we don't otherwise care about - like
"reserved" fields which may change in the future. Avoiding
initialization of those fields now also avoids possible conflict down
the road.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 8 Apr 2012 15:59:52 +0000 (12:59 -0300)]
[media] uvcvideo: Properly report the inactive flag for inactive controls
Note the unused in this patch slave_ids addition to the mappings will get
used in a follow up patch to generate control change events for the slave
ctrls when their flags change due to the master control changing value.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 8 Apr 2012 15:59:46 +0000 (12:59 -0300)]
[media] v4l2-event: Add v4l2_subscribed_event_ops
Just like with ctrl events, drivers may want to get called back on
listener add / remove for other event types too. Rather then special
casing all of this in subscribe / unsubscribe event it is better to
use ops for this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 29 Apr 2012 11:44:44 +0000 (08:44 -0300)]
[media] cpia2: major overhaul to get it in a working state again
This driver was severely broken. This patch makes it work again, and updates
it to the latest V4L2 frameworks (except for videobuf2). It passes the
v4l2-compliance tests and it now handles suspend/resume correctly.
Several custom controls are replaced by new standard controls, only the
USB_ALTERNATE control remains.
Tested with the Hanse HVS-CM500PC USB microscope.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Fri, 4 May 2012 09:38:43 +0000 (06:38 -0300)]
[media] media/video/et61x251: Remove this deprecated driver
The et61x251 has been deprecated for a couple of releases now, as all
devices it supports are also supported by gspca_etoms, and it has not
seen any maintenance in years. So now it is time to remove it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Fri, 27 Apr 2012 16:06:26 +0000 (13:06 -0300)]
[media] gspca_pac7311: Switch to coarse expo autogain algorithm
We can only control the clockdivider to control exposure on the pac7311,
making our expo control coarse, switch to an autogain algorithm optimized for
this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Wed, 25 Apr 2012 15:17:19 +0000 (12:17 -0300)]
[media] gspca_pac7311: Adjust control scales to match registers
Now that the pac7302 and pac7311 drivers are split, they no longer
share there control settings, so there is no need to scale the controls
to register values, instead make them reflect the registers directly.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Wed, 18 Apr 2012 09:12:57 +0000 (06:12 -0300)]
[media] gspca_pac7311: Make sure exposure changes get applied immediately
It turns out that the flush to sensor command needs to be done per register
bank. We were missing one such flush in set_exposure, causing exposure changes
to only show up when another setting in the same bank also got changed.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Wed, 25 Apr 2012 15:00:49 +0000 (12:00 -0300)]
[media] gspca_pac73xx: Remove comments from before the 7302 / 7311 separation
The pac7302 and pac7311 driver still contains some comments from before
they were separated, such as marking certain functions 7302 or 7311 only,
with the new split drivers these make no sense, remove them.
Also removed the empty/unused sd_stop0 function from pac7311.c
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Fri, 27 Apr 2012 14:32:24 +0000 (11:32 -0300)]
[media] gspca/autogain_functions.h: Allow users to declare what they want
Allow users of gspca/autogain_functions.h to declare which of the autogain
algoritms they are going to use. This allows us to remove the hacks from
drivers which don't use coarse_grained_expo_autogain.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 8 Apr 2012 14:04:30 +0000 (11:04 -0300)]
[media] stk-webcam: Don't flip the image by default
Prior to this patch the stk-webcam driver was enabling the vflip and mirror
bits in the sensor by default. Which only is the right thing to do if the
sensor is actually mounted upside down, which it usually is not.
Actually we've received upside down reports for both usb-ids which this
driver supports, one for an "ASUSTeK Computer Inc." "A3H" laptop with
a build in 174f:a311 webcam, and one for an "To Be Filled By O.E.M."
"Z96FM" laptop with a build in 05e1:0501 webcam.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Fri, 27 Apr 2012 16:28:34 +0000 (13:28 -0300)]
[media] radio-mr800: add support for stereo and signal detection
Thanks to an older driver by Faidon Liambotis <paravoid@debian.org> (as noted
in the radio-mr800 comment block at the start) for figuring out how to get the
signal/stereo state.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Fri, 27 Apr 2012 15:30:40 +0000 (12:30 -0300)]
[media] radio-mr800: cleanup and have it comply to the V4L2 API
Implement the control framework and update to the latest V4L2 framework.
The v4l2-compliance tool now runs without errors.
Fixed bad g/s_tuner handling with respect to mono/stereo.
Support control events.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] gspca - sn9c20x: Change the exposure setting of Omnivision sensors
The exposure of Omnivision sensors is defined by the registers 07, 10 and 04.
This patch updates the registers 10 and 04 before using the registers 2d
and 2e (dummy lines).
At the point of the call to video_register_device, both dev->vbi_dev and
dev->vdev have been allocated, and so should be freed on failure. The
error-handling code is moved to the end of the function, to avoid code
duplication.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dan Carpenter [Fri, 20 Apr 2012 12:15:02 +0000 (09:15 -0300)]
[media] ngene: remove an unneeded condition
"stat" is always zero here. The condition used to be needed, but we
shifted stuff around in 0f0b270f90 "[media] ngene: CXD2099AR Common
Interface driver".
This doesn't change how the code works, it's just a bit tidier.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
In file included from /home/lyakh/software/project/24/src/linux-2.6/drivers/media/video/v4l2-subdev.c:29:
linux-2.6/include/media/v4l2-ctrls.h:497: warning: 'struct file' declared inside parameter list
linux-2.6/include/media/v4l2-ctrls.h:497: warning: its scope is only this definition or declaration, which is probably not what you want
linux-2.6/include/media/v4l2-ctrls.h:505: warning: 'struct file' declared inside parameter list
Hans Verkuil [Thu, 19 Apr 2012 15:37:18 +0000 (12:37 -0300)]
[media] v4l2-ctrls.c: zero min/max/step/def values for 64 bit integers
Those fields are meaningless for such control types, and the control framework
should zero them. Otherwise v4l2-compliance will complain about non-zero
min/max/step/def fields.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
On 04-18-2012 01:30, Marcos Paulo de Souza wrote:
> The output of "make versioncheck" told us that:
>
> drivers/media/video/tlg2300/pd-video.c: 1669: need linux/version.h
>
> If we take a look at the code, we can see that this file uses the macro
> KERNEL_VERSION.
The V4L2 core now fills it automatically, so drivers shouldn't touch on
cap->version anymore.
Reported by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>