History log of /drivers/media/video/em28xx/em28xx.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fa5527cd3f428845d7950e6b2bab6babcbcd907b 20-Mar-2012 Ivan Kalvachev <ikalvachev@gmail.com> [media] em28xx: support for 2304:0242 PCTV QuatroStick (510e)

It is mostly copy/paste of the 520e code with setting GPIO7 removed
(no LED light).

I've worked on just released vanilla linux-3.3.0 kernel, so there may
be 1/2 lines offset to the internal working source, but most of the
code should apply cleanly.

I was able to get the DVB-C working (tuned and watched TV). Haven't
tested DVB-T (no signal atm).

Special thanks to everybody who worked on the code and to Antti
Palosaari and Devin Heitmueller who provided essential support on irc.

Hardware is based of:
Empia EM2884
Micronas DRX 3926K
NXP TDA18271HDC2
AVF4910 (not used atm)

Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
c247d7b107c6654bb73d539485df649db5c0796f 19-Mar-2012 Antti Palosaari <crope@iki.fi> [media] em28xx: support for 2013:0251 PCTV QuatroStick nano (520e)

Hardware is based of:
Empia EM2884
Micronas DRX 3926K
NXP TDA18271HDC2

... + analog parts.
Analog is not supported currently. Only DVB-T and DVB-C.

There seems to be still problems for locking DVB-C channels which have
strong signal. Attenuator helps. I think it is demodulator IF/RF AGC
issue. Lets fix it later. Patches are welcome.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
3553085cb47b10762e77ca783683dbf8142f9762 18-Mar-2012 Antti Palosaari <crope@iki.fi> [media] em28xx: support for 1b80:e425 MaxMedia UB425-TC

Hardware is based of:
Empia EM2874B
Micronas DRX 3913KA2
NXP TDA18271HDC2

Only DVB-C supported currently since missing firmware.
According to my tests, DRX 3913KA2 demodulator requires firmware
in order to support DVB-T mode.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
2321acf2962514088c2230b6d54f7a56368576c5 10-Mar-2012 Ezequiel García <elezegarcia@gmail.com> [media] media: em28xx: Remove unused urb arrays from device struct

These arrays were embedded in the struct itself, but they weren't
used by anyone, since urbs are now dinamically allocated
at em28xx_usb_isoc_ctl struct.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
86d38d1e0e0f66ec3973b718d35a590e04fb32fa 13-Feb-2012 Gianluca Gennari <gennarone@gmail.com> [media] em28xx: pre-allocate DVB isoc transfer buffers

On MIPS/ARM set-top-boxes, as well as old x86 PCs, memory allocation failures
in the em28xx driver are common, due to memory fragmentation over time, that
makes impossible to allocate large chunks of coherent memory.
A typical system with 256/512 MB of RAM fails after just 1 day of uptime (see
the old thread for detailed reports and crashlogs).

In fact, the em28xx driver allocates memory for USB isoc transfers at runtime,
as opposite to the dvb-usb drivers that allocates the USB buffers when the
device is initialized, and frees them when the device is disconnected.

Moreover, in digital mode the USB isoc transfer buffers are freed, allocated
and cleared every time the user selects a new channel, wasting time and
resources.

This patch solves both problems by allocating DVB isoc transfer buffers in
em28xx_usb_probe(), and freeing them in em28xx_usb_disconnect().
In fact, the buffers size and number depend only on the max USB packet size
that is parsed from the USB descriptors in em28xx_usb_probe(), so it can
never change for a given device.

This approach makes no sense in analog mode (as the buffer size depends on
the alternate mode selected at runtime), the patch creates two separate sets
of buffers for digital and analog modes.

For digital-only devices, USB buffers are created when the device is probed
and freed when the device is disconnected.
For analog-only devices, nothing changes: isoc buffers are created at runtime.
For hybrid devices, two sets of buffers are maintained: the digital-mode
buffers are created when the device is probed, and freed when the device is
disconnected; analog-mode buffers are created/destroyed at runtime as before.
So, in analog mode, digital and analog buffers coexists at the same time: this
can be justified by the fact that digital mode is by far more commonly used
nowadays, so it makes sense to optimize the driver for this use case scenario.

The patch has been tested in the last few days on a x86 PC and a MIPS
set-top-box, with the PCTV 290e (digital only) and the Terratec Hybrid XS
(hybrid device). With the latter, I switched several times between analog and
digital mode (Kaffeine/TvTime) with no issue at all.
I unplugged/plugged the devices several times with no problem.
Also, after over 3 days of normal usage in the MPIS set-top-box, the PCTV 290e
was still up and running.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
1020d13d50d0a5bfcfc8a0a6826ed221cdf8a775 08-Jan-2012 Sascha Sommer <saschasommer@freenet.de> [media] em28xx: increase maxwidth for em2800

The MaxPacketSize for em2800 based devices is too small to capture at full resolution.
Therefore scale down when the maximum frame size is selected.
The previous workaround that simply reduced the X resolution cannot be used
because it crops a part of the input as
the em2800 can only scale down with a factor of 0.5.

reverts commits 1ca31892e and fb3de0398ab.

[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
8ab3362665a699bd54fc489ff7fb6372678b94c1 28-Dec-2011 Holger Nelson <hnelson@hnelson.de> [media] em28xx: Reworked probe code to get rid of some hacks

Reworked device probing to get rid of hacks to guess the maximum size of
dvb iso transfer packets. The new code also selects the first alternate
config which supports the largest possible iso transfers for dvb.

[mchehab@redhat.com: Fix a few checkpatch.pl CodingStyle compliants]
Signed-off-by: Holger Nelson <hnelson@hnelson.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
4d28d3d9978b84326a4608c25bda484973bba0a6 24-Dec-2011 Gareth Williams <gareth@garethwilliams.me.uk> [media] Added USB Id & configuration array for Honestech Vidbox NW03

Adds support for the Honestech Vidbox NW03 USB capture device.

Signed-off-by: Gareth Williams <gareth@garethwilliams.me.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
a1ed02e9f1a0fa34e5b5e978209204033bb9cf4f 16-Nov-2011 Andreas Oberritter <obi@linuxtv.org> [media] em28xx: Add Terratec Cinergy HTC Stick

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
82e7dbbd4a16274b0a7038978734fc11bbf9f4b6 19-Nov-2011 Eddi De Pieri <eddi@depieri.net> [media] em28xx: initial support for HAUPPAUGE HVR-930C again

With this patch I try again to add initial support for HVR930C.

Tested only DVB-T, since in Italy Analog service is stopped.

Actually "scan -a0 -f1", find only about 50 channel while 400 should
be available.

[mchehab@redhat.com: Tested with DVB-C and fixed a few whitespace issues]
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Eddi De Pieri <eddi@depieri.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f055815fd0e4dd22ffd523f0e5117132c0a49e3d 25-Sep-2011 Chris Rankin <rankincj@yahoo.com> [media] em28xx: remove unused prototypes

This patch just removes the prototypes for the two functions that I've already
deleted in my previous patches.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
36588715fc0ed3ff0ffb025dc841652cb3b2b667 01-Aug-2011 Antti Palosaari <crope@iki.fi> [media] em28xx: add support for PCTV DVB-S2 Stick 460e [2013:024f]

It is based of...
* Empia EM28174
* NXP TDA10071 & Conexant CX24118A combo
* Allegro A8293

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
fec528b77f9be3e7ebb8d7c25888b0cf9fb8e8d6 04-Jul-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] Add initial support for Terratec H5

Not working yet. There are some fixes at the DRX-K that are needed
for it to work.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
4f83e7b3ef938eb9a01eadf81a0f3b2c67d3afb6 17-Jun-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] em28xx: Add support for devices with a separate audio interface

Some devices use a separate interface for the vendor audio class.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
5b89ecf98998911f397fa913b06ee2304a373e54 18-Jun-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] em28xx: Allow to compile it without RC/input support

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
ebaefdb7651383645f17d2d32398914175d1bcdd 01-Jun-2011 Mauro Carvalho Chehab <mchehab@redhat.com> [media] em28xx: use the proper prefix for board names

All boards use EM28xxx_BOARD, to identify that the macro
refers to a card entry. So:

EM2874_LEADERSHIP_ISDBT -> EM2874_BOARD_LEADERSHIP_ISDBT

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d6a5f921fb8cbd418b298e5bbe83e5c8c8e1da16 07-Apr-2011 Antti Palosaari <crope@iki.fi> [media] Add support for PCTV nanoStick T2 290e [2013:024f]

Supports DVB-T/T2/C, USB ID: 2013:024f.
Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
09bc1942c031686bfcf897746b6baf9d42c92ed5 13-Mar-2011 Devin Heitmueller <dheitmueller@kernellabs.com> [media] em28xx: include model number for PCTV 330e

Given how PCTV has multiple products with the same model name, include the
model number in the description and #define to make it a little more clear.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
6bda96447cef24fbf97a798b1ea664224d5fdc25 17-Nov-2010 Mauro Carvalho Chehab <mchehab@redhat.com> [media] rc: rename the remaining things to rc_core

The Remote Controller subsystem is meant to be used not only by Infra Red
but also for similar types of Remote Controllers. The core is not specific
to Infra Red. As such, rename:
- ir-core.h to rc-core.h
- IR_CORE to RC_CORE
- namespace inside rc-core.c/rc-core.h

