The vfl_type field is set by the core, so anything you fill in here will
be overwritten. And it will be set to a VFL_TYPE_ value, not a VID_TYPE_
value which is an obsolete V4L1 type.
Since these V4L1 types have been made unavailable for V4L2 drivers, this
driver stopped compiling.
In this case the fix is just removing this assignment.
Cc: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch adds support for Terratec Cinergy HT PCI MKII with card id 79.
Its more or less a copy of Pinnacle Hybrid PCTV.
Thanks to k1ngf1sher on forum.ubuntuusers.de for the idea to copy that card.
Signed-off-by: Stephan Wienczny <stephan@wienczny.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The videodev module is missing the char-major-81-* alias that would
cause it to be auto-loaded when a device of that type is opened. This
patch adds the alias.
Signed-off-by: Scott James Remnant <scott@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Call pwc_construct before trying to talk to device to obtain vc interface so
that LED and power setup works the first time the video device is opened.
Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
When unloading the cx8800 driver I sometimes get a general protection
fault. Analysis revealed a race in cx88_ir_stop(). It can be solved by
using a delayed work instead of a timer for infrared input polling.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The removal of the timer which polls the infrared input is racy.
Replacing the timer with a delayed work solves the problem.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The removal of the timer which polls the infrared input is racy.
Replacing the timer with a delayed work solves the problem.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The removal of the timer which polls the infrared input is racy.
Replacing the timer with a delayed work solves the problem.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
It reduces the size of the driver over all, and the function names in
strings need to be manually kept up to date while __func__ doesn't.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Many functions had a struct file pointer argument, but all they wants is
the struct zoran_fh pointer from the file's private data. Since every
caller of those functions already has the zoran_fh, just pass the that
instead. This saves a dereference in each function change.
While I'm at it, change the code formatting of affected functions to be
kernel standard style.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
kmalloc() can fail for large video buffers. By default the kernel
complains loudly about allocation failures, but we don't want to
frighten the user, so ask kmalloc() to keep quiet on such failures.
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The lock_norm module parameter doesn't look terribly useful. If you
don't want to change the norm, just don't change it. As a matter of
fact, no other v4l driver has such a parameter.
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The zoran driver had two kinds of buffer descriptors, one for jpg buffers
and one for raw buffers. They were mostly the same with only a couple
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
replace occurances of "HVR1150" with "HVR1120" - this was a typo.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
There are no drivers left that call msp3400 with V4L1 commands. Remove it
from this driver.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The code to optimize the usercopy only checked the ioctl NR field. However,
this code is also called for non-V4L2 ioctls (either private or ioctls from
linux/dvb/audio.h and linux/dvb/video.h for decoder drivers like ivtv).
If such an ioctl has the same NR as a V4L2 ioctl, then disaster strikes.
Modified the code to check on the full command ID.
Thanks to Martin Dauskardt for tracing the ivtv breakage to this particular
change.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This driver isn't used in any legacy mode, so no need for v4l2-i2c-drv-legacy.h.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
As announced VIDIOC_G_CHIP_IDENT_OLD is now removed for 2.6.30.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
changeset 04934e44e3784a1b969582e2d59afcec278470c6 removed the last implementation
that were still using the V4L1 obsoleted header.
Now, video_decoder.h is not used anymore by any driver.
Let's remove it and all references for it in Kernel.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The V4L1 obsoleted header video_decoder.h is not used anymore by any driver. Only
a name decoding function at v4l2-ioctl still implements it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The cx18 private packet insertion code only expects to operate on an MPEG PS
when inserting private packets of sliced VBI data. This patch keeps the cx18
driver from corrupting the MPEG TS or other non-PS stream types, in case the
user enables sliced VBI insertion for these MPEG stream types.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Based on a documentation clarification from Conexant, fix the register code
used for sliced VBI VPS service.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
My s-parse builds never griped about be32_to_cpu() casting to __be32, but Hans'
builds did. This change explictly declares the pointer into the VBI buffer
header as __be32, which is the correct thing to do as the data is always
big endian when we go to fetch it. Hopefully this will quiet s-parse warnings.
Also corrected a misplaced parenthesis logic error in checking for the VBI
header magic number.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix a scaling check that was failing, due to a magic number I missed fixing
during previous slice VBI changes. Now
$ v4l2-ctl -v width=480,height=480,pixelformat=MPEG
yields proper visual results again.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
It was a struct file *, but all that function wants is the struct zoran_fh
from the file's private data. Since every caller already has this, just
pass the zoran_fh instead.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The name of the option is DVB_FE_CUSTOMISE. However, on a few places, a wrong
name were used, due to a typo (DVB_FE_CUSTOMIZE).
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Compro VideoMate uses an external audio DSP chip, controlled via tvaudio
module (tda9874a). This patch improves em28xx infrastructure to support
an external audio processor and fixes the Compro VideoMate entry to work
with it.
Signed-off-by: Vitaly Wool <vital@embeddedalley.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add support for the alternate resolutions offered by SQ-905 based cameras. As
well as 320x240 all cameras can do 160x120 and some can do 640x480.
Signed-off-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
I have a GeoVision GV-800(S) card, it has 4 CONEXANT BT878A chips.
It has 16 video inputs and 4 audio inputs, and it is almost identical
to the GV-800, as seen on http://bttv-gallery.de .
The only difference appears to be the analog mux, it has a CD22M3494
in place of the MT8816AP. The card has a blue PCB, as seen in this
picture: http://www.gsbr.com.br/imagem/kits/GeoVision%20GV%20800.jpg .
This card wasn't originally supported, and it was detected as
UNKNOWN/GENERIC. The video inputs weren't working, so I tried
"forcing" a few cards like the GeoVision GV-600, but there was still
no video. So I made a patch to support this card, based on the Kodicom
4400r.
The GV-800(S) is identified as follows:
...
02:00.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:00.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)
02:04.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:04.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)
02:08.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:08.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)
02:0c.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:0c.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)
...
02:00.0 0400: 109e:036e (rev 11)
Subsystem: 800a:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdfff000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
Kernel modules: bttv
02:00.1 0480: 109e:0878 (rev 11)
Subsystem: 800a:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdffe000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
02:04.0 0400: 109e:036e (rev 11)
Subsystem: 800b:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdffd000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
Kernel modules: bttv
02:04.1 0480: 109e:0878 (rev 11)
Subsystem: 800b:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdffc000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
02:08.0 0400: 109e:036e (rev 11)
Subsystem: 800c:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdffb000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
Kernel modules: bttv
02:08.1 0480: 109e:0878 (rev 11)
Subsystem: 800c:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdffa000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
02:0c.0 0400: 109e:036e (rev 11)
Subsystem: 800d:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdff9000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
Kernel modules: bttv
02:0c.1 0480: 109e:0878 (rev 11)
Subsystem: 800d:763d
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at cdff8000 (32-bit, prefetchable) [size=4K]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
As you can see, the GV-800(S) card is almost identical to the GV-800
on bttv-gallery, so this patch might also work for that card. If not,
only a few changes should be required on the gv800s_write() function.
After this patch, the video inputs work correctly on linux 2.6.24 and
2.6.27 using the software 'motion'. The input order may seem a little
odd, but it's the order the original software/driver uses, and I decided
to keep that order to get the most out of the card.
I tried to get the audio working with the snd-bt87x module, but I only
get noise from every audio input, even after selecting a different mux
with alsamixer. Also, after trying to play sound from those sources, I
randomly get a RISC error about an invalid RISC opcode, and then that
output stops working. I also can't change the sampling rate when
recording. Any pointers to adding audio support are welcome.
Signed-off-by: Bruno Christo <bchristo@inf.ufsm.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add DVB support for Avermedia DVB-S Pro and
Avermedia DVB-S Hybrid+FM card both labled A700.
They use zl10313 demod (driver mt312) and zl10036 tuner.
[mchehab@redhat.com: change __FUNCTION__ into __func__]
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from querycap, enum_input, enum_fmt_vid_cap, and
g_fmt_vid_cap.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from g_audio, enum_input, g_parm and gmbuf.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from g_audio, queryctrl, and enum_fmt_vid_cap.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from enum_fmt_vid_cap, g_fmt_vid_cap, and g_parm.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from enum_input and g_tuner.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from enum_input and g_tuner.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Some code was calling v4l2_video_std_construct() when all it cared about
was the frame period. So make a function that just returns that and have
v4l2_video_std_construct() use it.
At this point there are no users of v4l2_video_std_construct() left outside
of v4l2-ioctl, so it could be un-exported and made static.
Change v4l2_video_std_construct() so that it doesn't zero out the struct
v4l2_standard passed in. It's already been zeroed out in the common ioctl
code.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
If an ioctl is read-only then the driver fills in all the fields. Lots of
times drivers only care about some fields so it's best if video_ioctl2
takes care of zeroing out the entire structure before handing it to the
driver. This saves code in each driver to do it and driver authors often
forget.
The existing memset code in some of the read-only ioctl handlers
can be deleted.
Convert a case statement to a single if statement.
Deleted a debug line from ENUMAUDOUT that was copy-and-pasted to G_AUDOUT
by mistake.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
There are many RW ioctls() in v4l2 where userspace only supplies one or two
of the first fields in the structure passed to the ioctl. The driver then
fills in the rest of the fields.
Instead of copying the entire structure from userspace to the kernel we
only need to copy those fields that userspace is actually supposed to
supply.
What's more, the fields that are meant to be only be output from the driver
can be zeroed out in the videodev code, in case the driver doesn't fill
them all in. Many of the ioctl handlers in v4l2_ioctl do this already, but
my patch does this at one common point and so all the memsets for each
ioctl can be deleted.
For VIDIOC_G_SLICED_VBI_CAP, which has one input field ('type') and other
output-only fields, the input field is near the end of the structure
instead of at the beginning. So there is still a memset in it's ioctl
handler to zero out the beginning of the struct.
There were a couple mistakes with the existing code:
For VIDIOC_G_AUDIO the index field was preserved, but G_AUDIO is a read
only ioctl so nothing is copied from userspace to preserve.
For VIDIOC_G_FREQUENCY the tuner field was not preserved like it should
have been. This would be a problem if there was any hardware with more
than one tuner/modulator.
For VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS, none of the
fields were preserved even though each ioctl has several field that are
supposed to be inputs to the driver! Obviously these ioctls don't get
used much. The index field is needed if the driver has multiple
discrete sizes/rates and other fields can be used too, e.g. if the size
depends on pixel format or frame rate depends on image size for
example.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add support for NetUP Dual DVB-S2 CI card
The card based on cx23885 PCI-e bridge, CiMax SP2 Common Interface chips,
STM lnbh24 LNB power chip, stv6110 tuners and stv0900 demodulator.
http://www.linuxtv.org/wiki/index.php/NetUP_Dual_DVB_S2_CI
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add CIMax2 Common Interface code for NetUP Dual DVB-S2 CI card.
SmarDTV CIMax(R) SP2 is Dual CableCARD, DVB Common Interface
and OpenCable Hardware Controller.
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>
Add init code for NetUP Dual DVB-S2 CI card
The card based on cx23885 PCI-e bridge, CiMax SP2 Common Interface chips,
STM lnbh24 LNB power chip, stv6110 tuners and stv0900 demodulator.
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>
For VIDIOC_QUERYBUF only the first two fields, size and type, are used as
input. The rest can be filled in by the driver as output. Most drivers do
not actually use all the field and unused ones should be zeroed out. Some
drivers have code to do this and some drivers should but don't. So put
some zero out code in v4l2_ioctl so that all drivers using that system get
it.
The drivers that have zeroing code get that code removed.
Some drivers checked that the type field was valid, but v4l2_ioctl already
does this so those checks can be removed as well.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
A recent patch added a forward declaration of cx88_core right before the
main definition of that structure, which is obviously unneeded.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
video_register_device_index() checks if it was passed a NULL video_device
pointer (which isn't allowed) _after_ it has already dereferenced it with
video_get_drvdata(vdev). The checks are clearly pointless and can be
removed, as the function would have crashed before reaching them if vdev
ever was NULL.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Remove variables that were holdovers from ivtv for supporting the CX23415
MPEG decoder output.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Give messages originating from internal subdevs a header using the subdev's
name. Fixed an uninitialized variable problem with reading the EEPROM, noticed
from log output. Got rid of the unused cx18_av_exit() function.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
We leaked buffers every time a device was removed, if the user had enabled
sliced VBI insertion into the MPEG stream. MythTV uses that.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Convert GPIO line functions, such a audio routing and device resets, to
v4l2_subdevices. This essentially completes the conversion of cx18 to the
v4l2_device/v4l2_subdevice framework. No regression testing has taken place as
of yet. Also an ivtv legacy bug with GPIO mux routing and going to/from radio
mode was commented, but not fixed.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This is a major perturbation to cx18 I2C device handling to convert it to the
v4l2_device/subdeivce framework. This change breaks GPIO audio multiplexer
control for the time being. It will be fixed in a coming change.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Added a new chip identifer to v4l2-chip-ident for the integrated A/V broadcast
decoder core internal to the CX23418. Completed separation and encapsulation
of the A/V decoder core interface as a v4l2_subdevice. The cx18 driver now
compiles and links again.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Convert card instance handling to a lighter weight mechanism like ivtv.
Also convert name strings and debug messages to use v4l2_device.name.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This is the next step in converting the cx18 driver to use the v4l2_device/
v4l2_subdevice framework. This is a straightforward conversion of the
cx18_av_*[ch] files. It compiles, but leaves the driver in an unlinkable
state at the moment.
Note, the cx18 integrated A/V digitizer will now make a host match at address 1,
as far as v4l2-dbg is concerned. That means it identifies itself as a separate
"chip", and acts as an alias to the integrated A/V decoder registers that are
also available with the host match at address 0.
Signed-off-by: Andy Walls <awalls@radix.net>
[mchehab@redhat.com: fix merge conflicts due to the removal of v4l2_ctrl_query_fill_std()]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Added usb vendor/product id for Kaiser Baas Video to DVD maker.
Thanks to Trevor Campbell <tca42186@bigpond.net.au> for providing all data and tests needed to add this card to em28xx driver.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Added SIIG AVTuner-PVR to the right entry.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Removed EM2821_BOARD_PROLINK_PLAYTV_USB2 entry.
This entry has a incorrect tuner set.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Now, just a few modules are still dependent of this legacy header:
$ grep -l DECODER_ `find linux/drivers/media/ -name '*.[ch]' -exec grep -l video_decoder '{}' \;`
linux/drivers/media/video/v4l2-ioctl.c
linux/drivers/media/video/indycam.c
linux/drivers/media/video/saa7191.c
linux/drivers/media/video/vino.c
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Zoran doesn't do autoprobing anymore, so remove support for this from the
i2c modules.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Thanks to Jean Delvare for pointing this out.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
By popular request increased the default number and size of the buffers
to something that tvtime likes.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The zoran i2c modules were still using V4L1 internally. Replace this
with V4L2. Also deleted saa7111.c and saa7114.c, we use saa7115.c instead.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[mchehab@redhat.com: fix v4l2_ctrl_query_fill_std merge conflict]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
count == 0 has a special meaning, implement this.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Actually try to turn the format into something usable rather than just
rejecting it if it isn't perfect.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Remove bogus check on bytesperline in the try_fmt_vid_out call.
Just set it to 0.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Devices like the saa7111 do not have this register, so check for this
before using it.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l2_ctrl_query_fill_std() function wasn't one the best idea I ever had.
It doesn't add anything valuable that cannot be expressed equally well with
v4l2_ctrl_query_fill and only adds overhead.
Replace it with v4l2_ctrl_query_fill() everywhere it is used and remove it
from v4l2_common.c.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add small function to retrieve the i2c address from a v4l2_subdev
pointer.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The controls V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET changed their type
to button controls (these are unused at the moment, so this is a safe change).
The controls V4L2_CID_PAN_RELATIVE, V4L2_CID_TILT_RELATIVE, V4L2_CID_FOCUS_RELATIVE
and V4L2_CID_ZOOM_RELATIVE are marked as write-only controls.
Cc: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch fixes an other bug of the kernel bug report 12737.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch fixes one bug of the kernel bug report 12737.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Multiple fixes:
1. allow register update by setting the Output Control register to 2 and not 3
2. fix scaling factor calculations
3. recover lost HFLIP control
4. fix Global Gain calculation
Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Currently, if an soc-camera device, connected to the sh_mobile_ceu_camera
camera host driver, supports several formats from the UYVY, VYUY, YUYV, YVYU
set, the driver would add four NV* formats for each of them. This patch fixes
this misbehaviour.
Reported-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
sh_mobile_ceu_camera.c support for signal polarity flags isn't platform
dependent, provide them locally. Only the bus width is implementation
specific.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Acked-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Color format regs array had been used, but it was not easy to understand
what to want to do, and additional bit became complex.
This patch modify this problem.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
soc_camera framework requires, that camera configuration is performed in
set_fmt, and start_capture and stop_capture only turn the camera on/off.
This patch modifies ov772x to comply to this requirement.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
All soc-camera camera and host drivers must specify supported data signal
polarity, after all drivers are fixed, we'll add a suitable test to
soc_camera_bus_param_compatible().
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
because they might design two of those chips on a single board.
You never know.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
As reported by Vitaly Wool <vital@embeddedalley.com>:
> about half a year ago I posted the patch that basically enabled Compro
> VideoMate For You USB TV box support.
> The main problem is I couldn't get the sound working.
> So I kind of decomposed the box and found out the audio decoder chip
> used there was Philips TDA9874A. As far as I can see, it's not supported
> within the em28xx suite although it is for other TV tuner drivers.
A tvaudio modprobing confirms that tda9874a chip is accessible via i2c:
tvaudio: TV audio decoder + audio/video mux driver
tvaudio: known chips: tda9840, tda9873h, tda9874h/a, tda9850, tda9855, tea6300, tea6320, tea6420, tda8425, pic16c54 (PV951), ta8874z
tvaudio' 1-0058: chip found @ 0xb0
tvaudio' 1-0058: tvaudio': chip_read2: reg254=0x11
tvaudio' 1-0058: tvaudio': chip_read2: reg255=0x2
tvaudio' 1-0058: tda9874a_checkit(): DIC=0x11, SIC=0x2.
tvaudio' 1-0058: found tda9874a.
tvaudio' 1-0058: tda9874h/a found @ 0xb0 (em28xx #0)
tvaudio' 1-0058: tda9874h/a: chip_write: reg0=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg1=0xc0
tvaudio' 1-0058: tda9874h/a: chip_write: reg2=0x2
tvaudio' 1-0058: tda9874h/a: chip_write: reg11=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg12=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg13=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg14=0x1
tvaudio' 1-0058: tda9874h/a: chip_write: reg15=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg16=0x14
tvaudio' 1-0058: tda9874h/a: chip_write: reg17=0x50
tvaudio' 1-0058: tda9874h/a: chip_write: reg18=0xf9
tvaudio' 1-0058: tda9874h/a: chip_write: reg19=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg20=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg24=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg255=0x0
tvaudio' 1-0058: tda9874a_setup(): A2, B/G [0x00].
tvaudio' 1-0058: tda9874h/a: thread started]
This patch automatically loads tvaudio when needed (currently, only
with this board).
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
At least 3 Vimicro cameras (0x332d, 0x3410 and 0x3420) fail to return correct
bandwidth information. The first model rounds the value provided by the host
to the nearest supported packet size, while the other two always request the
maximum bandwidth.
Introduce a device quirk to override the value returned by the device with an
estimated bandwidth computed by the driver from the frame size and frame rate,
and enable it for all Vimicro cameras.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Devices may send a zero-length packet to signal the end of a bulk payload. If
the payload size is a multiple of the URB size the zero-length packet will be
received by the URB completion handler. Handle this by ignoring all empty URBs.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The UVC specification requires SET_CUR requests on the streaming commit control
to use values retrieved from a successful GET_CUR request on the probe control.
Initialize streaming parameters with the probe control current value to make
sure the driver always complies.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
- add v4l2_device
- remove BKL
- make the debug parameter settable on the fly
- set bus_info in querycap
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Remain consistent in the naming: fields pointing to v4l2_device should
be called v4l2_dev. There are too many device-like entities without
adding to the confusion by mixing naming conventions.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Some drivers (e.g. for ISA devices) have no parent device because there
is no associated bus driver. Allow the parent device to be NULL in
those cases when registering v4l2_device.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
get_index() had a limitation of 32 devices per driver. This was
unnecessarily strict and has been replaced with the maximum number
of devices. That should really satisfy anyone!
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add initial support for cameras based on the SQ Technologies SQ-905
chipset (USB ID 2770:9120) to V4L2 using the gspca infrastructure.
Currently only supports one resolution and doesn't attempt to inform
libv4l what image flipping options are needed.
Signed-off-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
- prevent application oops when the device is disconnected
- wake up the application at disconnection time
- check the disconnection in ioctl dqbuf and poll
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Added support for I2C device at address 0x40 and subaddress 0x0d/0x0b
that provides remote control key reading support for AVerMedia Cardbus
Hybrid card, possibly for other AVerMedia Cardbus cards.
The I2C address 0x40 doesn't like the SAA7134's 0xfd quirk, so it was
disabled.
[mchehab@redhat.com: CodingStyle fixes]
Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix printk format warning:
drivers/media/video/zoran/zoran_driver.c:345: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'phys_addr_t'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The C99 specification states in section 6.11.5:
The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.
Cc: Jean-Francois Moine <moinejf@free.fr>
Cc: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Make correction to composite input plus svideo input to Avermedia E506R
Signed-off-by: Tim Farrington <timf@iinet.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The bttv driver had static array of structures for up to 16 possible bttv
devices, even though few users have more than one or two. The structures
were quite large and this resulted in a huge BSS segment.
Change the driver to allocate the bttv device data dynamically, which
changes "struct bttv bttvs[BTTV_MAX]" to "struct bttv *bttvs[BTTV_MAX]".
It would be nice to get ride of "bttvs" entirely but there are some
complications with gpio access from the audio & mpeg drivers.
To help bttvs removal along anyway, I changed the open() methods use the
video device's drvdata to get the driver data instead of looking it up in
the bttvs array. This is also more efficient. Some WARN_ON()s are added
in cases the device node exists by the bttv device doesn't, which I don't
think should be possible.
The gpio access functions need to check if bttvs[card] is NULL now. Though
calling them on a non-existent card in the first place is wrong, but hard
to solve given the fundamental problems in how the gpio access code works.
This patch reduces the bss size by 66560 bytes on ia32. Overall change is a
reduction of 66398 bytes, as the WARN_ON()s add some 198 bytes.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Over half of the card database was used to store muxsel data. 64 bytes
were used to store one 32 bit word for each of up to 16 inputs.
The Bt8x8 only has two bits to control its mux, so muxsel data for 16
inputs will fit into a single 32 bit word. There were a couple cards that
had special muxsel data that didn't fit in two bits, but I cleaned them up
in earlier patches.
Unfortunately, C doesn't allow us to have an array of bit fields. This
makes initializing the structure more of a pain. But with some cpp magic,
we can do it by changing:
.muxsel = { 2, 3, 0, 1 },
.muxsel = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 1 },
Into:
.muxsel = MUXSEL(2, 3, 0, 1),
.muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
That's not so bad. MUXSEL is a fancy macro that packs the arguments (of
which there can be one to sixteen!) into a single word two bits at a time.
It's a compile time constant (a variadic function wouldn't be) so we can
use it to initialize the structure. It's important the the arguments to
the macro only be plain decimal integers. Stuff like "0x01", "(2)", or
"MUX3" won't work properly.
I also created an accessor function, bttv_muxsel(btv, input), that gets the
mux bits for the selected input. It makes it cleaner to change the way the
muxsel data is stored.
This patch doesn't change the code size and decreases the datasegment by
9440 bytes.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This card apparently uses an external mux and the Bt878's mux should always
be set to MUX2. The values for the external mux control bits were stored
in the muxsel field. This meant that when changing inputs the driver would
switch the Bt878's mux to whatever value the external mux was supposed to
be set to, then eagle_muxsel() would switch it back to MUX2 and program the
external mux. This creates an unnecessary switch of the Bt878's mux.
So change muxsel to be 2 for each input. The external mux bits are just
"input&3" so they don't really need to be stored anywhere. This also
eliminates the last non-standard use of the muxsel data.
Cc: M G Berberich <berberic@fmi.uni-passau.de>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Old versions of the bttv driver would use the high nibble of an input's
muxsel value to program the GPIO lines enabled via gpiomask2. Apparently
this was supposed to be for switching external audio muxes. Anyway, the
code that did this was removed sometime in the pre-git 2.6 series.
The RemoteVision MX board used this feature to control an external video
mux and I guess no one noticed when they removed the code.
Move the extra gpio mux data out of the high nibble of muxsel and to
rv605_muxsel(), then have that function set the gpio lines with it.
From looking at the CD22M3494E datasheet, it seems like the mdelay(1) is a
much longer delay than necessary. It looks like only around 20 ns is
necessary.
Cc: Miguel Freitas <miguel@cetuc.puc-rio.br>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Old versions of the bttv driver would use the high nibble of an input's
muxsel value to program the GPIO lines enabled via gpiomask2. Apparently
this was supposed to be for switching external audio muxes. Anyway, the
code that did this was removed sometime in the pre-git 2.6 series.
These phytec boards used this feature to control an external video mux and
I guess no one noticed when they removed the code.
So add a muxsel_hook for these boards that does the necessary gpio setting.
BTW, I doubt the needs_tvaudio setting for these cards is correct.
Cc: Dirk Heer <d.heer@phytec.de>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The card data for BTTV_BOARD_IVC120 set muxsel to a bunch of bogus values
(1 to 16), which the common mux code would use to set the Bt878's mux to
some random value. Then the custom code in ivc120_muxsel() would change
the Bt878's mux to the right value (always MUX0).
Better to just make the muxsel data correct (all zeros, easy!) and get the
mux right to begin with. Then the extra Bt878 mux setting code in
ivc120_muxsel() can be eliminated (the rest of the code for the IVC-120G's
external mux is still there of course).
This will help me clean up muxsel for some other changes. It should also
get rid of an unnecessary mux switch when changing from certain inputs to
certain other inputs on the IVC-120G.
Cc: Alan Garfield <alan@fromorbit.com>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The code was using a muxsel value of -1U to indicate a digital input. A
couple places in were checking of muxsel < 0 to detect this, which doesn't
work of course because muxsel is unsigned and can't be negative.
Only a couple cards had digital inputs and it was always the last one, so
for the card database create a one bit field that indicates the last input
is digital. On init, this is used to set a new field in the bttv struct to
the digital input's number or UNSET for none. This makes it easier to
check if the current input is digital.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The bttv card database is quite large and the data structure used to store
it wasn't very efficient. Most of the field are only used at card
initialization time so it doesn't matter if they aren't efficient to
access.
Overall the changes reduce code size by 60 bytes in ia32. The data size is
decreased by 5024 byes. It is probably even more for 64-bit kernels.
Move the fields in the struct around to be sorted from largest to smallest.
This saves on padding space used for alignment.
Get rid of the unused digital_mode field. Leave the setting as a comment
in the few cards entries that set it, in case someone ever writes the code.
Get rid of the unused audio_inputs field. Leave the values in the card
entries in case someone ever writes code that might use it.
Get ride of the unused radio_addr field. No card entries even set it to
anything interesting so it's not left as comments. All the code that used
it was removed in commit v2.6.14-3466-g291d1d7 from Nov 8th 2005.
Reduce video_inputs to u8 as no card has more than 255 inputs (the most is
16).
Change tuner_addr to u8. I2C addresses are only seven bits and 255 means
ADDR_UNSET, so everything fits.
Make has_radio a one bit flag.
Make the pll setting a two bit field.
Reduce svhs to four bits as no card has an s-video input above 9. Change
the value for no s-video input from UNSET (which is -1U and out of range of
four bits) to NO_SVHS (which is now 15).
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The bttv card database structure had a "tuner" field that was the input
number of the tuner input or UNSET for no tuner. However, the only values
it could ever be are 0 and UNSET. Having a tuner on an input other than 0
didn't work and was never used.
There is also a "tuner_type" field that can be set to TUNER_ABSENT to
indicate no tuner, which makes "tuner = UNSET" redundant. In many cases,
tuner_type was set to UNSET when there was no tuner, which isn't quite
correct. tuner_type == UNSET is supposed to mean the tuner type isn't yet
known.
So, I changed cards where "tuner == UNSET" to always have tuner_type of
TUNER_ABSENT. At this point the tuner field is redundant, so I deleted it.
I have the card setup code set the card's tuner_type (not the card type's
tuner_type!) to TUNER_ABSENT if it hasn't yet been set at the end of the
setup code. Various places that check if the card has a tuner will now
look for this instead of checking the card type's "tuner" field.
Also autoload the tuner module before issuing the TUNER_SET_TYPE_ADDR I2C
client call instead of after issuing it.
Overall, on ia32 this decreases compiled code size by about 24 bytes and
reduces the data size by 640 bytes.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The code to set the norm for the TDA9880 analog demod was comparing
btv->norm, an index into the bttv driver's norm array, to V4L2_STD_NTSC,
which is a bit flag that's part of the V4L2 API. This doesn't work of
course and results in the PAL path always being taken.
What's more, it modified the bttv_tvcards[] entries for cards using the
TDA9880. This is wrong because changing the norm on one card will also
affect other cards of the same type. Writing to bttv_tvcards is also bad
because it should be read-only or even devinitdata.
Changing the norm would also cause the audio to become unmuted.
Have the code get called for both norm setting and audio input setting
(which where the gpios are set) to avoid needed to modify bttv_tvcards.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The norm value in the driver is an index into an array and the the driver
doesn't allow it to be negative or otherwise invalid. It should be
unsigned but wasn't in all places.
Fix some structs and functions to have the norm be unsigned. Get rid of
useless checks for "< 0". Most of the driver code can't handle a norm
value that's out of range, so change some ">= BTTV_TVNORMS" checks to
BUG_ON(). There's no point in silently ignoring invalid driver state just
to crash because of it later.
Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Added board Pinnacle Dazzle Video Creator Plus DVC107 to name description field.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Control arrays as are used with v4l2_ctrl_next must be sorted from
low to high. Add a comment at the top of all such arrays to warn
about this.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
In order to convert the v4l1 zoran and vino i2c drivers to v4l2 these
extra ops are required.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The cx2341x_mpeg_ctrls array must be ordered by control ID. I know that
this is bad design, but for now I will just fix this bug and revisit it
when all drivers have moved to v4l2_device/v4l2_subdev, since that will
allow me to do greatly improve control handling.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Lots of coding style fixes and a typo correction for em28xx.
[dougsland@redhat.com: fixed a reject due to a change on em28xx-audio.c]
Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patch removes printk and place em28xx_errdev macros to provide
information about driver name to dmesg.
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Essentially if a snd_em28xx_capture_trigger() stop followed by a snd_em28xx_capture_trigger() start would not yield any
data because there was some logic put in with an adev->shutdown variable which did not seem warranted in my humble opinion.
It would cause snd_em28xx_capture_trigger start never to start up the audio stream until the device was closed and
reopened again. Upon re-opening the device adev->shutdown is reset and audio data would again flow.
Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix for em28xx memory leak and function rename
Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Removed bad check. Thanks to Robert Krakora <rob.krakora@messagenetsystems.com>
to report that.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kaiomy entry.
Thanks to Peter Senna Tschudin <peter.senna@gmail.com> for borrow me one
of those devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
KBL is not needed on saa7134, so, let's remove it.
However, we should take some care to avoid opening the module while
initializing it. This issue exists with newer udev's that opens a device
as soon as the driver is registered. So, a proper lock is needed on
open.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix two broken controls where a step weren't specified. Without a step,
userspace apps won't allow to adjust such controls.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Some saa7134 devices require to open an i2c gate before tuning. This
patch fix the initialization for those devices.
The nxt200x_gate_ctrl() logic were returned back to the old place, since
we don't know how to close the gate. A future pacth could revert that
change and provide the proper close gate control, to avoid keeping it
open forever.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
On certain devices, before opening a tuner, we need to open the tuner
gate via i2c.
This patch just moves the tuner probing code to the same place where
such i2c commands are handled, to make easier to fix this trouble on
later patches.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Modified mxb to load the i2c modules through v4l2_subdev. So no more probing.
Modified tea6415c and tea6420 to use the standard routing ops to do the
routing, rather than using private commands. Dropped the private commands
from tda9840 (they were never used except during initialization of the
module).
Added saa7146 support for VIDIOC_DBG_G_CHIP_IDENT.
Converted saa5246a and saa5249 to v4l2_subdev.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Drivers that implement this always have to set the ident and revision
to V4L2_IDENT_NONE and 0. Do this in the v4l2 core so drivers don't have
to do this.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Use consistent naming for pci_dev, v4l2_device and video_device.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The raw video device didn't report the image size correctly.
When setting a new image the image height has to be a multiple of 32 lines.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sliced VBI, in the manner that ivtv implements it as a separate data stream,
now works for 525 line 60 Hz systems like NTSC-M. It may work for 625 line
50 Hz systems, but I have more engineering work to do, to verify it is operating
properly. Sliced data insertion into the MPEG PS should be working, but is
untested.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The cx23418 appears to send Raw VBI buffers with a PTS on a per frame
basis, not per field, so process Raw VBI on a whole frame basis and reduce
some complexity. Fix VBI buffer size computation to handle a whole
frame of Raw VBI for a 625 line system, which is the worst case and will
work for 525 lines systems as well.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fixed an endianess problem with the collection of the PTS from
the VBI buffer given to us by the encoder. Also extrapolated the
last 12 bytes of the last line of each field, to remove artifacts
created by removing the first 12 bytes of each field for raw VBI.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The driver was incorrectly setting 0 line counts in a firmware
API call to set the maximum amount of lines per field.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The Encoder will only allow the Raw VBI parameters, along with a number of
other API parameters, to take effect when no analog captures are in
progress. These parameters must be set before the first analog capture starts,
be it MPEG, VBI, YUV, etc., and cannot be changed until the last one stops. It
is not obvious to me what capture channel API parameters are shared and which
ones must be set per capture channel, so set them all for every analog
capture channel start up. This fixes the driver so that VBI capture can be
started up after the MPEG capture is going.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
More sliced VBI fixes to bring the cx18 driver closer to full V4L2 spec
compliance for VBI and to get sliced VBI working better.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The old code from ivtv used a CX23415/6 PTS, which was simply left at 0 in the
cx18 driver. Since the CX23418 gives us what I think is a PTS (or some other
90 kHz clock count) with each VBI buffer, this change has the cx18 driver use
that as a PTS.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The CX18_AUDIO_ENABLE register usually never reads back what was just written
under normal circumstances. Perform better checking that a write went to the
register as expected with a specification of what bits to verify.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch also enables the autogain for the mt9v111.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The mi1310_soc sequences come from the ms-win driver C0130Dev.inf.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
I2C_DRIVERIDs are phased out. Remove those that are unused at the moment.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
A hue of -128 was rejected due to an incorrect range check, which was
faithfully copy-and-pasted into four drivers...
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Most boards nowadays supports saa7134-alsa. Even some of they doesn't have any
option to wire an audio cable. So, lets load saa7134-alsa by default, if the
board is not based on saa7130 and if saa7134-alsa is compiled.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
saa7134: Fix tuner access on Kworld ATSC110
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The lack of the green color is fixed by sensor sequences closer to the
ms-win traces.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The webcams worked only one time after connection.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>