summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-simple.c
AgeCommit message (Collapse)Author
2007-11-04tuner: convert to bus-based I2C APIHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-10-18Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIGMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> 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>
2007-08-31tuner-simple: add get_rf_strength and improve status reading efficiencyMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-08-27tuner-simple: convert from tuner sub-driver into dvb_frontend moduleMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Acked-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-21tuner: kill i2c_client interface to tuner sub-driversMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> To ease the conversion of the analog tuner sub-drivers into dvb_frontend style tuner modules, we must remove the i2c_client interface. dvb_frontend style tuner modules use i2c_transfer directly on the i2c_adapter. This change only alters the interface between tuner.ko and the tuner sub-drivers. The v4l2 / i2c_client interface to tuner.ko remains intact. This patch adds inline functions tuner_i2c_xfer_send, and tuner_i2c_xfer_recv, to replace i2c_master_send and i2c_master_recv inside the tuner sub-drivers. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Acked-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-21Cleanup: remove linux/moduleparam.h from drivers/media filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> 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-08-21tuner: fix header file includes orderMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> kernel headers go above subsystem headers Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-08-11tuner: move last_div to tuner-simple private dataMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> tuner-simple is the only sub-driver that uses last_div, so we can free up two bytes of memory for all other tuners, by moving this into tuner-simple's private data area. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-08-03tuner: Better tuner radio supportTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add radio support for the Thomson DTT7612 tuner. This tuner uses a different 1st intermediate frequency than the other radio tuners supported (a lot of NTSC radio tuners probably need this change too). Add a new tuner-simple parameter, radio_if. It selects the 1st IF used for radio reception. The radio frequency setting code in tuner-simple now uses this field, instead of a special case select() block for each tuner with radio support. The tuner parameters for tuners that used a 33.3 MHz RIF now set radio_if to 1 in tuner-types.c. The Thomson DTT7612 gets radio_if = 2, also add has_tda9887 = 1 and fm_gain_normal = 1. Add some defines for tda9887 bits that control IF setting in radio mode. Add a new tda9887 config option, TDA9887_RIF_41_3, that selects a 41.3 MHz radio IF. Fix the way tda9887 radio options work. The driver was modifying the default radio mode config templates based on the TDA9887_XXXX flags. This means that _all_ tuners would get the same settings. If you had a one tuner than used TDA9887_GAIN_NORMAL and one that didn't, both would get the setting. Now the tda9987 driver just checks if tuner mode is radio and then applies the config settings directly to the data being sent, just like how all the TV mode settings already work. The PLL setting math is made a little more accurate. And a grammar error in a printk is fixed. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-06-26tuner: remove hardware-specific info from public headerMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Move internal structures and debug macros to drivers/media/video/tuner-driver.h Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-06-06tuner-simple: store tuning operations in tuner_operations structureMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Create static struct tuner_operations simple_tuner_ops for tuner-simple tuning function callback pointers Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-06-06tuner: create struct tuner_operationsMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Move tuner callback function pointers out of struct tuner, into struct tuner_operations. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-05-21Correct aliases for STD/L and STD/LcMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Some macros were using very weird names, like PAL/L (this std doesn't exist). Fixing it. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-21Tuner-simple.c add suport for SECAM-BG with FI1216MFMauro Carvalho Chehab
From: matthieu castet <castet.matthieu@free.fr> allow to use SECAM-BG with the FI1216MF tuner. The selection is done with the secam=B module argument. The default behaviour should be the same as before. Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-04Added the capability of selecting fm gain by tunerMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Some tuners require using cGainNormal instead of cGainLow for high sensibility on FM reception. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-03Fix broken TUNER_LG_NTSC_TAPE radio supportHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The TUNER_LG_NTSC_TAPE is identical in all respects to the TUNER_PHILIPS_FM1236_MK3. So use the params struct for the Philips tuner. Also add this LG_NTSC_TAPE tuner to the switches where radio specific parameters are set so it behaves like a TUNER_PHILIPS_FM1236_MK3. This change fixes the radio support for this tuner (the wrong bandswitch byte was used). Thanks to Andy Walls <cwalls@radix.net> for finding this bug. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-08-24tda9887: add configuration setting for L standard PLL gatingTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add a tuner config parameter for TDA9887, default_pll_gating_18, that changes the L standard PLL gating value from 36% to 0% (datasheet says 0%, tda9887 code says 18%). Turn this on for Microtune 4049FM5, as recomended by tuner datasheet. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-08-12Offset parameter permission were 0x666, instead of 0x664Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Although not dangerous, it may allow a normal user with access to a machine to untune a TV channel. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-25Remove of couple of useless linesTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> A buffer was set just before an if block, and then again in both branches of the if. Obvious coding error. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-07-17Set the Auxiliary Byte when tuning LG H06xF in analog modeMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> With the LG H06xF tuners, an auxiliary byte must be sent after the standard four-byte i2c sequence. The code that does this is currently in the wrong place, causing random bytes to be written to the tuner over i2c in the set_type function. This patch moves this code from set_type to default_set_tv_freq. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-06-25Add tda9887-specific tuner configurationHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Many tda9887 settings depend on the chosen tuner. Expand the tuner parameters to include these tda9887 settings. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-06-20Whitespace cleanupsMauro Carvalho Chehab
From: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.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-09imported patch tenna_xxx5.patchMauro Carvalho Chehab
2006-01-30show debug info for tuners trying to use unsupported video standardsMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> With tuner_debug enabled, if a tuner tries to use a video standard that doesn't have a matching tuner_params defined, the IFPCoff value and tuner number will be displayed, and the default tuner_params entry will be used. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-01-30use default tuner_params if desired_type not availableMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> If a given tuner definition contains more than one tuner_params array members, it will try to select the appropriate tuner_params based on the video standard in use. If there is no tuner_params defined for the current video standard, it will select the default, tuner_params[0] Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-01-30update tuner commentsMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Right now, all tuners are using the first tuner_params[] array element for analog mode. We are now ready to begin merging similar tuner definitions together, such that each tuner definition will have a tuner_params struct for each available video standard. The tuner_params[] array element will be chosen based on the video standard in use. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-01-29tuner_dbg will show tuner param and range selectedMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> - tuner_dbg will show tuner param and range selected Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-01-29allow multiple tuner params in each tuner definitionMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> - allow multiple tuner params in each tuner definition. - the correct tuner_params element will be chosen based on current video standard. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-01-29move video std detection to top of set_tv_freq functionMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> - move video std detection to top of set_tv_freq function - we must detect video std first, so that we can choose the correct tuner_params Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-01-23move config byte from tuner_params to tuner_range struct.Michael Krufky
- move config byte from tuner_params to tuner_range struct. - dvb tuners must be able to set different config byte for each range. Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2006-01-23rename cb variable names in tuner structures for global consistencyMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2006-01-15Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this.Hans Verkuil
- Moved MSP_SET_MATRIX to v4l2-common.h - Fix typos and integer overflows in tea5767.c - Split old freq field into a tv_freq and a radio_freq. Prevents that a radio tuner is initialized with a tv frequency or vice versa. - When switching to radio mode initialize the tuner with the last used radio frequency (this was already done for the TV mode). As a result of these changes the tuner module now remembers the last set radio and TV frequencies, which is what you would expect to happen. - Move out of range frequencies to the closest valid frequency as per v4l2 API spec. - Fix incorrect initial radio frequency (multiplier is 16000, not 16) - Add boundary check for out of range frequencies. - Use new flag to check if the order of the CB and freq. depends on the last set frequency. That is needed for some tuners or you can get static as a result. The flag is added for those tuners where I know that the datasheet indicates that this is necessary. - For this new check use the last set div value, not the last frequency as radio frequencies are always much higher due to the 16000 multiplier. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-12Redesign tuners struct for maximum flexibilityMichael Krufky
From: Michael Krufky <mkrufky@m1k.net> - tunertype struct redefined to allow one or more tuner_params structs per tuner definition, one for each video standard. - Each tuner_params struct has an element containing an arbitrary amount of tuner_ranges. (this is needed for dvb tuners - to be handled later) - A tuner_range may be referenced by multiple tuner_params structs. There are many duplicates in here. Reusing tuner_range structs, rather than defining new ones for each tuner, will cut down on memory usage, and is preferred when possible. - tunertype struct contains an element, has_tda988x. We must set this for all tunertypes that contain a tda988x chip, and then we can remove this setting from the various card structs. - Improves tuners array memory usage efficiency. - Right now, all tuners are using the first tuner_params[] array element for analog mode. In the future, we will be merging similar tuner definitions together, such that each tuner definition will have a tuner_params struct for each available video standard. At that point, the tuner_params[] array element will be chosen based on the video standard in use. Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2006-01-11Fixes some bad global variablesHans Verkuil
- debug global var is already used inside kernel, so renamed debug to tuner_debug for the tuner module Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2005-12-27reorganize tuner-simple threshold structure.Michael Krufky
- create an array containing frequency threshold and control byte. - allows for an arbitrary amount of frequency ranges to be set, like dvb-pll. - improves code readability. Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-25replace <media/i2c-compat.h> with "i2c-compat.h"Michael Krufky
-#include <media/i2c-compat.h> +#include "i2c-compat.h" Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-20correct Thomson DTT 761x frequency rangesMichael Krufky
From: Michael Krufky <mkrufky@m1k.net> - corrected Thomson DTT 7611 tuner programming, based on spec sheet - renamed to Thomson DTT 761x - applies to DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A (DTT 7610 is similar, but slightly different programming) - corrected frequency ranges for analog and digital modes Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-11added ntsc parameter to tuner and more standardized debugsMauro Carvalho Chehab
- debug message changed to be coherent with other modules - added ntsc parameter - parameters moved to the beginning at the file - tuner_status moved to a better position. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-12-11"Philips 1236D ATSC/NTSC dual in" - fix typo.Michael Krufky
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-05Fix broken TV standard check.Hans Verkuil
Fix incorrect matching of TV standards leading to incorrect IFPCoff values. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2005-11-30Added a new debug msg to help identifying tuner ProblemsMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-11-29added offset parameter for adjusting tuner offset by handMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-11-27Fix wrong tuner.h define for tuner 46 (it's a Panasonic, not a Microtune).Hans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2005-11-25tuner description now follows the same CodingStyle as the othersMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-11-16Tuner cleanups by removing Video IF from tuners struct.Mauro Carvalho Chehab
- Video IF was removed from tuners struct. - Each Video standard have its own Video IF frequency, so it is related to video standard. Of course tuner also needs saw filters for IF, but this way, similar tuners can be grouped into just one entry, if they have the same cut-off freqs and the same switch config and global config. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-11-08 * ../linux/Documentation/video4linux/CARDLIST.bttv:Nickolay V. Shmyrev
* ../linux/Documentation/video4linux/CARDLIST.tuner: * ../linux/drivers/media/video/bttv-cards.c: * ../linux/drivers/media/video/bttv.h: * ../linux/drivers/media/video/ir-kbd-i2c.c: * ../linux/drivers/media/video/tuner-simple.c: * ../linux/include/media/tuner.h: Support for Sabrent bt848 version. Signed-off-by: Bill Pechter <pechter@gmail.com> Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
2005-10-27 * ../linux/drivers/media/video/tuner-simple.c:Michael Krufky
(default_set_tv_freq): - ISO C90 forbids mixed declarations and code * ../v4l/compat.h: - Do not build support for nxt200x unless at least one of the following is true: a) KERNEL_VERSION >= 2.6.15 b) v4l / dvb merge-trees build environment. Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-10-27 * ../linux/drivers/media/video/cx88/Kconfig:Michael Krufky
* ../linux/drivers/media/video/cx88/Makefile: * ../linux/drivers/media/video/cx88/cx88-dvb.c: (nxt200x_set_ts_param), (dvb_register): * ../v4l/Makefile: - Added support for NXT200X based cards (ATI HDTV Wonder) * ../linux/drivers/media/video/cx88/cx88-cards.c: (cx88_card_setup): - Cleaned up initialization of ATI HDTV Wonder. The card is now able to work in analog or digital mode and able to switch between them without any problems. * ../linux/drivers/media/video/tuner-simple.c: (default_set_tv_freq): - Fixed value in "Philips TUV1236D ATSC/NTSC dual in" tuner data. - When tuning the "Philips TUV1236D ATSC/NTSC dual in" tuner, make sure that we are in the correct tuning mode. Signed-off-by: Kirk Lapray <kirk.lapray@gmail.com> Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-10-16- Whitespace Cleanups.Mauro Carvalho Chehab
- Whitespace script improved. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>