Commit Graph

541 Commits (2714b3b9be54076877fbb50c0811f9015b2906a5)

Author SHA1 Message Date
Mauro Carvalho Chehab 9e5d6760c2 V4L/DVB (9756): em28xx: Improve register log format
Change log format to look more like URB transactions. In fact, setup and
IN/OUT transactions are merged. This helps to debug the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:14 -02:00
Mauro Carvalho Chehab 8c2399895d V4L/DVB (9767): em28xx: improve board description messages
Print manufacturer/product info from USB device and also card entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab 6a18eaf61a V4L/DVB (9766): em28xx: improve probe messages
Prints usb speed used by em28xx interface. While there, fixes USB ID's
endiannes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab 017ab4b1e2 V4L/DVB (9765): em28xx: move tuner gpio's to the cards struct
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab 2fe3e2ee72 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>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab f502e86184 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>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 1c67e76f71 V4L/DVB (9762): em28xx: fix tuner absent entries
Before this patch, several devices without tuner were kept the value 0
for tuner_type. However, this means TUNER_TEMIC_PAL. Replace those
entries for the proper TUNER_ABSENT value.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab a5942b5c26 V4L/DVB (9761): em28xx: replace magic numbers for mux aliases
Instead of using magic vmux/amux, let's use an alias where possible.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 122b77e59e 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>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 0ec202d183 V4L/DVB (9759): em28xx: move gpio tables to the top of em28xx-cards
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 2a29a0d770 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>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab c864405747 V4L/DVB (9755): em28xx: cleanup: We need just one tuner callback
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 1bee0184f6 V4L/DVB (9754): em28xx: improve debug messages
Now, the first message states board names. Also, removed printing the alternate
settings by default. I2C messages are now clearer.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab ec5de990d9 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>
2008-12-29 17:53:41 -02:00
Mauro Carvalho Chehab 505b6d0b77 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>
2008-12-29 17:53:41 -02:00
Mauro Carvalho Chehab d4d889e329 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>
2008-12-29 17:53:41 -02:00
Mauro Carvalho Chehab a2070c6654 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>
2008-12-29 17:53:41 -02:00
Devin Heitmueller 6d676d8af8 V4L/DVB (9745): em28xx: Cleanup GPIO/GPO setup code
Cleanup the calls to set the GPIOs and GPOs for various devices,
replacing the register number with the #define from em28xx-reg.h and
converting over to using em28xx_write_reg()

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00
Devin Heitmueller 55927684e7 V4L/DVB (9744): em28xx: cleanup XCLK register usage
Convert over to setting the XCLK register usage with the new em28xx_write_reg()
function.

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

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00
Mauro Carvalho Chehab c9455fbb15 V4L/DVB (9717): em28xx: improve message probing logs
On some em28xx devices, there's an unused interface. This is printed on
the logs as an error. We can just ignore that interface.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:40 -02:00
Mauro Carvalho Chehab 31e0530c32 V4L/DVB (9676): em28xx: fix a regression caused by 22c90ec6a5e07173ee670dc2ca75e0df0a7772c0
If removing and reiserting the driver on some devices, tuner type will
be unset at the second time. This patch fixes this issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:37 -02:00
Mauro Carvalho Chehab 3ce6509456 V4L/DVB (9675): em28xx: devices with xc2028/3028 don't have tda9887
This patch cleans up the entries of xc2028/3028, since those devices
don't need or use a tda9887.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:37 -02:00
Mauro Carvalho Chehab 30e4ac7c03 V4L/DVB (9673): em28xx: fix Pixelview PlayTV board entry
Pixelview uses a Sigmatel stac codec. It has an external line out pin,
connected to AC97_MASTER_VOL. It also provides I2S output, but using a

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:37 -02:00
Mauro Carvalho Chehab e879b8ebb0 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>
2008-12-29 17:53:37 -02:00
Mauro Carvalho Chehab 209acc0224 V4L/DVB (9671): em28xx: Add detection of Sigmatel Stac97xx series of AC97 devices
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:37 -02:00
Mauro Carvalho Chehab 35ae6f04ad 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>
2008-12-29 17:53:37 -02:00
Mauro Carvalho Chehab f1990a9c39 V4L/DVB (9669): em28xx: Fix a stupid cut-and-paste error
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:36 -02:00
Devin Heitmueller 23159a0bfc V4L/DVB (9658): em28xx: use em28xx_write_reg() for i2c clock setup
Convert the calls that write the i2c clock register over to the new
em28xx_write_reg() function that allows for or'ing bits

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:36 -02:00
Devin Heitmueller b697248994 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>
2008-12-29 17:53:36 -02:00
Mauro Carvalho Chehab 5faff78904 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>
2008-12-29 17:53:35 -02:00
Mauro Carvalho Chehab 16c7bcadff 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>
2008-12-29 17:53:35 -02:00
Mauro Carvalho Chehab 35643943be 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>
2008-12-29 17:53:35 -02:00
Mauro Carvalho Chehab 8a5caa6bcb V4L/DVB (9650): em28xx: replace magic numbers to something more meaningful
audio mux entries were described by 0 and 1 magic numers. Use an enum
alias for each entry type.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:35 -02:00
Mauro Carvalho Chehab a42aa191cc V4L/DVB (9649): em28xx: remove two amux entries used only on one card
This patch parepares for an audio refactor patch that auto-detects ac97
chips.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:35 -02:00
Devin Heitmueller 5c2231c843 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>
2008-12-29 17:53:35 -02:00
Devin Heitmueller 67c96f6706 V4L/DVB (9644): em28xx: add em2750 to the list of known em28xx chip ids
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:35 -02:00
Mauro Carvalho Chehab 8975111396 V4L/DVB (9643): em28xx: remove the previous register names
Previously, AC97 registers were named as if they were part of em28xx
device, generating some confusion. Replace such names for a more general
naming convention.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:35 -02:00
Mauro Carvalho Chehab 6fbcebf06a V4L/DVB (9642): Add AC97 registers found on em28xx devices
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:34 -02:00
Mauro Carvalho Chehab f09fb53075 V4L/DVB (9641): Add chip ID's for em2820 and em2840
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:34 -02:00
Mauro Carvalho Chehab 66767920e3 V4L/DVB (9630): Some boards need to specify tuner address
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:34 -02:00
Devin Heitmueller 60245e858d V4L/DVB (9629): Add support for the ATI TV Wonder HD 600 USB Remote Control
Add support for the ATI TV Wonder HD 600 USB Remote Control
(required a new keymap)

