V4L/DVB: saa7134: don't wait too much to generate an IR event on raw_decode
At raw_decode mode, the key is processed after the end of a timer. The
previous code resets the timer every time something is received at the IR
port. While this works fine with IR's that don't implement repeat, like
Avermedia RM-JX IR, it keeps waiting until keydown, on IR's that implement
NEC repeat command, like the Terratec yellow.
The solution is to change the behaviour to do the timeout after the first
received data.
The timeout is currently set to 15 ms, as it works fine with NEC protcocol.
It may need some adjustments to support other protocols and to better handle
spurious detections that may happen with some IR sensors.
V4L/DVB: ir-core: Add logic to decode IR protocols at the IR core
Adds a method to pass IR raw pulse/code events into ir-core. This is
needed in order to support LIRC. It also helps to move common code
from the drivers into the core.
In order to allow testing, it implements a simple NEC protocol decoder
at ir-nec-decoder.c file. The logic is about the same used at saa7134
driver that handles Avermedia M135A and Encore FM53 boards.
Laurent Pinchart [Wed, 31 Mar 2010 15:29:26 +0000 (12:29 -0300)]
V4L/DVB: uvcvideo: Use POLLOUT and POLLWRNORM for output devices
The V4L2 specification requires drivers to use the write events in the
file operations poll handler for output devices. The uvcvideo driver
erroneously used read events for all devices. Fix this.
V4L/DVB: sn9c102 / zc0301: Handle webcams when no gspca subdriver conflict
Some webcams handled by both sn9c102 or zc0301 and some gspca subdrivers
(sonixb, sonixj and zc3xx) were not handled when gspca was generated but
not the associated subdrivers.
Vaibhav Hiremath [Sat, 27 Mar 2010 12:37:54 +0000 (09:37 -0300)]
V4L/DVB: V4L: tvp514x: Add Powerup sequence during s_input to lock the signal properly
For the sequence streamon -> streamoff and again s_input, it fails
to lock the signal, since streamoff puts TVP514x into power off state
which leads to failure in sub-sequent s_input.
So add powerup sequence in s_routing (if disabled), since it is
important to lock the signal at this stage.
Vaibhav Hiremath [Sat, 27 Mar 2010 12:37:07 +0000 (09:37 -0300)]
V4L/DVB: V4L: vpfe_capture: Add call back function for interrupt clear for vpfe_cfg
For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.
Jonathan Corbet [Mon, 1 Mar 2010 00:02:55 +0000 (21:02 -0300)]
V4L/DVB: ov7670: Don't use SMBUS I/O
Contrary to my earlier belief, the ov7670 is not actually an SMBUS device,
though it will pretend to be one if it's in a good mood. Unfortunately,
it's rarely in a good mood, especially on the XO 1.5. So use low-level i2c
I/O instead.
Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB: cx25821: prepend cx25821_ to video exported symbols
As reported by Randy Dunlap <randy.dunlap@oracle.com>:
drivers/staging/cx25821/cx25821-video.c:89:struct cx25821_fmt *format_by_fourcc(unsigned int fourcc)
(not static)
conflicts with (has the same non-static name as)
drivers/media/common/saa7146_video.c:87:struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc)
To solve, add cx25821_ prefix to the exported functions found on cx25821-video.h.
This patch were generated by this little shell/perl script:
cat drivers/staging/cx25821/cx25821-video.h|perl -ne \
'if (m/extern.* ([^\s\*]+)\(/) { $n=$1; print "s/([^\d\w_\.])$1/\\1cx25821_$1/g;\n" if (!($n =~ m/cx25821/)); }' \
>changes; for i in drivers/staging/cx25821/*.[ch]; do sed -r -f changes $i >a && mv a $i; done
Add support for design which has an em2863/tvp5150 and uses the standard
empia USB ID. In Sander's case, it was branded as an "Eminent model EM3705"
Thanks to Sander Van Ginkel for testing and help debugging the support.
[mchehab@redhat.com: move it to a vague card number slot (card=29)] Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB: videodev2: introduce a common control for chroma gain
Introduce a new control for modifying the chroma gain. This allows for user
intervention in abnormal signal conditions cases where the decoder's chroma
AGC cannot compensate and the value needs to be adjusted manually.
This patch enables the anti-alias filter, which was originally enabled for
the saa7113, but the saa7115_init_misc was trampling the value. Without this
patch, there would be visible vertical bands in the chroma.
Thanks to Andy Walls for helping test this change against other ivtv products.
V4L/DVB: em28xx: rework buffer pointer tracking for offset to start of video
Rework the logic for tracking the amount of data copied to the VBI buffer, to
address problem found where the video lines are several bytes shifted to the
right (and the leading pixels in the first line rendered are garbage). This
would occur because the copy function would advance the pointer when detecting
headers, but the caller would not adjust the length actually copied.
It turns up we can reduce the starting line for the active area, which results
in more data being captured when under PAL (while the full VBI capture window
still stays properly encoded).
Increase the packets per URB count from 40 to 64. I suspect that whoever was
looking at the usbsnoop captures saw "0x40" packets and mistook it for "40".
As a result of this change, I can see a 25% reduction in the number of
interrupts generated via powertop.
Hans de Goede [Thu, 11 Mar 2010 09:12:39 +0000 (06:12 -0300)]
V4L/DVB: sn9c102: Make hv7131d sensor code also recognize the HV7131E
The hv7131d sensor code also works for the hv7131e, this patch changes
it to also recognize the hv7131e sensor id.
Tested-by: Frank Danapfel <fdanapfe@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Vladimir Ermakov [Wed, 10 Mar 2010 15:44:57 +0000 (12:44 -0300)]
V4L/DVB: saa7134: add capture boards Hawell HW-404M7 and HW-808M7
Adds new capture boards Hawell HW-404M7 and HW-808M7. Those cards have 4
or 8 SAA7130 chips and for the work it only needs initialize registers.
The value of those registers were dumped under Windows using flytest.
But board haven't EEPROM.
Olimpiu Pascariu [Sun, 14 Mar 2010 15:44:37 +0000 (12:44 -0300)]
V4L/DVB: Staging: cx25821: fix coding style issues in cx25821-alsa.c
>From 9473816c446a6ca91905fc49a73732f70b5223b4 Mon Sep 17 00:00:00 2001
This is a patch to the cx25821-alsa.c file that fixes up errors and warnings found by the checkpatch.pl tool
[mchehab@redhat.com: a few adjustments on the comments to improve readability] Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Julia Lawall [Fri, 12 Mar 2010 09:15:32 +0000 (06:15 -0300)]
V4L/DVB: drivers/media/video: move dereference after NULL test
In quickcam_messenger.c, if the NULL test on uvd is needed, then the
dereference should be after the NULL test.
In vpif_display.c, std_info is initialized to the address of a structure
field. This seems unlikely to be NULL. Test std_info->stdid instead.
In saa7134-alsa.c, the function is only called from one place, where the
chip argument has already been dereferenced. On the other hand, if it
should be kept, then card should be initialized after it.
A simplified version of the semantic match that detects this problem is as
follows (http://coccinelle.lip6.fr/):
Ian Armstrong [Sat, 13 Mar 2010 23:22:34 +0000 (20:22 -0300)]
V4L/DVB: ivtv: Avoid hard system lock on decoder output mode change
Changing the decoder video standard just prior to, or during, the output of
the lower field may result in a hard system lock. To avoid this, try to ensure
the firmware call occurs only during the first 100 lines of the top field.
(Minor comment addition and a line break added Andy Walls <awalls@radix.net>.)
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jean Delvare [Mon, 15 Mar 2010 01:57:56 +0000 (22:57 -0300)]
V4L/DVB: saa7134: Fix IR support of some ASUS TV-FM 7135 variants
Some variants of the ASUS TV-FM 7135 are handled as the ASUSTeK P7131
Analog (card=146). However, by the time we find out, some
card-specific initialization is missed. In particular, the fact that
the IR is GPIO-based. Set it when we change the card type, and run
saa7134_input_init1().
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB: tm6000: replace occurences of req05 magic by a naming alias
Yet another naming replace magic thanks to perl scripts. This time, it
is done with:
cat tm6000-regs.h |perl -ne 'if (m/(TM6010_REQ[^\s]+)\s+0x([a-f0-9]+)\,
0x([a-f0-9]+)/) { $name="$1"; $req=$2; $val=$3; printf
"s/REQ_${req}_SET_GET_USBREG, 0x[0]*$3,/$1,/\n" }' >a; for i in tm*.c;
do sed -f a $i >b && mv b $i; done
V4L/DVB: tm6000: Replace all magic values by a register alias
Instead of using magic pairs of req/reg, replace them by the defined
values.
This patch were generated by the following script:
cat tm6000-regs.h |perl -ne 'if (m/(TM6010_REQ[^\s]+)\s+0x([a-f0-9]+)\,
0x([a-f0-9]+)/) { $name="$1"; $req=$2; $val=$3; printf
"s/REQ_${req}_SET_GET_AVREG[_BIT]*, 0x[0]*$3,/$1,/\n" }' >a; for i in
tm*.c; do sed -f a $i >b && mv b $i; done
V4L/DVB: tm6000: Add request at Req07/Req08 register definitions
Use a pair Req/Reg for all registers at req07 and req08 groups. This
makes easier to replace them at the code with a script and helps to
avoid using the wrong req with some register.
V4L/DVB: tm6000: Replace all Req 8 group of regs with another naming convention
According with the original patch that added the register names, those
are related to tm6010, so name it properly as such. Also, clearly
indicates when a register belongs to Request 0x08 and add its register
value at the name. This makes easier to double check if the proper
register is used along the driver.
This patch were made with the help of this simple perl script, applied
over the definitions of the last register groups:
V4L/DVB: tm6000: Replace all Req 7 group of regs with another naming convention
According with the original patch that added the register names, those
are related to tm6010, so name it properly as such. Also, clearly
indicates when a register belongs to Request 0x07 and add its register
value at the name. This makes easier to double check if the proper
register is used along the driver.
This patch were made with the help of this simple perl script:
Michael Krufky [Mon, 1 Feb 2010 00:06:10 +0000 (21:06 -0300)]
V4L/DVB: dvb-usb: enable specifying a separate generic bulk ctrl response endpoint
Some DVB USB devices use a separate endpoint for responses to control
messages sent with bulk transfers via the generic_bulk_ctrl_endpoint.
When generic_bulk_ctrl_endpoint_response is set, it will be used instead
of the generic_bulk_ctrl_endpoint when reading usb responses in the
dvb_usb_generic_rw helper function.
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Reviewed-by: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB: ir: use a real device instead of a virtual class
Change the ir-sysfs approach to create irrcv0 as a device, instead of
using class_dev. Also, change the way input is registered, in order
to make its parent to be the irrcv device.
Due to this change, now the event device is created under
/sys/class/ir/irrcv class: