Most UVC camera include an interrupt endpoint to report control value changes,
video streaming errors and camera button events. The USB controller
continuously polls the interrupt endpoint to retrieve such events. This
prevents the device from being auto-suspended, and thus consumes power.
Reporting video streaming errors don't make sense when the V4L2 device is
closed. Control value changes are probably useless as well if nobody listens to
the events, although caching will probably have to be completely disabled then.
No polling is thus be required when /dev/videoX is not opened.
To enable auto-suspend and save power do not poll the interrupt endpoint until
the device is open. We lose the ability to detect button events if no
application is using the camera.
http://bugzilla.kernel.org/show_bug.cgi?id=11948
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The UVC specification requires frame descriptors indexes to range from 1 to
the number of frame descriptors. At least some Hercules Dualpix Infinite
webcams erroneously use non-continuous index ranges. Make the driver support
them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
I have been informed by the manufacturer that the patch currently in the v4l tree to support the Genpix-CW3K version of the hardware will actually
damage the firmware on recent units. As he seems to not want this hardware supported in Linux, and I do not know how to detect the difference between
affected and not-affected units, I am requesting the immediate removal of support for this device. This patch removes a portion of the changeset
dce7e08ed2b1 applied 2007-08-18 relating to this specific device.
Adapted patch to not remove code, but to only to comment it out.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
dibusb_i2c_xfer seems to do things very dangerous :
it assumes that it get only write/read request or write request.
That means that read can be understood as write. For example a program
doing
file = open("/dev/i2c-x", O_RDWR);
ioctl(file, I2C_SLAVE, 0x50)
read(file, data, 10)
will corrupt the eeprom as it will be understood as a write.
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch adds the USB IDs for the Terratec devices T3 and T5.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
"Leadtek WinFast DTV Dongle H" is a hybrid digital/analog USB-stick TV
receiver. The code below allows the digital part to work with dvb_usb
in linux.
Signed-off-by: tomas petr <tom-petr@seznam.cz>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch is reorganizing the frontend-attach mechanism in order to
gain noise-less (superflous prints) deactivation of submodules.
Credits go to Uwe Bugla for helping to clean and test the code.
Signed-off-by: Uwe Bugla <uwe.bugla@gmx.de>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Reducing the print-levle of I2C error prints cleans some unwanted but
unavoidable errors from default syslog-level.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The em28xx actually has a register that tells the driver what the maximum
packet size is (based on a value programmed into the eeprom). Make use of
that register instead of assuming a hardcoded value of 564 (since 564 is not
correct for devices that do QAM such as the KWorld 340u).
Note that for now the em2874 code isn't there, falling back to the 564 value,
however this is not a problem since there are not any em2874 based devices in
the current v4l-dvb tree).
Thanks to Jarod Wilson for detecting the initial problem and figuring out that
the isoc configuration was wrong for his device.
Cc: Jarod Wilson <jarod@wilsonet.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Remove a debug printk() line I added which is no longer needed, and happened
to be causing compile failures on some earlier kernels in Han's daily
compile report.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
According to the engineer at PCTV Systems, the xc5000 reset pin is supposed
to be on GPIO12. However, despite three nights of effort, pulling that GPIO
low didn't reset the xc5000. While pulling MO_SRST_IO low does reset the
xc5000, this also resets in the s5h1409 being reset as well. This causes
tuning to always fail since the internal state of the s5h1409 does not match
the driver's state.
Given that the only two conditions in which the driver performs a reset is
during firmware load and powering down the chip, I am taking out the reset.
We know that the chip is being reset when the cx88 comes online, and not being
able to do power management for this board is better than not having any
tuning at all.
Problem discovered when implementing proper power management for the xc5000,
which results in calls to the reset callback *after* s5h1409 is initialized.
Cc: Steven Toth <stoth@kernellabs.com>
Cc: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Make sure the au0828 issues the command to power down the tuner when the
user is done using analog support.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Instead of polling at 100ms intervals for register writes, poll at 5ms
intervals. This is consistent with the xc5000 specification, and improves
tuning time by up to 500 ms on devices that such as the au0828 which do not
properly implement i2c clock stretching (since the five register writes that
occur for a tuning request often do not complete immediately but do complete
far before 100ms has gone by).
The net amount of time we wait before timing out is unchanged (500ms).
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch adds XC5000 supports for DVB-T 6MHz and 8MHz bandwidth.
Signed-off-by: David T.L. Wong <davidtlwong@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Xceive has graciously allowed us to now freely redistribute the xc5000
firmware, which eliminates the need for users to manually extract the blob
from the Hauppauge driver.
Thanks to Brian Mathews <bmathews@xceive.com> for providing this code
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
According to the xc5000 spec, the reset pin only needs to be held low for 10ms.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
There was a typo in the module description for the "no_poweroff" option, where the
help was being associated with the "debug" option instead.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Defer loading of the xc5000 firmware until it is actually needed. This helps
on distros that have hald, which results in the device not being available
for use for around ten seconds in cases where the i2c bus is slow (such as
the HVR-950Q). Also, the firmware load isn't really useful since we
immediately put the device to sleep afterward, which means a firmware reload
will be required anyway.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Provide for the ability for a user to disable putting the tuner to sleep, in
case he doesn't want to incur the cost of reloading the firmware when starting
up his/her application. The module options are intentionally identical to
xc3028.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Make it a little more obvious in the dmesg output what is going on during
firmware upload. This is more important for boards like the HVR-950q that
take nearly seven seconds to do the upload.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Starting in firmware version 1.1.44, Xceive recommends using the FINERFREQ for
all normal tuning (the doc indicates reg 0x03 should only be used for fast
scanning for channel lock)
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Expose the firmware build number along with the other version info
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The xc5000 datasheet indicates that the reset pin only needs to be held low
for 10ms. Reduce the value accordingly, which speeds up the firmware load
time a bit.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Xceive got rid of the XREG_POWER_DOWN register in later firmware revisions.
Their technical support informed me that the correct way to put the tuner
to sleep is to pull the reset pin (but don't reload the firmware).
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This switches to a new version of the xc5000 firmware, extracted from the
latest Hauppauge driver. It includes the support for the XREG_BUSY register
(a lack of which was causing tuning to take 3200ms instead of around 300ms).
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Don't sleep for 400ms polling the tuner's lock if in digital mode (since the
xc5000 lock status registers appear to only be reliable in analog mode)
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Bring back the code that puts the xc5000 to sleep. For the Pinnacle 801e
this results in power consumption at idle dropping from 325ma to 124ma.
If there are *actually* any devices that don't work in this configuration,
they should set dvb_frontend.ops.tuner_ops.sleep to NULL (per mkrufky's
suggestion)
Also, had to make sure we were making sure the firmware was loaded in the
digital version of set_params, or else we end up get i2c errors if the
device is asleep
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Make return value checking for calls to i2c routines explicit.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cleanup the i2c write routine, getting rid of a passthrough function with only
one caller
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch centralizes the i2c read functions, and eliminates pass-through
function only called by one caller.
Make reading of xc5000 registers an atomic i2c transaction in case we're on a
multi-master bus.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The patch means the board will be recognised, and the parts brought
out of reset correctly. This patches depends on the centralized GPIO
patch to be merged. What's missing before the HVR-1270 will function
for DTV? The model# needs to be added to avoid 'unknown model'
output and the LG3305/Tuner need to be attached in cx23885-dvb.c
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The GPIO's on the product can be in one of three places. To date we've
mainly used the GPIO's on the bridge itself, and once on the encoder.
Rather than having the complexity of multiple GPIO writes/reads from
isolated placed in the driver we'll route them through this function,
so we can make intelligent decisions about 1) Where the GPIO lives
and 2) Whether it conflicts (based on board) with some other function
to avoid bugs.
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
av7110_av_start_play() should return 0 on success.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Discard PES packet if transport error indicator flag is set.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Implemented TS replay capability.
audio/video devices are able to process PES and TS data now.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>