[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:34 -02:00
Devin Heitmueller 4b92253acc 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>
2008-12-29 17:53:33 -02:00
Mauro Carvalho Chehab 0a6b8a851e V4L/DVB (9612): Fix key repetition with HVR-950 IR
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:33 -02:00
Mauro Carvalho Chehab 91812fa74f V4L/DVB (9611): em28xx: experimental support for HVR-950 IR
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:33 -02:00
Mauro Carvalho Chehab a924a499ad 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>
2008-12-29 17:53:33 -02:00
Devin Heitmueller 864ec0b7a0 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>
2008-12-29 17:53:32 -02:00
Devin Heitmueller ebef13d480 V4L/DVB (9589): Properly support capture start on em2874
Properly support capture start on em2874

The transport stream enable register moved in the em2874, so make it work
properly.

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>
2008-12-29 17:53:32 -02:00
Devin Heitmueller 24a613e4b0 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>
2008-12-29 17:53:32 -02:00
Devin Heitmueller 95ea470574 V4L/DVB (9587): Handle changes to endpoint layout in em2874
Empia moved around their endpoint configuration in newer chips, so accommodate
the changes

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>
2008-12-29 17:53:32 -02:00
Devin Heitmueller 4924044495 V4L/DVB (9586): Fix possible null pointer dereference in info message
Fix case where we could end up dereferencing a NULL pointer if dev->vdev or
dev->vbi_dev were not set properly.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:32 -02:00
Devin Heitmueller a527c9f827 V4L/DVB (9585): Skip reading eeprom in newer Empia devices
Empia switched to a 16-bit addressable eeprom in newer devices.  While we
could certainly write a routine to read the eeprom, there is nothing of use
in there that cannot be accessed through registers, and there is the risk that
we could corrupt the eeprom (since a 16-bit read call is interpreted as a
write call by 8-bit eeproms).  So just be safe and bail out of the function.

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>
2008-12-29 17:53:32 -02:00
Devin Heitmueller 6a1acc3bc5 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>
2008-12-29 17:53:32 -02:00
Devin Heitmueller 600bd7f0ed 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>
2008-12-29 17:53:32 -02:00
Devin Heitmueller 1ed1dd54b0 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>
2008-12-29 17:53:31 -02:00
Devin Heitmueller 65c9fd4609 V4L/DVB (9581): Remove unused variable from em28xx-audio.c
Remove unused variable from em28xx-audio.c

Fix warning for unused "ret" variable

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:31 -02:00
Devin Heitmueller 5caeba045c V4L/DVB (9580): Add chip id for em2874 to list of known chips
Add em2874 chip id

Add chip id for em2874 to list of known chips

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:31 -02:00
Mauro Carvalho Chehab 1f6340bd43 V4L/DVB (9532): Properly handle error messages during alsa registering
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:28 -02:00
Kay Sievers af128a102c V4L/DVB (9521): V4L: struct device - replace bus_id with dev_name(), dev_set_name()
This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".

To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.

We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.

We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.

Thanks,
Kay

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:26 -02:00
Devin Heitmueller 231ffc9c07 V4L/DVB (9920): em28xx: fix NULL pointer dereference in call to VIDIOC_INT_RESET command
Fix a NULL pointer dereference that would occur if the video decoder tied to
the em28xx supports the VIDIOC_INT_RESET call (for example: the cx25840 driver)

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-23 09:13:50 -02:00
Mauro Carvalho Chehab a693b0cdba em28xx: remove backward compat macro added on a previous fix
commit 50f3beb50a fixed em28xx-alsa
locking schema. However, a backport macro was kept.

This patch removes the macro, since it is not needed for the module
compilation against upstream.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01 18:04:14 -02:00
Hans Verkuil 484ab62c5e V4L/DVB (9748): em28xx: fix compile warning
Label fail_unreg is no longer used.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01 17:12:57 -02:00
Douglas Schilling Landgraf faa3bd2e48 V4L/DVB (9743): em28xx: fix oops audio
Replaced usb_kill_usb for usb_unlink_usb
(wait until urb to fully stop require USB core to put the calling process to sleep).

Oops:
http://www.kerneloops.org/raw.php?rawid=71799&msgid=

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-01 17:09:42 -02:00
Mauro Carvalho Chehab 50f3beb50a V4L/DVB (9742): em28xx-alsa: implement another locking schema
Instead of using a spinlock, it is better to call the proper pcm stream
locking schema.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-24 12:24:52 -02:00
Mauro Carvalho Chehab 818a557eeb V4L/DVB (9668): em28xx: fix a race condition with hald
Newer versions of hald tries to open it to call QUERYCAP.

Due to the lack of a proper locking, it is possible to open the device
before it finishes initialization.

This patch adds a lock to avoid this risk, and to protect the list of
em28xx devices.

While here, remove the uneeded BKL lock.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-20 18:12:02 -02:00
Mauro Carvalho Chehab f2a2e49105 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>
2008-11-20 17:20:14 -02:00
Mauro Carvalho Chehab c4a98793a6 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>
2008-11-20 17:19:31 -02:00
Mauro Carvalho Chehab 625ff16794 V4L/DVB (9645): em28xx: Avoid memory leaks if registration fails
em28xx_init_dev() has some error conditions that are not properly
de-allocating dev var, nor freeing the device number for a future usage.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-20 17:19:20 -02:00
Devin Heitmueller 3f9b46c154 V4L/DVB (9632): make em28xx aux audio input work
The attached patch makes the em28xx auxillary audio input work.
Tested with the HVR-950.

em28xx: make auxillary audio input work

The tuner audio input was working but the aux input wasn't.  Tested with
the HVR-950.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-16 23:56:25 -02:00
Mauro Carvalho Chehab c41109fc9a V4L/DVB (9627): em28xx: Avoid i2c register error for boards without eeprom
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-16 23:55:48 -02:00
Hans Verkuil c6330fb86f V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d
The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
independent of the minor number. So instead of using the minor field
of the video_device struct one has to use the num field: this always
contains the kernel number of the device node.

I forgot about this when I did the v4l2 core change, so this patch
converts all drivers that use it in one go. Luckily the change is
trivial.

Cc: michael@mihu.de
Cc: mchehab@infradead.org
Cc: corbet@lwn.net
Cc: luca.risolia@studio.unibo.it
Cc: isely@pobox.com
Cc: pe1rxq@amsat.org
Cc: royale@zerezo.com
Cc: mkrufky@linuxtv.org
Cc: stoth@linuxtv.org
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21 14:31:37 -02:00
Thierry MERLE 46510b56ca V4L/DVB (9155): em28xx-dvb: dvb_init() code factorization
In dvb_init(),
        case EM2880_BOARD_TERRATEC_HYBRID_XS:
        case EM2880_BOARD_KWORLD_DVB_310U:
can be put in the same case than EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
since they do the same thing.

Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-13 07:16:18 -02:00
Hans Verkuil dd89601d47 V4L/DVB (9133): v4l: disconnect kernel number from minor
The v4l core creates four different video devices (video, vbi, radio, vtx)
and each has its own range of minor numbers. However, modern devices keep
increasing the number of devices that they need so a maximum of 64 video
devices will not be enough in the future. In addition this scheme makes
it very hard to add new device types.

This patch disconnects the kernel number allocation (e.g. video0, video1,
etc.) from the actual minor number (just pick the first free minor).

This allows for much more flexibility in the future. However, it does
require the use of udev. For those who cannot use udev a new CONFIG option
was created that changes the allocation scheme back to the old behavior.

Thanks to Greg KH for suggesting this approach during the 2008 LPC.

In addition, several bugs were fixed in the ivtv and cx18 drivers: these
drivers try to allocate specific kernel numbers but that scheme contained
a bug which caused what should have been e.g. video17 to appear as e.g.
video2.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:16 -02:00
Michael Krufky d7cba043d7 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>
2008-10-12 09:37:09 -02:00
Douglas Schilling Landgraf f2a01a0027 V4L/DVB (8937): em28xx: Fix and add some validations
Fixed and Added some validations

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:37:00 -02:00
Douglas Schilling Landgraf a50f4a444a V4L/DVB (8936): em28xx-cards: Add vendor/product id for EM2820_BOARD_PROLINK_PLAYTV_USB2
Added vendor/product id for EM2820_BOARD_PROLINK_PLAYTV_USB2

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:59 -02:00
Hans Verkuil d45b9b8ab4 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>
2008-10-12 09:36:58 -02:00
Hans Verkuil d56dc61265 V4L/DVB (8613): v4l: move BKL down to the driver level.
The BKL is now moved from the video_open function in v4l2-dev.c to the
various drivers. It seems about a third of the drivers already has a
lock of some sort protecting the open(), another third uses
video_exclusive_open (yuck!) and the last third required adding the
BKL in their open function.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:47 -02:00
Wiktor Grebla db98fb8b5b V4L/DVB (9103): em28xx: HVR-900 B3C0 - fix audio clicking issue
Fixed audio clicking problem which could be heard when using analog tv or composite input

Signed-off-by: Wiktor Grebla <greblus@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-04 23:15:30 -03:00
Darron Broad da3808e10f V4L/DVB (9099): em28xx: Add detection for K-WORLD DVB-T 310U
Correct firmware type to MTS
Correct audio routing for composite/s-video
Add DVB-T detection.

This patch uses the eeprom hash method for detection as the vendor/product
ids are also used for the DIGIVOX_AD. This may be a clone of the same
product. Explanatory text has been added prior to the hask look-up in
anticipation that it may help others.

The following has been tested to work:
Analogue TV (PAL-I)
Composite In
DVB-T (UK Crystal Palace)
USB AUDIO

The following has not been tested but probably works:
S-Video In

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-04 23:15:17 -03:00
Devin Heitmueller 5ea7fe48a9 V4L/DVB (8967): Use correct XC3028L firmware for AMD ATI TV Wonder 600
The AMD ATI TV Wonder 600 has an XC3028L and *not* an XC3028, so we need to
load the proper firmware to prevent the device from overheating.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-04 22:43:41 -03:00
Douglas Schilling Landgraf c737684b51 V4L/DVB (8935): em28xx-cards: Remove duplicate entry (EM2800_BOARD_KWORLD_USB2800)
Removed duplicated entry for EM2800_BOARD_KWORLD_USB2800

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-04 22:34:24 -03:00
Douglas Schilling Landgraf ff9b3e430b V4L/DVB (8884): em28xx-audio: fix memory leak
Free allocated memory

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-29 08:26:01 -03:00
Eugeniy Meshcheryakov a674a3b492 V4L/DVB (8582): set mts_firmware for em2882 based Pinnacle Hybrid Pro
Pinnacle Hybrid Pro (2304:0226) requires mts_firmware flag to have any
sound. Without this flag it is useful only for watching silent movies.

Signed-off-by: Eugeniy Meshcheryakov <eugen@debian.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-08-06 06:57:22 -03:00
Mauro Carvalho Chehab ee281b856d 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>
2008-07-27 18:07:56 -03:00
Mauro Carvalho Chehab fe43ef894c V4L/DVB (8542): em28xx: AMD ATI TV Wonder HD 600 entry at cards struct is duplicated
Thanks to "Devin Heitmueller" <devin.heitmueller@gmail.com> for pointing this
issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 18:07:54 -03:00
Mauro Carvalho Chehab 10ac660361 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>
2008-07-27 18:07:50 -03:00
Vitaly Wool d3603341e2 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>
2008-07-27 14:22:56 -03:00
Douglas Schilling Landgraf 95b86a9a90 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>
2008-07-27 14:22:54 -03:00
Aron Szabo 59d07f1b70 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>
2008-07-27 14:22:50 -03:00
Hans Verkuil 0ea6bc8d43 V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_device
The type and type2 fields were unused and so could be removed.
Instead add a vfl_type field that contains the type of the video
device.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:10 -03:00
Devin Heitmueller e14b3658a7 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>
2008-07-26 13:18:17 -03:00
reinhard schwab 655b840855 V4L/DVB (8489): add dvb-t support for terratec cinergy hybrid T usb xs
This patch adds dvbt support for the terratec cinergy hybrid T usb xsstick.
Thanks to Devin Heitmueller and Mauro Chehab for guiding me.

Signed-off-by: Reinhard Schwab <reinhard.schwab@aon.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-26 13:18:12 -03:00
Hans Verkuil a399810ca6 V4L/DVB (8482): videodev: move all ioctl callbacks to a new v4l2_ioctl_ops struct
All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in
a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it.

This ensures a clean separation between the const ops struct and the non-const
video_device struct.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-26 12:54:58 -03:00
Hans Verkuil 38f9d30859 V4L/DVB (8477): v4l: remove obsolete audiochip.h
Converted the last users of audiochip.h to the v4l2-chip-ident.h header
and remove the now unused audiochip.h header.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-26 12:54:40 -03:00
Hans Verkuil 35ea11ff84 V4L/DVB (8430): videodev: move some functions from v4l2-dev.h to v4l2-common.h or v4l2-ioctl.h
The functions in a header should not belong to another module. The prio functions
belong to v4l2-common.c, so move them to v4l2-common.h.

The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header
and move those functions to it.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23 19:00:17 -03:00
Hans Verkuil 5e85e732f0 V4L/DVB (8428): videodev: rename 'dev' to 'parent'
The field 'dev' is not the video device, but the parent of the video device.
Rename accordingly.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23 16:42:49 -03:00
Hans Verkuil f87086e302 v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10
Also remove some blank lines that were used to split compat code at -devel
tree.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:17:52 -03:00
Devin Heitmueller a9fc52bcbe 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>
2008-07-20 07:12:48 -03:00
Devin Heitmueller 17d9d558e8 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>
2008-07-20 07:08:49 -03:00
Devin Heitmueller 4fd305b2a2 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>
2008-07-20 07:08:19 -03:00
Hans Verkuil 78b526a435 V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacks
The naming for the callbacks that handle the VIDIOC_ENUM_FMT and
VIDIOC_S/G/TRY_FMT ioctls was very confusing. Renamed it to match
the v4l2_buf_type name.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:07:32 -03:00
Mauro Carvalho Chehab 83ee87a31d V4L/DVB (8026): Avoids an OOPS if dev struct can't be successfully recovered
On some alsa versions, it seems that snd_pcm_substream_chip(substream)
is returning a NULL pointer. This causes an OOPS, as reported by:

https://bugs.launchpad.net/ubuntu/+source/linux-ubuntu-modules-2.6.24/+bug/212271
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/212960

This patch avoids the OOPS by not letting and open() succeed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:47 -03:00
Devin Heitmueller a8a1f8cc0c V4L/DVB (8018): Add em2860 chip ID
em28xx-cards.c
em28xx-reg.h
 - Add em2860 chip ID (seen on Pointnix Intra-Oral Camera)
   http://www.pointnix.com/ENG/dental/product_02.asp

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:45 -03:00
Devin Heitmueller df61918163 V4L/DVB (8017): Ensure em28xx extensions only get run against devs that support them
em28xx-audio.c
em28xx-dvb.c
 - Em28xx extensions should ensure they are being only loaded against devices
   that support them.  Deals with case where there are multiple em28xx
   devices, some of which have DVB (or ALSA) support and some do not.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:44 -03:00
Devin Heitmueller b38cc64200 V4L/DVB (8011): em28xx: enable DVB for HVR-900
em28xx-cards.c
 - DVB support is supposed to be enabled for the first generation HVR-900.
   This device was confirmed with DVB by mkrufky when we did the original work
   in April, but I guess we forgot to set the flag.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:43 -03:00
Devin Heitmueller 0367ca1bc7 V4L/DVB (8010): em28xx: Properly register extensions for already attached devices
em28xx-video.c
 - Properly handle loading of the module when multiple devices are already
   connected (such as at bootup).  Before we were only calling dvb_init()
   against the last device in the list, so while we were handling subsequent
   adds properly, if there were multiple devices present on driver load,
   everybody except the last device would not get initialized.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26 15:58:42 -03:00
Al Viro a954b6681d V4L/DVB (7970): mix trivial endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05 06:35:52 -03:00
Mauro Carvalho Chehab eabcaf3204 V4L/DVB (7848): Fix dependencies for tuner-xc2028 and em28xx-dvb
em28xx-dvb doesn't need FW_LOADER. Instead, tuner-xc2028 needs to select
FW_LOADER.

Also, this can happen only if HOTPLUG is selected, since FW_LOADER
is dependent on HOTPLUG.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:07 -03:00
Mauro Carvalho Chehab fdbbfb092c V4L/DVB (7846): Re-creates VIDEO_TUNER
VIDEO_TUNER is responsible for compilation of tuners.ko module. This were the
previous behaviour before the creation of MEDIA_TUNER.

Before this patch, tuner.ko were created even for drivers that don't need a
tuner (like webcam drivers).

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:07 -03:00
Michael Krufky 74ee05109c V4L/DVB (7823): em28xx: add additional usb subids for Hauppauge HVR-950
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:54:00 -03:00
Mauro Carvalho Chehab 6430a5a368 V4L/DVB (7806): em28xx: dvb_unregister_frontend() shouldn't be called, if not registered yet
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14 02:53:58 -03:00
Mauro Carvalho Chehab 149ef72dee Rename common tuner Kconfig names to use the same
namespace for all of them.
2008-04-29 18:41:38 -03:00
Mauro Carvalho Chehab 7c91f0624a V4L/DVB(7767): Move tuners to common/tuners
There were several issues in the past, caused by the hybrid tuner design, since
now, the same tuner can be used by drivers/media/dvb and drivers/media/video.

Kconfig items were rearranged, to split V4L/DVB core from their drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-29 18:41:37 -03:00
Janne Grunau 094f9b4b31 V4L/DVB (7734): em28xx: copy and paste error in em28xx_init_isoc
Fixes a copy and paste error in check of kzalloc return value. The check block
was copied from the previous allocation but the variable wasn't exchanged.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-26 09:10:49 -03:00
Devin Heitmueller 4269a8eed2 V4L/DVB (7652): em28xx: Drop the severity level of the "urb resubmit failed"
em28xx-core.c
 - Drop the severity level of the "urb resubmit failed" to debug, since it
   occurs every time a stream disconnects, which fills the dmesg log

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:44 -03:00
Andrew Morton d1e0b57162 V4L/DVB (7650): git-dvb: Kconfig fix
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:44 -03:00
Mauro Carvalho Chehab e77ebdaa92 V4L/DVB (7619): em28xx: adds proper demod IF for HVR-900
Thanks to Aidan Thornton <makosoft@googlemail.com> for helping
to test this firmware

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab e54318e5a4 V4L/DVB (7618): em28xx: make some symbols static
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab e9888a1330 V4L/DVB (7617): Removes a manual mode setup
The setup is already done at open().

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab e3569abc1c V4L/DVB (7616): em28xx-dvb: Properly selects digital mode at the right place
The driver should be switched to digital mode, when trying to access the
frontend or when streaming.

This patch provides the correct code to support this feature.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab c67ec53f8f 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>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab 82ac4f8765 V4L/DVB (7614): em28xx-core: fix some debug printk's that wrongly received KERN_INFO
Those printk's were adding more info to a line that were already being
printed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab 41facaa4b6 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>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab 7e26ca8012 V4L/DVB (7612): em28xx-cards: use register names for GPIO/GPO
Before this patch, registers 0x04 and 0x08 were referenced by its value. This is
bad, since makes harder for someone to understand what this is doing.

This patch renames those two registers into an appropriate name.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab 2ba890ec08 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>
2008-04-24 14:09:42 -03:00
Mauro Carvalho Chehab 89b329ef9d 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>
2008-04-24 14:09:42 -03:00
Devin Heitmueller 7640ea9933 V4L/DVB (7609): em28xx-core: speed-up firmware load
em28xx-core.c:
 - Remove sleep in i2c message routine which slows down i2c by a factor
   10x.  Load time for BASE firmware went from 13s to .973s

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Devin Heitmueller 83244025e7 V4L/DVB (7608): em28xx-dvb: Some cleanups and fixes
em28xx-dvb.c:
 - Remove unneeded xc3028_ctrl structure.  The driver automatically preserves
   the previous value

tuner-xc2028.c:
 - Make the return type for xc2028_get_reg signed, since all of the callers
   are looking for "< 0" to detect errors.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Douglas Schilling Landgraf 6ea54d938b V4L/DVB (7607): CodingStyle fixes
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Mauro Carvalho Chehab e6a353b0dc V4L/DVB (7606): em28xx-dvb: Program GPO as well
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Mauro Carvalho Chehab 102a0b0879 V4L/DVB (7604): em28xx-dvb: Fix analog mode
The analog entries are wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Aidan Thornton 3421b7787a 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>
2008-04-24 14:09:41 -03:00
Aidan Thornton 579f72e44f 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>
2008-04-24 14:09:41 -03:00
Aidan Thornton 7e6388a1b9 V4L/DVB (7601): em28xx-dvb: add support for the HVR-900
Adds the correct GPIOs and demod attach code for the HVR-900


Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Mauro Carvalho Chehab d2d9fbfd73 V4L/DVB (7600): em28xx: Sets frequency when changing to analog mode
This will make tuner-xc2028 to change to analog, if needed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Mauro Carvalho Chehab 52284c3e47 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>
2008-04-24 14:09:41 -03:00
Devin Heitmueller bdfbf95203 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>
2008-04-24 14:09:41 -03:00
Mauro Carvalho Chehab 3ca9c09379 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>
2008-04-24 14:09:41 -03:00
Mauro Carvalho Chehab 227ad4ab90 V4L/DVB (7596): em28xx-dvb: Add support for HVR950
This patch adds DVB support for Hauppauge HVR950.

Thanks to Michael Krufky <mkrufky@linuxtv.org> for getting those values.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:41 -03:00
Mauro Carvalho Chehab ee6e3a865a 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>
2008-04-24 14:09:40 -03:00
Mauro Carvalho Chehab acaa4b609f V4L/DVB (7594): em28xx: Fix Kconfig
Some devices have msp3400 audio decoder chip. Selects it, if em28xx.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:40 -03:00
Mauro Carvalho Chehab 3aefb79af8 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>
2008-04-24 14:09:40 -03:00
Mauro Carvalho Chehab 44dc733cd9 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>
2008-04-24 14:09:39 -03:00
Aidan Thornton 3b5fa928a6 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>
2008-04-24 14:09:39 -03:00
Mauro Carvalho Chehab b4916f8ca1 V4L/DVB (7564): em28xx: Some fixes to display logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:39 -03:00
Mauro Carvalho Chehab dbecb44c11 V4L/DVB (7563): em28xx: Add missing checks
There are some cases where nobody is waiting for a buffer. Due to the
lack of check, if you try to abort the userspace app, machine were
hanging, since IRQ were trying to use a buffer that were disallocated.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:39 -03:00
Mauro Carvalho Chehab cb7847249f V4L/DVB (7559): em28xx: Fills the entire buffer, before getting another one
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:48 -03:00
Mauro Carvalho Chehab e9e6040df6 V4L/DVB (7557): em28xx: honour video_debug modprobe parameter
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:48 -03:00
Aidan Thornton 0ea13e6e59 V4L/DVB (7556): em28xx: fix locking on vidioc_s_fmt_cap
Currently, vidioc_s_fmt_cap is allowed even if streaming is running on some
other fh. This is likely to cause issues.

Block use of vidioc_s_fmt_cap if someone else has claimed access to the device.

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:48 -03:00
Mauro Carvalho Chehab b957dfdc31 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>
2008-04-24 14:08:48 -03:00
Brandon Philips 0561297501 V4L/DVB (7550): em28xx: Fix a possible memory leak
I did notice a possible memory leak since iolock is could possibly be
called before a buffer has been freed.

This ensure s_fmt isn't called while the queue is busy thereby avoiding
iolock on already allocated buffers.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:48 -03:00
Mauro Carvalho Chehab 78bb3949a9 V4L/DVB (7549): em28xx: some small cleanups
- Remove dead code;
- Fix a few CodingStyle issues;
- Prints frame number, if debug is enabled.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:47 -03:00
Aidan Thornton e0fadfd34d V4L/DVB (7548): Various fixes for the em28xx videobuf code
- Aborting buffer_filled if no-one's waiting on the waitqueue probably isn't
  what we want, since just because no-one's waiting for it now doesn't mean they
  wouldn't dequeue it in time. (vivi gets away with this, possibly because it
  can fill each buffer much faster.)