To be consistent with the other changes.

No functional change on this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
ca3dfd6a6f8364c1d51e548adb4564702f1141e9 10-Sep-2010 Mauro Carvalho Chehab <mchehab@redhat.com> [media] em28xx: Add support for Leadership ISDB-T

This device uses an em2874B + Sharp 921 One Seg frontend.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
8298f2f810b988dccfa0ab51cd874e107514c036 20-Oct-2010 Adrian Taylor <adrian.taylor@realvnc.com> [media] Support for Elgato Video Capture

This patch allows this device successfully to show video, at least from
its composite input.

I have no information about the true hardware contents of this device and so
this patch is based solely on fiddling with things until it worked. The
chip appears to be em2860, and the closest device with equivalent inputs
is the Typhoon DVD Maker. Copying the settings for that device appears
to do the trick. That's what this patch does.

[mchehab@redhat.com: update CARDLIST.em28xx accordingly, via script]
Signed-off-by: Adrian Taylor <adrian.taylor@realvnc.com>
Reviewed-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
39a96b4cf592e79aefd1b4f2b136c20ec7bf10a7 09-Oct-2010 Mauro Carvalho Chehab <mchehab@redhat.com> [media] em28xx-audio: fix some locking issues

Those locking issues affect tvtime, causing a kernel oops/panic, due to
a race condition.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
7e48b30af033076c85ab48a8306b5588faf5fb4b 07-Mar-2010 Jarod Wilson <jarod@redhat.com> V4L/DVB: dvb: add support for kworld 340u and ub435-q to em28xx-dvb

This adds support for the KWorld PlusTV 340U and KWorld UB345-Q ATSC
sticks, which are really the same device. The sticks have an eMPIA
em2870 usb bridge chipset, an LG Electronics LGDT3304 ATSC/QAM
demodulator and an NXP TDA18271HD tuner -- early versions of the 340U
have a a TDA18271HD/C1, later models and the UB435-Q have a C2.

The stick has been tested succesfully with both VSB_8 and QAM_256 signals.
Its using lgdt3304 support added to the lgdt3305 driver by a prior patch,
rather than the current lgdt3304 driver, as its severely lacking in
functionality by comparison (see said patch for details).

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
a469585b1cd41e6efd5c2746a655feb840525e5c 07-Jun-2010 David Härdeman <david@hardeman.nu> V4L/DVB: ir-core: convert em28xx to not use ir-functions.c

Convert drivers/media/video/em28xx/em28xx-input.c to not use ir-functions.c

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
02858eedcb78a664215b918d98cdb753ce432ce6 03-Apr-2010 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB: ir-core: Make use of the new IR keymap modules

Instead of using the ugly keymap sequences, use the new rc-*.ko keymap
files. For now, it is still needed to have one keymap loaded, for the
RC code to work. Later patches will remove this depenency.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
443fed9fa42bbeacdb8d336b8a5002a262cac15c 20-Mar-2010 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB: em28xx: add em286x/tvp5150 reference design

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>
/drivers/media/video/em28xx/em28xx.h
33c02facb5a3123212587295cc1c241ee7e03adb 22-Jan-2010 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB: em28xx: adjust number of packets per URB

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.

This work was sponsored by EyeMagnet Limited.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
7ca7ef6011e92b52a365ddc78f6668e01793c572 09-Feb-2010 Andrea.Amorosi76@gmail.com <Andrea.Amorosi76@gmail.com> V4L/DVB: em28xx: add Dikom DK300 hybrid USB tuner

Adds digital and analogue tv support for Dikom DK300 hybrid usb card.

Not working: remote controller

To be done: it seems that with the proposed patch the digital demodulator
remains activated if the tuner is switched from digital to analogue mode.

Workaround is to unplug and replug the device when switching from digital to
analogue. If someone can explain how to verify the gpio settings using the
usbsnoop, the above issue perhaps can be resolved.

Signed-off-by: Andrea Amorosi <Andrea.Amorosi76@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
ca39d84d438b609af127f2eb161cd9029afbc9a7 13-Nov-2009 Magnus Alm <magnus.alm@gmail.com> V4L/DVB: em28xx: fix for "Leadtek winfast tv usbii deluxe"

fix Video/Sound support "Leadtek winfast tv usbii deluxe".

Now, it is working Stereo, IR, Radio, TV, Svideo and Composite.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
66d9cbad5330d6df30c82f10ee18b62b096b84ef 25-Nov-2009 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB (13932): em28xx: add PAL support for VBI

Make the VBI support work for PAL standards in addition to NTSC.

This work was sponsored by EyeMagnet Limited.

Thanks go out to Andy Walls for providing a CD containing test PAL/VBI captures
and to Steven Toth for providing a PVR-350 to do signal generation with.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
63b0d5ad20365edf8baf96cdbb8e7faf62501286 10-Dec-2009 Laurent Pinchart <laurent.pinchart@ideasonboard.com> V4L/DVB (13554a): v4l: Use the video_drvdata function in drivers

Fix all device drivers to use the video_drvdata function instead of
maintaining a local list of minor to private data mappings. Call
video_set_drvdata to register the driver private pointer when not
already done.

Where applicable, the local list of mappings is completely removed when
it becomes unused.

[mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging]

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
1bad429e81f9a9ffa01c4158e6d1b1a3e06d9886 05-Dec-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (13545): em28xx: properly select IR protocol based on the IR table

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
694a101e6acb865f5405a95c358eea43c813cf24 27-Nov-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (13528): em28xx: add support for em2800 VC211A card

Adds support to VC211A em2800 card. As this board doesn't have eeprom,
and uses a common set of i2c address, it has no way to add any
autodetection for it.

The patch were tested by me and by Raimundo on his board. Thanks to
those tests, several bugs related to em2800 support were corrected.

for producing the usbsnoop dump, used to get the gpio's and allowing me
to remotelly access his machine and to the needed tests.

Thanks-to: Raimundo Eduvirgnes de Oliveira <eduvirgens@yahoo.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
1ca31892e3af05ad3a72769e3c922cca3cde4f9d 27-Nov-2009 Mauro Carvalho Chehab <mchehab@redhat.com> em28xx: em2800 chips support max width of 640

Due to hardware limitation, em2800 chips can't work at resolutions
higher than 640x576, since the URB packet size is not enough.

The effect is that the image looses packages and shows a distortion
along the vertical axes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
fc099f0e0e52a349a3fe92bfb8d3fb6ec5378174 07-Nov-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (13327): em28xx: fix alt modprobe parameter

It seems that some patch broke alt modprobe parameter. Fix it to allow
changing alternate interfaces during module load and at runtime.

If changed during runtime, you'll need to stop a and restart stream for
the parameter to be used.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
43e16ea241cab1f4d4206307b2f6eacbaf4dc335 02-Oct-2009 Jean Delvare <khali@linux-fr.org> V4L/DVB (13233): i2c_board_info can be local

Recent fixes to the em28xx and saa7134 drivers have been overzealous.
While the ir-kbd-i2c platform data indeed needs to be persistent, the
struct i2c_board_info doesn't, as it is only used by i2c_new_device().

So revert a part of the original fixes, to save some memory.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
285eb1a40242adb3feaf9c73d352cbfeee1bea1c 15-Sep-2009 Antti Palosaari <crope@iki.fi> V4L/DVB (12951): em28xx: add Reddo DVB-C USB TV Box

Support for Reddo DVB-C USB TV Box device. Remote is not working yet.
Thanks to Benjamin Larsson <banan@ludd.ltu.se>

Cc: Benjamin Larsson <banan@ludd.ltu.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
8c873d31af868b4e340defc7053945636c8bd0e1 03-Sep-2009 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB (12744): em28xx: restructure fh/dev locking to handle both video and vbi

The current locking infrastructure didn't support having multiple fds accessing
the device (such as video and vbi). Rework the locking infrastructure,
borrowing the design from cx88.

This work was sponsored by EyeMagnet Limited.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
28abf083d356bc4ec459ded7a95b6a22a20f6c3d 01-Sep-2009 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB (12742): em28xx: add raw VBI support for NTSC

Add support for raw VBI capture for the em28xx bridge, currently only for
NTSC. Support for PAL capture to follow shortly (including the removal of
numerous hard-coded NTSC-specific sizes for capture buffers, etc).

Note that the code currently changes the default current norm from PAL to
NTSC (so that zvbi-ntsc-cc works properly). The default norm really should
be moved into a board-level parameter.

This work was sponsored by EyeMagnet Limited.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
da52a55cff643b8e0b346b9894adf5b93946040d 01-Sep-2009 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB (12741): em28xx: make video isoc stream work when VBI is enabled

Add code enabling the VBI registers for variants of the em28xx chip that
support VBI, and make sure the isoc streaming code continues to work for
the video component of the stream (note the video and vbi data arrive
intermixed on the same isoc pipe).

Note that this version just drops the actual VBI data onto the floor as
opposed to processing it. The "#ifdef 0" tags are for the videobuf code that
appears in the next patch in this series.

We created a separate version of the isoc_copy version for parsing the version
of the stream that includes VBI data. In theory, they might be able to be
merged at some point in the future, but the initial goal is to ensure that we
do not cause any regressions with devices that do not have VBI support.

This work was sponsored by EyeMagnet Limited.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
ac07bb73fe226ae2088f060c63829afddb3f2403 08-Sep-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12712): em28xx: properly load ir-kbd-i2c when needed

