Commit Graph

467 Commits (41facaa4b63cc1a0ff5a900149a29942d47e1491)

Author SHA1 Message Date
Takashi Iwai 9004acc70e [ALSA] Remove sound/driver.h
This header file exists only for some hacks to adapt alsa-driver
tree.  It's useless for building in the kernel.  Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it.  This should be really killed in
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:48 +01:00
Steven Toth 72e04f720f V4L/DVB (7059): cx88: Ensure the tuner is reset correctly
Previous patches assume the tuner was on a different gpio. This patch
corrects this.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:05:12 -02:00
Steven Toth 9121106a7f V4L/DVB (7058): IR corrections for the Pinnacle 800i
IR corrections for the Pinnacle 800i

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:05:11 -02:00
Steven Toth 4917019d19 V4L/DVB (7046): Finalise support for the Pinnacle HD 8000i
Correctly set the atatch structures, enable IR, configure the
xc5000 tuner includes.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:05:08 -02:00
Steven Toth 73c993a829 V4L/DVB (7045): xc5000: Small amount of cleanup and commenting
xc5000: Small amount of cleanup and commenting, just for clarification.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:05:07 -02:00
Steven Toth 60464da8b1 V4L/DVB (7043): New card supported(partially): Pinnacle 800i
From Zhang: This patch continues the support for the Pinnacle HD 800i.

Patch committed as-is, cleanups to follow ... Steve

Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:05:06 -02:00
Hans Verkuil ea48c13ad0 V4L/DVB (6861): cx2341x: command argument should be u32 instead of int
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:04 -02:00
Michael Krufky 35e420357b V4L/DVB (6837): Convert cx88_input.audioroute to a bitfield
Prevent us from wasting some extra bytes of memory

Thanks to Trent Piepho, for pointing this out.


Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:50 -02:00
Mauro Carvalho Chehab d8f69971d8 V4L/DVB (6836): Fix CodingStyle troubles caused by the previous cx88 commits
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:50 -02:00
Frej Drejhammar 36e05a4475 V4L/DVB (6834): cx88-video: Enable selection of the WM8775 for cx88 cards
The auto selection of pertinent helper chips (VIDEO_HELPER_CHIPS_AUTO)
should select the wm8775 driver, which is used by at least one
Conexant 2388x based card (Hauppauge HVR-1300), if VIDEO_CX88 is
selected.

Signed-off-by: Frej Drejhammar <frej.drejhammar@gmail.com>
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:49 -02:00
Ricardo Cerqueira 66e6fbdf99 V4L/DVB (6833): Don't limit cx88 audio routing to blackbird boards
All cx2388 boards need the line-in audio to be routed from an external ADC
(refered to as "ADC mode" in the spec sheet), since the chip is uncapable
of dealing with baseband audio directly.
So... this patch enables normal mode when using the tuner (TV or Radio), and
enables ADC mode with any other source. It'll probably only work with boards
that have supported ADCs (such as the Wolfson wm9775)

Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:49 -02:00
Michael Krufky 6a0bc9a016 V4L/DVB (6832): cx88-blackbird: don't mute audio when stopping the codec
We should not mute the audio input when we stop the codec,
because it will interfere with the live uncompressed stream.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:49 -02:00
Ricardo Cerqueira 7b27d45bb5 V4L/DVB (6831): Audio routes fix for blackbird boards with the wm8775 ADC
Fix lack of audio on the MPEG-2 stream of wm8775 based blackbirds.

The wm8775 module initializes the audio input at "route 2", which doesn't
hold true for all boards. The HVR-1300, for example, uses route 1 for
tuner audio, and route 2 for baseband. So we must route the audio to the
proper input depending on what video input is being used.

Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:48 -02:00
Jelle Foks 4423a9a339 V4L/DVB (6830): cx88-blackbird: remove unnecessary encoder unmute
Remove the unnecessary BLACKBIRD_UNMUTE calls to the mpeg encoder in
cx88-blackbird.c

The encoder is never muted, hence unmuting should then only be necessary
once after hardware initialization.

I tested this from warm boots and cold boots (with long power down time
to ensure the sram in the chip is emptied), and found that after the
firmware upload the encoder is apparently not muted, making the unmutes
unnecessary.

Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:48 -02:00
Jelle Foks e21a5c68de V4L/DVB (6829): cx88-blackbird: remove unnecessary msleep()'s
Remove the unnecessary msleep()'s in cx88-blackbird.c

Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:48 -02:00
Jelle Foks f9e54e0c84 V4L/DVB (6828): cx88-blackbird: audio improvements
This patch should fix the 'muted audio' and 'raspy audio' problem for
mpeg2 streams out of cx88-blackbird devices.

Especially mythtv users would find that the audio would often sound bad
(aliased, or 'raspy'), mainly related to channel changes, many (all?)
other users would find that there was no audio at all in the mpeg data
from the encoder chip, unless the audio was manually unmuted.

The patch includes the following modifications:

Don't actually start the mpeg2 encoder until the device is read from
by the application.

Wait until the audio is stable for at least 400ms before starting the
mpeg encoder.

