When a new video frame is started, the driver takes the next video buffer from
the list of active buffers and moves it to dev->usb_ctl.vid_buf / dev->usb_ctl.vbi_buf
for further processing.
On streaming stop we currently only give back the pending buffers from the list
but not the ones which are currently processed.
This causes the following warning from the vb2 core since kernel 3.15:
...
------------[ cut here ]------------
WARNING: CPU: 1 PID: 2284 at drivers/media/v4l2-core/videobuf2-core.c:2115 __vb2_queue_cancel+0xed/0x150 [videobuf2_core]()
[...]
Call Trace:
[<c0769c46>] dump_stack+0x48/0x69
[<c0245b69>] warn_slowpath_common+0x79/0x90
[<f925e4ad>] ? __vb2_queue_cancel+0xed/0x150 [videobuf2_core]
[<f925e4ad>] ? __vb2_queue_cancel+0xed/0x150 [videobuf2_core]
[<c0245bfd>] warn_slowpath_null+0x1d/0x20
[<f925e4ad>] __vb2_queue_cancel+0xed/0x150 [videobuf2_core]
[<f925fa35>] vb2_internal_streamoff+0x35/0x90 [videobuf2_core]
[<f925fac5>] vb2_streamoff+0x35/0x60 [videobuf2_core]
[<f925fb27>] vb2_ioctl_streamoff+0x37/0x40 [videobuf2_core]
[<f8e45895>] v4l_streamoff+0x15/0x20 [videodev]
[<f8e4925d>] __video_do_ioctl+0x23d/0x2d0 [videodev]
[<f8e49020>] ? video_ioctl2+0x20/0x20 [videodev]
[<f8e48c63>] video_usercopy+0x203/0x5a0 [videodev]
[<f8e49020>] ? video_ioctl2+0x20/0x20 [videodev]
[<c039d0e7>] ? fsnotify+0x1e7/0x2b0
[<f8e49012>] video_ioctl2+0x12/0x20 [videodev]
[<f8e49020>] ? video_ioctl2+0x20/0x20 [videodev]
[<f8e4461e>] v4l2_ioctl+0xee/0x130 [videodev]
[<f8e44530>] ? v4l2_open+0xf0/0xf0 [videodev]
[<c0378de2>] do_vfs_ioctl+0x2e2/0x4d0
[<c0368eec>] ? vfs_write+0x13c/0x1c0
[<c0369a8f>] ? vfs_writev+0x2f/0x50
[<c0379028>] SyS_ioctl+0x58/0x80
[<c076fff3>] sysenter_do_call+0x12/0x12
---[ end trace 5545f934409f13f4 ]---
...
Many thanks to Hans Verkuil, whose recently added check in the vb2 core unveiled
this long standing issue and who has investigated it further.
Cc: <stable@vger.kernel.org>
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Add an ALSA handler inside usbtv module, in order to make
audio to work with those devices.
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Remove the dependencies of as102_cmd from as102, in order to
allow it to be compiled as a separate module.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This function just converts from the as10x internal data into
the DVBv5 cache. Get rid of it.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This function just parses the frontend cache and converts
to the as102 internal format message. Get rid of it.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Avoid having function prototypes by moving some
ancillary routines to the beginning of the file.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This driver is stable and doesn't contain any really serious
issue. Move it out of staging.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Add support for PCTV microStick (77e) device that uses a sms1140
chipset.
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
When DVB is streaming and suspend is called, it will call
au0828_stop_transport(), with will clean the streaming flag.
Due to that, stop_urb_transfer() will be called twice,
causing an oops.
So, we need another flag to be used at resume, telling it
to restart DVB.
While here, add a logic at stop_urb_transfer() to prevent
it of being called twice, and convert the usb_streaming
flag into boolean.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
dev->dvb is always not null, as it is an area at the dev
memory. So, checking if (dev->dvb) is always true.
Instead of this stupid check, what the code wants to do is
to know if the DVB was successully registered.
Fix it by checking, instead, for dvb->frontend. It should
also be sure that this var will be NULL if the device was
not properly initialized.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Suspend/resume conditions can be very tricky. Add some info
printk's to help tracking what's happening there.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Instead of using printk(KERN_foo, use pr_foo() macros.
No functional changes.
Note: we should do the same for dprintk(), but that would
require to remove the dprintk levels. So, for now, let's
not touch on it.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
No timers should be enabled during suspend. So,
stop them. At resume time, we should do the proper
initialization for it to keep working.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
The STREAM_ON state is used by s_format callback,
but the driver never sets it.
Fix it. This will also be needed in order to handle
suspend/resume ops.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
The scheduled work should be cancelled during suspend.
At resume time, we need to set the frontend again. So,
add such logic to the driver.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
At resume, we should restore the register contents. So,
reenable the bridge and GPIO settings.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Trying to make au0828 to suspend can do very bad things, as
the polling Kthread is not handled. We should disable it
during suspend, only re-enabling it at resume.
Still, analog and digital TV won't work, as we don't reinit
the settings at resume, but at least it won't hang.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Define au0828_rc_*() stubs to avoid compile errors when
VIDEO_AU0828_RC is disabled and avoid the need to enclose
au0828_rc_*() in ifdef CONFIG_VIDEO_AU0828_RC in .c files.
Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
It doesn't make sense to handle an IR code given before
suspending after the device resume. So, turn off IR
int while suspending.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
As the RC kthread can re-enable IR int, we should first
cancel the kthread and then disable IR int.
While here, remove a temporary debug printk.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
When the DVB code sets the frontend, it disables the IR
INT, probably due to some hardware bug, as there's no code
there at au8522 frontend that writes on register 0xe0.
Fixing it at au8522 code is hard, as it doesn't know if the
IR is enabled or disabled, and just restoring the value of
register 0xe0 could cause other nasty effects. So, better
to add a hack at au0828-input polling interval to enable int,
if disabled.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
The IR code increases the power consumption of the device.
Allow to disable it via modprobe parameter.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This sleep was doing some debouncing on the original driver.
This is not needed on Linux, because the RC core and the input
layer already takes care of it.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Pull media updates from Mauro Carvalho Chehab:
- removal of sn9c102. This device driver was replaced a long time ago
by gspca
- solo6x10 and go7007 webcam drivers moved from staging into
mainstream. They were waiting for an API to allow setting the image
detection matrix
- SDR drivers moved from staging into mainstream: sdr-msi3101 (renamed
as msi2500) and rtl2832
- added SDR driver for airspy
- added demux driver: si2165
- rework at several RC subsystem, making the code for RC-5 SZ variant
to be added at the standard RC5 decoder
- added decoder for the XMP IR protocol
- tuner driver moved from staging into mainstream: msi3101 (renamed as
msi001)
- added documentation for some additional SDR pixfmt
- some device tree bindings documented
- added support for exynos3250 at s5p-jpeg
- remove the obsolete, unmaintained and broken mx1_camera driver
- added support for remote controllers at au0828 driver
- added a RC driver: sunxi-cir
- several driver fixes, enhancements and cleanups.
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (455 commits)
[media] cx23885: fix UNSET/TUNER_ABSENT confusion
[media] coda: fix build error by making reset control optional
[media] radio-miropcm20: fix sparse NULL pointer warning
[media] MAINTAINERS: Update go7007 pattern
[media] MAINTAINERS: Update solo6x10 patterns
[media] media: atmel-isi: add primary DT support
[media] media: atmel-isi: convert the pdata from pointer to structure
[media] media: atmel-isi: add v4l2 async probe support
[media] rcar_vin: add devicetree support
[media] media: pxa_camera device-tree support
[media] media: mt9m111: add device-tree suppport
[media] soc_camera: add support for dt binding soc_camera drivers
[media] media: soc_camera: pxa_camera documentation device-tree support
[media] media: mt9m111: add device-tree documentation
[media] s5p-mfc: remove unnecessary calling to function video_devdata()
[media] s5p-jpeg: add chroma subsampling adjustment for Exynos3250
[media] s5p-jpeg: Prevent erroneous downscaling for Exynos3250 SoC
[media] s5p-jpeg: Assure proper crop rectangle initialization
[media] s5p-jpeg: fix g_selection op
[media] s5p-jpeg: Adjust jpeg_bound_align_image to Exynos3250 needs
...
HVR-950Q uses an I2C remote controller at address 0x47 (7-bits
notation). Add support for it.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Commits 21dc61d3c0 and 7a1dd50b89 reduced the board I2C
speed to 20 MHz by default, due to a I2C stretch issue:
while xc5000 uses i2c stretch when a command is sent to it,
au0828 doesn't support this feature.
However, this is needed only for Xceive tuners. The other
I2C devices can work at the max speed.
So, revert the workarounds at board level, handling it at
I2C level, only when talking with xc5000.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Fix the following warnings:
drivers/media/usb/cx231xx/cx231xx-cards.c: In function 'read_eeprom':
drivers/media/usb/cx231xx/cx231xx-cards.c:979:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Add support for:
[2040:b130] Hauppauge WinTV 930C-HD (model 1113xx)
After loading the driver the first open to dvb device node fails.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This is needed to support PCTV QuatroStick 522e which uses a si2157.
The si2157 driver is written using i2c_client attachment.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Tested-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Instead of using some random value, return an error if the
PCB config is not available or doesn't match a know profile
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
That makes easier to understand the code. It would also help
to add support for having boards with just digital support
on some latter patch, as allowed by some PCB configs.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
The initialization is already too complex. Use devm_ functions
to make the code simpler and easier to modify.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
On some newer boards, like HVR-930C HD, the information at
the PCB tables are sometimes higher than the ones actually
available on the device. That causes the probing code to
go past the interfaces array.
Add checks to the interface number before going past the
array.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Fixes an old copy+paste bug that has survived all recent code
changes in this code area.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Instead of counting the number of opened file handles, use function
v4l2_fh_is_singular_file() in em28xx_v4l2_open() and em28xx_v4l2_close() to
determine if the file handle is the first/last opened one.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Instead of calling
...
struct v4l2_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL);
filp->private_data = fh;
v4l2_fh_init(fh, vdev);
v4l2_fh_add(fh);
...
simply use function v4l2_fh_open() which does all of these calls for us.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
struct em28xx_fh isn't needed anymore because the only used field which is left is struct v4l2_fh fh.
Use struct v4l2_fh directly and remvove struct em28xx_fh.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>