Currently, the logic to load ir i2c ancillary module is broken. It is
associated to Hauppauge devices with IR flag on their eeprom, no matter
if the device uses i2c or em28xx direct IR support. That's wrong.

Instead, add a flag to the boards that use i2c IR chips and load the
module only for those devices and if ir is not disabled.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d2ebd0f806fdb6104903365e355675934eec22b2 07-Sep-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12698): em28xx: ir-kbd-i2c init data needs a persistent object

ir-kbd-i2c's ir_probe() function can be called much later (i.e. at
ir-kbd-i2c module load), than the lifetime of a struct IR_i2c_init_data
allocated off of the stack in cx18_i2c_new_ir() at registration time.
Make sure we pass a pointer to a persistent IR_i2c_init_data object at
i2c registration time.

Thanks to Brian Rogers, Dustin Mitchell, Andy Walls and Jean Delvare to
rise this question.

Before this patch, if ir-kbd-i2c were probed after em28xx, trash data
were used. After the patch, no matter what order, it is properly
reported as tested by me:

input: i2c IR (i2c IR (EM2840 Hauppaug as /class/input/input10
ir-kbd-i2c: i2c IR (i2c IR (EM2840 Hauppaug detected at i2c-4/4-0030/ir0 [em28xx #0]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
715a223323c8c8bcbe7739e20f6c619f7343b595 29-Aug-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12595): common/ir: use a struct for keycode tables

Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:

1) It requires that the scancode to be at the range 00-7f;

2) keycodes should be masked on 7 bits in order for it to work;

3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;

4) it is different than what is done with dvb-usb approach;

5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.

This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
u16 scancode;
u32 keycode;
};

This is very close to what dvb does. So, a further integration with DVB
code will be easy.

While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.

The only notable effect is the redution of about 35% of the ir-common
module size:

text data bss dec hex filename
6721 29208 4 35933 8c5d old/ir-common.ko
5756 18040 4 23800 5cf8 new/ir-common.ko

In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.

This patch itself shouldn't be doing any functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
6d888a66be1c50c2f5193c53d6ea556e01dd60e3 30-Aug-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12591): em28xx: Add entry for GADMEI UTV330+ and related IR keymap

[mchehab@redhat.com: Fix a few wrong IR keymaps]
Signed-off-by: Shine Liu <shinel@foxmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f2e26ae7c8c077d001c77b330130f98e42ccad70 13-Aug-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12449): adds webcam for Micron device MT9M111 0x143A to em28xx

[mchehab@redhat.com: fix merge conflict and a few CodingStyle issues]
Signed-off-by: Steve Gotthardt <gotthardt@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
c2a6b54a9cf08d4ffeb75d70603c4a5d03ac97ad 08-Aug-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12406): em28xx: fix: don't do image interlacing on webcams

Due to historical reasons, em28xx driver gets two consecutive frames and
fold them into an unique framing, doing interlacing. While this works
fine for TV images, this produces two bad effects with webcams:

1) webcam images are progressive. Merging two consecutive images produce
interlacing artifacts on the image;

2) since the driver needs to get two frames, it reduces the maximum
frame rate by two.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
b80fd2d811b48a92051f86d257b00f373e69a6d7 15-Jul-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12245): em28xx: add support for mt9m001 webcams

Thanks to Wally <wally@voosen.eu> for bringing the issue and helping
with the tests.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
579d315218e8a3f696e375c5f6917da6488bec8a 14-Jul-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12244): em28xx: adjust vinmode/vinctl based on the stream input format

Depending on the video input format, vinmode/vinctl needs adjustments.
For TV, this is not relevant, since the supported decoders output data
at the same format. However, webcam sensors may have different formats,
so, this needs to be adjusted based on the device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d36bb4e77257ed0df86deca3f69794f037f68c7d 14-Jul-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12243): em28xx: allow specifying sensor xtal frequency

In order to properly estimate fps, mt9v011 sensor driver needs to know
what is the used frequency on the sensor cristal. Adds the proper fields
and initialization code for specifying the cristal frequency.

Also, based on experimentation, it was noticed that the Silvercrest is
outputing data at 7 fps. This means that it should be using a 6.3 MHz
cristal. This information needs to be double checked later, by opening
the device. Anyway, by using this value for xtal, at least now we have
the correct fps report.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
5569996421fa1cfc1fc0d9e683ac1def46ea985d 14-Jul-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12239): em28xx: fix webcam scaling

While trying to fix an mt9v001 webcam, I noticed that HSCALE/VSCALE do
work with em28xx + webcam. The issue is that the scaling setup depends
on the number of visible rows/cols of the input image.

With mt9v011 (Silvercrest), the resolution is 640x480. So, the scaling
is different from a normal TV image (720x480 on NTSC). This were causing
a wrong scaling and a previous patch disabled scaling.

As each sensor have their different resolution setting, the xres/yres
should be adjusted accordingly with the input sensor.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
527f09a981e398331c2f8d8f7af83cd46e6a06cc 12-Jul-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12236): em28xx: stop abusing of board->decoder for sensor information

Instead of using em28xx board decoder field for storing sensor information,
let's use instead a separate field for it.

Also, as sensors are currently autodetected, there's no need of having
it at the boards description. So, move it to the main em28xx struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
c43221df762c33e832e8855cae77989b6bf69fa6 12-Jul-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12233): em28xx: rename is_27xx to is_webcam

Just renames the flag, to use a clearer name. Later patches will use
this flag to properly set some drivers behaviors for webcams.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
02e7804b2135ff941b8846f5820cf48fbfdadd54 29-Jun-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (12138): em28xx: add support for Silvercrest Webcam

This webcam uses a em2710 chipset, that identifies itself as em2820,
plus a mt9v011 sensor, and a DY-301P lens.

It needs a few different initializations than a normal em28xx device.

Thanks to Hans de Goede <hdegoede@redhat.com> and Douglas Landgraf
<dougsland@redhat.com> for providing the acces for the webcam during
this weekend, I could make a patch for it while returning back from
FISL/Fudcom LATAM 2009.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
19859229d7d98bc2d582ff45045dd7f73d649383 19-Jun-2009 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB (12101): em28xx: add support for EVGA inDtube

Add support for the EVGA inDtube. Both ATSC and analog side validated as
fully functional.

Thanks to Jake Crimmins from EVGA for providing the correct GPIO info.
Thanks to Alan Hagge for doing all the device testing.
Thanks to Greg Williamson for providing hardware for testing.

Cc: Jake Crimmins <jcrimmins@evga.com>
Cc: Alan Hagge <ahagge@gmail.com>
Cc: Greg Williamson <cheeseboy16@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d7de5d8ff74efd01916b01af875a0e87419a3599 06-Jun-2009 Franklin Meng <fmeng2002@yahoo.com> V4L/DVB (11977): em28xx: Add Kworld 315 entry

Added an entry for Kworld 315 (for while, dvb only)

Signed-off-by: Franklin Meng <fmeng2002@yahoo.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
3ed58baf5db4eab553803916a990a3dbca4dc611 28-May-2009 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB (11925): em28xx: Add support for the K-World 2800d

Make the KWorld 2800d work properly. In this case, that means making the
profile more generic so that it works for both the Pointnix Intra-Oral USB
camera and the KWorld device.

The device provides the audio through a pass-thru cable, so we don't need
an actual audio capture profile (neither the K-World device nor the Pointnix
have an onboard audio decoder).

Thanks to Paul Thomas for providing sample hardware.

Cc: Paul Thomas <pthomas8589@gmail.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
4d7a2d6721a6380d4ffc26d81d2c8232fd0d2dfc 13-May-2009 Jean Delvare <khali@linux-fr.org> V4L/DVB (11845): ir-kbd-i2c: Use initialization data

For specific boards, pass initialization data to ir-kbd-i2c instead
of modifying the settings after the device is initialized. This is
more efficient and easier to read.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
c668f32dca105d876e51862a003a302fa61e4ae4 13-May-2009 Jean Delvare <khali@linux-fr.org> V4L/DVB (11844): ir-kbd-i2c: Switch to the new-style device binding model

Let card drivers probe for IR receiver devices and instantiate them if
found. Ultimately it would be better if we could stop probing
completely, but I suspect this won't be possible for all card types.

There's certainly room for cleanups. For example, some drivers are
sharing I2C adapter IDs, so they also had to share the list of I2C
addresses being probed for an IR receiver. Now that each driver
explicitly says which addresses should be probed, maybe some addresses
can be dropped from some drivers.

Also, the special cases in saa7134-i2c should probably be handled on a
per-board basis. This would be more efficient and less risky than always
probing extra addresses on all boards. I'll give it a try later.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
766ed64de554fda08ceb927d36279eabcb08acb3 24-May-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (11827): Add support for Terratec Grabster AV350

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
4557af9c5338605c85fe54f5ebba3d4b14a60ab8 23-May-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (11825): em28xx: add Terratec Grabby

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d18e2fda7133287bf8a81809816e646cf17c332e 16-May-2009 Devin Heitmueller <dheitmueller@kernellabs.com> V4L/DVB (11810): em28xx: properly set packet size based on the device's eeprom configuration.

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>
/drivers/media/video/em28xx/em28xx.h
e5db5d44432abc82b1250dd05bd0a4b011392d9d 09-Apr-2009 Douglas Schilling Landgraf <dougsland@redhat.com> V4L/DVB (11486): em28xx: Add EmpireTV board support