Mute/Unmute the audio when starting/stopping the mpeg encoder.

Stop the mpeg encoder when changing parameters and when changing tuner
frequency.

Add a variable 'mpeg_active' to struct cx8802_dev to allow tracking of
whether or not the mpeg2 encoder is active.

Load the firmware on cx88-blackbird driver load.

Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:47 -02:00
Brandon Philips 0fc0686e64 V4L/DVB (6600): V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g
s/STATE_PREPARED/VIDEOBUF_PREPARED/g
s/STATE_QUEUED/VIDEOBUF_QUEUED/g
s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g
s/STATE_DONE/VIDEOBUF_DONE/g
s/STATE_ERROR/VIDEOBUF_ERROR/g
s/STATE_IDLE/VIDEOBUF_IDLE/g

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:11 -02:00
Adrian Bunk a2fbaa519b V4L/DVB (6576): cx88-mpeg.c: make 4 functions static
This patch makes the following needlessly global functions static:
- cx8802_init_common()
- cx8802_fini_common()
- cx8802_suspend_common()
- cx8802_resume_common()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:05 -02:00
Mauro Carvalho Chehab 55c88610fe V4L/DVB (6386): Add support for radio on CX88_BOARD_MSI_TVANYWHERE_MASTER
This board has some special tea5767 configuration. Basically, radio 
XTAL uses a different frequency than the other supported radios. It 
uses a 13 MHz XTAL.

This patch adds the proper radio gpio and tea5767 configurations for 
the board.

Also, with PAL/BG, the board requires some special init for tda9887:
port1=0 port2=0 qss=1

Thanks to Serge Kolotylo and MIDImaster for their help on identifying 
the proper needs for this driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:00:55 -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
Brandon Philips 053fcb6014 V4L/DVB (6602): V4L: Convert videobuf drivers to videobuf_stop
Drivers were using cookie cutter code for stopping the read/stream.  Use the
new videobuf_stop function which is lock safe.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-11 18:08:09 -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
Trent Piepho a04036a312 V4L/DVB (6336): cx8802: Plug memory leak when unregistering a driver
When a cx8802 sub-driver was unregistered, the struct cx8802_driver, which was
kmalloc()ed by cx8802_register_driver(), was deleted from the list of drivers,
but never freed.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho 89a47942f0 V4L/DVB (6335): cx8802: Replace list_for_each+list_entry with list_for_each_entry
Less code and more efficient.

Got ride of a variable that counted the number of devices in
cx8802_unregister_driver() but was never used.  Looked leftover from a
cut&paste.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho 081c2fc8b9 V4L/DVB (6334): cx88: Change (struct cx8802_dev)->drvlist to a list_head and fix bugs
It was a struct cx8802_driver for no apparent reason.  Nothing uses a
cx8802_driver in the cx8802_dev struct.  The only field that was used was
devlist, a list_head.

The code in cx8802_remove() that removed any loaded sub-drivers was broken.
It would delete the current list entry, but didn't use list_for_each_safe.  It
also called list_del() on the list _head_ inside the list_for_each loop?  It
would crash if it was run, which I don't think can ever happen.

Since the cx8802 sub-drivers use the cx8802 driver, they have to be unloaded
first.  So there isn't any way for a sub-driver to still be loaded when
cx8802_remove() is called...  Except maybe with PCI hot-plug, if one removes
the PCI card while the drivers are loaded?

So I left some code in to handle that if it's actually possible.  It will
remove the sub-drivers from the device cx8802_remove() was called on, and only
that device.  If one has two DVB cards and unplugs one, there is no reason to
unload the DVB drivers for both cards.  I have no way to test this, but it
can't be worse than what was there before.

cx8802_get_driver() is passed a cx8802_dev pointer and looks for the requested
driver on that device.  It first loops over the cx8802 device list looking for
the device it was passed, which is pointless.  It doesn't need to find the
device pointer in the list, as it already has the pointer.

The list_head in the cx8802_driver struct, which joins all the _drivers_
attached to a device, was named devlist.  Changed that to drvlist, since the
devlist is used for a list of _devices_ in other cx8802 structs.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
Trent Piepho f0ad90975b V4L/DVB (6333): cx88: Change void* card_priv to struct vp3054_i2c_state
card_priv was only used to store a pointer to the vp3054 state struct.
There's no need to use a void * since it doesn't have multiple types.

Make the field conditional on VP3045 support.  It was already conditional on
DVB support, but it's only used if VP3045 support is on, so that makes for a
better option to check.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:42 -02:00
Trent Piepho 7717cbedd9 V4L/DVB (6332): cx88: Only include the blackbird fields if blackbird is selected
Add some ifdefs around fields only used for blackbird support, similar to the
way the dvb fields are only included with dvb support.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:42 -02:00
Hans Verkuil 3bcc95760c V4L/DVB (6321): Remove obsolete VIDIOC_S/G_MPEGCOMP ioctls
Remove the obsolete VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP ioctls from
the V4L2 API as per the removal schedule (October 2007).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:30 -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
Trent Piepho bbaccc0445 V4L/DVB (6187): cx88-alsa: Add TLV support
Lets mixer apps display a dB range for the volume control.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:18 -02:00
Trent Piepho 54ac005adc V4L/DVB (6185): cx88-alsa: Add mute controls, change control names
Add two mute controls.  One mutes everything, the other just mutes the analog
pass-through output.

