Hans de Goede [Thu, 22 Aug 2013 15:41:14 +0000 (12:41 -0300)]
[media] gspca_ov519: Fix support for the Terratec Terracam USB Pro
This is a camera with an ov518+ revision 0 bridge + ov7620ae sensor,
which appearently needs different handling then the Trust spacecam 320, which
has an ov518+ revision 2 + ov7620ae sensor. The Terracam USB Pro used to write
this patch has kindly been provided by
Dr. Tilmann Bubeck <t.bubeck@reinform.de>.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Thu, 22 Aug 2013 09:15:31 +0000 (06:15 -0300)]
[media] ad9389b: set is_private only after successfully creating all controls
is_private was set right after creating each control, but the control pointer
might be NULL in case of an error. Set it after all controls were successfully
created, since that guarantees that all control pointers are non-NULL.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Thu, 22 Aug 2013 09:11:17 +0000 (06:11 -0300)]
[media] adv7604: set is_private only after successfully creating all controls
is_private was set right after creating each control, but the control pointer
might be NULL in case of an error. Set it after all controls were successfully
created, since that guarantees that all control pointers are non-NULL.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Mon, 19 Aug 2013 14:21:50 +0000 (11:21 -0300)]
[media] v4l2-dv-timings: add callback to handle exceptions
In most cases the v4l2_bt_timings_cap struct has all the information
necessary to determine valid timings, but occasionally there are exceptions.
Add a callback function to be able to test for those exceptions.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mats Randgaard [Wed, 14 Aug 2013 12:26:28 +0000 (09:26 -0300)]
[media] ad9389b: change initial register configuration in ad9389b_setup()
- register 0x17: CSC scaling factor was set to +/- 2.0. This register
is set by ad9389b_csc_conversion_mode() to the right value.
- register 0x3b: bits for pixel repetition and CSC was set to zero,
but that is the default value.
Martin Bugge [Wed, 14 Aug 2013 07:58:38 +0000 (04:58 -0300)]
[media] v4l2-dv-timings: fix CVT calculation
This patch fixes two errors that caused incorrect format detections:
The first bug is in the calculation of the vertical backporch: the combined
period of vsync and backporch must *exceed* a certain minimum value, and not
be equal to it.
The second bug is a rounding error in the reduced blanking calculation:
expand the ideal_duty_cylce to be in parts per ten thousand to avoid
rounding errors.
Signed-off-by: Martin Bugge <marbugge@cisco.com> Cc: Mats Randgaard <matrandg@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] v4l2-ctrl: Suppress build warning from v4l2_ctrl_new_std_menu()
Prevent following build warning:
drivers/media/v4l2-core/v4l2-ctrls.c: In function v4l2_ctrl_new_std_menu:
drivers/media/v4l2-core/v4l2-ctrls.c:1768:15: warning: 'qmenu_int_len' may be used uninitialized in this function
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Cc: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] v4l2-mem2mem: clear m2m context from job_queue before ctx streamoff
When streamoff is called on the context and the context
is added to the job_queue,
1] sometimes device_run receives the empty vb2 buffers (as
v4l2_m2m_streamoff is dropping the ready queue).
2] sometimes v4l2_m2m_job_finish may not succeed as the m2m_dev->curr_ctx
is made NULL in the v4l2_m2m_streamoff()
The above points may stop the execution of the other queued contexts.
This patch makes sure that before streamoff is executed on any context,
that context should "not be running" or "not queued" in the job_queue.
1] If the current context is running, then abort job will be called.
2] If the current context is queued, then the context will be removed from
the job_queue.
[media] media/v4l2: VIDEO_SH_VEU should depend on HAS_DMA
If NO_DMA=y:
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’
Commit da508f5799659241a359e2d07abb8af905f6291c ("[media] media/v4l2:
VIDEOBUF2_DMA_CONTIG should depend on HAS_DMA") added a dependency on
HAS_DMA to VIDEO_SH_VEU, as it selects VIDEOBUF2_DMA_CONTIG.
However, this got lost in the merge conflict resolution in commit df90e2258950fd631cdbf322c1ee1f22068391aa ("Merge branch 'devel-for-v3.10'
into v4l_for_linus").
Re-add the dependency to fix this.
Johannes Erdfelt [Sat, 17 Aug 2013 00:29:02 +0000 (21:29 -0300)]
[media] cx231xx: Add support for KWorld UB445-U
The KWorld UB445-U is similar to the UB430-AF but with a Samsung S5H1411
frontend. Luckily all of the hardware is already well supported, just the
device and USB ids need to be added to get it to work.
Signed-off-by: Johannes Erdfelt <johannes@erdfelt.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Julia Lawall [Wed, 14 Aug 2013 08:11:15 +0000 (05:11 -0300)]
[media] marvell-ccic/mmp-driver.c: simplify use of devm_ioremap_resource
Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@
- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
e = devm_ioremap_resource(e1, res);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] cx23885: Add DTV support for Mygica X8502/X8507 boards
Those boards were missing the ISDB-T support.
Most of the work on this patch were done by Alfredo.
My work here were to port this patch from Kernel 3.2 to upstream,
fix the issue caused by the set_frontend bad hook, and add the
Kconfig bits.
Tested on a X8502 board rebranded as:
"Leadership - Placa PCI-e de Captura de Vídeo Híbrida" - product code 3800.
[media] cx23885-dvb: use a better approach to hook set_frontend
When the frontend drivers got converted to DVBv5 API, the original
hook that tracked when a frontend is set got removed, being replaced
by an approach that would use the gate control. That doesn't work
fine with some boards. Also, the code were called more times than
desired.
Replace it by a logic that will hook the dvb set_frontend ops,
with works with both DVBv3 and DVBv5 calls.
Tested on a Mygica X8502 OEM board.
[media] media: vb2: Fix potential deadlock in vb2_prepare_buffer
Commit b037c0fde22b1d3cd0b3c3717d28e54619fc1592 ("media: vb2: fix
potential deadlock in mmap vs. get_userptr handling") fixes an AB-BA
deadlock related to the mmap_sem and driver locks. The same deadlock can
occur in vb2_prepare_buffer(), fix it the same way.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Sean Young [Tue, 30 Jul 2013 22:00:03 +0000 (19:00 -0300)]
[media] winbond: wire up rc feedback led
Note that with the rc-feedback trigger, the cir-rx trigger is now
redundant. The cir-tx trigger is not used by default; if this
functionality is desired then it should exist in rc-core, not in
a driver.
Also make sure that the led is suspended on suspend.
Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hello,
this is a new gspca driver for Syntek STK1135 webcams. The code is completely
new, but register values are based on Syntekdriver (stk11xx) by Nicolas VIVIEN
(http://syntekdriver.sourceforge.net).
Only one webcam type is supported now - vendor 0x174f, device 0x6a31.
It's Asus F5RL laptop flippable webcam with MT9M112.
The camera works better than in Windows - initializes much faster and
provides more resolutions (the sensor can do almost any resolution - just
add it to the stk1135_modes[] - could this feature be somehow used by
applications to avoid SW scaling?).
Autoflip works too - when the camera is flipped around, the image is flipped
automatically.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
If v4l2_fh_open() fails in dev_open(), gspca_dev->module left locked.
The patch adds module_put(gspca_dev->module) on this path.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans de Goede [Tue, 20 Aug 2013 12:18:24 +0000 (09:18 -0300)]
[media] radio-si470x-usb: Remove software version check
We've an user reporting a device with a software version of 0, which works
fine. Once we lower the version check to accept version 0 it becomes a nop,
so remove it completely.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Sat, 17 Aug 2013 22:30:18 +0000 (19:30 -0300)]
[media] msi3101: few improvements for RF tuner
* Fix AM_MODE. Now it could work at least in theory, cannot test.
* Use greatest common divisor algo to divide PLL fractional parts.
* Fix IF frequency mode.
* + some very minor "style" issues
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Sun, 11 Aug 2013 22:07:02 +0000 (19:07 -0300)]
[media] msi3101: change stream format 384
After feeding different signal levels using RF generator and looking
GNU Radio FFT sink I made decision to change bit shift 3 to bit shift
2 as there was very (too) huge visible leap in FFT sink GUI. Now it
looks more natural.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Wed, 7 Aug 2013 16:20:29 +0000 (13:20 -0300)]
[media] msi3101: changes for tuner PLL freq limits
I made some tuner freq limit tests against RF signal generator.
Adjust some PLL limits according to these test results.
Here are the results, taken from two different devices.
Ranges are measured RF limits + calculated VCO limits.
Mirics MSi3101 SDR Dongle:
VHF_MODE 52 - 132 1664 - 4224
B3_MODE 103 - 263 1648 - 4208
B45_MODE 413 - 960 1652 - 3840
Hauppauge WinTV 133559 LF:
VHF_MODE 49 - 130 1568 - 4160
B3_MODE 98 - 259 1568 - 4144
B45_MODE 391 - 960 1564 - 3840
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Tue, 6 Aug 2013 00:33:31 +0000 (21:33 -0300)]
[media] msi3101: init bits 23:20 on PLL register
It is not sure what is meaning of that number, but it is better
to try do as Windows driver. It seems to have small effect for
signal when looking FM FFT.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Allow stepless synthesizer configuration. With that change we lose
precision a little bit, as it is now between +-500Hz from the target.
It could be better but on that case calculation algorithm goes more
complex and atm there is more important things to do.
Two approach to improve which comes to my mind are:
1) select and use biggest suitable step
2) use greatest common divisor algo to find divisor for thresh & frac
when possible to avoid rounding errors, which is root of cause of
current +-500Hz inaccuracy.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Thu, 11 Jul 2013 15:19:32 +0000 (12:19 -0300)]
[media] msi3101: fix stream re-start halt
Restarting stream fails quite often. Small delay is between urb killing
and stream stop command - likely to give harware some time to process
killed urbs.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Thu, 11 Jul 2013 00:59:58 +0000 (21:59 -0300)]
[media] msi3101: enhance sampling results
It looks like there is some extra data carried to enhance sampling
results. When you tune to some some weak/empty channel those bits
are always zeroes. When you tune to some channel where is very
strong signals those bits are all zeroes.
Examining those 32-bits reveals shortly there is 16 pieces of 2-bit
numbers. Number seen are 0, 1 and 3 - for some reason 2 is not used.
I used that number to shift bits given amount to left, "increasing"
sampling resolution by 3-bits. It may be wrong, but after some testing
it still provides better signal.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Tue, 9 Jul 2013 19:19:15 +0000 (16:19 -0300)]
[media] msi3101: add sampling mode control
Whilst Quadrature Sampling is most common sampling technique used in
radio technology there is others too. Add control user could select
sampling mode. We currently support only quadrature sampling.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Tue, 9 Jul 2013 05:44:56 +0000 (02:44 -0300)]
[media] msi3101: fix sampling rate calculation
These calculations seem to give 100% correct results. Calculation
formulas could be still a little bit wrong as I have no knowledge
what kind of dividers, multipliers and VCO limits there really is.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Antti Palosaari [Fri, 5 Jul 2013 03:24:08 +0000 (00:24 -0300)]
[media] Mirics MSi3101 SDR Dongle driver
It is first Kernel software defined radio receiver driver.
That device is sold as a digital television solution.
MSi3101 is reference design which consists of two chips:
1) MSi2500 USB ADC
2) MSi001 RF-tuner
Driver is put to staging as API is not ready.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c: In function 'sh_mobile_ceu_clock_start':
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c:613:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Prathyush K [Wed, 7 Aug 2013 11:53:04 +0000 (08:53 -0300)]
[media] exynos-gsc: fix s2r functionality
When gsc is in runtime suspended state, there is no need to call
m2m_suspend during suspend and similarly, there is no need to call
m2m_resume during resume if already in runtime suspended state. This
patch adds the necessary conditions to achieve this.
Andrzej Hajda [Wed, 24 Jul 2013 13:57:32 +0000 (10:57 -0300)]
[media] V4L: s5c73m3: Add format propagation for TRY formats
Resolution set on ISP pad of S5C73M3-OIF subdev should be
propagated to source pad for TRY and ACTIVE formats.
The patch adds missing propagation for TRY format.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] V4L2: mt9t031: don't Oops if asynchronous probing is attempted
The mt9t031 driver hasn't yet been updated to support asynchronous
subdevice probing. If such a probing is attempted, the driver is allowed
to fail, but it shouldn't Oops. This patch fixes such a potential NULL
pointer dereference.
[media] V4L2: mx3_camera: add support for asynchronous subdevice registration
The soc-camera core does all the work on supporting asynchronous
subdevice probing, host drivers only have to pass a subdevice list to
soc-camera. Typically this list is provided by the platform.
[media] V4L2: soc-camera: fix requesting regulators in synchronous case
With synchronous subdevice probing regulators should be requested by the
soc-camera core in soc_camera_pdrv_probe(). Subdevice drivers, supporting
asynchronous probing, call soc_camera_power_init() to request regulators.
Erroneously, the same regulator array is used in the latter case as in
the former, which leads to a failure. This patch fixes it by preventing
the second regulator request from being executed.
Hans Verkuil [Thu, 25 Jul 2013 12:40:34 +0000 (09:40 -0300)]
[media] soc_camera: fix compiler warning
media_build/v4l/soc_camera.c: In function 'soc_camera_host_register':
media_build/v4l/soc_camera.c:1513:10: warning: 'sasd' may be used uninitialized in this function [-Wmaybe-uninitialized]
snprintf(clk_name, sizeof(clk_name), "%d-%04x",
^
media_build/v4l/soc_camera.c:1464:34: note: 'sasd' was declared here
struct soc_camera_async_subdev *sasd;
^
By changing the type of 'i' to unsigned and changing a condition we finally
convince the compiler that sasd is really initialized.
Add Renesas R-Car VIN (Video In) V4L2 driver.
Based on the patch by Phil Edworthy <phil.edworthy@renesas.com>.
[Sergei: removed deprecated IRQF_DISABLED flag, reordered/renamed 'enum chip_id'
values, reordered rcar_vin_id_table[] entries, removed senseless parens from
to_buf_list() macro, used ALIGN() macro in rcar_vin_setup(), added {} to the
*if* statement and used 'bool' values instead of 0/1 where necessary, removed
unused macros, done some reformatting and clarified some comments.]
Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] v4l: async: Make it safe to unregister unregistered notifier
Calling v4l2_async_notifier_unregister() on a notifier that hasn't been
registered leads to a crash. To simplify drivers, make it safe to
unregister a notifier that has not been registered.
[media] v4l: of: Drop acquired reference to node when getting next endpoint
The of_get_child_by_name() function takes a reference to the node it
returns. Make sure to drop it when looking for the ports node in
v4l2_of_get_next_endpoint().
[media] videobuf2-core: Verify planes lengths for output buffers
For output buffers application provide to the kernel the number of bytes
they stored in each plane of the buffer. Verify that the value is
smaller than or equal to the plane length.
This patch implements i2c_board_info.platform_data, and some options to
override the default initialization table for the GM7113C and SAA7113
chips.
Signed-off-by: Jon Arne Jørgensen <jonarne@jonarne.no> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] saa7115: Do not load saa7115_init_misc for gm7113c
Most of the registers changed in saa7115_init_misc table are out of range
for the gm7113c chip.
The only register that's within range, don't need to be changed here.
Signed-off-by: Jon Arne Jørgensen <jonarne@jonarne.no> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] saa7115: Fix saa711x_set_v4lstd for gm7113c
saa711x_set_v4lstd would toggle several bits that should not be touched
when changing std. This patch fixes this.
Signed-off-by: Jon Arne Jørgensen <jonarne@jonarne.no> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Mon, 29 Jul 2013 11:41:00 +0000 (08:41 -0300)]
[media] v4l2: use new V4L2_DV_BT_BLANKING/FRAME defines
Use the new blanking and frame size defines. This also fixed a bug in
these drivers: they assumed that the height for interlaced formats was
the field height, however height is the frame height. So the height
for a field is actually bt->height / 2.