Added EmpireTV entry.
Thanks to Xwang <xwang1976@email.it> to provide data for this board.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f2cf250af156bef127433efd255abfae6aab02f6 31-Mar-2009 Douglas Schilling Landgraf <dougsland@redhat.com> V4L/DVB (11331): em28xx: convert to v4l2_subdev

Converted em28xx driver to v4l2_subdev.
Thanks to Hans Verkuil <hverkuil@xs4all.nl> for helping this conversion.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
2bd1d9eb1c27034a77c8e1887156da72d6160ae1 04-Mar-2009 Vitaly Wool <vital@embeddedalley.com> V4L/DVB (10833): em28xx: enable Compro VideoMate ForYou sound

Compro VideoMate uses an external audio DSP chip, controlled via tvaudio
module (tda9874a). This patch improves em28xx infrastructure to support
an external audio processor and fixes the Compro VideoMate entry to work
with it.

Signed-off-by: Vitaly Wool <vital@embeddedalley.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
812c582390f2c6b81c0400d1286a7bce39d161d0 25-Feb-2009 Douglas Schilling Landgraf <dougsland@redhat.com> V4L/DVB (10739): em28xx-cards: remove incorrect entry

Removed EM2821_BOARD_PROLINK_PLAYTV_USB2 entry.
This entry has a incorrect tuner set.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
df7fa09cca9d80f746c29f95b09a7223f6c2f4e7 25-Feb-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (10654): em28xx: VideoMate For You USB TV box requires tvaudio

As reported by Vitaly Wool <vital@embeddedalley.com>:

> about half a year ago I posted the patch that basically enabled Compro
> VideoMate For You USB TV box support.
> The main problem is I couldn't get the sound working.
> So I kind of decomposed the box and found out the audio decoder chip
> used there was Philips TDA9874A. As far as I can see, it's not supported
> within the em28xx suite although it is for other TV tuner drivers.

A tvaudio modprobing confirms that tda9874a chip is accessible via i2c:

tvaudio: TV audio decoder + audio/video mux driver
tvaudio: known chips: tda9840, tda9873h, tda9874h/a, tda9850, tda9855, tea6300, tea6320, tea6420, tda8425, pic16c54 (PV951), ta8874z
tvaudio' 1-0058: chip found @ 0xb0
tvaudio' 1-0058: tvaudio': chip_read2: reg254=0x11
tvaudio' 1-0058: tvaudio': chip_read2: reg255=0x2
tvaudio' 1-0058: tda9874a_checkit(): DIC=0x11, SIC=0x2.
tvaudio' 1-0058: found tda9874a.
tvaudio' 1-0058: tda9874h/a found @ 0xb0 (em28xx #0)
tvaudio' 1-0058: tda9874h/a: chip_write: reg0=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg1=0xc0
tvaudio' 1-0058: tda9874h/a: chip_write: reg2=0x2
tvaudio' 1-0058: tda9874h/a: chip_write: reg11=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg12=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg13=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg14=0x1
tvaudio' 1-0058: tda9874h/a: chip_write: reg15=0x0
tvaudio' 1-0058: tda9874h/a: chip_write: reg16=0x14
tvaudio' 1-0058: tda9874h/a: chip_write: reg17=0x50
tvaudio' 1-0058: tda9874h/a: chip_write: reg18=0xf9
tvaudio' 1-0058: tda9874h/a: chip_write: reg19=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg20=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg24=0x80
tvaudio' 1-0058: tda9874h/a: chip_write: reg255=0x0
tvaudio' 1-0058: tda9874a_setup(): A2, B/G [0x00].
tvaudio' 1-0058: tda9874h/a: thread started]

This patch automatically loads tvaudio when needed (currently, only
with this board).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f74a61e3c6f218053742c2caf3e247fb41bf395e 11-Feb-2009 Indika Katugampala <indika_20012001@yahoo.co.jp> V4L/DVB (10528): em28xx: support added for IO-DATA GV/MVP SZ - EMPIA-2820 chipset

[dougsland@redhat.com: Fixed CodingStyle]
Signed-off-by: Indika Katugampala <indika_20012001@yahoo.co.jp>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
a1a6ee74f2c68918f2e145dccba3637eea91a52a 11-Feb-2009 Nicola Soranzo <nsoranzo@tiscali.it> V4L/DVB (10525): em28xx: Coding style fixes and a typo correction

Lots of coding style fixes and a typo correction for em28xx.

[dougsland@redhat.com: fixed a reject due to a change on em28xx-audio.c]
Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
22cff7b381eca256d2afb460b3b9815f83810011 08-Feb-2009 Douglas Schilling Landgraf <dougsland@redhat.com> V4L/DVB (10523): em28xx-audio: Add macros EM28XX_START_AUDIO / EM28XX_STOP_AUDIO

Added macros EM28XX_START_AUDIO and EM28XX_STOP_AUDIO for em28xx_cmd().

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
c744dff260e9efb1080d1e823e588f85176a057b 08-Feb-2009 Robert Krakora <rob.krakora@messagenetsystems.com> V4L/DVB (10519): em28xx: Fix for em28xx audio startup

Essentially if a snd_em28xx_capture_trigger() stop followed by a snd_em28xx_capture_trigger() start would not yield any
data because there was some logic put in with an adev->shutdown variable which did not seem warranted in my humble opinion.
It would cause snd_em28xx_capture_trigger start never to start up the audio stream until the device was closed and
reopened again. Upon re-opening the device adev->shutdown is reset and audio data would again flow.

Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
56ee38071fe0cf1746d53c5b40a46a835b24fbe4 11-Feb-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (10516): em28xx: Add support for Easy Cap Capture DC-60

Thanks to Peter Senna Tschudin <peter.senna@gmail.com> for borrow me one
of those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
0bf4f6ce6d43b135867a78fa1b4ac58e22d2e329 11-Feb-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (10514): em28xx: Add support for Kaiomy TVnPC U2 stick

Thanks to Peter Senna Tschudin <peter.senna@gmail.com> for borrow me one
of those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f7fe3e6f3c3e9ef6ba5ca187b514d225296d18dd 19-Jan-2009 Douglas Schilling Landgraf <dougsland@redhat.com> V4L/DVB (10323): em28xx: Add entry for GADMEI TVR200

Added entry for GADMEI TVR200.
Thanks to Yohanes Nugroho <yohanes@gmail.com> for testing and data collection.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
6e7b9ea0937eeb75fa166ef7bd22b5f3bb5676d1 19-Jan-2009 Robert Krakora <rob.krakora@messagenetsystems.com> V4L/DVB (10257): em28xx: Fix for KWorld 330U Board

Fix for KWorld 330U Board

Many thanks to Devin and Mauro!!!

Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
32929fb4c7c4a693ed723253b21e7bf3c8cb4b1c 17-Jan-2009 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (10243): em28xx: fix compile warning

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
8866f9cf8d85f3614855a49b9d9056f265d0cd33 13-Jan-2009 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (10228): em28xx: fix audio output PCM IN selection

Some em28xx devices use the PCM IN AC 97 PIN for digital audio. However,
currently, the PCM IN selection is not set by the driver. This patch allows
specifying the PCM IN expected output, via board description table.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
9baed99ee7a834b1f2599e13f219087f01c63f38 31-Dec-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev

Some devices require different setups on struct_audio. Due to that, we
may need to change some fields at dev.adev during device probe. So, this
patch moves the dynamic memory allocation of adev at em28xx-alsa to the
dynamic allocation of struct em28xx dev that happens during device
probe.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
bec43661b1dc0075b7445223ba775674133b164d 30-Dec-2008 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (10135): v4l2: introduce v4l2_file_operations.

Introduce a struct v4l2_file_operations for v4l2 drivers.

Remove the unnecessary inode argument.

Move compat32 handling (and llseek) into the v4l2-dev core: this is now
handled in the v4l2 core and no longer in the drivers themselves.

Note that this changeset reverts an earlier patch that changed the return
type of__video_ioctl2 from int to long. This change will be reinstated
later in a much improved version.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
7ed3a7a3113a5399a4591fdf1f2a07c9cd954853 30-Dec-2008 Devin Heitmueller <dheitmueller@linuxtv.org> V4L/DVB (10121): em28xx: remove worthless Pinnacle PCTV HD Mini 80e device profile

The Pinnacle 80e cannot be supported since Micronas yanked their driver
support for the drx-j chipset at the last minute. Remove the device profile
since it cannot work without the drx driver and it being there is only likely
to confuse people into thinking the device is supported but not working.

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
e890759220759dfe4f3bea91a2deafb565ec10e9 30-Dec-2008 Devin Heitmueller <dheitmueller@linuxtv.org> V4L/DVB (10120): em28xx: remove redundant Pinnacle Dazzle DVC 100 profile

The DVC 100 profile is redundant since we already have an existing identical
profile named "Pinnacle Dazzle DVC 90/DVC 100"

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
1e1addd57bdf56c51dbc292d7760ea3d207fe833 28-Dec-2008 Douglas Schilling Landgraf <dougsland@redhat.com> V4L/DVB (10055): em28xx: Add entry for PixelView PlayTV Box 4