- The first BUG_ON(lencopy <= 0); really isn't worth causing a kernel panic
  over, especially since there are some reasons why it could trigger in normal use.

- The top and botom frames are actually the wrong way around.

Signed-off-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:47 -03:00
Mauro Carvalho Chehab e74153d44a V4L/DVB (7547): em28xx: Fix a broken lock
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:10 -03:00
Mauro Carvalho Chehab f245e549f0 V4L/DVB (7545): em28xx: Fix CodingStyle errors and most warnings introduced by videobuf
The last videobuf changes introduced several CodingStyle errors. Fixes all those
errors, as reported by checkpatch.pl

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:00 -03:00
Mauro Carvalho Chehab ca21d2dc94 V4L/DVB (7544): em28xx: Fix timeout code
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:00 -03:00
Mauro Carvalho Chehab 47625da2ab V4L/DVB (7543): Fix capture start/stop and timeout
Also removes the dead restart_video_queue() function

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:00 -03:00
Mauro Carvalho Chehab ea8df7e09d V4L/DVB (7542): em28xx: Fix some warnings
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:08:00 -03:00
Aidan Thornton d7aa80207b 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>
2008-04-24 14:08:00 -03:00
Mauro Carvalho Chehab ad0ebb96c2 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>
2008-04-24 14:08:00 -03:00
Harvey Harrison d80e134dc8 V4L/DVB (7522): media/video/em28xx replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:07:59 -03:00
Michael Krufky ab8b870e43 V4L/DVB (7381): tuner: rename TUNER_PHILIPS_ATSC to TUNER_PHILIPS_FCV1236D
TUNER_PHILIPS_ATSC is an ambiguous name for a tuner.  Rename it to
TUNER_PHILIPS_FCV1236D to be more descriptive.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:07:52 -03:00
Sascha Sommer 2c4a07b2da V4L/DVB (7331): Fix em2800 altsetting selection
Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:07:49 -03:00
Douglas Schilling Landgraf ff699e6bd0 V4L/DVB (7094): static memory
- Static memory is always initialized with 0.
- Replaced in some cases C99 comments for /* */

Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 13:42:20 -03:00
Andrew Morton 46cb57e628 V4L/DVB (7291): em28xx: correct use of and fix
be less silly while we're there.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-20 12:39:00 -03:00
Julia Lawall 8281db3b52 V4L/DVB (7285): em28xx: Correct use of ! and &
In commit e6bafba5b4, a bug was fixed that
involved converting !x & y to !(x & y).  The code below shows the same
pattern, and thus should perhaps be fixed in the same way.

