Commit Graph

7632 Commits (a64bb4b7111e063154f97ff64dab03144cdfb5d9)

Author SHA1 Message Date
Hans Verkuil a64bb4b711 [media] cx18: use core priority handling
VIDIOC_S/G_PRIORITY handling is now done by the v4l2 core framework.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:38:04 -03:00
Hans Verkuil 0b5f265a88 [media] cx18: use v4l2_fh as preparation for adding core priority support
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:38:03 -03:00
Hans Verkuil cc0a2d411f [media] ivtv: convert to core priority handling
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:38:01 -03:00
Hans Verkuil 99cd47bc73 [media] v4l2-ioctl: add priority handling support
Drivers that use v4l2_fh can now use the core framework support of g/s_priority.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:59 -03:00
Hans Verkuil dfddb2441f [media] v4l2-fh: add v4l2_fh_is_singular
Several drivers need to do something when the first filehandle is opened
or the last filehandle is closed. Most implement some use count mechanism,
but if they use v4l2_fh, then you can also just check if this is the only
filehandle for the device node. A simple helper function can do this.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:58 -03:00
Hans Verkuil 73cb42068c [media] v4l2-fh: add v4l2_fh_open and v4l2_fh_release helper functions
Add two new functions: v4l2_fh_open allocates and initializes a struct v4l2_fh
based on a struct file pointer and v4l2_fh_release releases and frees a struct
v4l2_fh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:57 -03:00
Hans Verkuil fc5602be7c [media] v4l2-fh: implement v4l2_priority support
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:56 -03:00
Hans Verkuil 0f62fd6a2f [media] v4l2: add v4l2_prio_state to v4l2_device and video_device
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 <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:55 -03:00
Hans Verkuil 0226549308 [media] v4l2_prio: move from v4l2-common to v4l2-dev
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 <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:54 -03:00
Vadim Solomin 8c1476ffc0 [media] saa7134-input: key up events not sent after suspend/resume
On my AverMedia AverTV Studio 507, key up events are no longer sent after
a suspend-to-disk/resume cycle, resulting in "stuck" keys.

Apparently, for key up events to be generated, a certain GPIO pin must be set.
Currently it's set in saa7134_input_init1(), but that function is not called
on device resume. I suggest that code be moved to __saa7134_ir_start(), which
is called both on init and resume.

Signed-off-by: Vadim Solomin <vadic052@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:53 -03:00
Daniel Drake c6384c886d [media] via-camera: Fix OLPC serial check
The code that checks the OLPC serial port is never built at the moment,
because CONFIG_OLPC_XO_1_5 doesn't exist and probably won't be added.

Fix it so that it gets compiled in, only executes on OLPC laptops, and
move the check into the probe routine.

The compiler is smart enough to eliminate this code when CONFIG_OLPC=n
(due to machine_is_olpc() always returning false).

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 16:37:49 -03:00
Alexander Strakh a07500ef69 [media] drivers/media/video/tlg2300/pd-video.c: Remove second mutex_unlock in pd_vidioc_s_fmt
Error path in file drivers/media/video/tlg2300/pd-video.c:
1. First mutex_unlock on &pd->lock in line 767 (in function that
   called from line 805)
2. Second in line  806

 805        pd_vidioc_s_fmt(pd, &f->fmt.pix);
 806        mutex_unlock(&pd->lock);

Found by Linux Device Drivers Verification Project

Signed-off-by: Alexander Strakh <strakh@ispras.ru>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 06:51:57 -03:00
Jiri Slaby 35d9f510b6 [media] V4L: videobuf, don't use dma addr as physical
mem->dma_handle is a dma address obtained by dma_alloc_coherent which
needn't be a physical address in presence of IOMMU, as
a hardware IOMMU can (and most likely) will return a bus address where
physical != bus address.

So ensure we are remapping (remap_pfn_range) the right page in
__videobuf_mmap_mapper by using virt_to_phys(mem->vaddr) and not
mem->dma_handle.

While at it, use PFN_DOWN instead of explicit shift.

[mchehab@redhat.com: Fix compilation breakage due to the lack of a comma]
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 06:51:54 -03:00
Laurent Pinchart 4093a5c4a3 [media] uvcvideo: Fix descriptor parsing for video output devices
Commit 4057ac6ca9

    V4L/DVB (13505): uvcvideo: Refactor chain scan

broke output terminals parsing. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 06:51:48 -03:00
Stephan Lachowsky 38a66824d9 [media] uvcvideo: Fix uvc_fixup_video_ctrl() format search
The scheme used to index format in uvc_fixup_video_ctrl() is not robust:
format index is based on descriptor ordering, which does not necessarily
match bFormatIndex ordering.  Searching for first matching format will
prevent uvc_fixup_video_ctrl() from using the wrong format/frame to make
adjustments.