Added board PixelView PlayTV Box 4
Thanks to Vildenei Negrao Pereira <neodarkaman@brturbo.com.br> for testing and data collection.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
2e5ef2dfc45ff1ecebb0d8657b85b3fc716db9bf 29-Dec-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9980): em28xx: simplify analog logic

Now, just two routines are enough for analog: the first one configs the analog
part and register V4L2 devices, and the second one release analog devices.

After this patch, it will be easier to transform em28xx-video into an em28xx
extension, loaded only on analog devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
1a23f81b7dc3115b29cff0e4f58b5dd04a6242ad 29-Dec-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9979): em28xx: move usb probe code to a proper place

em28xx-video were holding several code that are not specific to V4L2
interface.

This patch moves the core code for em28xx-core, and usb probing code
into em28xx-cards.

This opens the possibility of breaking em28xx into a core module and a
V4L2 module, loaded only on devices that have analog interfaces.

Some cleanup may be done at em28xx-cards to optimize the config code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
531c98e71805b32e9ea35a218119100bbd2b7615 22-Dec-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9953): em28xx: Add suport for debugging AC97 anciliary chips

The em28xx driver can be coupled to an anciliary AC97 chip. This patch
allows read/write AC97 registers directly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
bddcf63313c6a4a85f94db092f45e31f530da691 20-Dec-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9927): em28xx: use a more standard way to specify video formats

This patch uses the same code for enumberating video formats that are
present on cx88, bttv and saa7134 drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f89bc32974a4376e8393001484af28d8c3350ab4 02-Dec-2008 Douglas Schilling Landgraf <dougsland@linuxtv.org> V4L/DVB (9793): em28xx: Add specific entry for WinTV-HVR 850

Added specific entry for WinTV-HVR 850

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
017ab4b1e2aa31dc9fe986ab6d1f5ffa2a84395b 27-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9765): em28xx: move tuner gpio's to the cards struct

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
2fe3e2ee72ef17daad1d3769321bb7dd69a003a9 27-Nov-2008 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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f502e861849ade3a128964410c87acedf437a6a1 27-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9763): em28xx: fix gpio settings

A previous changeset moved gpio from em28xx struct into em28xx_board.
However, the driver were not updated to properly honor those gpio's.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
122b77e59ed2de0692dfe45c87a93e98156fe03a 27-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> 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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
2a29a0d770ef6f24a8fd7806655c826d45888cba 26-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9758): em28xx: replace some magic by register descriptions where known

Replaces all occurrences of em28xx_write_regs_req() and em28xx_write_reg()
used to setup register names by em28xx_write_reg().

Also, documents the register names that are known.

This patch were generated by this small perl script:

my %reg_map = (
# Register table - the same as defined on parse_em28xx.pl script
);

while (<>) {
if (m/(.*)em28xx_write_regs_req\(dev\,\s*0x00\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
my $reg = $2;
my $val = $3;
$val =~ tr/A-f/a-f/;
$reg = $reg_map{$reg} if defined($reg_map{$reg});
printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
} elsif (m/(.*)em28xx_write_regs\(dev\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
my $reg = $2;
my $val = $3;
$val =~ tr/A-f/a-f/;
$reg = $reg_map{$reg} if defined($reg_map{$reg});
printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
} else {
print $_;
}
}

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
c864405747fa8b50c1454b280c216f54da834cb4 25-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9755): em28xx: cleanup: We need just one tuner callback

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
ec5de990d912c0d5cca98e030bf6447c1529f56d 25-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> 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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
505b6d0b774fa4475fedbd3cebf95199c17a0086 25-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9752): Remove duplicated fields on em28xx_board and em28xx structs

Several fields are duplicated on both structs. Let's just copy em28xx_board instead.

A later cleanup could just copy the fields that are changed, in order to keep em28xx_board
const.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d4d889e329bd0837598b3ef611806421754e9b83 25-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9751): em28xx: card description cleanups

Remove unused em28xx_board.vchannels and em28xx.video_channels.
Also, .is_em2800 = 0 is not needed, as all data is zeroed by kernel loader.

The table also included a notice that svideo weren't test on Hauppauge
USB2. Remove this notice, since this input also works properly.

Also, it does some whitespace cleanups.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
a2070c665459ac37a36bebae5e97bb4a2568990e 25-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> 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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
e879b8ebb000298f8124fc8fae570afc9eb37cbb 20-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9672): Allow opening more than one output at the same time

Some devices use more than one AC97 outputs. This patch allows such
devices to properly work.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
209acc02249d831e7f2e3d8083b6b562dde5fc6f 20-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9671): em28xx: Add detection of Sigmatel Stac97xx series of AC97 devices

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
35ae6f04ad3e4c3ed8a83382b6511bd9beb5c768 20-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9670): em28xx: allow specifying audio output

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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
b69724899440289ab258ff417c2d6aa104c70310 20-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> 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.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
5faff78904d9c07f38ac0e227b322e9f58d5447c 20-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9653): em28xx: improve AC97 handling

AC97 devices provide several input and outputs. However, before this
patch, em28xx device weren't properly allowing the usage of ac97
possible combinations. Also, several input volumes were left untouched,
instead of making sure that the volumes were set on mute state.

This patch improves support for ac97 devices by allowing to use any
inputs, and making sure that unused inputs are set on mute state.

Yet, some work is still needed to select the AC97 output.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
16c7bcadff2222b297d13951dc30e133f56d0154 20-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9652): em28xx: merge AC97 vendor id's into a single var

This makes easier to identify vendor ID, since AC97 vendors are
generally identified by 3 bytes. The remaining byte is used by the
vendor to identify its devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
35643943be58aef82826e340761e86e0d37870ec 19-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9651): em28xx: Improve audio handling

This patch properly implements audio handling on em28xx. Before this
patch, it was assumed that every device has an Empia 202 audio chip.
However, this is not true.

After this patch, specific AC97 chipset setup and configurations can be
done.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
5c2231c84304563fd5d28e8bbb72e09e882a8e32 19-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (9648): em28xx: get audio config from em28xx register

Make use of the em28xx chip configuration register to determine whether
we have AC97 audio, I2S audio, or no audio support at all.

Thanks for Ray Lu from Empia for providing the em2860/em2880 datasheet.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
66767920e3e6532db8afe04f9b2d8e1a9e95cad9 16-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9630): Some boards need to specify tuner address

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
4b92253acc723f365ad6b2f32e4118e38133b7b8 13-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (9628): em28xx: refactor IR support

Refactor the em28xx IR support based on the em2860/em2880 and em2874
datasheets.

Tested on the HVR-950 (em2883), Pinnacle 800e (em2883), Pinnacle 80e (em2874)
using the remote controls that came with those products.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
a924a499adb89f52046936deac87264774652a81 12-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9607): em28xx: Properly implement poll support for IR's

The first em28xx were based on i2c IR's. However, some newer designs
are coming with a polling-based IR. Those are done by reading a register
set at em28xx.

This patch adds core polling support for those devices. Later patches will
add support for some device-specific IR's.

This patch adds the same basic IR polling code used by bttv, cx88 and saa7134, and
shares the common getkey masks defined at ir-common.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
864ec0b7a03c8401e6e49f9e480489478ea14cb5 12-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (9590): Add registration for Pinnacle 80e ATSC tuner

Add registration for Pinnacle 80e ATSC tuner

Register the em2874 based Pinnacle 80e device. Note that support for this
device also requires the new drx-j driver (which is not available yet)

Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Thanks to Joerg Schindler from Pinnacle for providing sample hardware.
Thanks to Rainer Miethling from Pinnacle for providing engineering support.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
24a613e4b08c4077b4c809bebab1d4a36d541fcc 12-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (9588): Don't load em28xx audio module for digital-only devices

Rework the logic so that the em28xx-alsa module does not get loaded for devices
that don't support analog audio (such as the em2874)

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
6a1acc3bc5144e004996029b20e46e6020d128a7 12-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (9584): Support different GPIO/GPO registers for newer devices

Empia moved the location of the GPIO/GPO registers in newer devices. Add the
ability to specify the relocated registers (including caching of register
contents).

Thanks for Ray Lu from Empia for providing the em2874 datasheet.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
600bd7f0edee0f9687c3c77e6fe63c74452acbfa 12-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (9583): Remember chip id of devices at initialization

When setting up the device, remember the chip id, so we can control behavior
in the future without having to read the register continuously.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
1ed1dd54b0456a880ab4090275a47eb5a7a245d1 12-Nov-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (9582): Add a EM28XX_NODECODER option to the list of available decoders

Add a EM28XX_NODECODER option to the list of available decoders. This option
becomes important for devices that do not have analog support.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
f2a2e4910502e866833732f31ee697d15b3e56fd 19-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9647): em28xx: void having two concurrent control URB's

Now that we have a polling task for IR, there's a race condition, since
IR can be polling while other operations are being doing. Also, we are
now sharing the same urb_buf for both read and write control urb
operations. So, we need a mutex.

Thanks to Davin Heitmueller <devin.heitmueller@gmail.com> for warning me.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
c4a98793a63c423c9e1af51822325969e23c16d4 18-Nov-2008 Mauro Carvalho Chehab <mchehab@redhat.com> V4L/DVB (9646): em28xx: avoid allocating/dealocating memory on every control urb

Before this patch, every register setup on em28xx were dynamically
allocating a temporary buffer for control URB's to be handled.

To avoid this ping-pong, use, instead a pre-allocated buffer.