This is not tested and clearly changes the semantics, so it is only
something to consider.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E1,E2; @@
(
  !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-20 12:39:00 -03:00
Mauro Carvalho Chehab 61b080d214 V4L/DVB (7180): em28xx: add URB_NO_TRANSFER_DMA_MAP, since urb->transfer_dma is set
Thanks to Alan Stern <stern@rowland.harvard.edu> for pointing this issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:17 -03:00
Mauro Carvalho Chehab 3687e1e67e 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>
2008-02-18 11:15:17 -03:00
Mauro Carvalho Chehab 92ea42f442 V4L/DVB (7164): em28xx-alsa: Add a missing mutex
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:16 -03:00
Mauro Carvalho Chehab 00b8730f5d V4L/DVB (7163): em28xx: makes audio settings more stable
Improves audio configurations on em28xx:
        - mutes audio before changing amux;
        - adds a delay after setting audio src;
        - waits up to 50ms for ac97 busy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:16 -03:00
Mauro Carvalho Chehab 0df8130fe8 V4L/DVB (7162): em28xx: Fix endian and returns the correct values
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:15 -03:00
Mauro Carvalho Chehab 0da5176f4e V4L/DVB (7161): em28xx: Fix printing debug values higher than 127
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:15 -03:00
Mauro Carvalho Chehab 1e7ad56f1f V4L/DVB (7160): em28xx: Allow register dump/setting for debug
Adds vidioc_[g|s]_register handlers. This allows getting/setting register
from em28xx.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:14 -03:00
Mauro Carvalho Chehab 7463dda2ae V4L/DVB (7158): Fix em28xx audio initialization
AC97 register initialization seem to always be needed. This patch fixes audio
for Prolink/Pixelview USB2 board.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:14 -03:00
Andrew Morton 1685a6fed2 V4L/DVB (7156): em28xx/em28xx-core.c: fix use of potentially uninitialized variable
drivers/media/video/em28xx/em28xx-core.c: In function 'em28xx_set_audio_source':
drivers/media/video/em28xx/em28xx-core.c:276: warning: 'no_ac97' may be used uninitialized in this function

This looks like a genuine bug to me.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:13 -03:00
Luc Saillard 427d20c4e6 V4L/DVB (7132): Add USB ID for a newer variant of Hauppauge WinTV-HVR 900
Device description:
WinTV-HVR-900
M/R: 65018/B3C0 ##4207

Signed-off-by: Luc Saillard <luc@saillard.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:15:12 -03:00
Adrian Bunk 532fe65205 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>
2008-02-18 11:15:09 -03:00
Mauro Carvalho Chehab a348d2005d V4L/DVB (7049): Remove sound/driver.h
sound/driver.h is already included by sound/core.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-02-18 11:14:53 -03:00
S.Çağlar Onur 95a940e9e1 drivers/media/video/em28xx/: Fix undefined symbol error with CONFIG_SND=N
Without this you get undefined symbol errors with CONFIG_SND=N:

  ERROR: "snd_pcm_period_elapsed" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
  ERROR: "snd_pcm_hw_constraint_integer" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
  ERROR: "snd_pcm_set_ops" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
  ERROR: "snd_pcm_lib_ioctl" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
  ERROR: "snd_card_new" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
  ERROR: "snd_card_free" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
  ERROR: "snd_card_register" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!
  ERROR: "snd_pcm_new" [drivers/media/video/em28xx/em28xx-alsa.ko] undefined!

Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-09 23:27:01 -08:00
Mauro Carvalho Chehab ed086314f4 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>
2008-01-25 19:05:12 -02:00
Mauro Carvalho Chehab c8793b035d 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>
2008-01-25 19:04:55 -02:00
Mauro Carvalho Chehab 15b9becc68 V4L/DVB (7020): Add USB ID for a newer variant of Hauppauge WinTV USB2
Thanks to Jeroen Janssen <Jeroen.Janssen@vub.ac.be>

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:54 -02:00
Mauro Carvalho Chehab 3f4dfe2acf V4L/DVB (6970): Request snd-usb-audio for devices with Audio Class support
Before this patch, only Vendor Class audio support were loaded. This means that
older em28xx devices won't have digital audio support loaded.

This patch changes the logic to auto load eighter snd-usb-audio, for devices
with USB Audio Class or em28xx-alsa, for devices with USB Vendor Class.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:39 -02:00
Mauro Carvalho Chehab a4950134d4 V4L/DVB (6969): Avoid causing regressions for non-HVR950 boards
Only HVR950 has analog_gpio configured. It makes no sense to set gpio to 0 for
other boards. Better to add a test, while this var is not set for all xc3028
devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:39 -02:00
Mauro Carvalho Chehab 0be4375410 V4L/DVB (6956): Add Radio support for em28xx
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:34 -02:00
Mauro Carvalho Chehab 3abee53e44 V4L/DVB (6955): Properly implement 12MHz I2S support
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:33 -02:00
Mauro Carvalho Chehab d7448a8d9d 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>
2008-01-25 19:04:32 -02:00
Mauro Carvalho Chehab 6d79468dd8 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>
2008-01-25 19:04:32 -02:00
Mauro Carvalho Chehab 1a6f11e0e8 V4L/DVB (6950): Lindent em28xx-audio.c
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:31 -02:00
Markus Rechberger a52932b405 V4L/DVB (6949): Adds em28xx-audio module
em28xx-audio module exports em28xx Vendor Class audio as an -alsa
driver. This module were written based on usbaudio driver by Markus
Rechberger. Recently, he acked to allow us to merge it on kernel:

http://lists-archives.org/video4linux/20408-supporting-prolink-pixelview-405-dvd-maker.html

Thanks to Markus Rechberger <mrechberger@gmail.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:31 -02:00
Mauro Carvalho Chehab 74f38a8237 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>
2008-01-25 19:04:31 -02:00
Mauro Carvalho Chehab 539c96d0fd 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>
2008-01-25 19:04:30 -02:00
Aurelien Jarno aec2aef267 V4L/DVB (em28xx): Add support for Pinnacle Dazzle DVC 100
The patch below adds the "Pinnacle Dazzle DVC 100" to the list of
cards supported by the em28xx driver. As the configuration is the same
as the DVC 90 one, it simply adds a new USB ID to the list of devices
supported by the DVC 90 configuration.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:58 -02:00
Mauro Carvalho Chehab c23f5949c0 V4L/DVB (6665): Fix CodingStyle
thanks to checkpatch.pl

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:41 -02:00
Mauro Carvalho Chehab 5add9a6f3c 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>
2008-01-25 19:02:39 -02:00
Aidan Thornton 122d15888a 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>
2008-01-25 19:02:16 -02:00
Mauro Carvalho Chehab 7d497f8afa 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>
2008-01-25 19:02:08 -02:00
Mauro Carvalho Chehab cb77d01022 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>
2008-01-25 19:02:07 -02:00
Mauro Carvalho Chehab 195a4ef627 V4L/DVB (6585): Convert em28xx to video_ioctl2
Uses the newer ioctl handler at videodev. This patch also cleans up some
bad logic at the driver and do CodingStyle and other cleanups at the
resulting driver.

Also, since VIDIOCMBUF were not working, the V4L1 compat code were removed.
The compat code will eventually be re-inserted, if we find a clean way for
implementing compatibility with the old API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:07 -02:00
Mauro Carvalho Chehab 9e31ced888 V4L/DVB (6584): Fix read() method
Backport read() fixes from Markus Rechberger.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:07 -02:00
Mauro Carvalho Chehab a225452ef8 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>
2008-01-25 19:02:06 -02:00
Mauro Carvalho Chehab a3a048cea3 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>
2008-01-25 19:02:06 -02:00
Mauro Carvalho Chehab 98ae127cae V4L/DVB (6562): Make HVR900 to use also tveeprom
Hauppauge firmwares can be decoded using tveeprom. This patch adds HVR-900 as
a tveeprom client. It also adds xc3028 tuner entry to tveeprom.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:02 -02:00
Mauro Carvalho Chehab f8b6030ccc V4L/DVB (6560): Fix a bug when setting tuner type
Tuner-type were correctly filled only by the hint function.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:01 -02:00
Mauro Carvalho Chehab 232fcefb55 V4L/DVB(6548b) Fix compilation for em28xx
From: Mauro Carvalho Chehab <mchehab@infradead.org>

In file included from drivers/media/video/em28xx/em28xx-i2c.c:31:
drivers/media/video/tuner-xc2028.h:10:26: error: dvb_frontend.h: No such file or directory

In file included from drivers/media/video/em28xx/em28xx-i2c.c:31:
drivers/media/video/tuner-xc2028.h:32: warning: 'struct dvb_frontend' declared inside parameter list
drivers/media/video/tuner-xc2028.h:32: warning: its scope is only this definition or declaration, which is probably not what you want

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:58 -02:00
Mauro Carvalho Chehab d2ba055d3b V4L/DVB (6546): Add comments for the hint methods
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:57 -02:00
Sascha Sommer fad7b958e7 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>
2008-01-25 19:01:56 -02:00
Sascha Sommer 4362559d82 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>
2008-01-25 19:01:56 -02:00
Sascha Sommer 5a80415bca 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>
2008-01-25 19:01:55 -02:00
Mauro Carvalho Chehab ea4fd5679b V4L/DVB (6537): Add entry for Pixelview Prolink PlayTV USB 2.0
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:55 -02:00
Mauro Carvalho Chehab 03910cc390 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>
2008-01-25 19:01:55 -02:00
Mauro Carvalho Chehab 3dbd85ba36 V4L/DVB (6535): Fix: Adds the generic PCI IDs for em28xx
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:54 -02:00
Mauro Carvalho Chehab 7d070e26a8 V4L/DVB (6519): Fix HVR900/HVR950 entry
- Television is now default;
- Add HVR950 name at the entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:54 -02:00
Mauro Carvalho Chehab 352fae1dff V4L/DVB (6516): Allow faster loading by using 64 bytes block by em28xx i2c write
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:53 -02:00
Mauro Carvalho Chehab 6c362c8e58 V4L/DVB (6476): Add support for analog tv on HVR-950
This patch adds USB ID for HVR-950. It also adds the callback for handling
firmware loading.

Thanks to Markus Reichberger for the reset commands.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:36 -02:00
Mauro Carvalho Chehab 882876bf97 V4L/DVB (6474): Add support for tuner-xc2028
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:34 -02:00
Mauro Carvalho Chehab 1246657785 V4L/DVB (6422): Add the pending entries for xc2028/3028 based boards
Also replaces all occurrences of TUNER_XCEIVE_XC3028 to TUNER_XC2028.

Some work is still may be required to make sure that non-tm6000 drivers will
be capable of using tuner-xc2028.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:01 -02:00
Mauro Carvalho Chehab 7f1711234e V4L/DVB (6384): Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIG
Currently, the only tuner-specific device that allows special
configurations is tda9887. However, tea5767 also may require some
special configurations (for example, to specify a different Xtal freq).

This patch replaces TDA9887_SET_CONFIG by a more generic internal ioctl
(TUNER_SET_CONFIG). The newer one allows specifying what tuner is
appliable to a configuration set, and allows an arbitrary configuration
struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:54 -02:00
Mauro Carvalho Chehab 63337dd3f5 V4L/DVB (6581): Fix: avoids negative vma usage count
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:07 -02:00
Sascha Sommer 2b2c93ac99 V4L/DVB (6540): em28xx: fix failing autodetection after the reboot
The attached patch is required so that the autodetecion code also works after
a reboot.

Setting the I2C speed does not seem to be supported for em2800.

Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:02 -02:00
Mauro Carvalho Chehab fe51f819bc V4L/DVB (6532): Add the remaining addresses for tda9887
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:29 -02:00
Ludovico Cavedon 8c6da5c41e V4L/DVB (6531): Fix a regression caused by commit 153962364d
From: Ludovico Cavedon <cavedon@sssup.it>

Signed-off-by: Ludovico Cavedon <cavedon@sssup.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:29 -02:00
Trent Piepho 6d35c8f648 V4L/DVB (6514): em28xx: Include linux/mm.h
This em28xx-video.c uses functions from this header, but doesn't include it.
It depends on some v4l headers included two levels down including poll.h,
which includes mm.h.

These v4l headers might change, so it's best to include the headers needed
directly.

It also causes problems for the out of core build system's backward
compatibility with older kernels, which is the real reason I bothered to
create a patch for something that would otherwise be so minor that it would
hardly be worth the trouble.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:28 -02:00
Randy Dunlap cb20630cef V4L/DVB (6479): use input functions, should depend on INPUT
All of these drivers select VIDEO_IR, which uses the input subsystem,
so they should also depend on INPUT.

Problem examples:

drivers/built-in.o: In function `ir_input_key_event':
ir-functions.c:(.text+0x10849a): undefined reference to `input_event'
ir-functions.c:(.text+0x1084ac): undefined reference to `input_event'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11cc0a): undefined reference to `get_key_pinnacle_color'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11cc4f): undefined reference to `get_key_pinnacle_grey'
drivers/built-in.o: In function `saa7134_input_fini':
(.text+0x11cd8b): undefined reference to `input_unregister_device'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11d1fa): undefined reference to `input_allocate_device'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11d317): undefined reference to `input_register_device'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11d6ca): undefined reference to `input_free_device'

drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c3f3): undefined reference to `ir_codes_hauppauge_new'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c450): undefined reference to `ir_codes_pinnacle_color'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c480): undefined reference to `ir_codes_purpletv'
drivers/built-in.o: In function `saa7134_set_i2c_ir':
(.text+0x11c495): undefined reference to `ir_codes_pinnacle_grey'
drivers/built-in.o: In function `saa7134_ir_start':
(.text+0x11c622): undefined reference to `ir_rc5_timer_end'
drivers/built-in.o: In function `saa7134_ir_start':
(.text+0x11c637): undefined reference to `ir_rc5_timer_keyup'
drivers/built-in.o: In function `build_key':
saa7134-input.c:(.text+0x11c769): undefined reference to `ir_extract_bits'
saa7134-input.c:(.text+0x11c7ad): undefined reference to `ir_input_keydown'
saa7134-input.c:(.text+0x11c7f0): undefined reference to `ir_input_keydown'
saa7134-input.c:(.text+0x11c7f9): undefined reference to `ir_input_nokey'
saa7134-input.c:(.text+0x11c806): undefined reference to `ir_input_nokey'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ca07): undefined reference to `ir_codes_encore_enltv'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11caf6): undefined reference to `ir_input_init'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cbf2): undefined reference to `ir_codes_avermedia'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cc24): undefined reference to `ir_codes_pctv_sedna'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cc53): undefined reference to `ir_codes_flydvb'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cc85): undefined reference to `ir_codes_videomate_tv_pvr'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ccb7): undefined reference to `ir_codes_pixelview'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cce9): undefined reference to `ir_codes_eztv'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cd1b): undefined reference to `ir_codes_manli'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cda8): undefined reference to `ir_codes_cinergy'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cdd7): undefined reference to `ir_codes_flyvideo'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ce06): undefined reference to `ir_codes_asus_pc39'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11ce7d): undefined reference to `ir_codes_gotview7135'
drivers/built-in.o: In function `saa7134_input_init1':
(.text+0x11cee1): undefined reference to `ir_codes_proteus_2309'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04 21:41:23 -02:00
Florin Malita e7222ca9b4 V4L/DVB (6350): V4L: possible leak in em28xx_init_isoc
Coverity (CID 1929) spotted the following: if a transfer buffer
allocation fails, the last allocated urb is leaked (it hasn't been
stored in dev->urb[] yet so em28xx_uninit_isoc misses it). The patch
also includes a small typo fix.

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

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

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:24 -02:00
Robert P. J. Day 3a4fa0a25d Fix misspellings of "system", "controller", "interrupt" and "necessary".
Fix the various misspellings of "system", controller", "interrupt" and
"[un]necessary".

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:10:43 +02:00
David Brownell 3be27d37c2 i2c: Remove NOP i2c_algorithm.algo_control() methods
This removes NOP implementations of i2c_algorithm.algo_control.

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

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-10-13 23:56:32 +02:00
Trent Piepho a991f44b79 V4L/DVB (6316): Change list_for_each+list_entry to list_for_each_entry
The rest of V4L files.

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

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

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

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:35:29 -03:00
Mauro Carvalho Chehab 9c12224a60 V4L/DVB (6079): Cleanup: remove linux/moduleparam.h from drivers/media files
Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This
patch removes all occurences of moduleparm.h from drivers/media files.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:17 -03:00
Rolf Eike Beer afa76b392e V4L/DVB (6005): Initialize filp->private_data only once in em28xx_v4l2_open
Some lines later filp->private_data is initialized to dev again.
Since there are some checks that might fail in the mean time
keep the later version.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:00 -03:00
Jesper Juhl 1207cf84f2 USB: Fix a memory leak in em28xx_usb_probe()
If, in em28xx_usb_probe() the memory allocation
	dev->alt_max_pkt_size = kmalloc(32*
						dev->num_alt,GFP_KERNEL);