Signed-off-by: Stephan Lachowsky <stephan.lachowsky@maxim-ic.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 06:51:05 -03:00
Pawel Osciak 5db2c3ba4d [media] vb2: Handle return value from start_streaming callback
Fix vb2 not handling return value from start_streaming() callback.

Signed-off-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:55:08 -03:00
Pawel Osciak 4ffabdb35a [media] vb2: vb2_poll() fix return values for file I/O mode
poll() should be returning poll-specific error values, not E* errors.

Signed-off-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:55:07 -03:00
Pawel Osciak 950720840f [media] Update Pawel Osciak's e-mail address
Signed-off-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:55:05 -03:00
Jean-François Moine ce5b2acce6 [media] gspca - nw80x: New subdriver for Divio based webcams
[mchehab@redhat.com: Fix a few CodingStyle issues]
Tested-by: Kjell Claesson <kjell.claesson@epost.tidanet.se>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:51 -03:00
Jean-François Moine 59929cefa5 [media] gspca - main: Cleanup source
- change copyright and erroneous comment
- small code optimization
- have constant the device template

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:50 -03:00
Jean-François Moine 58c92d37e7 [media] gspca - ov519: Add exposure and autogain controls for ov2610/2610ae
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:49 -03:00
Jean-François Moine 7d47b789ce [media] gspca - jeilinj / stv06xx: Fix some warnings
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:48 -03:00
Jean-François Moine 75b79ffcc3 [media] gspca - sonixb: Clenup source
- update copyright and module author
- set the sensor table as constant

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:47 -03:00
Hans de Goede f0baad866b [media] gspca - sonixb: Update inactive flags to reflect autogain setting
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:46 -03:00
Jean-François Moine f51a8caafe [media] gspca - sonixb: Use the new control mechanism
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:44 -03:00
Jean-François Moine fa85bb6f9b [media] gspca: New file autogain_functions.h
This file contains functions for the auto gain.
It must be used with the new control mechanism.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:43 -03:00
Jean-François Moine 4e5144eef4 [media] gspca - zc3xx: Cleanup source
- change some comments and copyright
- change an erroneous register name
- change hdcs2020b to hdcs2020

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:41 -03:00
Jean-François Moine 170960fa9a [media] gspca - zc3xx: Remove double definition
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:40 -03:00
Hans de Goede c2f644aeeb [media] gspca_cpia1: Add support for button
Not only the qx3 microscope has a button, but some cameras too. Tested
with the Trust sp@cecam 100 (and with a creative and ezcam without button).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:39 -03:00
Xiaochen Wang c05df8b32a [media] pvrusb2: check kmalloc return value
allows the driver to proceed and initialize the below two values
 even if the kmalloc() fails.
        hdw->std_info_enum.def.type_enum.value_names
        hdw->std_info_enum.def.type_enum.count

Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:37 -03:00
Mike Isely 228ee5928b [media] pvrusb2: Remove dead code
This was caught via a compiler warning.  Amazingly enough this bit of
benign dreck dates all the way back to 2008.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:36 -03:00
Mike Isely 43823c0224 [media] pvrusb2: Implement support for Terratec Grabster AV400
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:35 -03:00
Andrzej Pietrasiewicz 941f896071 [media] v4l2: vb2-dma-sg: fix potential security hole
Memory allocated by alloc_page() function might contain some potentially
important data from other system processes. The patch adds a flag to
zero the allocated page before giving it to videobuf2 (and then to
userspace).

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:30 -03:00
Marek Szyprowski 72f1fc33a7 [media] v4l2: vb2: simplify __vb2_queue_free function
__vb2_queue_free function doesn't really return anything useful. This patch
removes support for the return value to simplify the code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:29 -03:00
Marek Szyprowski 31901a078a [media] v4l2: vb2: one more fix for REQBUFS()
Return immediately if the target number of buffers is the same as
the current one and memory access type doesn't change.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:28 -03:00
Andrzej Pietrasiewicz a9bb36aa0d [media] v4l2: vb2-dma-sg: fix memory leak
This patch fixes two minor memory leaks in videobuf2-dma-sg module. They
might happen only in case some other operations (like memory allocation)
failed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:27 -03:00
Marek Szyprowski 29e3fbd8ed [media] v4l2: vb2: fix queue reallocation and REQBUFS(0) case
This patch fixes 2 minor bugs in videobuf2 core:
1. Queue should be reallocated if one change the memory access
method without changing the number of buffers.
2. In case of REQBUFS(0), the request should not be passed to the
driver.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:23 -03:00
Sylwester Nawrocki 91707b8b27 [media] s5p-fimc: Fix G_FMT ioctl handler
Use pix_mp member of struct v4l2_format to return a format
description rather than pix. Also fill in the plane_fmt array.
This is a missing bit of conversion to the multiplanar API.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:20 -03:00
Sylwester Nawrocki 1e00469599 [media] s5p-fimc: Use dynamic debug
Use pr_debug instead of printk so it is possible to control
debug traces at runtime.
E.g. to enable debug trace in file fimc-core.c use command:
echo -n 'file fimc-core.c +p' > /sys/kernel/debug/dynamic_debug/control
or
echo -n 'file fimc-core.c -p' > /sys/kernel/debug/dynamic_debug/control
to disable.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:19 -03:00
Sylwester Nawrocki e0eec9af8b [media] s5p-fimc: Add a platform data entry for MIPI-CSI data alignment
Allow the MIPI-CSI data alignment to be defined in the board setup
as it may be different across various camera sensors.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:18 -03:00
Sylwester Nawrocki 117182d183 [media] s5p-fimc: Allow defining number of sensors at runtime
Add num_clients field to struct s5p_fimc_isp_info to define exactly
size of clients array which simplifies a bit the sensors management.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:16 -03:00
Sylwester Nawrocki 4ecbf5d1d2 [media] s5p-fimc: Prevent hanging on device close and fix the locking
Rework the locking in m2m driver to assure proper operation on SMP systems.