Also, be sure that read control URB's also use the buffer, instead of
relying on a stack buffer.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d7cba043d7ec840d67bd5143779d1febe7d83407 12-Sep-2008 Michael Krufky <mkrufky@linuxtv.org> V4L/DVB (9049): convert tuner drivers to use dvb_frontend->callback

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
d45b9b8ab43c8973a9630ac54f4ede6c3e009f9e 04-Sep-2008 Hans Verkuil <hverkuil@xs4all.nl> V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings

Fix sparse warnings. None are serious, but cutting down on these helps find
future serious sparse warnings/errors.

Redid the av7710.c patch based on a suggestion by Oliver Endriss.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
/drivers/media/video/em28xx/em28xx.h
ee281b856d4e4921da24387ab116bb0855c2efaa 27-Jul-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (8543): em28xx: Rename #define for Compro VideoMate ForYou/Stereo

There are two videomate boards supporded by em28xx. The names are almost
identical.
This patch renames one of such entries to something else.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
10ac6603613d46a43a4544fbbe9581e50879bd45 27-Jul-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (8541): em28xx: HVR-950 entry is duplicated.

Thanks to "Devin Heitmueller" <devin.heitmueller@gmail.com> for pointing this
issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
d3603341e2f3c39f017f8df4b1cd734aeb0d453b 27-Jul-2008 Vitaly Wool <vital@embeddedalley.com> V4L/DVB (8540): em28xx-cards: Add Compro VideoMate ForYou/Stereo model

Added Compro VideoMate ForYou/Stereo model (analog only)

Signed-off-by: Vitaly Wool <vital@embeddedalley.com>
[dougsland@gmail.com: Solved conflicts with v4l-dvb devel tree]
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
[mchehab@infradead.org: Need to fix some merge conflicts]
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
95b86a9a9020da22e7c25abc77aae4dc8f02ab55 27-Jul-2008 Douglas Schilling Landgraf <dougsland@gmail.com> V4L/DVB (8539): em28xx-cards: New supported IDs for analog models

- New supported IDs for analog models
(Based on Markus Rechberger <mrechberger@gmail.com> version of em28xx driver)

- Validation field for new em28xx boards.

Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
[mchehab@infradead.org: Need to fix some merge conflicts]
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
59d07f1b705c466ea4eaca9c43d46be6d6a065a4 27-Jul-2008 Aron Szabo <aron@aron.ws> V4L/DVB (8538): em28xx-cards: Add GrabBeeX+ USB2800 model

Added GrabBeeX+ USB2800 model (analog only)

[mchehab@infradead.org: Need to fix some merge conflicts]
Signed-off-by: Aron Szabo <aron@aron.ws>
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
e14b3658a7651ffd9b1f407eaf07f4dde17ef1e7 26-Jul-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (8492): Add support for the ATI TV Wonder HD 600

em28xx-cards.c
em28xx-dvb.c
em28xx.h
- Add support for the ATI TV Wonder HD 600, based on a 94 email exchange and
USB traces provided by Ronnie Bailey

Thanks to Ronnie Bailey <purevw@wtxs.net> for testing the changes

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
a9fc52bcbeb5245b58d23c558f3e3e8f18bebbc3 28-Jun-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (8123): Add support for em2860 based PointNix Intra-Oral Camera

em28xx-cards.c
em28xx-input.c
em28xx-video.c
em28xx.h
- Add support for the PointNix Intra-Oral Camera, which required addition of
a construct for reading the "snapshot" button (provided on the em2860 and
em2880 chips, but this is the first case where I have seen it actually used
in a product). The button is wired to pin 56 on the em2880.

http://www.pointnix.com/ENG/dental/product_02.asp

Thanks to Roberto Mantovani <rmantovani@libero.it> for testing the changes

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
17d9d558e818530cc7d210ffea575a36f48eaa1a 08-Jun-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (8006): em28xx: Split HVR900 into two separate entries

- Separate the newer variant of the HVR-900 into its own device profile
because it has a Micronas DRX397 instead of the Zarlink demod. This
doesn't make the device work, but at least we don't try to initialize it
as though it had the Zarlink device.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
[mchehab@infradead.org: avoid compilation breakage at mainstream, where drx397xD.h doesn't exist yet]
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
4fd305b2a2c4d16e8d4ebc95c84f946edd3385c5 04-Jun-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (7992): Add support for Pinnacle PCTV HD Pro stick (the older variant 2304:0227)

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
e54318e5a41cfe10325ae2f817d337beb84e79aa 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7618): em28xx: make some symbols static

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
c67ec53f8f4e90ebd482789e2f6d121f41a0bd90 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7615): em28xx: Provide the proper support for switching between analog/digital

Before this patch, HVR900/HVR950 were incorreclty going back to analog. The
result is that only digital were working.

This patch provides the proper setup for analog/digital and tuner callback.
It also properly resets analog into a sane state at open().

Thanks to Steven Toth <stoth@linuxtv.org> and Michael Krufky <mkrufky@linuxtv.org>
for helping to set the proper parameters to GPO/GPIO em2883 ports.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
41facaa4b63cc1a0ff5a900149a29942d47e1491 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7613): em28xx: rename registers

Now, all registers will follow the same convension:

EM28XX_R<reg_number>_<reg_name>

This allows to associate a register with its value, and also with a canonical
name. Also, registers that are specific to a given chip were renamed accordingly,
as EM2800_foo (for 2800 only registers) or EM2880_foo (for registers that started
to appear on em2880).

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
2ba890ec0849b222a6dabb5192ccd8fd1696d6d3 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7611): em28xx: Move registers to a separate file

em28xx.h contains lots of different stuff inside. The better is to break it on
some files.

This patch removes the register names, moving them to a separate file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
89b329ef9d7cc16ed46fc991b21b2d45e7bf452c 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7610): em28xx: Select reg wait time based on chip ID

This is more conservative than just removing the msleep() from
em28xx_write_regs_req(), since some old hardware may still need it.
So, it will remove the sleep time only for those chips where this
removal were tested.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
6ea54d938b6f81baa0952a8b15d3e67e6c268b8f 18-Apr-2008 Douglas Schilling Landgraf <dougsland@gmail.com> V4L/DVB (7607): CodingStyle fixes

Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
102a0b0879a01a413ed5f667f7db9c2085ca8474 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7604): em28xx-dvb: Fix analog mode

The analog entries are wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
3421b7787a2cf41ac5edce9b5766bddd1e1d9986 18-Apr-2008 Aidan Thornton <makosoft@googlemail.com> V4L/DVB (7603): em28xx-dvb: don't use videobuf-dvb

Modifies em28xx-dvb not to use videobuf-dvb, but instead to include the code
for registering dvb devices locally and use the URB management code in the
em28xx driver directly. DVB data streaming should now work.

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
579f72e44fb1c991352f44c20b471c3001357f68 18-Apr-2008 Aidan Thornton <makosoft@googlemail.com> V4L/DVB (7602): em28xx: generalise URB setup code

Move the URB setup and management code to em28xx-core.c and generalise
it slighlty so that the DVB code can use it.

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
52284c3e47bf502aaff72ab2ede509193b628b1b 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7599): em28xx-dvb: videobuf callbacks are waiting for em28xx_fh

Thanks to Devin Heitmueller <devin.heitmueller@gmail.com> for pointing
this issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
bdfbf9520372daf2b4d6941474c92310848ccb27 18-Apr-2008 Devin Heitmueller <devin.heitmueller@gmail.com> V4L/DVB (7598): em28xx: several fixes on gpio programming

em28xx-cards.c:
- Fix reversed val/rst values in both analog_gpio and digital_gpio
vectors
- Fix crash that would was occurring during every analog startup
while looping over gpio_ctl
- Remove what appears to be a redundant setting of gpio_ctl->val
- Don't use OREN538 demodulation for the HVR-950 (prevents ATSC
scanning from working)

em28xx-dvb.c:
- Tuner should be in digital mode when issuing the reset
- Add copyright
- Change struct definition (corresponds to fix in em28xx-cards.c for
gpio_ctl looping)

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
3ca9c09379e8f3be0744c47f72769457fa46e9f3 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7597): em28xx: share the same xc3028 setup for analog and digital modes

Thanks to Devin Heitmueller <devin.heitmueller@gmail.com> and Aidan
Thornton" <makosoft@googlemail.com> for pointing some errors with the
previous scenario.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
ee6e3a865a469c78daa93a1e6cdbaca3a102f9c8 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7595): Improve generic support for setting gpio values

em28xx based devices with xc3028 may require some specific gpio values.
This patch adds a generic handling for such values.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
3aefb79af8d41c85e11da7109d62038849421bb6 18-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7593): em28xx: add a module to handle dvb

This patch adds em28xx-dvb. This driver is highly based on cx88-dvb and
saa7134-dvb.

This code currently loads and unloads successfully. However, some
changes are needed to properly support the mpeg streams and to setup
em28xx to work on DVB mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
44dc733cd9edac53402d705cd2f720accd0b3e2c 13-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7567): em28xx: Some cleanups

Removes some fields from data structs.

There are some fields that are just caching some calculus for buffer
size. The calculus were moved to the places it were needed and the now
unused fields were removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
3b5fa928a6b2971ec65571745defc5d9758b4bc1 13-Apr-2008 Aidan Thornton <makosoft@googlemail.com> V4L/DVB (7565): em28xx: fix buffer underrun handling