fails, then we'll bail out and return -ENOMEM.
The problem is that in that case we don't free the storage allocated
to 'dev', thus causing a memory leak.

This patch fixes the leak by freeing 'dev' before we return -ENOMEM.
This fixes Coverity bug #647.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-08-22 14:27:47 -07:00
Mauro Carvalho Chehab bf57ab7ae7 V4L/DVB (5640): Fix: em28xx shouldn't be selecting VIDEO_BUF
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-22 16:00:12 -03:00
Al Viro 1b2bad2f04 em28xx and ivtv should depend on PCI
.. because video-buf.c requires PCI, and VIDEO_EM28XX selects it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-15 18:56:37 -07:00
Linus Torvalds 57a44415be Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (44 commits)
  V4L/DVB (5571): V4l1-compat:  Make VIDIOCSPICT return errors in a useful way
  V4L/DVB (5624): Radio-maestro.c cleanup
  V4L/DVB (5623): Dsbr100.c Replace usb_dsbr100_do_ioctl to use video_ioctl2
  V4L/DVB (5622): Radio-zoltrix.c cleanup
  V4L/DVB (5621): Radio-cadet.c Replace cadet_do_ioctl to use video_ioctl2
  V4L/DVB (5619): Dvb-usb: fix typo
  V4L/DVB (5618): Cx88: Drop the generic i2c client from cx88-vp3054-i2c
  V4L/DVB (5617): V4L2: videodev, allow debugging
  V4L/DVB (5614): M920x: Disable second adapter on LifeView TV Walker Twin
  V4L/DVB (5613): M920x: loosen up 80-col limit
  V4L/DVB (5612): M920x: rename function prefixes from m9206_foo to m920x_foo
  V4L/DVB (5611): M920x: replace deb_rc with deb
  V4L/DVB (5610): M920x: remove duplicated code
  V4L/DVB (5609): M920x: group like functions together
  V4L/DVB (5608): M920x: various whitespace cleanups
  V4L/DVB (5607): M920x: Initial support for devices likely manufactured by Dposh
  V4L/DVB (5606): M920x: add "c-basic-offset: 8" to help emacs to enforce tabbing
  V4L/DVB (5605): M920x: Add support for LifeView TV Walker Twin
  V4L/DVB (5603): V4L: Prevent queueing queued buffers.
  V4L/DVB (5602): Enable DiSEqC in Starbox II (vp7021a)
  ...
