Michael Krufky | 7b0ac9c | 2006-01-13 14:10:25 -0200 | [diff] [blame] | 1 | /* |
| 2 | * descriptions for simple tuners. |
| 3 | */ |
| 4 | |
| 5 | #ifndef __TUNER_TYPES_H__ |
| 6 | #define __TUNER_TYPES_H__ |
| 7 | |
| 8 | enum param_type { |
Michael Krufky | 6232549 | 2008-04-22 14:45:52 -0300 | [diff] [blame] | 9 | TUNER_PARAM_TYPE_RADIO, |
| 10 | TUNER_PARAM_TYPE_PAL, |
| 11 | TUNER_PARAM_TYPE_SECAM, |
| 12 | TUNER_PARAM_TYPE_NTSC, |
| 13 | TUNER_PARAM_TYPE_DIGITAL, |
Michael Krufky | 7b0ac9c | 2006-01-13 14:10:25 -0200 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | struct tuner_range { |
| 17 | unsigned short limit; |
Michael Krufky | 3fc46d3 | 2006-01-23 17:11:11 -0200 | [diff] [blame] | 18 | unsigned char config; |
Michael Krufky | 7b0ac9c | 2006-01-13 14:10:25 -0200 | [diff] [blame] | 19 | unsigned char cb; |
| 20 | }; |
| 21 | |
| 22 | struct tuner_params { |
| 23 | enum param_type type; |
Hans Verkuil | ba8fc39 | 2006-06-25 15:34:39 -0300 | [diff] [blame] | 24 | |
Hans Verkuil | 27487d4 | 2006-01-15 15:04:52 -0200 | [diff] [blame] | 25 | /* Many Philips based tuners have a comment like this in their |
| 26 | * datasheet: |
| 27 | * |
| 28 | * For channel selection involving band switching, and to ensure |
| 29 | * smooth tuning to the desired channel without causing |
| 30 | * unnecessary charge pump action, it is recommended to consider |
| 31 | * the difference between wanted channel frequency and the |
| 32 | * current channel frequency. Unnecessary charge pump action |
| 33 | * will result in very low tuning voltage which may drive the |
| 34 | * oscillator to extreme conditions. |
| 35 | * |
Michael Krufky | de03d21 | 2006-01-15 16:04:04 -0200 | [diff] [blame] | 36 | * Set cb_first_if_lower_freq to 1, if this check is |
Michael Krufky | 01872c5 | 2006-01-15 15:47:02 -0200 | [diff] [blame] | 37 | * required for this tuner. |
Hans Verkuil | 27487d4 | 2006-01-15 15:04:52 -0200 | [diff] [blame] | 38 | * |
| 39 | * I tested this for PAL by first setting the TV frequency to |
| 40 | * 203 MHz and then switching to 96.6 MHz FM radio. The result was |
| 41 | * static unless the control byte was sent first. |
| 42 | */ |
| 43 | unsigned int cb_first_if_lower_freq:1; |
Hans Verkuil | ba8fc39 | 2006-06-25 15:34:39 -0300 | [diff] [blame] | 44 | /* Set to 1 if this tuner uses a tda9887 */ |
| 45 | unsigned int has_tda9887:1; |
| 46 | /* Many Philips tuners use tda9887 PORT1 to select the FM radio |
| 47 | sensitivity. If this setting is 1, then set PORT1 to 1 to |
| 48 | get proper FM reception. */ |
| 49 | unsigned int port1_fm_high_sensitivity:1; |
| 50 | /* Some Philips tuners use tda9887 PORT2 to select the FM radio |
| 51 | sensitivity. If this setting is 1, then set PORT2 to 1 to |
| 52 | get proper FM reception. */ |
| 53 | unsigned int port2_fm_high_sensitivity:1; |
Mauro Carvalho Chehab | 483deb0 | 2006-12-04 08:31:38 -0300 | [diff] [blame] | 54 | /* Some Philips tuners use tda9887 cGainNormal to select the FM radio |
| 55 | sensitivity. If this setting is 1, e register will use cGainNormal |
| 56 | instead of cGainLow. */ |
| 57 | unsigned int fm_gain_normal:1; |
Hans Verkuil | ba8fc39 | 2006-06-25 15:34:39 -0300 | [diff] [blame] | 58 | /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners |
| 59 | use Intercarrier mode. If this setting is 1, then the tuner |
| 60 | needs to be set to intercarrier mode. */ |
| 61 | unsigned int intercarrier_mode:1; |
| 62 | /* This setting sets the default value for PORT1. |
| 63 | 0 means inactive, 1 means active. Note: the actual bit |
| 64 | value written to the tda9887 is inverted. So a 0 here |
| 65 | means a 1 in the B6 bit. */ |
| 66 | unsigned int port1_active:1; |
| 67 | /* This setting sets the default value for PORT2. |
| 68 | 0 means inactive, 1 means active. Note: the actual bit |
| 69 | value written to the tda9887 is inverted. So a 0 here |
| 70 | means a 1 in the B7 bit. */ |
| 71 | unsigned int port2_active:1; |
| 72 | /* Sometimes PORT1 is inverted when the SECAM-L' standard is selected. |
| 73 | Set this bit to 1 if this is needed. */ |
| 74 | unsigned int port1_invert_for_secam_lc:1; |
| 75 | /* Sometimes PORT2 is inverted when the SECAM-L' standard is selected. |
| 76 | Set this bit to 1 if this is needed. */ |
| 77 | unsigned int port2_invert_for_secam_lc:1; |
| 78 | /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */ |
| 79 | unsigned int port1_set_for_fm_mono:1; |
Trent Piepho | d7304de | 2006-08-24 22:43:45 -0300 | [diff] [blame] | 80 | /* Select 18% (or according to datasheet 0%) L standard PLL gating, |
| 81 | vs the driver default of 36%. */ |
| 82 | unsigned int default_pll_gating_18:1; |
Trent Piepho | 5e082f1 | 2007-08-03 18:32:38 -0300 | [diff] [blame] | 83 | /* IF to use in radio mode. Tuners with a separate radio IF filter |
| 84 | seem to use 10.7, while those without use 33.3 for PAL/SECAM tuners |
| 85 | and 41.3 for NTSC tuners. 0 = 10.7, 1 = 33.3, 2 = 41.3 */ |
| 86 | unsigned int radio_if:2; |
Hans Verkuil | ba8fc39 | 2006-06-25 15:34:39 -0300 | [diff] [blame] | 87 | /* Default tda9887 TOP value in dB for the low band. Default is 0. |
| 88 | Range: -16:+15 */ |
| 89 | signed int default_top_low:5; |
| 90 | /* Default tda9887 TOP value in dB for the mid band. Default is 0. |
| 91 | Range: -16:+15 */ |
| 92 | signed int default_top_mid:5; |
| 93 | /* Default tda9887 TOP value in dB for the high band. Default is 0. |
| 94 | Range: -16:+15 */ |
| 95 | signed int default_top_high:5; |
| 96 | /* Default tda9887 TOP value in dB for SECAM-L/L' for the low band. |
| 97 | Default is 0. Several tuners require a different TOP value for |
| 98 | the SECAM-L/L' standards. Range: -16:+15 */ |
| 99 | signed int default_top_secam_low:5; |
| 100 | /* Default tda9887 TOP value in dB for SECAM-L/L' for the mid band. |
| 101 | Default is 0. Several tuners require a different TOP value for |
| 102 | the SECAM-L/L' standards. Range: -16:+15 */ |
| 103 | signed int default_top_secam_mid:5; |
| 104 | /* Default tda9887 TOP value in dB for SECAM-L/L' for the high band. |
| 105 | Default is 0. Several tuners require a different TOP value for |
| 106 | the SECAM-L/L' standards. Range: -16:+15 */ |
| 107 | signed int default_top_secam_high:5; |
| 108 | |
Michael Krufky | 6232549 | 2008-04-22 14:45:52 -0300 | [diff] [blame] | 109 | u16 iffreq; |
Michael Krufky | 7b0ac9c | 2006-01-13 14:10:25 -0200 | [diff] [blame] | 110 | |
| 111 | unsigned int count; |
| 112 | struct tuner_range *ranges; |
| 113 | }; |
| 114 | |
| 115 | struct tunertype { |
| 116 | char *name; |
Michael Krufky | bbab6fd | 2006-02-06 09:15:11 -0200 | [diff] [blame] | 117 | unsigned int count; |
Michael Krufky | 7b0ac9c | 2006-01-13 14:10:25 -0200 | [diff] [blame] | 118 | struct tuner_params *params; |
Michael Krufky | 6232549 | 2008-04-22 14:45:52 -0300 | [diff] [blame] | 119 | |
| 120 | u16 min; |
| 121 | u16 max; |
Michael Krufky | 23a8810 | 2008-04-22 14:45:53 -0300 | [diff] [blame] | 122 | u32 stepsize; |
Michael Krufky | 6f4a572 | 2008-04-22 14:45:53 -0300 | [diff] [blame] | 123 | |
| 124 | u8 *initdata; |
| 125 | u8 *sleepdata; |
Michael Krufky | 7b0ac9c | 2006-01-13 14:10:25 -0200 | [diff] [blame] | 126 | }; |
| 127 | |
| 128 | extern struct tunertype tuners[]; |
| 129 | extern unsigned const int tuner_count; |
| 130 | |
| 131 | #endif |