When job_abort or stop_streaming was called to immediately shutdown
a memory-to-memory transaction video buffers scheduled for processing
were never returned to vb2 and v4l2_m2m_job_finish was not called
which led to hanging.

Correct this and also return the unprocessed buffers to vb2 marking
them as erroneous, in case the end of frame interrupt do not occur.

Reported-by: Sewoon Park <seuni.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:15 -03:00
Sylwester Nawrocki a0f8caefaf [media] s5p-fimc: Prevent oops when i2c adapter is not available
Prevent invalid pointer dereference on error path.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:14 -03:00
Sungchun Kang 8ec737ffcc [media] s5p-fimc: fix ISR and buffer handling for fimc-capture
In some cases fimc H/W did not stop although there were no output
buffers available. So the capture deactivation interrupt routine
is modified and the state of ST_CAPT_RUN is cleared only
in the LAST-IRQ call.

After LAST-IRQ is generated, H/W pointer will be skipped by 1 frame.
(reference by user manual) So, S/W pointer should be increased too.

Reviewed-by Jonghun Han <jonghun.han@samsung.com>
Signed-off-by: Sungchun Kang <sungchun.kang@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:13 -03:00
Abylay Ospan 4174ebf5eb [media] Force xc5000 firmware loading for NetUP Dual DVB-T/C CI RF card
Two xc5000 tuners connected to same i2c bus.
Experiments shows that situation when one tuner is not initialized
while other is tuned to channel causes TS errors.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:12 -03:00
Abylay Ospan 8af81ddb12 [media] Fix CI code for NetUP Dual DVB-T/C CI RF card
CI reset takes several seconds on some CAM,
so there is no need to lock mutex all that time.
Also we need not to preserve CI's reset bits in
CIBUSCTRL register, they are handled automatically by FPGA.
Set it to 0 explicitly in order to not reset wrong CAM.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:11 -03:00
Abylay Ospan d164460f89 [media] cx23885: Altera FPGA CI interface reworked
It decreases I2C traffic.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:07 -03:00
Mauro Carvalho Chehab 1039752353 [media] cpia2: Fix some gcc 4.6 warnings when debug is disabled
cpia2_core.c:529:14: warning: variable 'dir' set but not used [-Wunused-but-set-variable]
cpia2_core.c:526:5: warning: variable 'block_index' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:06 -03:00
Mauro Carvalho Chehab 972d724caf [media] several drivers: Fix a few gcc 4.6 warnings
au0828-dvb.c:99:6: warning: variable 'ptr' set but not used [-Wunused-but-set-variable]
au0828-video.c:1180:25: warning: variable 'maxheight' set but not used [-Wunused-but-set-variable]
au0828-video.c:1180:15: warning: variable 'maxwidth' set but not used [-Wunused-but-set-variable]
bttv-input.c:196:16: warning: variable 'current_jiffies' set but not used [-Wunused-but-set-variable]

Those variables are not used at all, so just remove them.

Cc: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:05 -03:00
Hans Verkuil fa9448d9bd [media] altera-ci.h: add missing inline
Functions defined in a header should be static inline. This prevents
compile warnings like:

	'altera_ci_tuner_reset' defined but not used

(Actually appeared in the media backwards compatibility build).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:04 -03:00