Commit Graph

3234 Commits (a3a048cea301baba5d451991074a85dc20a8f228)

Author SHA1 Message Date
Hans Verkuil 18e16f9c95 V4L/DVB (6342): ivtv: fix circular locking (bug 9037)
If you try to access the video device from within an udev rule,
then you get into a circular locking situation.

Changed the driver to postpone the registration of the devices until
everything else has been fully initialized, so that the newly created
device can be used immediately.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:47 -02:00
Hans Verkuil 34ca7d3791 V4L/DVB (6341): ivtv: fix resizing MPEG1 streams
Resizing an MPEG 1 stream would cut off the right half of the
image due to a missing divide by 2 in VIDIOC_S_FMT.

Also did some minor cleanup in this part of the code.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:46 -02:00
Ian Armstrong 6659e3ed55 V4L/DVB (6340): ivtvfb: screen mode change sometimes goes wrong
This patch partially reverts a previous change that caused the
CX2341X_OSD_SET_PIXEL_FORMAT firmware calls to be skipped when the pixel
format of the framebuffer wasn't altered by FBIOPUT_VSCREENINFO.

Unfortunately, another firmware call on the PVR350 sometimes scrambles the
display when trying to adjust the framebuffer settings. This patch re-enables
the CX2341X_OSD_SET_PIXEL_FORMAT calls to try and prevent this from
occurring.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:45 -02:00
Hans Verkuil 4339ab9365 V4L/DVB (6339): ivtv: set the video color to black instead of green when capturing from the radio
Thanks-to: Martin Dauskardt <md001@gmx.de>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:44 -02:00
Hans Verkuil af3420b449 V4L/DVB (6338): ivtv: fix incorrect EBUSY return
Trying to open the radio when a capture is in progress will make it
impossible to open the radio again since the radio stream wasn't released.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:44 -02:00
Trent Piepho a04036a312 V4L/DVB (6336): cx8802: Plug memory leak when unregistering a driver
When a cx8802 sub-driver was unregistered, the struct cx8802_driver, which was
kmalloc()ed by cx8802_register_driver(), was deleted from the list of drivers,
but never freed.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho 89a47942f0 V4L/DVB (6335): cx8802: Replace list_for_each+list_entry with list_for_each_entry
Less code and more efficient.

Got ride of a variable that counted the number of devices in
cx8802_unregister_driver() but was never used.  Looked leftover from a
cut&paste.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho 081c2fc8b9 V4L/DVB (6334): cx88: Change (struct cx8802_dev)->drvlist to a list_head and fix bugs
It was a struct cx8802_driver for no apparent reason.  Nothing uses a
cx8802_driver in the cx8802_dev struct.  The only field that was used was
devlist, a list_head.

The code in cx8802_remove() that removed any loaded sub-drivers was broken.
It would delete the current list entry, but didn't use list_for_each_safe.  It
also called list_del() on the list _head_ inside the list_for_each loop?  It
would crash if it was run, which I don't think can ever happen.

Since the cx8802 sub-drivers use the cx8802 driver, they have to be unloaded
first.  So there isn't any way for a sub-driver to still be loaded when
cx8802_remove() is called...  Except maybe with PCI hot-plug, if one removes
the PCI card while the drivers are loaded?

So I left some code in to handle that if it's actually possible.  It will
remove the sub-drivers from the device cx8802_remove() was called on, and only
that device.  If one has two DVB cards and unplugs one, there is no reason to
unload the DVB drivers for both cards.  I have no way to test this, but it
can't be worse than what was there before.

cx8802_get_driver() is passed a cx8802_dev pointer and looks for the requested
driver on that device.  It first loops over the cx8802 device list looking for
the device it was passed, which is pointless.  It doesn't need to find the
device pointer in the list, as it already has the pointer.

The list_head in the cx8802_driver struct, which joins all the _drivers_
attached to a device, was named devlist.  Changed that to drvlist, since the
devlist is used for a list of _devices_ in other cx8802 structs.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho f0ad90975b V4L/DVB (6333): cx88: Change void* card_priv to struct vp3054_i2c_state
card_priv was only used to store a pointer to the vp3054 state struct.
There's no need to use a void * since it doesn't have multiple types.

Make the field conditional on VP3045 support.  It was already conditional on
DVB support, but it's only used if VP3045 support is on, so that makes for a
better option to check.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:42 -02:00
Trent Piepho 7717cbedd9 V4L/DVB (6332): cx88: Only include the blackbird fields if blackbird is selected
Add some ifdefs around fields only used for blackbird support, similar to the
way the dvb fields are only included with dvb support.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:42 -02:00
Maxim Levitsky ea63d0b11e V4L/DVB (6330): V4L: saa7134: Fix interaction between tvaudio thread and the freezer
make tvaudio thread freezeable, and add proper support for that

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:41 -02:00
Maxim Levitsky c458473ebf V4L/DVB (6329): Additional Fixes for saa7134 suspend/resume
Fixes few more problems I found in my saa7134 resume code:

* Race between IRQ handler and .suspend()/.resume() functions

* Removes timeout timers on active buffers - those
	buffers will be recaptured after resume

* Adds suspend/resume for IR code - probably
	necessary if using polling mode

* Adds #ifdef CONFIG_PM overs suspend code

* Runs  a quirk in set_tvnorm in suspend/resume too

* Rearranges the order of calls in saa7134_resume to
	be exactly as in saa7134_initdev thus the card is
	initialized in exactly the same way

* Since DMA audio capture suspend/resume isn't yet supported,
	avoid re-enabling it on resume for now

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:41 -02:00
Adrian Bunk 7e7f05ca15 V4L/DVB (6328): ivtv: fix NULL dereference
We shouldn't dereference "itv" when we know it's NULL...

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:40 -02:00
Michael Krufky 1419683d85 V4L/DVB (6326): tuner-core.c: fe_has_signal() can return uninitialized value
Initialize strength to zero.

Thanks to Adrian Bunk, who spotted this with the Coverity checker.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:39 -02:00
Florin Malita fcf94c89af V4L/DVB (6325): Double-free in cx23885_initdev
Both cx23885_initdev and cx23885_dev_setup free the device in their
error path so a failure in the latter causes a double-free. Since
cx23885_dev_setup is only called from cx23885_initdev, it should be safe
to remove its deallocation and leave the cleanup up to the allocating
function.

Coverity CID 1922.

Signed-off-by: Florin Malita <fmalita@gmail.com>
CC: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:36 -02:00
Pekka Enberg a13625c518 V4L/DVB (6324): fix videobuf_cgmbuf export
As videobuf_cgmbuf is defined only if CONFIG_VIDEO_V4L1_COMPAT is enabled,
move the EXPORT_SYMBOL_GPL declaration inside the #ifdef block.  Fixes
compilation for x86_64 defconfig.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:35 -02:00
Jiri Slaby 475d526311 V4L/DVB (6323): V4L: cinergyT2, remove bad usage of ERESTARTSYS
cinergyT2, remove bad usage of ERESTARTSYS

test of cinergyt2->disconnect_pending doesn't ensure pending signal and so
ERESTARTSYS would reach userspace, which is not permitted. Change it to
EAGAIN.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:31 -02:00
Hans Verkuil 3bcc95760c V4L/DVB (6321): Remove obsolete VIDIOC_S/G_MPEGCOMP ioctls
Remove the obsolete VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP ioctls from
the V4L2 API as per the removal schedule (October 2007).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:30 -02:00
Mauro Carvalho Chehab 22c4a4e98e V4L/DVB (6320): v4l core: remove the unused .hardware V4L1 field
struct video_device used to define a .hardware field. While
initialized on severl drivers, this field is never used inside V4L.
However, drivers using it need to include the old V4L1 header.

This seems to cause compilation troubles with some random configs.
Better just to remove it from all drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:24 -02:00
Pekka Seppänen 786e9d4c3f V4L/DVB (6319): radio-gemtek: fix 'VID_HARDWARE_GEMTEK' undeclared
Remove obsolete V4L v1 reference.

Thanks to Ingo Molnar for pointing this issue.

Signed-off-by: Pekka Seppänen <pexu@kapsi.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:19 -02:00
Trent Piepho bbaccc0445 V4L/DVB (6187): cx88-alsa: Add TLV support
Lets mixer apps display a dB range for the volume control.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:18 -02:00
Trent Piepho 54ac005adc V4L/DVB (6185): cx88-alsa: Add mute controls, change control names
Add two mute controls.  One mutes everything, the other just mutes the analog
pass-through output.

Rename the existing volume control.  The controls are now:
Playback Volume
Playback Switch
Capture Switch

These names might seem odd, but I believe they are more correct.  The previous
"Capture Volume" control didn't actually effect the volume of the captured
audio.  Instead it controls the volume of the analog pass-thought output.  It
appears that pass-through controls like this are usually considered to be in
the playback direction, not capture.  For example, "CAPTURE feedback Playback
Volume" is the name used for a control that appears to have the same effect in
the ca0106 driver.  We only have one volume control, so we can omit the
"CAPTURE feedback" part.

If someone where to add PCM playback support to the driver, then this would be
the volume control.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:16 -02:00
Marcin Garski db955170d4 more UTF-8 conversions
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:22:11 +02:00
Jan Engelhardt 96de0e252c Convert files to UTF-8 and some cleanups
* Convert files to UTF-8.

  * Also correct some people's names
    (one example is Eißfeldt, which was found in a source file.
    Given that the author used an ß at all in a source file
    indicates that the real name has in fact a 'ß' and not an 'ss',
    which is commonly used as a substitute for 'ß' when limited to
    7bit.)

  * Correct town names (Goettingen -> Göttingen)

  * Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313)

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:21:04 +02:00
Robert P. J. Day 3a4fa0a25d Fix misspellings of "system", "controller", "interrupt" and "necessary".
Fix the various misspellings of "system", controller", "interrupt" and
"[un]necessary".

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:10:43 +02:00
Pavel Emelyanov ba25f9dcc4 Use helpers to obtain task pid in printks
The task_struct->pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.