Rename the existing volume control.  The controls are now:
Playback Volume
Playback Switch
Capture Switch

These names might seem odd, but I believe they are more correct.  The previous
"Capture Volume" control didn't actually effect the volume of the captured
audio.  Instead it controls the volume of the analog pass-thought output.  It
appears that pass-through controls like this are usually considered to be in
the playback direction, not capture.  For example, "CAPTURE feedback Playback
Volume" is the name used for a control that appears to have the same effect in
the ca0106 driver.  We only have one volume control, so we can omit the
"CAPTURE feedback" part.

If someone where to add PCM playback support to the driver, then this would be
the volume control.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:16 -02:00
Jaroslav Kysela c1017a4cdb [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16 16:51:18 +02:00
Trent Piepho 8bb629e22f V4L/DVB (6312): cx88: Replace list_for_each+list_entry with list_for_each_entry
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 13:34:48 -03:00
Trent Piepho 5a3ebe8755 V4L/DVB (6283): videobuf: Remove references to old Kconfig option name
CONFIG_VIDEO_BUF_DVB became CONFIG_VIDEOBUF_DVB.

But in these cases, it makes more sense to use CONFIG_VIDEO_SAA7134_DVB
or CONFIG_VIDEO_CX88_DVB_MODULE depending on the driver.

The reference in cx23885.h should just be removed, as the code there needs to
be included if DVB is on or off.  I do not think you can even compile the
cx23885 driver without DVB.  It's clearly just leftover from when the file was
obvious copied from the cx88 driver (which is not mentioned in the copyright
BTW).

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:03:08 -03:00
Mauro Carvalho Chehab 28318c72ad V4L/DVB (6260): Fix Kconfig dependency
Thanks to Michael Krufky for pointing this to me.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:49 -03:00
Mauro Carvalho Chehab ba366a23b6 V4L/DVB (6257): Rename video-buf-dvb to videobuf-dvb to be consistent with the other patches
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-10 00:02:46 -03:00
Mauro Carvalho Chehab c1accaa21b V4L/DVB (6252): Adapt drivers to use the newer videobuf modules
PCI-dependent videobuf_foo methods were renamed as videobuf_pci_foo.

Also, videobuf_dmabuf is now part of videobuf-dma-sg private struct.
So, to access it, a subroutine call is needed.

This patch renames all occurences of those function calls to be
consistent with the video-buf split.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
2007-10-09 22:14:55 -03:00
Mauro Carvalho Chehab 13595a51c0 V4L/DVB (6247): Fix bug #8689: Fixes IR stop/start during suspend/resume
IR workqueue should be disabled during suspend. This avoids some troubles, like
the one reported on bug #8689:

"The Hauppauge HVR 1100 ir-remote control does not work after resume from
suspend to ram or disk."

This patch disables IR before suspending, re-enabling it after resume.

Thanks to Peter Poklop <Peter.Poklop@gmx.at> for reporting it and helping with
the fix.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Reviewed-by: Peter Poklop <Peter.Poklop@gmx.at>
2007-10-09 22:14:51 -03:00
Trent Piepho 415927dcd1 V4L/DVB (6186): cx88-alsa: Remove some unused fields in card state struct
Not sure why they are there, but they don't do anything now.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:13:58 -03:00
Trent Piepho 82896f29d4 V4L/DVB (6184): cx88-alsa: Make volume control stereo
Use the balance control to make the mono volume control stereo.

Note that full range isn't supported.  The balance control attenuates one
channel by 0 to -63 dB, and the volume control provides additional attenuation
to both channels by another 0 to -63 dB.

So the channel with the most attenuation has a range of 0 to -126 dB, while
the other channel only has a range of 0 to -63 dB.  ALSA volume controls don't
appear to support this concept.  I just limited the range to 0 to -63 total.
Once you get to -63 dB, you're already at silence, so additional attenuation
is pretty much pointless anyway.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:31 -03:00
Michael Krufky 6fcecce7e1 V4L/DVB (6181): cx88: auto-load rtc and ir receiver i2c modules for FusionHDTV5 RT Gold
Auto-load ir-kbd-i2c for ir receiver support, and rtc-isl1208 for rtc 
support for the FusionHDTV5 RT Gold.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:08:31 -03:00
Michael Krufky b930e1d851 V4L/DVB (6125): whitespace cleanup: replace leading spaces with tabs
There were many instances of 7-space indents spread throughout
the v4l-dvb tree.

This patch replaces the 7-space indents with tabs.  The whitespace cleaner
script doesn't catch these, because it assumes that all indents are 8-space.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:29 -03:00
Hans Verkuil 01f1e44fe8 V4L/DVB (6088): cx2341x: some controls can't be changed while the device is busy
The driver should now pass the 'busy' state of the device to the cx2341x 
module whenever controls are set or tried. -EBUSY will be returned if 
the device is busy and the user attempts to modify certain 'dangerous' 
controls. It concerns controls that change the audio or video 
compression mode and bitrates.

The cx88-blackbird and pvrusb2 drivers currently always pass '0' (not busy)
to the cx2341x, effectively keeping the old behavior for now.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:42 -03:00
Trent Piepho f6210c9160 V4L/DVB (6085): cx88-alsa: Fix mmap support
The driver has long claimed to support mmap, but it didn't work at all.  Some
of the dma buffer parameters weren't set, and since video_buf uses vmalloc to
allocate the buffer, a page callback is needed too.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:37 -03:00
Trent Piepho ffb7394d51 V4L/DVB (6084): cx88-alsa: Eliminate snd_cx88_cards
The driver kepts a static global array of snd_card pointers for each card
probed, which was never used.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:36 -03:00
Trent Piepho 05b2723387 V4L/DVB (6083): cx88-alsa: Rework buffer handling
Rework the way the DMA buffer is handled and IRQs are generated.

ALSA uses a ring-buffer of multiple periods.  Each period is supposed to
corrispond to one IRQ.

The existing driver was generating one interrupt per ring-buffer, as opposed
to per period.  This meant that as soon as the IRQ was generated, the hardware
was already starting to re-write the beginning of the buffer.  Since the DMA
happens on a per-line basis, there was only a narrow window to copy the data
out before the buffer was overwritten.

The cx88 core RISC program generator is modified so that it can set the IRQ
and counter flags to count every X lines of DMA transfer.  This way we can
generate an interrupt every period instead of every full ring-buffer.  Right
now only period of one line are supported, but it should be possible to
support longer periods.  Note that a WRITE instruction generates an IRQ when
it starts, not when the transfer is finished.  Thus to generate an IRQ when
line X is done, one must set the IRQ flag on the instruction that starts line
X+1, not the one that ends line X.

Change the line size so that there are four lines in the SRAM FIFO.  If there
are not four lines, the analog output from the cx88's internal DACs is full of
clicks and pops.

Try to handle FIFO sync errors.  Sometimes the chip generates many of these
errors before audio data starts.  Up to 50 sync errors will be ignored and the
counter reset.

Have the IRQ handler save the RISC counter to the chip struct, and then have
the pointer callback use this to calculate the pointer position.  We could
read the counter from the pointer callback, but sometimes the sync errors on
start up cause the counter to go crazy.  ALSA sees this and thinks there has
been an overrun.  The IRQ hander can avoid saving the counter position on
sync errors.

The chip "opened" flag wasn't necessary.  ALSA won't try to open the same
substream multiple times.  Probably this code was cut&pasted from the bt87x
driver, which has multiple sub-streams for one chip.

Do error checking for the videobuf mapping functions.

snd_card_cx88_runtime_free() is useless and can be deleted.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:34 -03:00
Trent Piepho 16cf1d0c5d V4L/DVB (6082): cx88: Improve risc instruction printing in sram channel dump
When the risc instrunctions from the CMDS were printed, instruction arguments
weren't taken into account.

This changes output like:
cx88[0]:   risc0: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc1: 0x0cac2800 [ INVALID sol eol 23 21 19 18 13 count=2048 ]
cx88[0]:   risc2: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc3: 0x0cac2c00 [ INVALID sol eol 23 21 19 18 13 count=3072 ]

cx88[0]:   risc0: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc1: 0x0cac2800 [ arg #1 ]
cx88[0]:   risc2: 0x1d010400 [ write sol eol irq1 cnt0 count=1024 ]
cx88[0]:   risc3: 0x0cac2c00 [ arg #1 ]

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:28 -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
Trent Piepho 19453bc188 V4L/DVB (6068): cx88-alsa: Use pci_dev->revision
The revision is part of the pci_dev struct, so there is no need to read it in.

Stop storing the revision and latency in the chip struct, since they're never
used after being printed out when the driver loads.

linux/pci.h wasn't included.  It was getting picked up something else,
probably cx88.h, but this file uses struct pci_dev so it should include pci.h.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:00 -03:00
Trent Piepho 5a5b3b5d4f V4L/DVB (6067): cx88-alsa: Hardware doesn't support mono audio
channels_min should be 2, not 1.  The hardware only supports stereo.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:59 -03:00
Trent Piepho 59fd8f8d8e V4L/DVB (6066): cx88-alsa: Change order of interrupt enabling, fix spurious IRQs
Currently the driver turns on audio interrupts, then sets the audio interrupt
mask to select which interrupts to get.  One could received unwanted
interrupts since the mask is set _after_ interrupts have already been turned
on.  Change the order of the operations, and clear any audio interrupt status
bits that are already set for good measure.

Before changing the SRAM FIFO parameters, make sure the FIFO isn't being used.
This shouldn't happen with just the ALSA driver, as it should never try to
turn on FIFO/RISC/DMA while they are already on.  However, the V4L driver
needs to turn the audio FIFO on for analog audio output to work (undocumented
cx88 bug).  The FIFO parameters are in an inconsistent state while they are
updated, and this results in many FIFO sync error IRQs if the FIFO is in use
while it's in this inconsistent state.

Also create and use a bunch of symbolic constants for audio interrupt mask
bits.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:55 -03:00
Trent Piepho 5ba862b77e V4L/DVB (6065): cx88-alsa: Call core irq handler when needed
When an irq handled by the cx88 core driver (currently IR and errors) occurs
and the cx88-alsa irq handler is the first called, it will claim to have
handled the irq but it doesn't call cx88_core_irq() to handle it.

The means loading cx88-alsa can disable the IR remote.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:55 -03:00
Trent Piepho 8ddac9ee4b V4L/DVB (6064): cx88: Add symbolic names for the PCI interrupt bits
Used for the PCI_INTMSK and PCI_INT_STAT registers.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:54 -03:00
Trent Piepho fa40b2237a V4L/DVB (6034): cx88: Add parameter to control radio deemphasis time constant
FM radio transmission use a preemphasis/deemphasis scheme to reduce
high-frequency noise.  The cx88 audio decoder is supposedly set to no
deemphasis by the current driver.

However, the "no deemphasis" setting doesn't work.  On my chip, cx23883, it
produces the same result as the 75 us time constant.  Maybe the default
settings on the cx23881 are for 50 us?

Since the deemphasis time constant varies by country, allow setting it via a
module parameter.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:21 -03:00
Trent Piepho 5772f81326 V4L/DVB (6023): cx88: Clean up some ugly and inconsistent printk()s
Get rid of the "CORE" prefix from cx88 printks.  It was only used a few times,
and it makes it look like they're coming from the kernel core or something.

Fix the message, "TV tuner 60 at 0x1fe, Radio tuner -1 at 0x1fe", by adding a
"cx88[0]" prefix to be consistent, and to keep people who grep their dmesg
output for cx88 from missing it.  Get rid of the addresses, which are always
wrong.  The addresses are always set to -1, but because it's an unsigned 8-bit
value, the left shift converts it to the nonsense address 0x1fe.

In the cx8802 driver, some cut and pasted code prefixed lines with "CORE
cx88[0]:", which has been changed to "cx88[0]/2:" like the other printks from
the cx8802 driver.

Also fix some ugly printks in the cx8802 driver that used __FUNCTION__ for
KERN_INFO and KERN_ERR messages.

The changed printks in cx88-mpeg.c also needed lots of whitespace and
80-column fixes.

A bunch of misc changes in cx88-dvb.c and cx88-video.c to add message levels
or a consistent "cx88[?]/2" or "cx88[?]/0" prefix.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:17 -03:00
Trent Piepho bbc83597df V4L/DVB (6022): cx88: Move card core creation from cx88-core.c to cx88-cards.c
A lot of code in cx88-cards.c was only used by cx88-core.c when the core state
is first allocated and initialized.  Moving that task to cx88-cards makes the
driver simpler and the files more self contained.

- Module parameters tuner, radio, card, and latency move to cx88-cards.c
- cx88_boards is made static
- cx88_subids is made static and const
- cx88_bcount is eliminated
- cx88_idcount is eliminated
- cx88_card_list() is made static
- cx88_card_setup_pre_i2c() is made static
- cx88_card_setup() is made static
- cx88_pci_quirks() is moved from cx88-core to cx88-cards
  The function argument "char *name" is made const too
- get_ressources() is moved from cx88-core to cx88-cards, and renamed to
  cx88_get_resources()
- The code to allocate and initialize the core state struct and the chip is
  moved out of cx88-core.c:cx88_get_core() and into a new function in
  cx88-cards.c, cx88_core_create().  This makes both functions simpler.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:16 -03:00
Trent Piepho 6a59d64c5c V4L/DVB (6021): cx88: Copy board information into card state
The cx88 driver state stored the ID of the board type in core->board.  Every
time the driver need to get some information about the board configuration, it
uses the board number as an index into board configuration array.

This patch changes it so that the board number is in core->boardnr, and
core->board is a copy of the board configuration information.  This allows
access to board information without the extra indirection.  e.g.
cx88_boards[core->board].mpeg becomes core->board.mpeg.

This has a number of advantages:
- The code is simpler to write.

- It compiles to be smaller and faster, without needing the extra array lookup
  to get at the board information.

- The cx88_boards array no longer needs to be exported to all cx88 modules.

- The boards array can be made const

- It should be possible to avoid keeping the (large) cx88_boards array around
  after the module is loaded.

- If module parameters or eeprom info override some board configuration
  setting, it's not necessary to modify the boards array, which would
  affect all boards of the same type.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:16 -03:00
Trent Piepho b09a79f584 V4L/DVB (6020): cx88: Fix use of uninitialized variable
An error message for PCI resource allocation failure used the board type
before it was set.  Just get rid of the error message, as get_ressources()
[sic] already prints one.  Format that error message better, and add the pci
function and subsystem information to better associate the error with what
caused it.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:15 -03:00
Trent Piepho c252b05115 V4L/DVB (6019): cx88: Make card database more memory efficient
The vmux setting is only two bits, but was taking up a whole 32 
in the input description struct.  By changing it to a two-bit 
bitfield, it can fit in what was padding space before and drop 
the input size by 4 bytes, from 28 to 24. This drops the board 
description struct, which has 9 inputs, from 280 to 244 bytes.  
Total driver size decreases by 2108 bytes.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:05:12 -03:00
Trent Piepho a75d204860 V4L/DVB (5977): cx8800: Add register debug functions to radio device too
Add the advanced debug functions to the radio videodev template.  One could
already use them from the video and vbi devices.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:04:33 -03:00
Trent Piepho 19dc74b7c5 V4L/DVB (5975): cx88: Wrong values used for HD-3000 radio mode
After some tedious work with a logic probe and a magnifying glass, I've
determined that GPIO 7 is used to switch between the DTT7612's Sound 4.5 MHz
IF output on pin 12 and the FM 10.7MHz If output on pin 11.  GPIO 2 is used to
switch the card's analog sound output from from the analog input connector to
the CX23883's audio DACs.

So, in radio mode GPIO2 = 1 and GPIO7 = 0.

Add some comments about how the HD-3000's GPIOs are connected.

Delete the vmux setting for the radio, as vmux doesn't apply to radio mode.
Also delete the lines setting unused gpio words to zero; it's not necessary as
0 is the default value for uninitialized fields.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:04:30 -03:00
Jesper Juhl 915366da0c V4L/DVB (5912): Clean up duplicate includes in drivers/media/
This patch cleans up duplicate includes in
        drivers/media/

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:03:12 -03:00
Steven Toth 48200baeab V4L/DVB (6188): Avoid a NULL pointer dereference during mpeg_open()
Bug: With a hardware encoder board installed as cx88[1] and a
non-encoder boards installed as cx88[0], an OOPS is generated
during cx8802_get_device() called from mpeg_open().

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-14 13:13:42 -03:00
Cyrill Gorcunov 32b78de7fe V4L/DVB (5871): Conexant 2388x: check for kthread_run
The patch adds checking of kthread_run return code and issues a message
if it fails.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-20 17:35:55 -03:00
Mauro Carvalho Chehab fe06fe0a4d V4L/DVB (5861): Use msecs_to_jiffies instead of HZ on bttv, cx88 and saa7134
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-20 17:35:51 -03:00
Jean Delvare 7e520d09f1 V4L/DVB (5815): Cx88: i2c structure templates clean-up
Clean up the use of structure templates in cx88-i2c and cx88-vp3054-i2c.
For one thing, a real template is supposed to be read-only. And in some
cases it's more efficient to initialize the few fields we need
individually.

This clean-up shrinks cx88-i2c.o by 33% and cx88-vp3054-i2c.o by 49%
(x86_64).

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:34 -03:00
Michael Krufky 829ea96477 V4L/DVB (5788): Cx88-input: convert nested if's to switch..case
In the function, cx88_ir_handle_key:
- convert nested if statement to a switch..case block

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:20 -03:00
Edgar Pisani e7d11ecbde V4L/DVB (5787): Cx88: add remote control support for Leadtek Winfast DTV1000
Signed-off-by: Edgar Pisani <episani@onqweb.com.au>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:20 -03:00
Jan Frey 39cf1e810a V4L/DVB (5786): Ir-kbd-i2c: add support for Hauppauge HVR1300 remote
- add support for the I2C based IR transceiver of the Hauppauge HVR-1300
- remove bad code from cx88-input.c

Signed-off-by: Jan Frey <jfrey@gmx.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:20 -03:00
Mauro Carvalho Chehab 7d816b256d V4L/DVB (5783): Fix excess of debug messages on cx88-mpeg
Closes the issue opened on Kernel bugzilla:
	http://bugzilla.kernel.org/show_bug.cgi?id=8383
There's no need to print timeout without debug turned on:
	Apr 27 23:02:14 video kernel: cx88[1]/2-mpeg: cx8802_timeout

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:18 -03:00
Michael Krufky 47a9991e80 V4L/DVB (5780): Dvb: Remove static dependencies on dvb-pll
This patch removes all static dependencies on the dvb-pll module.
All exported dvb_pll_desc's have been UNexported, and the caller
will reference the individual dvb_pll_desc by it's index in the
pll_list array.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Acked-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:16 -03:00
Michael Krufky 6d7930e0cd V4L/DVB (5772): Cx88: remove two unused pointers from struct cx8802_dev
The following two pointers in struct cx8802_dev are unused - remove them:

void* fe_handle;
int   (*fe_release)(void *handle);

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:13 -03:00
Michael Krufky e0099e9eda V4L/DVB (5734): Cx88: kill dev->fw_size
Now that cx88-blackbird is only accepting the official firmware image,
we no longer have any need to store the size of the firmware inside the
cx88 data structure.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:52 -03:00
Hans Verkuil 2547223732 V4L/DVB (5733): Blackbird should accept only new cx2341x encoding firmwares
Remove temporary support for older 256 kB firmwares.
ivtv, pvrusb2 and blackbird can now all handle the newer larger firmwares,
so support for the older (buggier) firmware can be removed.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:51 -03:00
Dmitry Torokhov 2c8a3a3355 V4L/DVB (5698): Input: drivers/media - switch to using input_dev->dev.parent
In preparation for struct class_device -> struct device input
core conversion switch to using input_dev->dev.parent when
specifying device position in sysfs tree.

Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
Acked-by: Thierry Merle <thierry.merle@free.fr>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:46 -03:00
Daniel Gimpelevich 7cb47a1460 V4L/DVB (5685): Cx88: add support for ADS Tech Instant Video PCI
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:37 -03:00
Dmitry Torokhov 749823a06e V4L/DVB (5683): V4L: cx88 - switch to using msecs_to_jiffies()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:36 -03:00
Michael Krufky 7b68814d79 V4L/DVB (5637): Cx88: kill core->pll_desc and core->pll_addr
Now that dvb-pll is being used properly in all cx88-dvb instances,
the cx88 driver no longer needs to store pll_desc nor pll_addr.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:30 -03:00
Trent Piepho b7754d74d2 V4L/DVB (5636): Integrate all users of the fmd1216 tuner with dvb-pll
Enhance the dvb-pll definition of the fmd1216 tuner by adding an init sequence
and a sleep sequence.

The init sequence sets the AGC control register to 0xa0, selecting the fast
time constant and 112 dBuV take-over point.  This the recommended value for
DVB-T operation.

The sleep sequence sets bit P4 (which is believed to turn the analog
demodulator on), turns off the tuning voltage, and sets the AGC control
register to 0x60 (external AGC voltage, the recommended value for analog
operation).

The existing dvb-pll users in the cx88 driver, listed below, will gain these
init and sleep sequences.

CX88_BOARD_HAUPPAUGE_HVR1100    Hauppauge WinTV-HVR1100 DVB-T/Hybrid
CX88_BOARD_HAUPPAUGE_HVR1100LP  Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profi
CX88_BOARD_WINFAST_DTV2000H     WinFast DTV2000 H
CX88_BOARD_HAUPPAUGE_HVR3000    Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DV
CX88_BOARD_HAUPPAUGE_HVR1300    Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encod

This non-dvb-pll user in the cx88 driver should only gain the sleep sequence,
as it already had an equivalent init sequence.  The non-dvb-pll code for this
user is removed.

X88_BOARD_DNTV_LIVE_DVB_T_PRO   digitalnow DNTV Live! DVB-T Pro

In these saa7134 driver, these non-dvb-pll users are converted to use dvb-pll:

SAA7134_BOARD_MD7134                    Medion 7134
SAA7134_BOARD_ASUS_EUROPA2_HYBRID       Asus Europa2 OEM

The saa7134 functions philips_fmd1216_tuner_init(),
philips_fmd1216_tuner_sleep(), and philips_fmd1216_tuner_set_params() are
deleted and the dvb-pll versions are used.

This should result in equivalent sleep, init, and tuning sequences being sent
to the tuner.

For the cxusb driver, only one board is effected:

USB_PID_MEDION_MD95700          	Medion MD95700

This board used dvb_usb_tuner_init_i2c() and dvb_usb_tuner_set_params_i2c()
for init and tuning, respectively.  These functions are effectively the same
as the dvb-pll versions.  They call a tuner pass control function defined at
the dvb-usb level, but this does not matter, as this card does not have a
tuner pass control function (only the dib3000mb does).  This board will gain
the sleep sequence, while init and tuning should be unchanged.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:29 -03:00
Michael Krufky 4abe9f9d94 V4L/DVB (5633): Tuv1236d: move rf input switching code into dvb-pll
This patch removes duplicate code from cx88-dvb and saa7134-dvb that handles
rf input switching for the TUV1236d tuner.

The functionality is added to dvb-pll, where all the other code that 
handles the TUV1236d is kept.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:14 -03:00
Michael Krufky 77d6750470 V4L/DVB (5632): Dvb-pll: pass dvb_frontend_parameters to generic set() function
Rename dvb_pll_desc.setbw() to set(), and accept struct dvb_frontend_parameters
instead of passing both freq and bandwidth, so that this may be used as a
generic function.

In order to do this, dvb_pll_configure must also be altered in the same manner,
to take struct dvb_frontend_parameters instead of freq and bandwidth.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:12 -03:00
Trent Piepho ecf854df72 V4L/DVB (5629): Cx88: VP3054 support can't be a module when cx88 is compiled in
If cx88 support is compiled into the kernel while vp3054 is left as a module,
the kernel will fail to link.  Adjust the existing "#if" code in cx88 so
that it won't consider vp3054 to be supported in this case.

It might make sense to move vp3054 selection into the "customisation" menu
instead of a cx88 sub-option (though this is a cx88 feature, there is no extra
chip involved).

It might also make sense to use dvb_attach() to load vp3054 support.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:11 -03:00
Rafael J. Wysocki 8314418629 Freezer: make kernel threads nonfreezable by default
Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves.  This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.

It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.

The patch causes all kernel threads to be nonfreezable by default (ie.  to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE.  It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear.  Additionally, it updates documentation to
describe the freezing of tasks more accurately.

[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:02 -07:00
Jelle Foks f057131fb6 V4L/DVB (5816): Cx88-blackbird: fix vidioc_g_tuner never ending list of tuners
v4l-info and other programs would loop indefinitely while querying the
tuners for cx88-blackbird cards.

The cause was that vidioc_g_tuner didn't return an error value for
qctrl->id != 0, making the application think there is a never ending
list of tuners...

This patch adds the same index check as done in vidioc_g_tuner() in
cx88-video.

Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-03 15:11:16 -03:00
Jean Delvare ed69686a16 V4L/DVB (5618): Cx88: Drop the generic i2c client from cx88-vp3054-i2c
Drop the generic client declared in cx88-vp3054-i2c: it's not used
anywhere. This shrinks cx88-vp3054-i2c.o by 29% on x86_64. Unless it
was there for later use?

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-09 10:13:05 -03:00
Adrian Bunk 9df2ead585 V4L/DVB (5567): Cx88-mpeg.c: make 2 functions static
This patch makes two needlessly global functions static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-09 10:12:29 -03:00
Alexey Dobriyan 45e95980f2 V4L/DVB (5565): Cx88: fix compilation on alpha
error: 'DMA_32BIT_MASK' undeclared

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-09 10:12:27 -03:00
Randy Dunlap e63340ae6b header cleaning: don't include smp_lock.h when not used
Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:07 -07:00
Andrew Morton c24228daa1 cx88-video build fix
alpha:

drivers/media/video/cx88/cx88-video.c: In function 'cx8800_initdev':
drivers/media/video/cx88/cx88-video.c:1782: error: 'DMA_32BIT_MASK' undeclared (first use in this function)
drivers/media/video/cx88/cx88-video.c:1782: error: (Each undeclared identifier is reported only once
drivers/media/video/cx88/cx88-video.c:1782: error: for each function it appears in.)

Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-07 12:13:04 -07: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
vignesh.babu@wipro.com c42cabefce V4L/DVB (5526): Cx88-alsa.c: Use kzalloc
Replacing kmalloc/memset combination with kzalloc.

Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:40 -03:00
Jean Delvare e8f4e7525c V4L/DVB (5491): Cx88: Support the DTV1000 T analog inputs
Add support for the S-Video and CVBS (composite) analog video inputs
of the Leadtek WinFast DTV1000 T adapter.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:23 -03:00
Mauro Carvalho Chehab aaa40cb8b7 V4L/DVB (5488): Replace DMA magic mask for its aliases
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:20 -03:00
Mauro Carvalho Chehab 66623a0419 V4L/DVB (5480): Fix cx88_print_irqbits calls to use ARRAY_SIZE
cx88_print_irqbits were expecting a string pointer with 32 bytes. Better 
to pass the string size and use ARRAY_SIZE on its calls.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:13 -03: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
Mauro Carvalho Chehab 5b9c4e6dbb V4L/DVB (5478): Use ARRAY_SIZE and a cleaner logic for initializing tuner
ATI HDTV Wonder needs to initialize some registers before allowing the
tuner to start working.
The current logic have lots of magic. This patch makes the code cleaner,
using ARRAY_SIZE() for the initialization array and using a
bidimensional array, instead of doing some stuff like:
	&buffer[i+2]

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:11 -03:00
Trent Piepho a5a2ecfc3b V4L/DVB (5452): Cx88: merge identical boards
The attach code for HAUPPAUGE_HVR3000 and HAUPPAUGE_HVR1300 is exactly
the same as the code used by HAUPPAUGE_HVR1100, HAUPPAUGE_HVR1100LP, and
WINFAST_DTV2000H.  So, those first two cards are added to the case block
used by the last three.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:44:55 -03:00
Michael Krufky 923da8a750 V4L/DVB (5432): Cx88: whitespace cleanup
replace leading spaces with tabs

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:44:45 -03:00
Michael Krufky 733aeaf4c0 V4L/DVB (5431): Cx88: autodetect ADS Tech InstantTV DVB-S
The ADS Tech InstantTV DVB-S is a clone of the KWorld DVB-S 100.
This patch adds autodetection support for this card based on
pci subsystem id.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:44:44 -03:00
Trent Piepho 6bdcc6e6db V4L/DVB (5363): Dvb: Remove lgh06xf driver
The code of the dvb-pll driver and the lgh06xf driver is nearly
identical.  The main difference is that the lgh06xf driver would set the
AGC TOP value on every tune call.  The dvb-pll driver now has the ability
to set the AGC TOP when the front-end device is opened, which is a better
way to go about it.  By using this ability of dvb-pll, the lgh06xf driver
is made unnecessary.

There is one other difference.  dvb-pll will probe for the presence of an
I2C pll chip by doing a one byte read, the lgh06xf driver did not do
this.  In some devices the PLL is not reachable over I2C at the timer the
tuner is attached.  Some more initialization, such as firmware loading,
must take place first.  None of the devices using a LG-H06xF should have
this problem.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:44:05 -03:00