This patch fixes three related issues and a fourth trivial one:

- Use buffers even if no-one's currently waiting for them (fixes
underrun issues);

- Don't return incomplete/mangled frames at the start of streaming and
in the case of buffer underruns;

- Fix an issue which could cause the driver to write to a buffer that's
been freed after videobuf_queue_cancel is called (exposed by the
previous two fixes - for some reason, ignoring buffers that weren't
being waited on worked around the issue);

- Fix a bug which could cause only one field to be filled in the first
buffer (or first few buffers) after streaming is started.

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
b4916f8ca1da71bb97fb6dcf1e8da3f9c64cf80e 13-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7564): em28xx: Some fixes to display logic

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
b957dfdc3161d00b01b52154eb2d53580c8911e5 13-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7555): em28xx: remove timeout

It seems that we don't need a timeout for em28xx.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
d7aa80207babe694b316a48200b096cf0336ecb3 13-Apr-2008 Aidan Thornton <makosoft@googlemail.com> V4L/DVB (7541): em28xx: Some fixes to videobuf

It fixes a couple of minor bugs, comments out a bogus BUG_ON, sets fh->type
correctly, uses dev->width and dev->height for now, and adds a missing spinlock
init (nasty - caused a system lockup). It also adds some debug code which
probably isn't all that useful. I haven't tested this version of the patch yet,
though, so I'm not sure what you can expect if you try it.

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
ad0ebb96c220c461386e9a765fca3daf5590d01e 13-Apr-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7540): em28xx: convert to use videobuf-vmalloc

The usage of videobuf-vmalloc allows to cleanup em28xx logic.

Also, it reduced its size by about 5.42% on i386 arch (and about 7.5% on x86_64):

39113 4876 40 44029 abfd old/em28xx.ko
36731 4868 40 41639 a2a7 /home/v4l/master/v4l/em28xx.ko

Also, the preliminary tests, made on a single core 1.5 MHz Centrino showed
that CPU usage reduced from 42%-75% to 28%-33% (reports from "top") command.

A test with time command presented an even better result:

This is the performance tests I did, running code_example to get 1,000 frames
@29.995 Hz (about 35 seconds of stream), tested on a i386 machine, running at
1,5GHz:

The old driver:

$ time -f "%E: %Us User time, %Ss Kernel time, %P CPU used" ./capture_example
0:34.21: 8.22s User time, 25.16s Kernel time, 97% CPU used

The videobuf-based driver:

$ time -f "%E: %Us User time, %Ss Kernel time, %P CPU used" ./capture_example
0:35.36: 0.01s User time, 0.05s Kernel time, 0% CPU used

Conclusion:

The time consumption to receive the stream where reduced from about 33.38
seconds to 0.05 seconds.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
3687e1e67e4920a202d53cc24678fb34fcda8fc5 08-Feb-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7179): Allow more than one em28xx board

em28xx driver is capable of handling more than one usb device. However, isoc
transfers require a large amount of data to be transfered.

Before this patch, just one em28xx board were enough to allocate more than 50%
URBs:

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 8
B: Alloc=480/800 us (60%), #Int= 0, #Iso= 2
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1

So, only one board could use an USB host at the same time. After the patch, it
is possible to use more than one em28xx at the same time, on the same usb host,
if the image size is slower or equal to 345600, since those images will
require about 30% of the URBs:

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 8
B: Alloc=232/800 us (29%), #Int= 0, #Iso= 2
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1

So, in thesis, after the patch, it would be possible to use up to 3 boards by
each usb host, if the devices are generating small images.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
92ea42f442c4895e38f525a097d7d8ce2a55b9b9 06-Feb-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7164): em28xx-alsa: Add a missing mutex

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
532fe65205253aef1ce5c0c76d2d8d303fb3fe71 29-Jan-2008 Adrian Bunk <bunk@kernel.org> V4L/DVB (7106): em28xx/: make 2 functions static

This patch makes the following needlessly global functions static:
- em28xx-core.c:em28xx_write_reg_bits()
- em28xx-video.c:em28xx_vdev_init()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
ed086314f4e41eb90a9107c7fb2737230686f668 24-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7060): em28xx: remove has_tuner

has_tuner flag doesn't make much sense, since tuner_type=TUNER_ABSENT
means the same thing.

Having two ways to say that a tuner is not present is
not nice, since it may lead to bad setups. In fact, with the previous
code, if a device were using has_tuner=0, but the user forces a tuner,
with modprobe option tuner=type, the modprobe option won't work.

Also, tveeprom returns TUNER_ABSENT, when tuner is unknown or absent.
So, with the previous logic, in this case, the driver should set
has_tuner=0, or has_tuner=1 otherwise.

Instead of adding several additional tests and setups, better just to
remove .has_tuner.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
c8793b035df7b18997d1cf34254064dac166f009 13-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (7021): Move all board specific configuration to em28xx-cards.c

This cleanup moves the board-specific configurations to em28xx-cards.c.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
0be4375410f1ecc917f3c0caf8f98908d357c93f 05-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6956): Add Radio support for em28xx

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
3abee53e4402b6ae39e1e610f9ef94eb74097138 05-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6955): Properly implement 12MHz I2S support

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
d7448a8d9d06ca2ca4fd1f17404450ecba8bea3a 05-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6952): Add code for autoloading em28xx-alsa, if needed

Older em28xx devices does implement standard Audio Class.

However, on newer devices, this were replaced by a Vendor Class. This
patch autodetects that an em28xx lacks Audio Class and auto-loads
em28xx-alsa, for the devices that implements only a Vendor Class.

For devices with Audio Class, snd-usb-audio module will provide an ALSA
interface.

This patch uses the request_module_async function as defined on cx88-mpeg.c,
originally wrote by Markus Rechberger.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
6d79468dd8537530f4150e76ed9b4b63f80571c6 05-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6951): Integrates em28xx-audio.c into em28xx kernel module

Also fixes the remaining CodingStyle issues that Lindent didn't fix.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
74f38a82376fb1b289d0957429ba45349f0cad62 05-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6948): HVR950 requires additional settings for audio to properly work

Thanks to Markus Rechberger <mrechberger@gmail.com> for retriving those
commands.

Also, MTS firmware is required for audio to work on HVR950.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
539c96d0fd86bfdcfac75c88b74aa5798439293d 05-Jan-2008 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6947): Improve audio setup handling

It is possible to select audio inputs via em28xx or via ac97 functions.
This patch allows configuring a board to use either one way.

It also do some cleanups at audio setup configurations.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
5add9a6f3c90680f89b4694e81025d2aed9559af 22-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6659): Convert MTS to bitfield

Xc2028.3028 has two type of firmwares: audio-standard specific ones and
baseband MTS firmwares. MTS firmwares provide stereo decoding for 6 MHz
BTSC/EIAJ and for monoaural audio decoding on 8 MHz firmwares.

It seems that the option to use MTS or a standard-specific audio decoding
depends on the way xc2028/3028 is connected.

Instead of wasting 32 (or 64 bits) to signalize if the driver needs to use MTS
firmware, this patch converts it to a bitfield that can be shared with other
proprieties of xc2028/3028.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
122d15888a8aa95fb6ca32eb1307c3e3337f1a38 20-Nov-2007 Aidan Thornton <makosoft@googlemail.com> V4L/DVB (6619): Use MTS firmware for the HVR-900

The HVR-900 requires the MTS version of the xc3028 firmware in order
to get any sound. The below patch selects this firmware variant on
HVR-900 cards, as well as splitting the HVR-950 into its own entry
(since I don't know if it uses the MTS variant and it will have to be
split off eventually anyway).

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
7d497f8afa80128bb99a425a6d7a766a863128a5 11-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6587): Cleanup at tv norm selection

With the conversion to the vidio_ioctl2, tvnorms array is not required anymore.

Also, removed some code from V4L1 time (VIDEO_MODE_foo), specied at the
non-used video_decoder.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
cb77d010221e66c63f4a71546fed73be9b12b9a3 11-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6586): Remove some dead code and make drive fully V4L2 compatible

There were some vestiges of an old V4L1 I2C driver that were called by em28xx.
This patch removes this dead code, and replaces videodev.h to videodev2.h

Now, this driver doesn't require V4L1 anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
9e31ced888d1ca49ec5be51ef295e3ce994366c4 11-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6584): Fix read() method

Backport read() fixes from Markus Rechberger.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
a225452ef80a7bd894fd2dfd01a4973d444152f4 11-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6583): Fix em28xx read stream locking

On some situations, closing an streaming application and re-opening were
returning -EBUSY.

Uses the same locking schema also present on cx88.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
a3a048cea301baba5d451991074a85dc20a8f228 11-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6582): Fix em28xx to allow multiple open

Allows shared access support for em28xx. Just one userspace application is
allowed to get stream. The other(s) application(s) can change V4L2 controls,
set video standards, etc.

This patch were splited from Markus Rechberger's tree and backported to 2.6.17
by Pádraig Brady.

The original patch were ported to the latest em28xx version and had CodingStyle
corrected to solve the issues pointed by scripts/checkpatch.pl.

Thanks to Pádraig Brady <P@draigBrady.com> for pointing this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
fad7b958e753e18ff443786360f7846da50a3085 04-Nov-2007 Sascha Sommer <saschasommer@freenet.de> V4L/DVB (6545): em28xx: autodetect Cinergy 200 USB and VGear PocketTV

