V4L/DVB (3359): Redesign tuners struct for maximum flexibility
- 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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-13 09:10:25 -07:00
|
|
|
/*
|
|
|
|
* descriptions for simple tuners.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __TUNER_TYPES_H__
|
|
|
|
#define __TUNER_TYPES_H__
|
|
|
|
|
|
|
|
enum param_type {
|
|
|
|
TUNER_PARAM_TYPE_RADIO, \
|
|
|
|
TUNER_PARAM_TYPE_PAL, \
|
|
|
|
TUNER_PARAM_TYPE_SECAM, \
|
2006-01-13 09:10:26 -07:00
|
|
|
TUNER_PARAM_TYPE_NTSC
|
V4L/DVB (3359): Redesign tuners struct for maximum flexibility
- 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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-13 09:10:25 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct tuner_range {
|
|
|
|
unsigned short limit;
|
2006-01-23 12:11:11 -07:00
|
|
|
unsigned char config;
|
V4L/DVB (3359): Redesign tuners struct for maximum flexibility
- 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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-13 09:10:25 -07:00
|
|
|
unsigned char cb;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tuner_params {
|
|
|
|
enum param_type type;
|
2006-06-25 12:34:39 -06:00
|
|
|
|
2006-01-15 10:04:52 -07:00
|
|
|
/* Many Philips based tuners have a comment like this in their
|
|
|
|
* datasheet:
|
|
|
|
*
|
|
|
|
* For channel selection involving band switching, and to ensure
|
|
|
|
* smooth tuning to the desired channel without causing
|
|
|
|
* unnecessary charge pump action, it is recommended to consider
|
|
|
|
* the difference between wanted channel frequency and the
|
|
|
|
* current channel frequency. Unnecessary charge pump action
|
|
|
|
* will result in very low tuning voltage which may drive the
|
|
|
|
* oscillator to extreme conditions.
|
|
|
|
*
|
2006-01-15 11:04:04 -07:00
|
|
|
* Set cb_first_if_lower_freq to 1, if this check is
|
2006-01-15 10:47:02 -07:00
|
|
|
* required for this tuner.
|
2006-01-15 10:04:52 -07:00
|
|
|
*
|
|
|
|
* I tested this for PAL by first setting the TV frequency to
|
|
|
|
* 203 MHz and then switching to 96.6 MHz FM radio. The result was
|
|
|
|
* static unless the control byte was sent first.
|
|
|
|
*/
|
|
|
|
unsigned int cb_first_if_lower_freq:1;
|
2006-06-25 12:34:39 -06:00
|
|
|
/* Set to 1 if this tuner uses a tda9887 */
|
|
|
|
unsigned int has_tda9887:1;
|
|
|
|
/* Many Philips tuners use tda9887 PORT1 to select the FM radio
|
|
|
|
sensitivity. If this setting is 1, then set PORT1 to 1 to
|
|
|
|
get proper FM reception. */
|
|
|
|
unsigned int port1_fm_high_sensitivity:1;
|
|
|
|
/* Some Philips tuners use tda9887 PORT2 to select the FM radio
|
|
|
|
sensitivity. If this setting is 1, then set PORT2 to 1 to
|
|
|
|
get proper FM reception. */
|
|
|
|
unsigned int port2_fm_high_sensitivity:1;
|
2006-12-04 04:31:38 -07:00
|
|
|
/* Some Philips tuners use tda9887 cGainNormal to select the FM radio
|
|
|
|
sensitivity. If this setting is 1, e register will use cGainNormal
|
|
|
|
instead of cGainLow. */
|
|
|
|
unsigned int fm_gain_normal:1;
|
2006-06-25 12:34:39 -06:00
|
|
|
/* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners
|
|
|
|
use Intercarrier mode. If this setting is 1, then the tuner
|
|
|
|
needs to be set to intercarrier mode. */
|
|
|
|
unsigned int intercarrier_mode:1;
|
|
|
|
/* This setting sets the default value for PORT1.
|
|
|
|
0 means inactive, 1 means active. Note: the actual bit
|
|
|
|
value written to the tda9887 is inverted. So a 0 here
|
|
|
|
means a 1 in the B6 bit. */
|
|
|
|
unsigned int port1_active:1;
|
|
|
|
/* This setting sets the default value for PORT2.
|
|
|
|
0 means inactive, 1 means active. Note: the actual bit
|
|
|
|
value written to the tda9887 is inverted. So a 0 here
|
|
|
|
means a 1 in the B7 bit. */
|
|
|
|
unsigned int port2_active:1;
|
|
|
|
/* Sometimes PORT1 is inverted when the SECAM-L' standard is selected.
|
|
|
|
Set this bit to 1 if this is needed. */
|
|
|
|
unsigned int port1_invert_for_secam_lc:1;
|
|
|
|
/* Sometimes PORT2 is inverted when the SECAM-L' standard is selected.
|
|
|
|
Set this bit to 1 if this is needed. */
|
|
|
|
unsigned int port2_invert_for_secam_lc:1;
|
|
|
|
/* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */
|
|
|
|
unsigned int port1_set_for_fm_mono:1;
|
2006-08-24 19:43:45 -06:00
|
|
|
/* Select 18% (or according to datasheet 0%) L standard PLL gating,
|
|
|
|
vs the driver default of 36%. */
|
|
|
|
unsigned int default_pll_gating_18:1;
|
2007-08-03 15:32:38 -06:00
|
|
|
/* IF to use in radio mode. Tuners with a separate radio IF filter
|
|
|
|
seem to use 10.7, while those without use 33.3 for PAL/SECAM tuners
|
|
|
|
and 41.3 for NTSC tuners. 0 = 10.7, 1 = 33.3, 2 = 41.3 */
|
|
|
|
unsigned int radio_if:2;
|
2006-06-25 12:34:39 -06:00
|
|
|
/* Default tda9887 TOP value in dB for the low band. Default is 0.
|
|
|
|
Range: -16:+15 */
|
|
|
|
signed int default_top_low:5;
|
|
|
|
/* Default tda9887 TOP value in dB for the mid band. Default is 0.
|
|
|
|
Range: -16:+15 */
|
|
|
|
signed int default_top_mid:5;
|
|
|
|
/* Default tda9887 TOP value in dB for the high band. Default is 0.
|
|
|
|
Range: -16:+15 */
|
|
|
|
signed int default_top_high:5;
|
|
|
|
/* Default tda9887 TOP value in dB for SECAM-L/L' for the low band.
|
|
|
|
Default is 0. Several tuners require a different TOP value for
|
|
|
|
the SECAM-L/L' standards. Range: -16:+15 */
|
|
|
|
signed int default_top_secam_low:5;
|
|
|
|
/* Default tda9887 TOP value in dB for SECAM-L/L' for the mid band.
|
|
|
|
Default is 0. Several tuners require a different TOP value for
|
|
|
|
the SECAM-L/L' standards. Range: -16:+15 */
|
|
|
|
signed int default_top_secam_mid:5;
|
|
|
|
/* Default tda9887 TOP value in dB for SECAM-L/L' for the high band.
|
|
|
|
Default is 0. Several tuners require a different TOP value for
|
|
|
|
the SECAM-L/L' standards. Range: -16:+15 */
|
|
|
|
signed int default_top_secam_high:5;
|
|
|
|
|
V4L/DVB (3359): Redesign tuners struct for maximum flexibility
- 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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-13 09:10:25 -07:00
|
|
|
|
|
|
|
unsigned int count;
|
|
|
|
struct tuner_range *ranges;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tunertype {
|
|
|
|
char *name;
|
2006-02-06 04:15:11 -07:00
|
|
|
unsigned int count;
|
V4L/DVB (3359): Redesign tuners struct for maximum flexibility
- 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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-13 09:10:25 -07:00
|
|
|
struct tuner_params *params;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct tunertype tuners[];
|
|
|
|
extern unsigned const int tuner_count;
|
|
|
|
|
|
|
|
#endif
|