This is a bit hack, but returning error when driver is not tuned yet
causes DVBv5 zap stop polling DVBv5 statistics. Thus return 0 even
callback is called during invalid device state.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
There should be clearly some lock in order to make sure firmware
command in execution is not disturbed by another command. It has
worked as callbacks are serialized somehow pretty well and command
execution happens usually without any delays.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Rename device state struct from 'priv' to 'dev'.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
All users are now using I2C binding and old attach could be removed.
Use I2C client for proper logging at the same.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
On power-on LNB power supply voltage is disabled, due to that no
need to disable it during probe. Tone is supply is hard-coded as
external tone coming from the demodulator. Program both voltage
and tone on set_voltage(). Use register cache to prevent unneeded
programming.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
As driver is now proper I2C client driver, we could use correct
functions for I2C I/O. Also rename state from priv to dev. Fix
logging too.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Remove legacy media attach as all users are on I2C bindings now.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Devices that were using a8293 SEC are converted to I2C platform data
thus that old config structure is left unused.
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
The zoran driver has now been converted to the control framework
which means that these three subdevice drivers no longer need to
support the legacy core control ops since the last bridge driver
that needed that has now been converted.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Switch this driver to the control framework and to v4l2_fh for
handling control events.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Use the standard core lock to take care of serializing ioctl calls and
to serialize file operations.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
There is no need to zero the v4l2_capability struct, the v4l2 core has done
that already.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
The names of the pixelformats is set by the core. So there no longer
is any need for drivers to fill it in.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- Fix an off-by-one index check in vidioc_enum_fmt()
- Fill in the pix.sizeimage field in vidioc_try_fmt_cap()
- Fix an off-by-one index check in vidioc_s_input()
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Convert the driver to use v4l2_fh in order to support control events.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- fill in the missing colorspace value.
- don't reject incorrect field values, always replace with a valid value.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Interestingly enough, the existing control handling code basically did
nothing. At least the new code will inherit the controls from the
saa7115 driver.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
These things are only initialized if you start streaming video, but
they are also used in the disconnect function. So just init them
always during probe time.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
The standards supported by S-Video and Composite inputs are not
limited by PAL, so make it more generic.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
In various places the stack was used to provide buffers for USB data, but
this should be allocated memory.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
If remove_pending is non-zero, then the v4l2_lock is never unlocked.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Set the colorspace and field in vidioc_try_fmt_vid_cap().
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- setup initial radio and tv frequencies.
- set/get the correct frequency (radio vs tv).
- disable tuner/freq ioctls if there is no tuner.
- fix some tuner index checks.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
The radio device node had the same caps as the video node. Fix this.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
The g/s_audio ioctls didn't do anything, so remove them all for both
video and radio nodes and remove V4L2_CAP_AUDIO.
The enum/g/s_input ioctls are invalid for radio nodes, so remove them
from the radio ioctl_ops.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Convert this driver to the control framework and struct v4l2_fh
(needed for handling control events).
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This causes lots of problems and is *very* slow as well.
One of the main problems is that this prohibits the use of the control
framework since subdevs will be unloaded on power off which is not allowed
as long as they are used by a usb device.
Apparently the reason for doing this is to turn off a noisy tuner. My hardware
has no problem with that, and I wonder whether the hardware with that noisy
tuner wasn't just functioning improperly as I have never heard of noisy tuners.
Contact me if you have one of those devices and I can take a look whether the
tuner can't be powered off if necessary by letting the tuner subdevice go
into standby mode. Unloading the tuner module is just evil and is not the
right approach.
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This patch fix spelling typos in intro.xml.
This xml file is not created from comments within source,
I fix the xml file.
Signed-off-by: Masanari Iida <[email protected]>
[[email protected]: removed mention of obsolete devfs]
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Here's the driver for the Renesas R-Car JPEG processing unit.
The driver is implemented within the V4L2 framework as a memory-to-memory
device. It presents two video nodes to userspace, one for the encoding part,
and one for the decoding part.
It was found that the only working mode for encoding is no markers output, so we
generate markers with software. In the current version of driver we also use
software JPEG header parsing because with hardware parsing performance is lower
than desired.
>From a userspace point of view the process is typical (S_FMT, REQBUF,
optionally QUERYBUF, QBUF, STREAMON, DQBUF) for both the source and destination
queues. STREAMON can return -EINVAL in case of mismatch of output and capture
queues format. Also during decoding driver can return buffers if queued
buffer with JPEG image contains image with inappropriate subsampling (e.g.
4:2:0 in JPEG and 4:2:2 in capture). If JPEG image and queue format dimensions
differ driver will return buffer on QBUF with VB2_BUF_STATE_ERROR flag.
During encoding the available formats are: V4L2_PIX_FMT_NV12M,
V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16, V4L2_PIX_FMT_NV16M for source and
V4L2_PIX_FMT_JPEG for destination.
During decoding the available formats are: V4L2_PIX_FMT_JPEG for source and
V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_NV16M, V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16
for destination.
Performance of current version:
1280x800 NV12 image encoding/decoding
decoding ~122 FPS
encoding ~191 FPS
Signed-off-by: Mikhail Ulyanov <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Currently, the warning for missing device_caps gives a backtrace like so:
[<ffffffff8175c199>] dump_stack+0x45/0x57
[<ffffffff8109ad5a>] warn_slowpath_common+0x8a/0xc0
[<ffffffff8109ae8a>] warn_slowpath_null+0x1a/0x20
[<ffffffffa0237453>] v4l_querycap+0x43/0x80 [videodev]
[<ffffffffa0237734>] __video_do_ioctl+0x2a4/0x320 [videodev]
[<ffffffff812207e5>] ? do_last+0x195/0x1210
[<ffffffffa023a11e>] video_usercopy+0x22e/0x5b0 [videodev]
[<ffffffffa0237490>] ? v4l_querycap+0x80/0x80 [videodev]
[<ffffffffa023a4b5>] video_ioctl2+0x15/0x20 [videodev]
[<ffffffffa0233733>] v4l2_ioctl+0x113/0x150 [videodev]
[<ffffffff81225798>] do_vfs_ioctl+0x2f8/0x4f0
[<ffffffff8113b2d4>] ? __audit_syscall_entry+0xb4/0x110
[<ffffffff81022d7c>] ? do_audit_syscall_entry+0x6c/0x70
[<ffffffff81225a11>] SyS_ioctl+0x81/0xa0
[<ffffffff8113b526>] ? __audit_syscall_exit+0x1f6/0x2a0
[<ffffffff81763549>] system_call_fastpath+0x12/0x17
This indicates that device_caps are missing but doesn't give
much of a clue which driver is actually at fault. Improve
the warning output by showing the capabilities and the
responsible driver.
Signed-off-by: Laura Abbott <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
video_unregister_device() calls device_unregister(), which calls
put_device(), which calls kobject_put(), and if this is the last reference
then kobject_release() is called, which calls kobject_cleanup(), which
calls ktype's release method which happens to be device_release() in this
case, which calls dev->release(), which happens to be
v4l2_device_release() in this case, which calls vdev->release(), which
happens to be video_device_release(). But video_device_release() is
called explicitly both in error recovery path of s5p_jpeg_probe() and
in s5p_jpeg_remove(). The pointers in question are not nullified between
the two calls, so this is harmful.
This patch fixes the driver so that video_device_release() is not called
twice for the same object.
Signed-off-by: Andrzej Pietrasiewicz <[email protected]>
Signed-off-by: Sylwester Nawrocki <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
MFC hardware is known to trash random memory if one tries to use a
buffer which has lower DMA addresses than the configured DMA base
address. This patch adds a check for this case and proper error
handling.
Signed-off-by: Marek Szyprowski <[email protected]>
Acked-by: Kamil Debski <[email protected]>
[[email protected]: fixed typo (addres -> address]
Signed-off-by: Sylwester Nawrocki <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
MFCINST_GOT_INST state is set to encoder context with set_format
only for capture buffer. In queue_setup of encoder called during
reqbufs, it is checked MFCINST_GOT_INST state for both capture
and output buffer. So this patch fixes encoder to check
MFCINST_GOT_INST state only for capture buffer from queue_setup.
Signed-off-by: Seung-Woo Kim <[email protected]>
Signed-off-by: Sylwester Nawrocki <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
event API conformance testing with coccinelle spatches are being
used to locate API usage inconsistencies this triggert with:
./drivers/media/platform/s5p-tv/mixer_reg.c:364
incorrect check for negative return
Return type of wait_event_timeout is signed long not int and the
return type is >=0 always thus the negative check is unnecessary.
An appropriately named variable of type long is inserted and the
call fixed up aswell as the negative return check dropped.
Signed-off-by: Nicholas Mc Guire <[email protected]>
Signed-off-by: Sylwester Nawrocki <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Sylwester Nawrocki <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Use eth_zero_addr to assign the zero address to the given address
array instead of memset when second argument is address of zero.
The Coccinelle semantic patch that makes this change is as follows:
// <smpl>
@eth_zero_addr@
expression e;
@@
-memset(e,0x00,ETH_ALEN);
+eth_zero_addr(e);
// </smpl>
Signed-off-by: Vaishali Thakkar <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
COLORSPACE_JPEG should only be used for JPEGs. Use SMPTE170M instead,
which is how YCbCr images are usually encoded.
Signed-off-by: Hans Verkuil <[email protected]>
Acked-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>