tda8290 were using some random video standard for FM. This results on random
errors. Instead, program tda8290 in expert mode, using a configuration near the
one specified on NXP datasheet for tda8295 (available on their site).
Also, properly display that the device is on radio mode.
Probably due to a removed code, tda827x were doing some wrong calculus at the
returned frequency. I suspect that the original idea were to return the
programmed divisor converted into frequency again.
However, the current code is sometimes multiplying the programmed frequency by
62500, and, on other cases, like radio, it dividing it by 1000.
Instead of doing such math, let's just store the frequency value as requested by
the caller module.
Cc: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/home/mauro/v4l-dvb/v4l/tuner-xc2028.c: In function 'xc2028_sleep':
/home/mauro/v4l-dvb/v4l/tuner-xc2028.c:1111: warning: 'return' with no value, in function returning non-void
V4L/DVB (9770): em28xx: turn off tuner when not used
em28xx devices generally get hot when xc3028 tuner is powered on. This
patch solves this by turning power off when the device is not used, at the
expense of having a higher load time, when calling a TV application.
Since firmware load happens on 1 or 2 seconds on most devices, this is not a pain.
Also, it helps to save the planet by saving some power :)
V4L/DVB (9769): tuner-xc2028: powers device of when not used
Since the firmware load is now fast on most boards, better to keep the tuner
off by default. A modprobe parameter were added to keep the old behavior,
to be used by old devices.
Andy Walls [Sun, 23 Nov 2008 19:27:57 +0000 (16:27 -0300)]
V4L/DVB (9730): cx18: Quiet a sometimes common warning that often has benign consequences
cx18: Quiet a sometimes common warning that often has benign consequences.
No one probably cares that the firmware took forever to ack our command, as
they always seem to succeed whether or not the firmware acks it in a reasonable
amount of time.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
cx18: Adjust outgoing mailbox timeouts and remove statistics logging.
This saves some wasted storage in struct cx18 for each card. Cutting
the outgoing mailbox timeouts in half from the previous value appears to
be safe with MythTV. Got rid of interrupted case code path after
a wait uninterruptable returns.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Tue, 18 Nov 2008 01:48:46 +0000 (22:48 -0300)]
V4L/DVB (9725): cx18: Remove unnecessary MMIO accesses in time critical irq handling path
Remove unnecessary MMIO accesses in time critical irq handling path. Also
ensured that the mailbox ack field is read in last, so we know for sure if we
have a stale mailbox or not on receipt.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy so that
write retries always occur and read retries never occur (as they never help).
Remove MMIO statistics logging to speed up MMIO accesses. Deprecate & ignore
retry_mmio and mmio_ndelay module parameters, to essentially force
retry_mmio=1 and mmio_ndelay=0.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Mon, 17 Nov 2008 00:18:00 +0000 (21:18 -0300)]
V4L/DVB (9723): cx18: Propagate staleness of mailbox and mdl ack data to work handler
cx18: Propagate staleness of mailbox and mdl ack data to work handler to let
the work handler know that the data from the encoder may not be coherent.
Allows for smarter handling of buffers in future, to deal with MDLs that fall
out of rotation due to irq handler being late in collecting mailbox and mdl ack
info.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 16 Nov 2008 23:18:05 +0000 (20:18 -0300)]
V4L/DVB (9722): cx18: Convert per stream queue spinlocks into mutexes
Convert the per stream queue spinlocks into mutexes. All queue
manipulation happens via the work queue or system calls into the driver, and
not in an interrupt context. This reduces the amout of time the cx18 driver
keeps interrupts disabled.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 16 Nov 2008 20:15:01 +0000 (17:15 -0300)]
V4L/DVB (9721): cx18: Change to singlethreaded global work queue thread for deferable work
Change to singlethreaded global work queue thread for deferable work,
instead of the kernel default multithreaded work queue. This ensures
execution of deferable work is always in the proper order, so caputred buffers
don't get reordered.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 16 Nov 2008 04:38:19 +0000 (01:38 -0300)]
V4L/DVB (9720): cx18: Major rewrite of interrupt handling for incoming mailbox processing
A major rewrite of interrupt handling for incoming mailbox processing, to split
the timing critical steps from the the deferrable steps as the sending XPU on
the CX23418 will time out and overwrite our incoming mailboxes rather quickly.
Setup a pool of work "order forms" for the irq handler to send jobs to the new
work handler routine which uses the kernel default work queue to do the
deferrable work. Started optimizing some of the cx18-io calls as they are now
the low hanging fruit for recoving microseconds back from the timeline.
Future optimizations will get rid of mmio read retries, mmio stats logging, and
combine smaller functions in the irq path into the larger ones to save ~2 us
each.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Alexey Klimov [Wed, 19 Nov 2008 03:36:29 +0000 (00:36 -0300)]
V4L/DVB (9655): radio-mr800: fix unplug
This patch fixes problems(kernel oopses) with unplug of device while
it's working.
Patch adds disconnect_lock mutex, changes usb_amradio_close and
usb_amradio_disconnect functions and adds a lot of safety checks.
Andy Walls [Sun, 9 Nov 2008 22:51:44 +0000 (19:51 -0300)]
V4L/DVB (9599): cx18: Fix unitialized variable problem upon APU firmware file read failure
If APU firmware file read failed, the jump vector to the APU was undefined and
the APU would be started executing garbage. Fix uninitialized variable to be
an infinite loop for the APU, but also bail out before even starting the APU.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 9 Nov 2008 21:14:07 +0000 (18:14 -0300)]
V4L/DVB (9598): cx18: Prevent CX23418 from clearing it's outgoing ack interrupts to driver
When the CX23418 CPU unit sent out an ack interrupt to the linux driver, it
also received that interrupt and cleared the flag before the linux driver could
see what the interrupt was for. This fix prevents the CPU from receiving an
IRQ for it's own outgoing ack's to the linux driver. This fix is critical now
that the linux driver doesn't poll but relies on these ack interrupts.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 8 Nov 2008 20:14:22 +0000 (17:14 -0300)]
V4L/DVB (9597): cx18: Minor fixes to APU firmware load process
Use the APU fw start address from rom file instead of a hardcoded entry vector.
Fixed cx18_setup_page() calls to use the correct APU image load addresses.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 8 Nov 2008 17:19:37 +0000 (14:19 -0300)]
V4L/DVB (9596): cx18: Further changes to improve mailbox protocol integrity & performnce
All waits for cx18 mailbox API commands are now uninterruptable. Added
code to collect mailbox ack statistics. Tweaked timeouts based on collected
stats and video vertical frame and field rates.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 8 Nov 2008 02:57:46 +0000 (23:57 -0300)]
V4L/DVB (9595): cx18: Improve handling of outgoing mailboxes detected to be busy
cx18: Improve handling of outgoing mailboxes detected to be busy. When
encountering a busy mailbox, sleep instead of polling, and wait for interrupt or
timeout. If the mailbox is still busy, force it free. When sending commands,
make sure we never create a situation where we mark the mailbox busy upon
sending, and ensure we always have a method to cleanly recover from a busy
mailbox.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Thu, 6 Nov 2008 04:15:41 +0000 (01:15 -0300)]
V4L/DVB (9593): cx18: Add outgoing mailbox mutexes and check for ack via waitq vs poll
Add mutexes to ensure exclusive access for outgoing driver to CX23418 mailboxes.
Also wait on a waitq for mailbox acknowledgement from the CX23418 instead of
polling.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Thu, 6 Nov 2008 00:19:15 +0000 (21:19 -0300)]
V4L/DVB (9592): cx18: Use default kernel work queue; fix streaming flag for work handler
cx18: Use default kernel work queue; fix streaming flag for work handler.
Eliminate cx18 specific work queue and use the kernel default work queue.
Fixed the F_STREAMING_FLAG for the TS stream so cx18_dvb_work_handler()
can know when it is not safe to send MDLs to the firmware.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 2 Nov 2008 21:15:28 +0000 (18:15 -0300)]
V4L/DVB (9513): cx18: Reduce number of mmio read retries
cx18: Reduce number of mmio read retries to improve performance. Experiments
have shown 2 things: read retries never improve the result of a suspect mmio
read from the CX23418 (the result stays all 0xff's), and that most of the
suspected read failures are actually proper reads of values that should be
all 0xff's. This change reduces the number of read retries and keeps the
count separate from write retries.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Manu Abraham [Mon, 19 Nov 2007 19:44:47 +0000 (16:44 -0300)]
V4L/DVB (9442): Revert back previous change to 90MHz
Note:
* At High Symbol Rates we do not have enouph machine cycles to handle the
incoming symbols and hence might run into problems at the very end of the
specified definition
* Most of the equations have been calculated for a master clock of 99 MHz,
running at 90MHz, raises lot of issues such as the need to recalculate
all of them , which is eventually very painful.
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (9764): em28xx: Add support for suspend the device when not used
Several chips may be turned off when the device is not used, like audio,
video and dvb demods. This patch adds a gpio callback at the core
structs to allow turning off such devices.
Before this patch, several devices without tuner were kept the value 0
for tuner_type. However, this means TUNER_TEMIC_PAL. Replace those
entries for the proper TUNER_ABSENT value.
V4L/DVB (9760): em28xx: move gpio lines into board table description
Instead of a large, ugly switch specifying the gpio tables for each
device, let's move it into the boards struct. This also helps to see
what boards have already the gpio's for DVB.
V4L/DVB (9753): em28xx: cleanup: saa7115 module auto-detects saa711x type
Since saa7115 has saa711x chip auto-detection, there's no need on differenciating
it at cards table. Just use the generic name for all boards that use a philips
saa711x decoder.
V4L/DVB (9747): em28xx: Properly handles XCLK and I2C speed
The previous patches removed XCLK and I2C magic. Now, we finally know
what those registers do. Also, only a very few cards need different
setups for those.
Instead of keeping the setups for those values inside the per-device
hack magic switch, move the uncommon values to the board-specific
struct, and have a common setup for all other boards.
So, almost 100 lines of hacking magic were removed.
A co-lateral effect of this patch is that it also fixes a bug at em28xx-core, where xclk
were set, without taking any care about not overriding a previous xclk setup.
Cleanup the calls to set the GPIOs and GPOs for various devices,
replacing the register number with the #define from em28xx-reg.h and
converting over to using em28xx_write_reg()
Antonio Ospite [Sat, 22 Nov 2008 08:23:39 +0000 (05:23 -0300)]
V4L/DVB (9712): gspca:Subdriver ov534 added.
The OmniVision OV534 is the USB bridge chip used in Sony Playstation EYE,
it is found also in other webcams like Hercules Blog Webcam and
Hercules Dualpix HD.
This driver is the port to gspca of a prototype driver by Mark Ferrell
based on vivi. The original code to initialize the camera and start the
capture is from Jim Paris on ps2dev.org, here integrated with the analysis
of the USB communications taken by the windows driver.
Erik Andrén [Sat, 1 Nov 2008 16:13:03 +0000 (13:13 -0300)]
V4L/DVB (9698): Add another vflip quirk for the s5k4aa
The msi gx7xx range of computers seem to be a strange lot with lots of different sys vendor names and differently oriented sensors. This commit adds another quirk for a range of them.
Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Mon, 17 Nov 2008 17:52:56 +0000 (14:52 -0300)]
V4L/DVB (9685): gspca: Correct restart of webcams in spca501.
Currently the spca501 driver only works the first time used, then the cam needs
to be unplugged or the driver reloaded, this is because currently the data
which should be send each time the stream is started is send only once.
Likewise currently the data to initialize the cam is send from the probe
function, and thus will not get send after a suspend/resume.
This patch fixes this by sending both at the right time.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dirk Heer [Fri, 21 Nov 2008 22:00:55 +0000 (19:00 -0300)]
V4L/DVB (9677): bttv: fix some entries on Phytec boards and add missing ones
This Patch does modify the bttv-cards.c and bttc.h so that the driver
supports VD-011, VD-012, VD-012-X1 and VD-012-X2 Framegrabber from
Phytec Messtechnik GmbH.
Some boards use different AC97 setups for output. This patch adds the
capability of specifying the output to be used. Currently, only one
output is selected, but the better is to allow user to select it via a
mixer, on alsa driver.
Alain Kalker [Mon, 17 Nov 2008 20:20:38 +0000 (17:20 -0300)]
V4L/DVB (9665): af9015: Add support for the Digittrade DVB-T USB Stick remote
Adds support for the Digittrade DVB-T USB Stick remote.
As the Digittrade USB stick identifies itself as a generic Afatech AF9015
device, the remote cannot be autodetected. To enable it, add the following
to /etc/modprobe.d/dvb-usb-af9015 or /etc/modprobe.conf:
Laurent Pinchart [Mon, 17 Nov 2008 21:32:11 +0000 (18:32 -0300)]
V4L/DVB (9662): uvcvideo: Fix printk badness when printing ioctl names
Add a trailing newline character after calling v4l_printk_ioctl() to avoid
messing the kernel log up and merge the uvc_v4l2_ioctl message with the ioctl
name.
Laurent Pinchart [Wed, 12 Nov 2008 14:46:43 +0000 (11:46 -0300)]
V4L/DVB (9661): uvcvideo: Commit streaming parameters when enabling the video stream
Sonix-based cameras seem to require the host to commit video streaming
parameters before selecting the alternate endpoint. While most applications
issue a VIDIOC_S_FMT ioctl before starting streaming, this is not required
by the V4L2 specification.
The problem has been noticed on Ubuntu 8.10 with applications using libv4l.
The library blocks VIDIOC_S_FMT calls when the requested format is identical
to the currently selected format. As the driver commits video streaming
parameters when initialising the device, only the first run of a
libv4l-enabled application would succeed.
For the sake of completeness, experiment showed that the camera keeps sending
12 bytes isochronous packets (header only, no data) without toggling the FID
bit if video streaming parameters haven't been committed before selecting the
alternate endpoint.
V4L/DVB (9657): em28xx: add a functio to write on a single register
Introduce a new function that writes to a single register. This is
useful because the vast majority of register writes are a single
register, and this format permits or'ing register value bits together.