Adds autodetection support for the Cinergy200 USB and the VGear PocketTV.

Whenever a usb device with generic empia em2800 usb ids is detected the device
gets scanned for connected i2c devices. If the device list matches an em2800
device in the device list the model id gets changed accordingly.

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
4362559d826b369df41fc74df4c5db6061962dce 03-Nov-2007 Sascha Sommer <saschasommer@freenet.de> V4L/DVB (6539): em28xx: add support for vgear pockettv

attached patch adds support for the vgear pockettv.
It seems to require a write to another register for audio to work.
I checked my old cinergydrv and we did the same register write there. I
therefore enabled it for all em2800 based devices.

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
5a80415bcabf2b59e8c34db6e743c54582cfd3c2 04-Nov-2007 Sascha Sommer <saschasommer@freenet.de> V4L/DVB (6538): em28xx: fix locking to allow accesses from 2 different threads at the same time

The attached patch modifies the em28xx driver so that there can be ioctls from
multiple different threads.

This is necessary for capture apps like MPlayer that use different threads for
capturing and channel tuning.

Now the locking is only done for the ioctls that change properties of the
device or access the i2c bus.

It also removes some locks that look unnecessary:

In em28xx_init_dev:
the videodevice is not registered yet so nothing can access the hardware
meanwhile, the device struct is not assigned to the interface yet so no race
with disconnect is possible

In em28xx_release_resources:
it gets only called when dev->lock is already held

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
ea4fd5679b258d8ae85124a47b587a53ba6409de 04-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6537): Add entry for Pixelview Prolink PlayTV USB 2.0

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
03910cc39035d27f4c85c8ad2a236cc5c9456127 04-Nov-2007 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (6536): Add a hint for boards without unique USB ID

This patch adds a function to allow trying to detect boards that shares
the generic IDs.

The current detection method is based at eeprom checksum.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
adcb0fa2504aac35e0ed285147b11e75a6db34c7 22-May-2006 Adrian Bunk <bunk@stusta.de> V4L/DVB (3963): Em28xx/: possible cleanups

This patch contains the following possible cleanups:
- make the following needlessly global functions static:
- em28xx-core.c: em28xx_accumulator_set()
- em28xx-core.c: em28xx_capture_area_set()
- em28xx-core.c: em28xx_scaler_set()
- em28xx-core.c: em28xx_isocIrq()
- remove the following unused EXPORT_SYMBOL's:
- em28xx-cards.c: em28xx_boards
- em28xx-cards.c: em28xx_bcount
- em28xx-cards.c: em28xx_id_table

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
2e7c6dc3989136844eb63e05f9e4dc6608a763c6 03-Apr-2006 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (3715): Change all emails to the currently used one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
282b7cb3e03d9ada4067083e61919d74197a1e5a 07-Feb-2006 Markus Rechberger <mrechberger@gmail.com> V4L/DVB (3326): Adding support for Terratec Prodigy XS

Adding support for Terratec Prodigy XS

Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
3593cab5d62c4c7abced1076710f9bc2d8847433 07-Feb-2006 Ingo Molnar <mingo@elte.hu> V4L/DVB (3318b): sem2mutex: drivers/media/, #2

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
4d17d0834a2e6a5cba096ea09592a4a096183300 07-Feb-2006 Markus Rechberger <mrechberger@gmail.com> V4L/DVB (3276): Added terratec hybrid xs and kworld 2800rf support

- Added terratec hybrid xs product/vendorid
- Added gpio audio initialization for kworld pvr 2800rf

Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
a94e95b443811c127734ef10f3b7d2220532c1d2 23-Jan-2006 Markus Rechberger <mrechberger@gmail.com> V4L/DVB (3432): Hauppauge HVR 900 Composite support

- Hauppauge HVR 900 Composite support

Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
e5589befc472ca50882f37c4fb32333fc93a65b7 23-Jan-2006 Mauro Carvalho Chehab <mchehab@infradead.org> V4L/DVB (3421): Several fixes to prepare for VBI

- Fixed VBI compilation.
- Included capacity to specify vbi and video number.
- Added a better control for using more than one em28xx device.
- VIDIOC_G_FMT now calls a function.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
/drivers/media/video/em28xx/em28xx.h
0e7072ef6623c3dc58faf3f7310aba77b0a5845e 09-Jan-2006 Michael Krufky <mkrufky@m1k.net> V4L/DVB (3277): Fix incorrect filename reference in top comments


- Fix incorrect filename reference in top comments

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
/drivers/media/video/em28xx/em28xx.h
5e453dc757385ec892a818e4e3b5de027987ced9 09-Jan-2006 Michael Krufky <mkrufky@m1k.net> V4L/DVB (3269): ioctls cleanups.


- Now, all internal ioctls are at v4l2-common.h
- removed unused ioctl at saa6752hs.h
- all debug ioctl code moved to v4l2-common.c
- removed duplicated stuff from other cards

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
/drivers/media/video/em28xx/em28xx.h
9bb13a6dc3a6f68c990264838ff0493d900c48d7 09-Jan-2006 Mauro Carvalho Chehab <mchehab@brturbo.com.br> V4L/DVB (3233): Fixed API to set I2S speed control


- Created a new ioctl to control I2S speed. Old calls to an
inadequate V4L2 API replaced.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
/drivers/media/video/em28xx/em28xx.h
f85c657ff1f712abd5207a95fba8a5fcc282ab04 19-Dec-2005 Jean Delvare <khali@linux\-fr.org> [PATCH] V4L/DVB (3188): Fix compilation failure with gcc 2.95.3.

- Fix compilation failure with gcc 2.95.3.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
/drivers/media/video/em28xx/em28xx.h
674434c691e10015660022fc00b04985a23ef87b 12-Dec-2005 Mauro Carvalho Chehab <mchehab@brturbo.com.br> [PATCH] V4L/DVB: (3086c) Whitespaces cleanups part 4

Clean up whitespaces at v4l/dvb files

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
9d4d9c05c807ab8a49ac0024987b223bb32c022d 09-Nov-2005 Mauro Carvalho Chehab <mchehab@brturbo.com.br> [PATCH] V4L: 920: fixed autodetection of max size by if alternate setting

- Fixed autodetection of max size by if alternate setting
- Fixed some debug messages

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
3acf28095009509c9ca1e283de821b5be9ddede6 09-Nov-2005 Mauro Carvalho Chehab <mchehab@brturbo.com.br> [PATCH] v4l: 886: renamed common structures to em28xx

- Renamed common structures to em28xx

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
45632c4f835e74f937d8632f7ba2dd49aa39c476 09-Nov-2005 Mauro Carvalho Chehab <mchehab@brturbo.com.br> [PATCH] v4l: 863: added pinnacle dazzle dvc 90

- Added Pinnacle Dazzle DVC 90

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
30556b23f31973ca311341277c4e4b128c0528bb 09-Nov-2005 Markus Rechberger <mrechberger@gmail.com> [PATCH] v4l: 840: fixed settings for msi vox usb 2.0 saa7114 is missing atm

- Fixed settings for MSI Vox USB 2.0 (saa7114 is missing atm)

Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
9c75541fc97252e605b7bc8f9b09f816483e22fb 09-Nov-2005 Markus Rechberger <mrechberger@gmail.com> [PATCH] v4l: 813: replaced obsolete video get drvdata and video set drvdata

- Replaced obsolete video_get_drvdata and video_set_drvdata

Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
4ac97914c6c35f6bf132071c718e034d0846b9f5 09-Nov-2005 Mauro Carvalho Chehab <mchehab@brturbo.com.br> [PATCH] v4l: 800: whitespace cleanups

- Whitespace Cleanups.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
74458e6c1aea9e422e46030e7bc61e9b0984be5b 09-Nov-2005 Sascha Sommer <saschasommer@freenet.de> [PATCH] v4l: 786: chip id removed since it isn t required anymore

- Chip_id removed since it isn't required anymore.

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
d5e5265315770bda46c50ecaa64e2b9790f2064c 09-Nov-2005 Mauro Carvalho Chehab <mchehab@brturbo.com.br> [PATCH] v4l: 784: several improvement on i2c ir handling for em2820

- Several Improvement on I2C IR handling for em2820:
- moved Pinnacle IR table (ir_codes_em2820) to em2820-input.c
- IR struct renamed and moved to a header file.
- New file to handle em2820-specific IR.
- Some cleanups.
- attach now detects I2C IR and calls em2820-specific IR code
- IR compat code moved to compat.h
- New header with struct IR_i2c there, to allow it to be
used by board-specific input handlers.

- Some improvements at em28xx board detection:
- Board detection message improved to show interface and class.
- Now it doesn't touch audio interfaces.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
596d92d5128d308b5a79f21c3e72c87f5fc7e58b 09-Nov-2005 Mauro Carvalho Chehab <mchehab@brturbo.com.br> [PATCH] v4l: 767: included support for em2800

- Included support for em2800.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h
a6c2ba283565dbc9f055dcb2ecba1971460bb535 09-Nov-2005 akpm@osdl.org <akpm@osdl.org> [PATCH] v4l: 716: support for em28xx board family

- Added support for em28xx board family

Signed-off-by: Ludovico Cavedon <cavedon@sssup.it>
Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/media/video/em28xx/em28xx.h