2007-05-11 12:57:16 -07:00
Jan Engelhardt c5da5afb9d V4L/DVB (5586): Use menuconfig objects II - V4L
Change Kconfig objects from "menu, config" into "menuconfig" so
that the user can disable the whole feature without having to
enter the menu first.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-09 10:12:39 -03:00
Michael Opdenacker 59c51591a0 Fix occurrences of "the the "
Signed-off-by: Michael Opdenacker <michael@free-electrons.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-05-09 08:57:56 +02:00
Robert P. J. Day beb7dd86a1 Fix misspellings collected by members of KJ list.
Fix the misspellings of "propogate", "writting" and (oh, the shame
:-) "kenrel" in the source tree.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-05-09 07:14:03 +02:00
Jean Delvare 6473d160b4 PCI: Cleanup the includes of <linux/pci.h>
I noticed that many source files include <linux/pci.h> while they do
not appear to need it. Here is an attempt to clean it all up.

In order to find all possibly affected files, I searched for all
files including <linux/pci.h> but without any other occurence of "pci"
or "PCI". I removed the include statement from all of these, then I
compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
false positives manually.

My tests covered 66% of the affected files, so there could be false
positives remaining. Untested files are:

arch/alpha/kernel/err_common.c
arch/alpha/kernel/err_ev6.c
arch/alpha/kernel/err_ev7.c
arch/ia64/sn/kernel/huberror.c
arch/ia64/sn/kernel/xpnet.c
arch/m68knommu/kernel/dma.c
arch/mips/lib/iomap.c
arch/powerpc/platforms/pseries/ras.c
arch/ppc/8260_io/enet.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8xx_io/enet.c
arch/ppc/syslib/ppc4xx_sgdma.c
arch/sh64/mach-cayman/iomap.c
arch/xtensa/kernel/xtensa_ksyms.c
arch/xtensa/platform-iss/setup.c
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-mpc.c
drivers/media/video/saa711x.c
drivers/misc/hdpuftrs/hdpu_cpustate.c
drivers/misc/hdpuftrs/hdpu_nexus.c
drivers/net/au1000_eth.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fec_8xx/fec_mii.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/fs_enet/mac-fcc.c
drivers/net/fs_enet/mac-fec.c
drivers/net/fs_enet/mac-scc.c
drivers/net/fs_enet/mii-bitbang.c
drivers/net/fs_enet/mii-fec.c
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/lasi_82596.c
drivers/parisc/hppb.c
drivers/sbus/sbus.c
drivers/video/g364fb.c
drivers/video/platinumfb.c
drivers/video/stifb.c
drivers/video/valkyriefb.c
include/asm-arm/arch-ixp4xx/dma.h
sound/oss/au1550_ac97.c