The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.

[akpm@linux-foundation.org: git-drm went and changed lots of stuff]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:43 -07:00
Jiri Slaby 7b19ada2ed get rid of input BIT* duplicate defines
get rid of input BIT* duplicate defines

use newly global defined macros for input layer. Also remove includes of
input.h from non-input sources only for BIT macro definiton. Define the
macro temporarily in local manner, all those local definitons will be
removed further in this patchset (to not break bisecting).
BIT macro will be globally defined (1<<x)

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: <dtor@mail.ru>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: <lenb@kernel.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Cc: <perex@suse.cz>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: <vernux@us.ibm.com>
Cc: <malattia@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:42 -07:00
Jiri Slaby 1977f03272 remove asm/bitops.h includes
remove asm/bitops.h includes

including asm/bitops directly may cause compile errors. don't include it
and include linux/bitops instead. next patch will deny including asm header
directly.

Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:41 -07:00
Ralf Baechle e8c44319c6 Replace __attribute_pure__ with __pure
To be consistent with the use of attributes in the rest of the kernel
replace all use of __attribute_pure__ with __pure and delete the definition
of __attribute_pure__.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Bryan Wu <bryan.wu@analog.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:32 -07:00
Rafael J. Wysocki e42837bcd3 freezer: introduce freezer-friendly waiting macros
Introduce freezer-friendly wrappers around wait_event_interruptible() and
wait_event_interruptible_timeout(), originally defined in <linux/wait.h>, to
be used in freezable kernel threads.  Make some of the freezable kernel
threads use them.

