summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-tvaudio.c
AgeCommit message (Collapse)Author
2007-08-15cx88: Copy board information into card stateTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> 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>
2007-07-19backport kernel changeset 831441862956fffa17b9801db37e6ea1650b0f69Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Original patch description from the patch by Rafael J. Wysocki <rjw@sisk.pl>: 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. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-02Fix v4l-dvb backward compatibilityMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Due to several internal API changes on kernel, kernel backward compatibility were lost. Basically, compat.h should be the last include for it to work properly. This patch basically reorders kernel headers to allow backward compat to work fine. Also: Some includes were added after some non-include macros, on old drivers. Better to keep all includes at the beginning of the files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-13backport mainstream changeset 6473d160b4aba8023bcf38519a5989694dfd51a7Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: The original kernel patch is from Jean Delvare <khali@linux-fr.org> PCI: Cleanup the includes of <linux/pci.h> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-13Backport kernel changeset e63340ae6b6205fef26b40a75673d1c9c0c8bb90Mauro Carvalho Chehab
From: Mauro Carvalho Chehab kernel-sync: The original patch description, from Randy Dunlap <randy.dunlap@oracle.com>: 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: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21Backport of git changeset cd354f1ae75e6466a7e31b727faede57a1f89ca5Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Backport a changeset from Schmielau <tim@physik3.uni-rostock.de> that removes uneeded includes for linux/sched.h Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-07freezer.h exists only on kernel 2.6.20Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Create compat code with older kernels. kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-07Cx88xx: Fix lockup on suspendMauro Carvalho Chehab
From: Robert Hancock <hancockr@shaw.ca> Suspending with the cx88xx module loaded causes the system to lock up because the cx88_audio_thread kthread was missing a try_to_freeze() call, which caused it to go into a tight loop and result in softlockup when suspending. Fix that. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-10-16cx88: determine whether or not to use external adc based on input settingMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Some cx88-blackbird boards use an external adc, but not necessarily for all inputs. Thus, this needs to be configurable on the card level for each input. This patch allows for the usage of the external adc to be determined by a bit setting in the cx88_input struct for cards based on the cx88 blackbird design. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-09-25cx88: rename mpeg capability flags from CX88_BOARD_FOO to CX88_MPEG_FOOMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> The flags for mpeg capabilities are sub-optimally named as CX88_BOARD_DVB and CX88_BOARD_BLACKBIRD, which creates some confusion. This patch renames the above to CX88_MPEG_DVB and CX88_MPEG_BLACKBIRD. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> CC: Steven Toth <stoth@hauppauge.com> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-09-25Changed cx88_board .dvb and .register to an enum.Steven Toth
From: Steven Toth <stoth@hauppauge.com> Some basic cleanup in preperation for a future patch where the cx88-mpeg functions have to deal with the port being used by multiple frontends in (mpeg2 hw encoder and dvb demod). Signed-off-by: Steven Toth <stoth@hauppauge.com>
2006-08-17Enable audio DMA restart on channel change even when cx88-alsa is compiledRicardo Cerqueira
From: Ricardo Cerqueira <v4l@cerqueira.org> cx88-alsa can be compiled in (in distro built kernels, for example), but not used. In those cases, the audio DMA restart is needed for proper sound on NICAM channels. This patch enables the DMA restart even with ALSA, but the functions now check if cx88-alsa is really active. Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
2006-07-19Removed the remaining config.h stuffMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since kernel include autoconf.h via command line, those config.h inclusion can be removed. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-24cx88: cleanupsMichael Krufky
From: Adrian Bunk <bunk@stusta.de> remove the following unused hooks: - cx88-blackbird.c: cx88_ioctl_hook() - cx88-blackbird.c: cx88_ioctl_translator() make the following needlessly global functions static: - cx88-tvaudio.c: cx88_detect_nicam() remove the following unused EXPORT_SYMBOL's: - cx88-cards.c: cx88_bcount - cx88-cards.c: cx88_subids - cx88-cards.c: cx88_idcount - cx88-cards.c: cx88_card_list - cx88-cards.c: cx88_card_setup - cx88-core.c: cx88_start_audio_dma - cx88-core.c: cx88_stop_audio_dma - cx88-i2c.c: cx88_i2c_init Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-06-22cx88: clear EN_I2SIN_ENABLE bit for ASUS PVR-416 to enable audioMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> clear EN_I2SIN_ENABLE bit for ASUS PVR-416 to enable audio streaming in both raw video and blackbird mpeg encoder modes. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-06-19cx88-tvaudio.c must #include <linux/config.h>Michael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-06-18Don't kill cx88 DMA sound on channel changeRicardo Cerqueira
From: Ricardo Cerqueira <v4l@cerqueira.org> There's a call at cx88-tvaudio to reset DMA sound on channel change; that call was killing cx88-alsa whenever the channel was changed, resulting in no sound. Remove those calls if cx88-alsa is selected to be compiled. Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
2006-05-09cx88-blackbird: add support for ProLink Pixelview Playtv@P7000Michael Krufky
From: Angelo Marconi <am@massalombarda.net> - Add support for ProLink Pixelview Playtv@P7000 Raw video and MPEG encoded video confirmed to work properly. SVideo, Composite and FM inputs are untested - disabled for now. Signed-off-by: Angelo Marconi <am@massalombarda.net> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-04-16KWorld HardwareMpegTV XPert: Enable Blackbird MPEG encoder supportMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> - clear I2SIN to deliver the audio stream to the cx23416 mpeg encoder. - enable blackbird support on the KWorld HardwareMpegTV XPert Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-04-13cx88-tvaudio: replace 'if' with 'switch..case'Michael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> This patch cleans up a potential mess that has yet to occur in the card-specific part of cx88-tvaudio.c that sets sound input from external adc. It may be a good idea to move this setting into cx88-cards.c in the future. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-04-13cx88: added support for KWorld MCE 200 DeluxeMichael Krufky
From: Valentin Zagura <puthre@gmail.com> This patch adds support for KWorld MCE 200 Deluxe. Raw video is working perfectly, MPEG capture using cx88-blackbird is also working, but the quality could be improved. FIXME: tested TV input only, disabled composite, svideo and radio until they can be tested also. Signed-off-by: Valentin Zagura <puthre@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-04-11Since we are not using CVS, $Id makes no sense anymoreMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-03-18Implement V4L2_TUNER_MODE_LANG1_LANG2 audio modeHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Add a new audio mode V4L2_TUNER_MODE_LANG1_LANG2 (used by VIDIOC_G/S_TUNER). This mode allows the user to select both languages of a bilingual transmission, one language on the left, one on the right audio channel. If there is no bilingual transmission, or it is not supported, then this mode should act like V4L2_TUNER_MODE_STEREO. This mode is introduced for PVR-like drivers where it is useful to be able to record both languages of a bilingual broadcast. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-15Fix for lack of analog output on some cx88 boardsMauro Carvalho Chehab
From: Panagiotis Christeas <p_christ@hol.gr> - Workaround to fix a known regression at cx88-tvaudio.c - provide a module parameter workaround to always enable analog output. Signed-off-by: Panagiotis Christeas <p_christ@hol.gr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-05Workaround to deal with the cx88 DMA code conflictsRicardo Cerqueira
From: Ricardo Cerqueira <v4l@cerqueira.org> Existing audio DMA uses conflict with cx88-alsa. This workaround disables that code if cx88-alsa is being compiled Signed-off-by:
2005-12-05Several fixes for Hauppauge Roselyn Design (blackbird)Mauro Carvalho Chehab
From: Steven Toth <stoth@hauppauge.com> - This patch adds eeprom awareness for the Roslyn. In effect, the blackbird will query the tuner V4L2_STD_xxxx definitions to determine whether it's connected to a NTSC or PAL tuner. Based on that, various default values will change for blackbird encoding. - Fixes back panel SVIDEO/COMPOSITE with audio, work properly. - Fixes a problem with lip sync issues, due to bad framerate vs audio rate assumptions. - Fixed a problem with the GPIO configuration in cx88-cards. - Removed the comments in cx88-cards that made no sense. Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-11-18enabled audio DMA setting on cx88 chips, even when dma not in useMauro Carvalho Chehab
- enabled audio DMA transfer code even when DMA not in use to solve a problem on some broken cx88 chips. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-11-18Fixes nicam soundMauro Carvalho Chehab
From: Ian Pickworth <ian@pickworth.me.uk> - resolved problem of sporadic buzz after setting Nicam stereo - improved setting audio standard with dma reset - cleaned up comments format - more sensitive Nicam detection Signed-off-by: Ian Pickworth <ian@pickworth.me.uk> Signed-off-by: Michal Pytasz <pytasz@lodz.home.pl> Signed-off-by: Marcin Rudowski <mar_rud@poczta.onet.pl> Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-11-06- Improves the audio handling for NICAM on cx88 audio.Mauro Carvalho Chehab
Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-10-31 - correct nicam audio settings to match dscalerMichael Krufky
Thanks to: Ian Pickworth <ian@pickworth.me.uk> and Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-10-09From: Mauro Carvalho Chehab <mchehab@brturbo.com.br>Mauro Carvalho Chehab
- Lots of small changes to allow compiling with kernel 2.4. Compilation result not tested yet. - After this patch, .version should be removed, since its syntax has changed. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-10-04 * cx88-tvaudio.c: (set_audio_registers), (set_audio_start),Nickolay V. Shmyrev
(set_audio_finish), (set_audio_standard_BTSC), (set_audio_standard_NICAM), (set_audio_standard_A2), (set_audio_standard_EIAJ), (set_audio_standard_FM), (cx88_detect_nicam), (cx88_set_tvaudio), (cx88_get_stereo), (cx88_set_stereo), (cx88_audio_thread): - Reindent cx88-tvaudio.c to keep coding style. Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
2005-09-10 - some clean up in cx88-tvaudio.cMauro Carvalho Chehab
- replaced hex values when writing to AUD_CTL to EN_xx for better reading. - Moved writing to register AUD_CTL from "set_audio_start" to "set_audio_finish". - Changed the order of writing Lang2 to work correctly - Added an "#if 0" to comment out existing code in "cx88_get_stereo" because simply reading from register "AUD_STATUS" is _not_ enough to auto-detect btsc-sap, dual-fm-stereo or nicam. It is simply not working. - Using "EN_A2_AUTO_STEREO" does not work. - Allow select by hand between Mono, Lang1, Lang2 and Stereo. - *Bad side effect* is now if I'm selecting for example stereo but it is not supported from tv-channel I'm currently receiving loud noise. Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-08-30Reversed PAL_I patch since it is broken.Mauro Carvalho Chehab
2005-08-30 * cx88-core.c: (set_tvaudio):Mauro Carvalho Chehab
* cx88-tvaudio.c: (set_audio_standard_NICAM), (set_audio_standard_A2), (set_audio_standard_FM), (cx88_detect_nicam), (cx88_set_tvaudio), (cx88_newstation), (cx88_set_stereo): * cx88.h: - Added nicam autodetection for PAL B/G/D/K/I/L. If it fails then falls back to fm / am mono audio. - Added debug messages about detecting state. - 'set_audio_standard_NICAM_L' and 'set_audio_standard_PAL_I' moved to 'set_audio_standard_A2' and 'set_audio_standard_NICAM' for cleaner code. - Changed some WW_xx values for better handling. - Added 'use_nicam' to 'core' to save nicam detecting state for later use in 'cx88_set_stereo'. - Not working: - Auto fall back to fm / am mono if transmitting quality goes bad. - A2 dual fm stereo auto detecting. Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-08-17 *cx88-reg.h:Mauro Carvalho Chehab
- Added some registers to control PCI controller at CX2388x chips. * cx88-tvaudio.c: - BTSC Lang1 now is set to auto_stereo mode. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-08-07 * cx88-tvaudio.c:Mauro Carvalho Chehab
- Support for BTSC improved. Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-08-07- Some clean up in cx88-tvaudio.cMauro Carvalho Chehab
- replaced hex values when writing to AUD_CTL to EN_xx for better reading. - Moved writing to register AUD_CTL from "set_audio_start" to "set_audio_finish". - Changed the order of writing Lang2 to work correctly - Added an "#if 0" to comment out existing code in "cx88_get_stereo" because simply reading from register "AUD_STATUS" is _not_ enough to auto-detect btsc-sap, dual-fm-stereo or nicam. It is simply not working. - Using "EN_A2_AUTO_STEREO" does not work. - Allow select by hand between Mono, Lang1, Lang2 and Stereo. - *Bad side effect* is now if I'm selecting for example stereo but it is not supported from tv-channel I'm currently receiving loud noise. Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-07-15 - linux/version.h removed at linux-2.6.13-rc3-mm1.Mauro Carvalho Chehab
- Removed remaining trailing spaces. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-07-07scripts/buildpatch:Mauro Carvalho Chehab
- Added code to eliminate #if 0 and #if 1 when submiting pathes to new kernel. Miscelaneous CodingStyle stuff. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-06-05Deemphasis code for cx88 chipset implemented. Currently, not used.Mauro Carvalho Chehab
2005-06-03Mauro Chehab:Mauro Carvalho Chehab
* cx88-cards.c: - changed tuner number by it's name as defined on tuner.h. * scripts/make_kern_diff.sh - now it also makes diff for include files. Catalin Climov <catalin@climov.com>: * cx88-blackbird.c: - Blackbird firmware API cleanup, symbolic constants for param values. - improved readability and comprehensibility for api calls. * cx88-cards.c: - PVR2000 & MEC gpio fixes. * cx88-tvaudio.c: - enable sound input from external adc * cx88-video.c: - initialize the hue, contrast and brightness controls to default values * cx88-mpeg.c: - s/cx_write/cx_set for MO_TS_INTMSK, MO_DEV_CNTRL2, MO_TS_DMACNTRL
2005-03-07- cx88: stereo/bilang fix.Gerd Knorr
2005-02-22- misc fixes from various people.Gerd Knorr
- make or51132.c compile (not work) on 2.6.10.
2005-02-15- some powermanagement stuff.Gerd Knorr
- misc fixes. - fixup patch generation control files.
2005-02-14- cx88: more NICAM stuff.Gerd Knorr
- tuner: tda8290 fix.
2005-02-10- more nicam / pal-i stuff from Ian Pickworth.Gerd Knorr
2005-01-24- sync with 2.6.11-rc2 & latest dvb cvs.Gerd Knorr
- misc card-specific tweaks.
2005-01-20- cx88: pal-i fixes (Ian Pickworth).Gerd Knorr
- cx88: nicam-l fixes (Didier Caillaud). - cx88: misc minor fixes/cleanups.
2005-01-07- new bttv card (by Chris Fanning).Gerd Knorr
- misc.