I would welcome test reports for these files. I am fine with removing
the untested files from the patch if the general opinion is that these
changes aren't safe. The tested part would still be nice to have.

Note that this patch depends on another header fixup patch I submitted
to LKML yesterday:
  [PATCH] scatterlist.h needs types.h
  http://lkml.org/lkml/2007/3/01/141

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-05-02 19:02:35 -07:00
Mauro Carvalho Chehab 53c4e9551c V4L/DVB (5479): Use ARRAY_SIZE instead of a magic number
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:12 -03:00
Tim Schmielau cd354f1ae7 [PATCH] remove many unneeded #includes of sched.h
After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there.  Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm.  I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-14 08:09:54 -08:00
Arjan van de Ven fa027c2a0a [PATCH] mark struct file_operations const 4
Many struct file_operations in the kernel can be "const".  Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data.  In addition it'll catch accidental writes at compile time to
these shared resources.

[akpm@sdl.org: dvb fix]
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12 09:48:45 -08:00
David Brownell 9a2816c1c4 V4L/DVB (5014): Allyesconfig build fixes on some non x86 arch
- CAFE_CCIC needs to depend on PCI, else "allyesconfig" breaks
   on systems without PCI
- em28xx-video can't udelay(2500) else "allyesconfig" breaks
   on systems that refuse to spin that long (I saw it on ARM)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-27 14:20:41 -02:00
Al Viro 663d1ba2f1 [PATCH] em28xx NULL noise removal
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-10 15:37:23 -07:00
David Howells 7d12e780e0 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 15:10:12 +01:00
Hans Verkuil 784e8fe417 V4L/DVB (4546): Add u32 argument to VIDIOC_INT_RESET.
The extra argument makes it possible to reset subsystems of a chip if
that is supported.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-09-26 12:30:34 -03:00
Mauro Carvalho Chehab faa1cb2039 V4L/DVB (4518): Allow manually selecting the proper helper drivers
There are several boards on V4L that can work with several different
helper modules for audio/video encoding/decoding and similar stuff.
This patch adds the capability of choicing between autoselecting the
pertinent helper modules for each driver, or to manually selecting
them.
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Mike Isely <isely@pobox.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-09-26 12:30:33 -03:00
Mauro Carvalho Chehab eb42c42449 V4L/DVB (4507): Make tvp5150 an independent Kconfig item
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-09-26 12:30:32 -03:00
Michael Krufky 4987abed29 V4L/DVB (4267): Remove all instances of request_module("tda9887")
We should no longer try to load the tda9887 module, because it no longer
exists. The tda9887 driver has been merged into the tuner module.
This patch removes all instances of request_module("tda9887") from
the following video4linux drivers: bttv, cx88, em28xx and saa7134.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-30 15:59:29 -03:00
Mauro Carvalho Chehab 153962364d V4L/DVB (4205): Merge tda9887 module into tuner.
Most uses a tda988[5/6/7] IF demodulator as part of the device.
Having this as a separate stuff makes harder to configure it, since there
are some tda9887 options that are tuner-dependent and should be bound into
tuner-types structures.
This patch merges tda9887 module into tuner. More work is required to make
tuner-types to properly use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-25 02:05:24 -03:00