This is necessary for the freezer to stop sending signals to kernel threads,
which is implemented in the next patch.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:19 -07:00
Jaroslav Kysela c1017a4cdb [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16 16:51:18 +02:00
Al Viro 64a6f9500d signedness: module_param_array nump argument
... should be unsigned int

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-14 12:41:52 -07:00
Jean Delvare cdeec3cc79 cx23885: Drop empty i2c algorithm control callback
i2c_algorithm.algo_control is about to be removed.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-13 23:56:32 +02:00
David Brownell 3be27d37c2 i2c: Remove NOP i2c_algorithm.algo_control() methods
This removes NOP implementations of i2c_algorithm.algo_control.

With this change, there are no implementations of this hook in
the kernel.org tree ... that hook seems about ripe to remove.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-10-13 23:56:32 +02:00
Al Viro 13bcd5d0e2 v4l: copy_to_user() is not a good method name
Breaks on any target that has copy_to_user() defined as a non-trivial
macro.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-13 09:58:59 -07:00
Greg Kroah-Hartman 7e7654a92a cdev: remove unneeded setting of cdev names
struct cdev does not need the kobject name to be set, as it is never
used.  This patch fixes up the few places it is set.


Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-12 14:51:02 -07:00
Kay Sievers 7eff2e7a8b Driver core: change add_uevent_var to use a struct
This changes the uevent buffer functions to use a struct instead of a
long list of parameters. It does no longer require the caller to do the
proper buffer termination and size accounting, which is currently wrong
in some places. It fixes a known bug where parts of the uevent
environment are overwritten because of wrong index calculations.

Many thanks to Mathieu Desnoyers for finding bugs and improving the
error handling.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12 14:51:01 -07:00
Linus Torvalds 038a5008b2 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (867 commits)
  [SKY2]: status polling loop (post merge)
  [NET]: Fix NAPI completion handling in some drivers.
  [TCP]: Limit processing lost_retrans loop to work-to-do cases
  [TCP]: Fix lost_retrans loop vs fastpath problems
  [TCP]: No need to re-count fackets_out/sacked_out at RTO
  [TCP]: Extract tcp_match_queue_to_sack from sacktag code
  [TCP]: Kill almost unused variable pcount from sacktag
  [TCP]: Fix mark_head_lost to ignore R-bit when trying to mark L
  [TCP]: Add bytes_acked (ABC) clearing to FRTO too
  [IPv6]: Update setsockopt(IPV6_MULTICAST_IF) to support RFC 3493, try2
  [NETFILTER]: x_tables: add missing ip6t_modulename aliases
  [NETFILTER]: nf_conntrack_tcp: fix connection reopening
  [QETH]: fix qeth_main.c
  [NETLINK]: fib_frontend build fixes
  [IPv6]: Export userland ND options through netlink (RDNSS support)
  [9P]: build fix with !CONFIG_SYSCTL
  [NET]: Fix dev_put() and dev_hold() comments
  [NET]: make netlink user -> kernel interface synchronious
  [NET]: unify netlink kernel socket recognition
  [NET]: cleanup 3rd argument in netlink_sendskb
  ...

Fix up conflicts manually in Documentation/feature-removal-schedule.txt
and my new least favourite crap, the "mod_devicetable" support in the
files include/linux/mod_devicetable.h and scripts/mod/file2alias.c.

(The latter files seem to be explicitly _designed_ to get conflicts when
different subsystems work with them - that have an absolutely horrid
lack of subsystem separation!)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-11 19:40:14 -07:00
Stephen Hemminger 3b04ddde02 [NET]: Move hardware header operations out of netdevice.
Since hardware header operations are part of the protocol class
not the device instance, make them into a separate object and
save memory.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:52:52 -07:00
Trent Piepho a991f44b79 V4L/DVB (6316): Change list_for_each+list_entry to list_for_each_entry
The rest of V4L files.

There is one list_for_each+list_entry in cpia_pp.c that
wasn't changed because it expects the loop iterator to remain NULL if
the list is empty.

A bug in vivi is fixed; the 'safe' version needs to be used because the loop
deletes the list entries.

Simplify a second loop in vivi and get rid if an un-used variable in that loop.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:35:29 -03:00
Trent Piepho e77e2c2f29 V4L/DVB (6315): pvrusb2: Change list_for_each+list_entry to list_for_each_entry
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:35:20 -03:00
Trent Piepho 6d28e98906 V4L/DVB (6314): saa7134: Replace list_for_each+list_entry with list_for_each_entry
A couple loops weren't changed because they expected the loop iterator
to be left as NULL if the list was empty.  Maybe the code should just
check for that first, then loop?

Adjust some of the loop logic to be simpler.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:35:07 -03:00
Trent Piepho 805a439241 V4L/DVB (6313): ivtv: Replace list_for_each+list_entry with list_for_each_entry
Also fixed a few cases of cut&paste errors where 'buf' would be set to the
first entry in the list prior to be used as the loop iterator.  In one case
the value of buf was used before it was changed, but the rest were
unnecessary.

There was one list_for_each+list_entry loop that wasn't changed, since it
depending on the loop iterator being left as NULL if the list was empty.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
CC: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:34:56 -03:00
Trent Piepho 8bb629e22f V4L/DVB (6312): cx88: Replace list_for_each+list_entry with list_for_each_entry
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:34:48 -03:00
Trent Piepho 7948261942 V4L/DVB (6311): dvb: Replace list_for_each+list_entry with list_for_each_entry
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:34:33 -03:00
Jiri Slaby c3e2a8e64c V4L/DVB (6308): V4L: zc0301, remove bad usage of ERESTARTSYS
zc0301, remove bad usage of ERESTARTSYS

down_read_trylock can't be interrupted and so ERESTARTSYS would reach
userspace, which is not permitted. Change it to EAGAIN

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:25 -03:00
Jiri Slaby 3abff557d5 V4L/DVB (6307): V4L: w9968cf, remove bad usage of ERESTARTSYS
w9968cf, remove bad usage of ERESTARTSYS

down_read_trylock can't be interrupted and so ERESTARTSYS would reach
userspace, which is not permitted. Change it to EAGAIN

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:25 -03:00
Maxim Levitsky acd827d63a V4L/DVB (6306): Few clenups for saa7134 resume code
*Disable DMA explictly on suspend
*Enable DMA on resume, after all buffers were configured
*Disable overlay on resume - apps should enable it when X is resumed

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Brandon Philips 49ee718ef5 V4L/DVB (6305): V4L: videobuf-core.c avoid NULL dereferences in videobuf-core
The return value of videobuf_alloc() is unchecked but this function will
return NULL on an error.  Check for NULL and make videobuf_reqbufs()
return the number of successfully allocated buffers.

Also, fix saa7146_video.c and bttv-driver.c to use this returned
buffer count.

Tested against the vivi driver.  Not tested against saa7146 or bt8xx
devices.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Trent Piepho c726b65d07 V4L/DVB (6301): pvrusb: Update DEBUGIFC sysfs to kernel 2.6.13+
The prototypes for the show and store methods of a device_attribute changed in
kernel 2.6.13, but the code in pvrusb2 was never updated.  I guess the
DEBUGIFC stuff isn't used much....

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Trent Piepho bde00cc027 V4L/DVB (6300): CodingStyle cleanup
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:20 -03:00
Trent Piepho 102abd826a V4L/DVB (6299): dvb: Add dependencies for VIDEOBUF_DVB
It needs to select VIDEOBUF_GEN and VIDEOBUF_DMA_SG, since it uses those
modules.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:19 -03:00
Michael Krufky 21a7ad4a7e V4L/DVB (6297): cx23885: remove wrong Kconfig selection of VIDEOBUF
fix bad Kconfig dependency of cx23885 module.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:15 -03:00
Joachim Steiger fa3b877e5c V4L/DVB (6296): dib0700: add support for AverMedia DVB-T Express card
add Avermedia dvb-t express card 34 (usb2) id

Signed-off-by: Joachim Steiger <roh@hyte.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:15 -03:00
Eric Sandeen 0ac3a5bbca V4L/DVB (6295): saa7134: add autodetection for KWorld ATSC-115
Recognize the KWorld ATSC115 PCI ID as a hardware clone of the ATSC110.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:15 -03:00
Kay Sievers 54bd5b66c8 V4L/DVB (6293): V4L: convert struct class_device to struct device
The currently used "struct class_device" will be removed from the
kernel. Here is a patch that converts all users in drivers/media/video/
to struct device.

Reviewed-by: Thierry Merle <thierry.merle@free.fr>
Reviewed-by: Mike Isely <isely@pobox.com>
Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:14 -03:00
Mauro Carvalho Chehab d4cae5a500 V4L/DVB (6292): videobuf_core init always require callback implementation
In the past, videobuf_queue_init were used to initialize PCI DMA videobuffers.
This patch renames it, to avoid confusion with the previous kernel API, doing:
	s/videobuf_queue_init/void videobuf_queue_core_init/

Also, the operations is now part of the function parameter. The function will
also add a test if this is defined, otherwise producing BUG.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:14 -03:00
Mauro Carvalho Chehab d5f1b01644 V4L/DVB (6291): Fix: avoid oops on some SMP machines
This workaround fix a bug that happens on some SMP machines. On those machines,
videobuf_iolock is called too soon, before file .mmap handler. This patch calls
the scheduler before iolocking, allowing it to properly call the pending mmap.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:14 -03:00
Mauro Carvalho Chehab 5ddff43435 V4L/DVB (6290): remove videobuf_set_pci_ops
Before the videobuf redesign, a procedure for re-using videobuf without PCI
scatter/gather where provided by changing the pci-dependent operations by
other operations.

With the newer approach, those methods are obsolete and can safelly be removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:10 -03:00
Robert P. J. Day 7568e3ce67 V4L/DVB (6289): Remove reference to dead CONFIG_UST and ust.h header
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:10 -03:00
Mauro Carvalho Chehab aecfde539e V4L/DVB (6287): Fix DMA Scatter/Gather constructor
cx23885 driver were converted to use the newer videobuf support. Unfortunately,
the constructor weren't changed. This causes an oops, since the abstract methods
(implemented as callbacks) aren't defined.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
2007-10-10 00:03:09 -03:00
Mauro Carvalho Chehab 593f18c6e4 V4L/DVB (6286): Add support for MSI TV @nywhere A/D NB
This is a Lifeview hybrid OEM board.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:09 -03:00
Jesper Juhl 925343ecdf V4L/DVB (6285): Remove pointless kmalloc() return value cast in Zoran PCI controller driver
No need to cast the void pointer returned by kmalloc() in
drivers/media/video/zoran_driver.c::v4l_fbuffer_alloc().

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:09 -03:00
Trent Piepho 409d84f85a V4L/DVB (6284): cx23885: Update to new videobuf code
cx23885 was still uses the old video-buf includes and code, which would only
`work' if one happened to be compiling against a kernel that had the old
headers.  Even then, it wouldn't actually work, it would just compile without
errors.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:09 -03:00
Trent Piepho 5a3ebe8755 V4L/DVB (6283): videobuf: Remove references to old Kconfig option name
CONFIG_VIDEO_BUF_DVB became CONFIG_VIDEOBUF_DVB.

But in these cases, it makes more sense to use CONFIG_VIDEO_SAA7134_DVB
or CONFIG_VIDEO_CX88_DVB_MODULE depending on the driver.

The reference in cx23885.h should just be removed, as the code there needs to
be included if DVB is on or off.  I do not think you can even compile the
cx23885 driver without DVB.  It's clearly just leftover from when the file was
obvious copied from the cx88 driver (which is not mentioned in the copyright
BTW).

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:08 -03:00
Christoph Hellwig 9320874a3e V4L/DVB (6279): en_50221: convert to kthread API
Here's an attempted update to the full kthread API + wake_up_process:

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
CC: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:08 -03:00
Maxim Levitsky d00cd2985e V4L/DVB (6278): Buf: fix typo that caused data loss when readng streams from device
If videobuf_read_stream reads two or more buffers it was overwriting the first one

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-10 00:03:08 -03:00
Mauro Carvalho Chehab 14f37aee29 V4L/DVB (6277): vivi cleanup: remove the unused vars
Vivi driver is now simpler. This patch removes the now unused vars.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:08 -03:00
Brandon Philips 00f98d0804 V4L/DVB (6276): V4L: videobuf-core.c lock before streaming check
The reading/streaming fields are used for mutual exclusion of the queue and
should be protected by the queue lock.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-10 00:03:05 -03:00
Brandon Philips ba32bd95d4 V4L/DVB (6275): V4L: vivi.c remove the "resource" locking
The "resource" locking in vivi isn't needed since
streamon/streamoff/read_stream do mutual exclusion using
q->reading/q->streaming.

Plus it is sort of broken:

a) res_locked() use in vivi_read() is racey.
b) res_free() calls mutex_lock twice causing streamoff to break

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:05 -03:00
Brandon Philips 85c7c70bc2 V4L/DVB (6274): V4L: vivi.c replace logic in vivi_poll with videobuf_poll_stream
Since vivi is using videobuf_read_stream() it can use videobuf_poll_stream()
now.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:05 -03:00
Brandon Philips a326ae1126 V4L/DVB (6273): V4L: vivi.c vidioc_try_fmt_cap() negotiate a valid field
If the client provides V4L2_FIELD_ANY vivi should return a valid field :)

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:00 -03:00
Maxim Levitsky 11f7078c10 V4L/DVB (6272): V4L: properly fix support for capturing interlaced video in saa7134
By "capturing interlaced video" I mean that card ensures that top field
is really top and vice versa (I think it takes the filed ID from signal)
Properly turn on/off that support depending on signal state

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:59 -03:00
Maxim Levitsky cb71201f20 V4L/DVB (6271): V4L: Add basic support for suspend/resume for saa7134
This adds support for suspend/resume for core of saa7134

Should fix bug#7220

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:59 -03:00
Maxim Levitsky f5a1ac64cc V4L/DVB (6270): V4L: Honor dev->ctl_invert when setting up the decoder in saa7134
When user sets dev->ctl_invert, driver writes negative values to
SAA7134_DEC_LUMA_CONTRAST and SAA7134_DEC_CHROMA_SATURATION,
but general code that initializes decorder ignores that

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:59 -03:00
Maxim Levitsky b4aeb8b823 V4L/DVB (6269): V4L: Fix a "scheduling while atomic" bug in saa7134
set_tvnorm can sleep in saa7134_i2c_xfer
(it will be called through tuner code)
but code calls it under spinlock. Fix that

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:58 -03:00
Maxim Levitsky 9900132f34 V4L/DVB (6268): V4L: Fix a lock inversion in generic videobuf code
videobuf_qbuf takes q->lock, and then calls
q->ops->buf_prepare which by design in all drivers calls
videobuf_iolock which calls videobuf_dma_init_user and this
takes current->mm->mmap_sem

on the other hand if user calls mumap from other thread, sys_munmap
takes current->mm->mmap_sem and videobuf_vm_close takes q->lock

Since this can occur only for V4L2_MEMORY_MMAP buffers, take
current->mm->mmap_sem in qbuf, before q->lock, and don't take
current->mm->mmap_sem videobuf_dma_init_user for those buffers

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:58 -03:00
Mauro Carvalho Chehab 851c0c96b2 V4L/DVB (6266): videobuf cleanup: mmap check is common to all videobuf. Make it at core
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-10 00:02:55 -03:00
Mauro Carvalho Chehab cd4765efdd V4L/DVB (6265): Prevent for calling mmap_free without an allocated buffer
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-10 00:02:55 -03:00
Mauro Carvalho Chehab 3bef5e4a1f V4L/DVB (6264): Make the vertical lines to move
While this is not the standard color bar behaviour, having some movement
there allows to check if buffers are being properly handled.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:54 -03:00
Mauro Carvalho Chehab 123f8ef64e V4L/DVB (6263): Fix buffer release code
Release code should happen before the cleaning of map variable.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:54 -03:00
Mauro Carvalho Chehab e78dcf5552 V4L/DVB (6262): An allocation error message were being printed as a debug msg
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:50 -03:00
Mauro Carvalho Chehab c520a4970c V4L/DVB (6261): Cleans mem->vmalloc after vfree
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:50 -03:00
Mauro Carvalho Chehab 28318c72ad V4L/DVB (6260): Fix Kconfig dependency
Thanks to Michael Krufky for pointing this to me.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:49 -03:00
Mauro Carvalho Chehab 40558dafff V4L/DVB (6259): Fix vivi poll() method
Due to the replace of videobuf_read_one to videobuf_read_stream, poll()
method implementation is wrong. This fixes poll() implementation, making
read of /dev/video? to work again.

With this method, an USB driver can use video-buf, without needing to
request memory from the DMA-safe area.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:49 -03:00
Mauro Carvalho Chehab ba366a23b6 V4L/DVB (6257): Rename video-buf-dvb to videobuf-dvb to be consistent with the other patches
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:46 -03:00
Mauro Carvalho Chehab 79618cf413 V4L/DVB (6256): Remove the obsolete video-buf module
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-09 22:15:00 -03:00
Mauro Carvalho Chehab 5a0377060e V4L/DVB (6255): Convert vivi to use videobuf-vmalloc
This patch removes the usage of videobuf-dma-sg from vivi driver, using
instead videobuf-vmalloc. This way, vivi will be useful for testing the
newer method. Reverting this patch won't hurt vivi, since both methods
work fine.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:56 -03:00
Mauro Carvalho Chehab 87b9ad070c V4L/DVB (6254): Add videobuf-vmalloc
Adds a newer videobuf-vmalloc module. This module uses the same
videobuf controls, but implements memory allocation based on vmalloc
methods.

With this method, an USB driver can use video-buf, without needing to
request memory from the DMA-safe area.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:56 -03:00
Mauro Carvalho Chehab 6bb2790f8a V4L/DVB (6253): Convert vivi to use the newer videobuf-dma-sg module
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:56 -03:00
Mauro Carvalho Chehab c1accaa21b V4L/DVB (6252): Adapt drivers to use the newer videobuf modules
PCI-dependent videobuf_foo methods were renamed as videobuf_pci_foo.

Also, videobuf_dmabuf is now part of videobuf-dma-sg private struct.
So, to access it, a subroutine call is needed.

This patch renames all occurences of those function calls to be
consistent with the video-buf split.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-09 22:14:55 -03:00
Mauro Carvalho Chehab 7a7d9a89d0 V4L/DVB (6251): Replace video-buf to a more generic approach
video-buf currently does two different tasks:

- Manages video buffers with a common code that allows
  implementing all the V4L2 different modes of buffering;

- Controls memory allocations

While the first task is generic, the second were written to support PCI DMA
Scatter/Gather needs. The original approach can't even work for those
video capture hardware that don't support scatter/gather.

I did one approach to make it more generic. While the approach worked
fine for vivi driver, it were not generic enough to handle USB needs.

This patch creates two different modules, one containing the generic
video buffer handling (videobuf-core) and another with PCI DMA S/G.
After this patch, it would be simpler to write an USB video-buf and a
non-SG DMA module.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-09 22:14:55 -03:00
Brett Warden 7c596fa964 V4L/DVB (6250): bw-qcam use data_reverse instead of manually poking the control register fix
coding-style repairs

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:55 -03:00
Sascha Sommer b5457b7bdf V4L/DVB (6249): Add Typhoon Tv-Tuner PCI to bttv-cards.c
Adds an entry for the Typhoon Tv-Tuner PCI to bttv-cards.c

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:55 -03:00
Mauro Carvalho Chehab 13595a51c0 V4L/DVB (6247): Fix bug #8689: Fixes IR stop/start during suspend/resume
IR workqueue should be disabled during suspend. This avoids some troubles, like
the one reported on bug #8689:

"The Hauppauge HVR 1100 ir-remote control does not work after resume from
suspend to ram or disk."

This patch disables IR before suspending, re-enabling it after resume.

Thanks to Peter Poklop <Peter.Poklop@gmx.at> for reporting it and helping with
the fix.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Peter Poklop <Peter.Poklop@gmx.at>
2007-10-09 22:14:51 -03:00
Trent Piepho b25be97929 V4L/DVB (6246): GemTek Radio card - Control Word
Redoes the way the control word is stored and set.
The existing code was a lot more complicated than it needed to be.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Pekka Seppänen <pexu@kapsi.fi>
2007-10-09 22:14:51 -03:00
Trent Piepho 857e594ad5 V4L/DVB (6245): GemTek Radio card - frequency calculation
Frequency calculation to use better math.  It's still the same
IF offset and step size (which are not the same as the datasheet says) as
the code was before.  It's just more efficient and accurate.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Pekka Seppänen <pexu@kapsi.fi>
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:50 -03:00
Pekka Seppanen 4753647e64 V4L/DVB (6244): [PATCH 1/2] GemTek Radio card
Code cleanup for GemTek Radio card driver. Removed unnecessary / invalid
I/O commands and rewrote code for tuning on-board BU2614FS chip. Adds
several new module params for power users. Includes automatic device
probing.

Signed-off-by: Pekka Seppanen <pexu@kapsi.fi>
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Reviewed-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:50 -03:00
Pekka Seppanen 3e7589c507 V4L/DVB (6243): [PATCH 2/2] GemTek Radio card
Details now match with radio-gemtek.c, eg. no more different ports.
Included a short note about cards that should be compatible with
radio-gemtek module.

Signed-off-by: Pekka Seppanen <pexu@kapsi.fi>
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Reviewed-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:50 -03:00
Michael Krufky 0173e4696f V4L/DVB (6241): fix typo in DVB_PLL Kconfig help text
s/driver/drives/1

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:50 -03:00
Brett Warden 9e19db5b6d V4L/DVB (6238): bw-qcam: use data_reverse instead of manually poking the control register
Fixes use of parport_write_control() to match the newer interface that
requires explicit parport_data_reverse() and parport_data_forward() calls.
This eliminates the following error message and restores the original
intended behavior:

parport0 (bw-qcam): use data_reverse for this!

Also increases threshold in qc_detect() from 300 to 400, as my camera often
results in a count of approx 330.  Added a kernel error message to indicate
detection failure.

Thanks Ray and Randy for your comments, and for pointing out that I
needed to reset the port to forward mode!

Signed-off-by: Brett T. Warden <brett.warden@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:50 -03:00
Oliver Neukum 0b67f5c568 V4L/DVB (6237): Oops in pwc v4l driver
The pwc driver is defficient in locking, which can trigger an oops
when disconnecting.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
CC: Luc Saillard <luc@saillard.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:49 -03:00
Andres Salomon 23869e2368 V4L/DVB (6235): cafe_ccic: default to allocating DMA buffers at probe time
By default, we allocate DMA buffers when actually reading from the video
capture device.  On a system with 128MB or 256MB of ram, it's very easy
for that memory to quickly become fragmented.  We've had users report
having 30+MB of memory free, but the cafe_ccic driver is still unable to
allocate DMA buffers.

Our workaround has been to make use of the 'alloc_bufs_at_load' parameter
to allocate DMA buffers during device probing.  This patch makes DMA
buffer allocation happen during device probe by default, and changes
the parameter to 'alloc_bufs_at_read'.  The camera hardware is there,
if the cafe_ccic driver is enabled/loaded it should do its best to ensure
that the camera is actually usable; delaying DMA buffer allocation
saves an insignicant amount of memory, and causes the driver to be much
less useful.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:49 -03:00
Michael Krufky 4562fbeac6 V4L/DVB (6232): dvb-pll: report whether input rf will be autoselected or set via insmod option
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:49 -03:00
Michael Krufky 8528fa4147 V4L/DVB (6231): dvb-pll: always show pll name if forced via insmod option
The name of the pll will be shown if forced via insmod option,
or if debug is enabled.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:49 -03:00
Michael Krufky 704e39bf62 V4L/DVB (6230): dvb-pll: add module option to force dvb-pll desc id (for debug use only)
Add a module option to force the dvb-pll module to use an alternate dvb-pll
description without having to recompile the kernel.

Having a module option like this is useful in some cases, where the vendor
may release an alternate revision of the hardware using a different tuner,
but without changing the pci subsystem / usb device ids.

This option is intended for debugging purposes _only_.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:48 -03:00
Michael Krufky ff3e7dd580 V4L/DVB (6229): dvb-pll: increase DVB_PLL_MAX to 64
Increased DVB_PLL_MAX from 16 to a figure that would never be reached in a
practical sense.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:46 -03:00
Michael Krufky 05a4611b5d V4L/DVB (6228): dvb-pll: add module option to specify rf input
Add a module option to dvb-pll, called "input" to specify which rf
input to use on devices with multiple rf inputs.  If the module option
is not specified, then the driver will autoselect the rf input, as per
previous behavior.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:46 -03:00
Michael Krufky a27e5e769e V4L/DVB (6227): dvb-pll: store instance ID in dvb_pll_priv structure
Store an instance ID in the dvb_pll_priv structure, so that module options
specific to a given pll may be used by the functions within the driver.

When debug is turned on, print a message indicating which pll was attached
and it's instance id.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:45 -03:00
Michael Krufky 5d7802b261 V4L/DVB (6226): dvb-pll: pass fe pointer into dvb_pll_configure() and set() functions
The pll-specific set() function will need access to the dvb_pll_priv
structure for new functionality.  This patch gives access to this
structure to the required functions.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:45 -03:00
Stas Sergeev f438d97447 V4L/DVB (6225): AverTV Studio 307 has only one composite input
AverTV Studio 307 has only one composite input.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
Acked-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:45 -03:00
Michael Krufky 0e789d7ffa V4L/DVB (6224): VIDEO_CX23885 depends on DVB_CORE
Fix the following dependency issue:

ERROR: "dvb_dmx_init" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_unregister_adapter" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_register_frontend" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_unregister_frontend" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_net_release" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_frontend_detach" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_dmxdev_release" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_dmx_swfilter" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_net_init" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_dmx_release" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_register_adapter" [drivers/media/video/video-buf-dvb.ko] undefined!
ERROR: "dvb_dmxdev_init" [drivers/media/video/video-buf-dvb.ko] undefined!

ERROR: "mt2131_attach" [drivers/media/video/cx23885/cx23885.ko] undefined!
ERROR: "s5h1409_attach" [drivers/media/video/cx23885/cx23885.ko] undefined!

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:40 -03:00
Michael Krufky c8e2f07be0 V4L/DVB (6222): select DVB_PLL if !DVB_FE_CUSTOMISE for FusionHDTV5 Express
VIDEO_CX23885 must select DVB_PLL if !DVB_FE_CUSTOMISE for FusionHDTV5 Express

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:40 -03:00
Oliver Endriss f64899ca5a V4L/DVB (6221): budget-ci: select TT keymap for DVB-S TT 1500
DVB-S TT 1500 must use the TT keymap.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:40 -03:00
Sakari Ailus 2060955748 V4L/DVB (6220): TCM825x: Add support for vidioc_int_g_ifparm call, small cleanups
vidioc_int_g_ifparm returns platform-specific information about the
interface settings used by the sensor. Support for [gs]_ext_clk has
been removed.

Fix indentation and remove useless & characters.

Remove experiment for typechecking slave callback function arguments.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:40 -03:00
Sakari Ailus 61c310dc1e V4L/DVB (6218): V4L: Int if: Use -ENOIOCTLCMD for nonexistent ioctls
Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:39 -03:00
Sakari Ailus 098c645e39 V4L/DVB (6216): V4L: Int if: add vidioc_int_g_ifparm, other updates
vidioc_int_g_ifparm can be used to obtain hardware-specific information
about the interface used by the slave.

Rearrange v4l2-int-device.h as well.

Also remove useless & characters.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:39 -03:00
Hans-Jürgen Koch 588005e100 V4L/DVB (6215): Bugfix for saa6588.c, add forgotten spin_lock_init()
There's a serious bug in saa6588.c, it uses a non-initialized spin_lock.
Funny thing is that it works fine with bttv, but completly freezes the
machine if e.g. saa7134 is loaded.

Thanks to Derek Philip for reporting this bug on the rdsd-devel list.

This patch adds the missing spin_lock_init().

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:35 -03:00
Jean Delvare 39f46adef8 V4L/DVB (6214): usbvision: Don't support I2C_M_REV_DIR_ADDR
I2C adapters should only support I2C_M_REV_DIR_ADDR if they really have
to (i.e. if they are connected to a broken I2C device which needs this
deviation from the standard I2C protocol.) As no media chip driver
uses I2C_M_REV_DIR_ADDR, I don't think that the usbvision driver needs
to support it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Thierry Merle <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:35 -03:00
Jean Delvare 7fb0dfc853 V4L/DVB (6212): pvrusb2: I2C adapter tweaks from Jean Delvare
* I2C adapters aren't expected to handle I2C_M_NOSTART unless they
  really have to. As the pvrusb2 driver doesn't support it, I take it
  that it doesn't need it so it shouldn't mention it at all.
* I2C_FUNC_SMBUS_EMUL includes I2C_FUNC_SMBUS_BYTE_DATA so listing
  both is redundant.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:35 -03:00
Mike Isely 56585386e2 V4L/DVB (6211): pvrusb2: Allocate a debug mask bit for reporting video standard things
It's useful to see specific details for how the pvrusb2 driver is
figuring out things related to the video standard, independent of
other initialization activities.  So let's set up a separate debug
mask bit for this and turn it on.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:34 -03:00
Mike Isely 9f66d4eac6 V4L/DVB (6210): pvrusb2: Do a far better job at setting the default initial video standard
The v4l tveeprom logic tells us what video standards are supported by
the hardware, however it doesn't directly tell us what should be the
preferred initial standard.  For example "NTSC/NTSC-J" devices are
reported by tveeprom as support NTSC-M and PAL-M, and while that might
be true, in the vast majority of cases NTSC-M is really what the user
is going to want.  However the driver previously just arbitrarily
picked the "lowest numbered" standard as the initial default, which in
that case would have been PAL-M.  (And making matters more confusing -
this only caused real problems on 24xxx devices because the saa7115 on
29xxx seems to autodetect the right answer anyway.)  This change
implements an algorithm that uses the set of "supported" standards as
a hint to decide on the initial standard.  This algorithm ONLY comes
into play if the driver isn't specifically told what to do; said
another way - the user can always still change the standard via the
sysfs interface, via the usual V4L methods, or even specified as a
module parameter.  The idea here is only to pick a better starting
point if the user (or app) doesn't otherwise do something to set the
standard; otherwise this change has no real impact.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:34 -03:00
Mike Isely 1d643a3722 V4L/DVB (6209): pvrusb2: Better discriminate among device types
This is a bunch of cleanup in various places to improve behavior based
on actual device type being driven.  While this doesn't actually
affect operation with existing devices, it cleans things up so that it
will be easier / more deterministic when other devices are added.
Ideally we should make stuff like this table-driven, but for now this
is just a series of small incremental (read: safe) improvements.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:34 -03:00
Mike Isely 4db666cc3d V4L/DVB (6208): pvrusb2: Implement programmatic means to extract prom contents
The pvrusb2 driver already has a method for extracting the FX2's
program memory back out to a user application; this ability is used to
facilitate manual firmware extraction as per the procedure documented
on the pvrusb2 web site.  This change follows that pattern and
implements a corresponding method to grab the binary contents of the
PVR USB2 prom (which for PVR USB2 devices can contain information in
addition to the usual Hauppauge metadata).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:34 -03:00
Mike Isely 401c27ce96 V4L/DVB (6207): pvrusb2: Fix a potential oops in an error leg cleanup
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:30 -03:00
Mike Isely 747f07961e V4L/DVB (6205): pvrusb2: Fix oops in error leg cleanup
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:30 -03:00
Simon Farnsworth 289ea1f033 V4L/DVB (6203): Fix SVideo input on KWorld DVB-T 220 boards
Fix SVideo input on KWorld DVB-T 220 boards. Without this patch, the
luma pin on the SVideo input is treated as a composite in, and the
chroma pin is ignored.

Also, fix the radio, and provide a second composite input for people who
are used to the existing composite on SVideo connector behaviour.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Reviewed-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:30 -03:00
Michael Krufky f139fa71c0 V4L/DVB (6200): cx23885: use a pointer to the required i2c bus in dvb_register function
Store a pointer to the required i2c_bus so that we do not put the wrong
analog demod into standby.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:29 -03:00
Steven Toth a6a3f14035 V4L/DVB (6199): cx23885: Changes to allow demodulators on each transport bus
cx23885: Changes to allow demodulators on each transport bus.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:29 -03:00
Michael Krufky 9bc37caadf V4L/DVB (6196): cx23885: add support for DViCO FusionHDTV 5 Express
This patch adds digital ATSC / QAM support for the DViCO FusionHDTV5 Express.
Remote control is supported by ir-kbd-i2c, RTC is supported by rtc-isl1208.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:29 -03:00
Steven Toth 579f1163cd V4L/DVB (6195): Changes to support MPEG TS on VIDB
Changes to support MPEG TS on VIDB

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:28 -03:00
Steven Toth 6f074abb62 V4L/DVB (6194): Changes to support interrupts on VIDB
Changes to support interrupts on VIDB

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:28 -03:00
Michael Krufky ccbe64c664 V4L/DVB (6193): cx23885: define Video B Interrupt Status register bit values
- define missing register bit values for VID_B
- corrected VID/VBI_B_GPCNT_CTL register addresses

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:28 -03:00
Steven Toth 661c7e44c5 V4L/DVB (6192): Ensure start_dma() is capable of starting dma on port VIDB
start_dma() would fail to start dma if a device used VIDB (portb).

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:28 -03:00
Steven Toth bfde287c2f V4L/DVB (6191): Removed a redundant switch()
The switch() statement is no longer required.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:28 -03:00
Steven Toth fc959befe0 V4L/DVB (6190): cx23885: GPIO fix for non HVR1800lp boards
The HVR1250 and HVR1800 boards need the s5h1409 demod GPIO enabled.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:14:27 -03:00
Trent Piepho 415927dcd1 V4L/DVB (6186): cx88-alsa: Remove some unused fields in card state struct
Not sure why they are there, but they don't do anything now.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:13:58 -03:00
Trent Piepho 82896f29d4 V4L/DVB (6184): cx88-alsa: Make volume control stereo
Use the balance control to make the mono volume control stereo.

Note that full range isn't supported.  The balance control attenuates one
channel by 0 to -63 dB, and the volume control provides additional attenuation
to both channels by another 0 to -63 dB.

So the channel with the most attenuation has a range of 0 to -126 dB, while
the other channel only has a range of 0 to -63 dB.  ALSA volume controls don't
appear to support this concept.  I just limited the range to 0 to -63 total.
Once you get to -63 dB, you're already at silence, so additional attenuation
is pretty much pointless anyway.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:31 -03:00
Michael Krufky 6fcecce7e1 V4L/DVB (6181): cx88: auto-load rtc and ir receiver i2c modules for FusionHDTV5 RT Gold
Auto-load ir-kbd-i2c for ir receiver support, and rtc-isl1208 for rtc 
support for the FusionHDTV5 RT Gold.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:31 -03:00
Michael Krufky a1dec5160d V4L/DVB (6180): tuner: don't probe 0x6b or 0x6f on cx88 boards
Ignore 0x6b and 0x6f on cx88 boards. Some FusionHDTV cards
have an ir receiver at 0x6b and an RTC at 0x6f which can
get corrupted if probed.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:30 -03:00
Michael Krufky 3c44358c49 V4L/DVB (6179): Clean up FusionHDTV ir code
- fixed missing buttons in keymap.

- make function names & descriptions more generic,
  since this same ir receiver and remote is used in
  many FusionHDTV products.

- miscellaneous cleanups.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:27 -03:00
Chaogui Zhang d54d698091 V4L/DVB (6178): add IR remote support for FusionHDTV 5 RT Gold
This patch adds support for the built-in IR receiver of the DViCO
Fusion HDTV5 RT GOLD PCI card, using FusionHDTV MCE remote controller.

Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:26 -03:00
Steven Toth 2df9a4c2d8 V4L/DVB (6173): cx23885: Minor cleanup and important NMI comment placed in code
I wanted to document the NMI assert issue inside the code, even though
it's already documented in the patch history. If/when the next cx23887
revision appears, is may need to be enabled on that also.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:26 -03:00
Steven Toth 86184e06da V4L/DVB (6172): cx23885: Removing duplicate tuner and demod definitions
A number of Hauppauge boards share the same tuner and demod
configurations. This patch removes duplicate structures.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:25 -03:00
Steven Toth 31bae4a620 V4L/DVB (6171): cx23885: Cleaning up defines
Moving some defines into the correct header file.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:22 -03:00
Steven Toth 2e52f215be V4L/DVB (6170): cx23885: General cleanup of old code
Removed unused code.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:21 -03:00
Steven Toth f29379c361 V4L/DVB (6169): Removed unused function mt2131_set_gpo()
Unused code is removed.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:20 -03:00
Steven Toth a77743bc2d V4L/DVB (6168): cx23885: Added HVR1250 ATSC support
Adding support for the Hauppauge HVR1250 PCIe ATSC board.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:20 -03:00
Steven Toth 4823e9ee9f V4L/DVB (6167): cx23885: Changed PCI quirks to after bridge detech
Changed the pci_quirks function to detech the bridge type before setting
the NMI clear bit, rather than detecting based on unique board id.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:17 -03:00
Steven Toth 426d523664 V4L/DVB (6166): cx23885: Ensure pci_quirks is called after board identification
The pci_quirks function was being called too early during initialisation,
it needs to be called after the board has been identified.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:16 -03:00
Michael Krufky b86b580244 V4L/DVB (6165): cx23885: fix Kconfig dependencies
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:15 -03:00
Michael Krufky 3c5666aee3 V4L/DVB (6164): cx23885: turn off i2c_debug by default
Turn off i2c_debug by default, to make the driver less verbose.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:15 -03:00
Michael Krufky 60a41d3b61 V4L/DVB (6163): cx23885: remove old comments
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:12 -03:00
Michael Krufky 44a6481dcd V4L/DVB (6162): cx23885: whitespace cleanups
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:11 -03:00
Michael Krufky 70ebd70573 V4L/DVB (6161): cx23885-dvb.c doesnt need to include dvb-pll.h
The dvb-pll module is not being used by this driver.
Remove the unneeded #include.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:10 -03:00
Steven Toth 047646bfbb V4L/DVB (6159): General code cleanup
Removed if 0'd code, removed cx88 references.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:09 -03:00
Steven Toth fe475163ff V4L/DVB (6158): Fix MT2131 tuner lock status problem
The mt2131 tuner reports lock even when the hardware should not
lock. This patch allows the s5h1409 demodulator to be configured to query
either the tuner driver for status, or the demodulator status when the
application requests lock status. This avoids returning false CARRIER
and/or SIGNAL lock status.

S5H1409 and MT2131 drivers.  This is the remainder of the changeset, which
only touches cx23885-dvb.c

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:06 -03:00
Steven Toth e133be0f58 V4L/DVB (6157): Removed the need to manually define .bridge for each card
Moved the field from cx23885_board to cx23885_dev and added code to
iautomatically set the bridge type based on the pci device id.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:06 -03:00
Steven Toth 0fc0739ba9 V4L/DVB (6156): Added the I2C_FUNC_I2C support to the cx23885 i2c algo definition
This is required to support the cx258xx family of audio and video decoders.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:05 -03:00
Steven Toth 3328e4fbf1 V4L/DVB (6155): Cleanup/remove code to access the sram memory maps
The cx23885 and cx23887 family use two different memory maps which govern
how the internal SRAM is configured. This patch streamlines the access to those
structures.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:02 -03:00
Steven Toth 3bd4065961 V4L/DVB (6154): NMI hang and corrupt transport packet fixes
The sram allocations for the cx23887 differ slightly from the cx23885.
This patch modifies the cx23887 specific sram memory map to reflect this.
As a result, interrupts and DMA handling have also been enabled in
cx23885_start_dma() for 887 specific boards.

ATSC streaming is now available on cx23885 and cx23887 bridges.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:01 -03:00
Steven Toth a2129af5b6 V4L/DVB (6153): I2C bus 3 register was incorrect
I2C bus 3 was being initialised with the incorrect address register.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:00 -03:00
Michael Krufky 03121f05f9 V4L/DVB (6152): cx23885: forward compatibility fixes for recent kernels
- fix #include for <media/video-buf-dvb.h>
- fix cx23885_irq declaration for 2.6.19 and later

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:00 -03:00
Michael Krufky 2f52cdb209 V4L/DVB (6151): include drivers/media/video/cx23885/Kconfig
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:59 -03:00
Steven Toth d19770e517 V4L/DVB (6150): Add CX23885/CX23887 PCIe bridge driver
This is a new framework to support boards based on the CX23885/7 PCIe
bridge. The framework supports digital (no analog yet)

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:56 -03:00
Michael Krufky f61b48f7a8 V4L/DVB (6142): cx25840: fix build warning
Fix the following build warning:

 CC [M]  cx25840-core.o

cx25840-core.c: In function 'init_dll1':
cx25840-core.c:147: warning: implicit declaration of function 'udelay'


Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:51 -03:00
Michael Krufky 1f5ef19779 V4L/DVB (6141): tuner: use get_rf_strength instead of get_status to determine signal strength
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:50 -03:00
Michael Krufky 3782e050f8 V4L/DVB (6140): tda8290: add get_rf_strength and improve status reading efficiency
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:49 -03:00
Michael Krufky 6b897f2c39 V4L/DVB (6139): tea5767: add get_rf_strength and improve status reading efficiency
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:49 -03:00
Michael Krufky fd443f7444 V4L/DVB (6138): tea5761: add get_rf_strength and improve status reading efficiency
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:46 -03:00
Michael Krufky 735f0b9af1 V4L/DVB (6137): tuner-simple: add get_rf_strength and improve status reading efficiency
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:45 -03:00
Michael Krufky 8fb3b9f7a9 V4L/DVB (6136): dvb_frontend: add get_rf_strength function pointer to dvb_tuner_ops
Add get_rf_strength function pointer to dvb_tuner_ops, so that rf signal
strength can be read directly from the tuner driver by the dvb demodulator
driver and / or the analog tuning system.

This is an internal api addition -- userspace is not affected.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:44 -03:00
Michael Krufky ca805d57cf V4L/DVB (6134): tuner: alter build to produce separate modules
Break tuner.ko into separate modules. This was a quick change -
Tuner sub-drivers are still static-linked to tuner.ko, this will
change after using dvb_attach and removing the probing functions.

After this change, one can deselect undesired tuner sub-drivers via Kconfig.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:43 -03:00
Michael Krufky 4adad287de V4L/DVB (6133): tuner-simple: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:41 -03:00
Michael Krufky 8d0936ed15 V4L/DVB (6132): tea5767: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:40 -03:00
Michael Krufky 7ab10bf72a V4L/DVB (6131): tea5761: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:39 -03:00
Michael Krufky 96c0b7cfa5 V4L/DVB (6130): mt20xx: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:39 -03:00
Michael Krufky 910bb3e3c5 V4L/DVB (6129): tda8290: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:35 -03:00
Michael Krufky e18f9444bd V4L/DVB (6128): hybrid tuner refactoring core changes, phase 1
Prepare tuner-core for conversion of tuner sub-drivers into 
dvb_frontend modules

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:35 -03:00
Michael Krufky db8a695658 V4L/DVB (6127): tuner: kill i2c_client interface to tuner sub-drivers
To ease the conversion of the analog tuner sub-drivers into dvb_frontend
style tuner modules, we must remove the i2c_client interface.

dvb_frontend style tuner modules use i2c_transfer directly on the i2c_adapter.

This change only alters the interface between tuner.ko and the tuner
sub-drivers. The v4l2 / i2c_client interface to tuner.ko remains intact.

This patch adds inline functions tuner_i2c_xfer_send, and tuner_i2c_xfer_recv,
to replace i2c_master_send and i2c_master_recv inside the tuner sub-drivers.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:34 -03:00
Michael Krufky 293197cd0f V4L/DVB (6126): tuner: add warning for obsolete i2c address range 0x64 thru 0x6f
The tuner module has a rather aggressive range of possible i2c addresses.

As per the specs available, it appears as if there are no 4-byte tuners that
actually use i2c addresses in the range 0x64 thru 0x6f, yet, tuner-core claims
the address range 0x60 thru 0x6f.

Allowing tuner.ko to probe these addresses can cause potential damage to
certain IR receivers, RTC chips or any other IC's that might otherwise reside
on the i2c bus using one of these addresses.

The plan is to remove these i2c addresses from the i2c address range of the
tuner module. If any devices are discovered that actually do have tuners at
one of these addresses, the newer i2c probing methods will be used to handle
those cases.

In order to collect this information and avoid any potential regressions,
the following warning has been added upon successful detection of a tuner
using an i2c address in the range 0x64 thru 0x6f:

====================== WARNING! ======================
Support for tuners in i2c address range 0x64 thru 0x6f
will soon be dropped. This message indicates that your
hardware has a {tuner name} tuner at i2c address {addr}.
To ensure continued support for your device, please
send a copy of this message, along with full dmesg
output to v4l-dvb-maintainer@linuxtv.org
Please use subject line: "obsolete tuner i2c address."
====================== WARNING! ======================

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:30 -03:00
Michael Krufky b930e1d851 V4L/DVB (6125): whitespace cleanup: replace leading spaces with tabs
There were many instances of 7-space indents spread throughout
the v4l-dvb tree.

This patch replaces the 7-space indents with tabs.  The whitespace cleaner
script doesn't catch these, because it assumes that all indents are 8-space.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:29 -03:00
Tyler Trafford 38051450b3 V4L/DVB (6124): cx25840: add a few 10 microsecond delays
There were a couple of places in the cx25840 initialization where the
datasheet called for a 10 microsecond delay, which we ignored because
of the 10 usec I2C delay. Put them in anyway now that the I2C delay
was decreased to 5 usec.

Signed-off-by: Tyler Trafford <ttrafford@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:29 -03:00
Hans Verkuil 51b39dfa54 V4L/DVB (6123): ivtv: move ivtv.h public header to include/linux
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:28 -03:00
Adrian Bunk 136280322d V4L/DVB (6122): ivtvfb: fix an obvious bug in ivtvfb_release_buffers()
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:25 -03:00
Hans Verkuil 641ed49db6 V4L/DVB (6121): ivtvfb: replace ivtv_fb prefix to ivtvfb
ivtvfb: replace ivtv_fb prefix to ivtvfb, change warning to info message

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:24 -03:00
Hans Verkuil 7b3a0d49e3 V4L/DVB (6120): ivtvfb: rename some missed ivtv-fb references to ivtvfb
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:24 -03:00
Hans Verkuil 0f45b8c57e V4L/DVB (6119): ivtvfb: renamed ivtv-fb to ivtvfb, move header to include/linux
The convention for framebuffer devices is to call them xxxfb, not xxx-fb.
Conform to this. Also move the ivtvfb.h header to include/linux: it is a
public header. The FBIO_WAITFORVSYNC ioctl is now also defined in the
ivtvfb.h header, no more need to include matroxfb.h for just this ioctl.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:23 -03:00
Hans Verkuil 66cfaeff95 V4L/DVB (6118): ivtv-fb: add missing FBIO_WAITFORVSYNC ioctl define
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:20 -03:00
Hans Verkuil effa0b0863 V4L/DVB (6117): ivtv: finish VBI related cleanup
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:14 -03:00
Hans Verkuil 2f3a98931f V4L/DVB (6116): ivtv: VBI cleanups and fixes
Besides some VBI cleanups this patch also fixes a subtle problem with the
VBI re-insertion stream where the PIO work handler wasn't called quickly
enough, resulting in occasional corrupt data.

Furthermore the CC output didn't disable CC correctly and at the right time,
causing duplicates to be sent.

An saa7127 fix for VPS output was also added: the wrong data was sent.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:14 -03:00
Hans Verkuil 26e9d59956 V4L/DVB (6115): ivtv/ivtv-fb: improve locking to avoid initialization problems
ivtv/ivtv-fb: improve locking to prevent ivtv/ivtv-fb initialization problems

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:13 -03:00
Hans Verkuil 49ebf14e24 V4L/DVB (6113): ivtv: udelay for the i2c bus was set too high
An udelay of 5 is sufficient for standard speed i2c busses, 10 make it
too slow.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:12 -03:00
Hans Verkuil 21340ae03a V4L/DVB (6112): cx25840: use a workqueue to load the firmware
Loading the firmware using the i2c bit-banging code blocks the kernel.
Move the firmware load code into a workqueue so that it plays well with
other processes.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:09 -03:00
Mauro Carvalho Chehab f58db9590f V4L/DVB (6111): Fix a warning when compiling on x86_64
tcm825x.c: In function 'ioctl_try_fmt_cap':
tcm825x.c:639: warning: format '%d' expects type 'int', but argument 4
                                        has type 'long unsigned int'

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:09 -03:00
Hans Verkuil 3eaeef5742 V4L/DVB (6109): ivtv: use new videodev2.h pixel formats
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:04 -03:00
Oliver Endriss 608f62d6ff V4L/DVB (6107): dvb_frontend: clean-up shutdown handling
Now dvb_powerdown_on_sleep controls whether
- whether LNB power is turned off
- whether the tuner/frontend enters sleep mode

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:03 -03:00
Oliver Endriss 849be2cdf1 V4L/DVB (6106): dvb_frontend: Default for dvb_shutdown_timeout set to 0
Default for dvb_shutdown_timeout set to 0.
dvb_shutdown_timeout > 0 is used for debugging only.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:02 -03:00
Oliver Endriss 48136e1e93 V4L/DVB (6105): dvb_frontend: ts_bus_ctrl() handling fixed
ts_bus_ctrl() should only be called by
- the first open
- the last release call.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:59 -03:00
Marco Schluessler 226835d7e0 V4L/DVB (6104): dvb_ca_en50221: decrement module use count on error
decrement module use count on error

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:58 -03:00
Marco Schluessler 0c12c1bfc4 V4L/DVB (6103): dvb_ca_en50221: return correct error code value
return correct error code value

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:58 -03:00
Jesper Juhl d9bf2c0377 V4L/DVB (6102): dvb: remove some unneeded vmalloc() return value casts from av7110
vmalloc() returns void * - no need to cast it.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:57 -03:00
Michael Krufky 71be258bd9 V4L/DVB (6100): dvb_net: whitespace cleanup
Clean whitespace brain-damage caused by previous patch,
"Fix a warning at dvb_net"

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:54 -03:00
Jesper Juhl 6327e952cd V4L/DVB (6098): ivtv: kzalloc() returns void pointer, no need to cast
Since kzalloc() returns a void pointer, we don't need to cast the
return value in drivers/media/video/ivtv/ivtv-queue.c

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:53 -03:00
Hans Verkuil 2d4d5f11ec V4L/DVB (6097): ivtv: set correct pixel format and alpha properties
ivtv: set correct pixel format and alpha properties in VIDIOC_G_FBUF

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:53 -03:00
Hans Verkuil 559e196a56 V4L/DVB (6096): ivtv: fix V4L2_ENC_CMD_STOP_AT_GOP_END support
Support for V4L2_ENC_CMD_STOP_AT_GOP_END was broken. While the driver
correctly waited for the card to capture until the GOP was complete,
afterwards the driver buffers were just flushed instead of waiting
for the application to read all the pending data.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:49 -03:00
Hans Verkuil a158f35593 V4L/DVB (6094): ivtv: more ivtv-driver.h cleanups
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:48 -03:00
Hans Verkuil fd8b281a28 V4L/DVB (6093): ivtv: reorganized and cleanup ivtv struct
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:48 -03:00
Hans Verkuil 33c0fcad21 V4L/DVB (6092): ivtv: more cleanups, merged ivtv-audio.c and ivtv-video.c into ivtv-routing.c
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:47 -03:00
Hans Verkuil 612570f2c4 V4L/DVB (6091): ivtv: header cleanup
- add guards
- remove unused header includes
- move card-specific stuff from ivtv-driver.h to ivtv-cards.h
- move YUV-specific stuff from ivtv-driver.h to ivtv-yuv.h

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:44 -03:00
Hans Verkuil 459a52fab2 V4L/DVB (6090): ivtv-fb: correct transparency bit reporting
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:43 -03:00
Hans Verkuil d2a35fb172 V4L/DVB (6089): ivtv: log in status if framebuffer uses YUV instead of RGB
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:42 -03:00
Hans Verkuil 01f1e44fe8 V4L/DVB (6088): cx2341x: some controls can't be changed while the device is busy
The driver should now pass the 'busy' state of the device to the cx2341x 
module whenever controls are set or tried. -EBUSY will be returned if 
the device is busy and the user attempts to modify certain 'dangerous' 
controls. It concerns controls that change the audio or video 
compression mode and bitrates.

The cx88-blackbird and pvrusb2 drivers currently always pass '0' (not busy)
to the cx2341x, effectively keeping the old behavior for now.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:42 -03:00
Hans Verkuil ea115d54bc V4L/DVB (6087): ivtv: prevent changing VBI format while capture is in progress
Changing the VBI format requires a CX2341X_ENC_INITIALIZE_INPUT firmware
call. This can only be done if no capture is in progress. So return
-EBUSY if the encoder is busy.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:38 -03:00
Hans Verkuil ad8ff0f10b V4L/DVB (6086): ivtv: fix output mode processing: UDMA_YUV wasn't cleared
- Always clear when stopping the decoder
- Clear if the filehandle that is being close was used for UDMA_YUV output.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:38 -03:00
Trent Piepho f6210c9160 V4L/DVB (6085): cx88-alsa: Fix mmap support
The driver has long claimed to support mmap, but it didn't work at all.  Some
of the dma buffer parameters weren't set, and since video_buf uses vmalloc to
allocate the buffer, a page callback is needed too.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:37 -03:00
Trent Piepho ffb7394d51 V4L/DVB (6084): cx88-alsa: Eliminate snd_cx88_cards
The driver kepts a static global array of snd_card pointers for each card
probed, which was never used.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:36 -03:00
Trent Piepho 05b2723387 V4L/DVB (6083): cx88-alsa: Rework buffer handling
Rework the way the DMA buffer is handled and IRQs are generated.

ALSA uses a ring-buffer of multiple periods.  Each period is supposed to
corrispond to one IRQ.

The existing driver was generating one interrupt per ring-buffer, as opposed
to per period.  This meant that as soon as the IRQ was generated, the hardware
was already starting to re-write the beginning of the buffer.  Since the DMA
happens on a per-line basis, there was only a narrow window to copy the data
out before the buffer was overwritten.

The cx88 core RISC program generator is modified so that it can set the IRQ
and counter flags to count every X lines of DMA transfer.  This way we can
generate an interrupt every period instead of every full ring-buffer.  Right
now only period of one line are supported, but it should be possible to
support longer periods.  Note that a WRITE instruction generates an IRQ when
it starts, not when the transfer is finished.  Thus to generate an IRQ when
line X is done, one must set the IRQ flag on the instruction that starts line
X+1, not the one that ends line X.

Change the line size so that there are four lines in the SRAM FIFO.  If there
are not four lines, the analog output from the cx88's internal DACs is full of
clicks and pops.

Try to handle FIFO sync errors.  Sometimes the chip generates many of these
errors before audio data starts.  Up to 50 sync errors will be ignored and the
counter reset.

Have the IRQ handler save the RISC counter to the chip struct, and then have
the pointer callback use this to calculate the pointer position.  We could
read the counter from the pointer callback, but sometimes the sync errors on
start up cause the counter to go crazy.  ALSA sees this and thinks there has
been an overrun.  The IRQ hander can avoid saving the counter position on
sync errors.

The chip "opened" flag wasn't necessary.  ALSA won't try to open the same
substream multiple times.  Probably this code was cut&pasted from the bt87x
driver, which has multiple sub-streams for one chip.

Do error checking for the videobuf mapping functions.

snd_card_cx88_runtime_free() is useless and can be deleted.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:34 -03:00
Trent Piepho 16cf1d0c5d V4L/DVB (6082): cx88: Improve risc instruction printing in sram channel dump
When the risc instrunctions from the CMDS were printed, instruction arguments
weren't taken into account.

This changes output like:
cx88[0]:   risc0: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc1: 0x0cac2800 [ INVALID sol eol 23 21 19 18 13 count=2048 ]
cx88[0]:   risc2: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc3: 0x0cac2c00 [ INVALID sol eol 23 21 19 18 13 count=3072 ]

cx88[0]:   risc0: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc1: 0x0cac2800 [ arg #1 ]
cx88[0]:   risc2: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc3: 0x0cac2c00 [ arg #1 ]

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:28 -03:00
Jean Delvare aeb292d134 V4L/DVB (6081): ivtv: Fix static structure initialization
Convert the initialization of ivtv_i2c_algo_template to C99-style.
Otherwise a future change to struct i2c_algo_bit_data would break
this code.

Also declared that structure const - it's a template after all.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:24 -03:00
Mauro Carvalho Chehab 9c12224a60 V4L/DVB (6079): Cleanup: remove linux/moduleparam.h from drivers/media files
Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This
patch removes all occurences of moduleparm.h from drivers/media files.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:17 -03:00
Michal Piotrowski f518b43c45 V4L/DVB (6078): Coding style fix drivers/media/video/zr36016.c
Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:07 -03:00
Michal Piotrowski b9758dfe0a V4L/DVB (6077): Coding style fix drivers/media/video/zr36050.c
Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:06 -03:00
Michal Piotrowski 5634f2ec80 V4L/DVB (6076): Coding style fix drivers/media/video/zr36060.c
Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:05 -03:00
Michael Krufky ffbb807c13 V4L/DVB (6075): tuner: kernel headers go above subsystem headers
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:04 -03:00
Michael Krufky c996899d0b V4L/DVB (6074): tuner: fix ifdef tags to match actual file name
The file, tuner-driver.h was originally named tuner-hw.h, but we decided to
rename it.  At the time, I had forgotten to change the #ifdef __TUNER_HW_H__
to #ifdef __TUNER_DRIVER_H__ .  This patch corrects that.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:04 -03:00
Edgar Simo d90d9f5a0a V4L/DVB (6072): saa7134: add DVB-T support for Avermedia Super 007
Add DVB-T support for Avermedia Super 007

Analog television is untested.  The device lacks input adapters for radio,
svideo & composite -- seems to be a DVB-T ONLY device.

Signed-off-by: Edgar Simo <bobbens@gmail.com>
Acked-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:01 -03:00
Edgar Simo 261f5081a4 V4L/DVB (6071): saa7134-dvb: add missing newline
This is a simple whitespace cleanup.

Signed-off-by: Edgar Simo <bobbens@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:00 -03:00
Trent Piepho 19453bc188 V4L/DVB (6068): cx88-alsa: Use pci_dev->revision
The revision is part of the pci_dev struct, so there is no need to read it in.

Stop storing the revision and latency in the chip struct, since they're never
used after being printed out when the driver loads.

linux/pci.h wasn't included.  It was getting picked up something else,
probably cx88.h, but this file uses struct pci_dev so it should include pci.h.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:00 -03:00
Trent Piepho 5a5b3b5d4f V4L/DVB (6067): cx88-alsa: Hardware doesn't support mono audio
channels_min should be 2, not 1.  The hardware only supports stereo.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:59 -03:00
Trent Piepho 59fd8f8d8e V4L/DVB (6066): cx88-alsa: Change order of interrupt enabling, fix spurious IRQs
Currently the driver turns on audio interrupts, then sets the audio interrupt
mask to select which interrupts to get.  One could received unwanted
interrupts since the mask is set _after_ interrupts have already been turned
on.  Change the order of the operations, and clear any audio interrupt status
bits that are already set for good measure.

Before changing the SRAM FIFO parameters, make sure the FIFO isn't being used.
This shouldn't happen with just the ALSA driver, as it should never try to
turn on FIFO/RISC/DMA while they are already on.  However, the V4L driver
needs to turn the audio FIFO on for analog audio output to work (undocumented
cx88 bug).  The FIFO parameters are in an inconsistent state while they are
updated, and this results in many FIFO sync error IRQs if the FIFO is in use
while it's in this inconsistent state.

Also create and use a bunch of symbolic constants for audio interrupt mask
bits.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:55 -03:00
Trent Piepho 5ba862b77e V4L/DVB (6065): cx88-alsa: Call core irq handler when needed
When an irq handled by the cx88 core driver (currently IR and errors) occurs
and the cx88-alsa irq handler is the first called, it will claim to have
handled the irq but it doesn't call cx88_core_irq() to handle it.

The means loading cx88-alsa can disable the IR remote.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:55 -03:00
Trent Piepho 8ddac9ee4b V4L/DVB (6064): cx88: Add symbolic names for the PCI interrupt bits
Used for the PCI_INTMSK and PCI_INT_STAT registers.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:54 -03:00
Hans Verkuil 7c03a4488b V4L/DVB (6061): ivtv: add VIDIOC_OVERLAY
Add VIDIOC_OVERLAY to enable/disable the OSD. Also add the OSD state to the
log status report.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:53 -03:00
Hans Verkuil 8beb058f1e V4L/DVB (6060): ivtv: fix IVTV_IOC_DMA_FRAME bug introduced by highmem bugfix
The return value of ivtv_udma_fill_sg_list() was changed by the
highmem bugfix, but that return value was still used in ivtv-yuv.c.

Revert to the old return value, but in addition return -1 in case of
a memory allocation error.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:48 -03:00
Hans Verkuil 25e3f8f40e V4L/DVB (6059): ivtv: log stereo/bilingual audio modes
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:47 -03:00
Hans Verkuil 0989fd2c88 V4L/DVB (6058): ivtv: add support for highmem udma
When trying to DMA userspace buffers to the cx23415 you need to check
whether the page is in highmem. If this is the case, then bounce buffers
have to be used to allow DMA.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:46 -03:00
Hans Verkuil 3869c6a088 V4L/DVB (6057): ivtv-fb: remove unused header includes
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:46 -03:00
Hans Verkuil baa4072d84 V4L/DVB (6056): ivtv: move serialization to the fileops level
Serialization is now done on the open/close/ioctl level and also when the
read/write/poll start an encoder/decoder stream.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:43 -03:00
Hans Verkuil 1aa32c2ffd V4L/DVB (6055): ivtv: improve debug messages
- add FILE debug flag for open/close/read/write/poll.
- show cmd for encoder/decoder command ioctl.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:42 -03:00
Hans Verkuil 313e91e824 V4L/DVB (6054): ivtv: specify some stream sizes in kB instead of MB
Some streams (PCM, VBI decoding) do not need that much memory, so specify
the allocated memory in kB instead of MB to limit memory usage. E.g. 1 MB
is overkill for the VBI decoding stream, 64 kB is enough.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:41 -03:00
Hans Verkuil 2ce55b606b V4L/DVB (6053): ivtv: setup TV output standard on init to prevent flicker
The TV output standard was set only on first use, which meant that the saa7127
was set to NTSC until then, leading to flickering on PAL systems.

Since the saa7127 has no firmware it is OK to initialize it immediately.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:40 -03:00
Hans Verkuil 8267761881 V4L/DVB (6051): cx25840: make proper use of SOFT_RESET
Whenever the 0x80b register is used the microcontroller should be reset.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:38 -03:00
Hans Verkuil e17a06bada V4L/DVB (6050): ivtv: retry/timer improvements
- Give up frame after three retries.
- When the last capture/decode ends, make sure to delete the dma_timer.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:37 -03:00
Hans Verkuil 51a99c0428 V4L/DVB (6049): ivtv: fix VBI reinsertion decoding
- Invalid VBI packets should result in an empty VBI frame, not
  in an zero-sized frame that causes the reader to incorrectly
  return a 0 (EOF) value.
- PIO completion should not reset the sg_pending_size field.
- The DMA offset detection code should be ignored for PIO transfers:
  it somehow messes up the data on the card and is not needed anyway
  for PIO.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:36 -03:00
Hans Verkuil de870b52be V4L/DVB (6048): ivtv: fix stop stream locking
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:36 -03:00
Hans Verkuil 37093b1ea6 V4L/DVB (6047): ivtv: Fix scatter/gather DMA timeouts
It turns out that the cx23415/6 DMA engine cannot do scatter/gather DMA
reliably. Every so often depending on the phase of the moon and your
hardware configuration the cx2341x DMA engine simply chokes on it and
you have to reboot to get it working again.

This change replaced the scatter/gather DMA by single transfers at a time,
where the driver is now responsible for DMA-ing each buffer.

UDMA is still done using scatter/gather DMA, that will be fixed soon.

Many thanks to Mark Bryars <mark.bryars@etvinteractive.com> for discovering
the link between scatter/gather and the DMA timeouts.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:32 -03:00
Hans Verkuil f4071b85ea V4L/DVB (6046): ivtv: always steal full frames if out of buffers.
When there are no more free buffers, then buffers are stolen from the
predma queue. Buffers should be stolen from the head of that queue (which
is where the most recently added buffers are) and all buffers belonging
to a frame should be stolen. Otherwise 'half-frames' would remain in the
queue, which leads to ugly playback and complete sync failure for YUV
buffers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:32 -03:00
Hans Verkuil 3562c43be8 V4L/DVB (6045): ivtv: fix handling of INITIALIZE_INPUT fw call
The CX2341X_ENC_INITIALIZE_INPUT firmware call requires careful handling,
otherwise the computer can freeze or the top-third of the screen can start
flickering. This patch ensures that CX2341X_ENC_INITIALIZE_INPUT is called
at the right time and in the right way.

In addition the stop capture handling was improved so that the last pending
DMA transfer is also processed. Otherwise this would be the first data that
arrived when a new capture was started which is not what you want.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:31 -03:00
Kazuhiko Kawakami da80be2136 V4L/DVB (6044): vp27smpx: clarify history of this source.
Signed-off-by: Kazuhiko Kawakami <kazz-0@mail.goo.ne.jp>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:30 -03:00