diff options
Diffstat (limited to 'include/media/tuner.h')
| -rw-r--r-- | include/media/tuner.h | 98 |
1 files changed, 46 insertions, 52 deletions
diff --git a/include/media/tuner.h b/include/media/tuner.h index b37cde606692..7674b121ce8b 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
| @@ -82,9 +82,9 @@ | |||
| 82 | #define TUNER_PHILIPS_FM1236_MK3 43 | 82 | #define TUNER_PHILIPS_FM1236_MK3 43 |
| 83 | 83 | ||
| 84 | #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ | 84 | #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ |
| 85 | /* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ | 85 | /* Microtune merged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ |
| 86 | #define TUNER_MICROTUNE_4049FM5 45 | 86 | #define TUNER_MICROTUNE_4049FM5 45 |
| 87 | #define TUNER_MICROTUNE_4042_FI5 46 | 87 | #define TUNER_PANASONIC_VP27 46 |
| 88 | #define TUNER_LG_NTSC_TAPE 47 | 88 | #define TUNER_LG_NTSC_TAPE 47 |
| 89 | 89 | ||
| 90 | #define TUNER_TNF_8831BGFF 48 | 90 | #define TUNER_TNF_8831BGFF 48 |
| @@ -102,7 +102,7 @@ | |||
| 102 | #define TUNER_YMEC_TVF_8531MF 58 | 102 | #define TUNER_YMEC_TVF_8531MF 58 |
| 103 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ | 103 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ |
| 104 | 104 | ||
| 105 | #define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */ | 105 | #define TUNER_THOMSON_DTT761X 60 /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ |
| 106 | #define TUNER_TENA_9533_DI 61 | 106 | #define TUNER_TENA_9533_DI 61 |
| 107 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ | 107 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ |
| 108 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 | 108 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 |
| @@ -115,47 +115,26 @@ | |||
| 115 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ | 115 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ |
| 116 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ | 116 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ |
| 117 | 117 | ||
| 118 | #define NOTUNER 0 | ||
| 119 | #define PAL 1 /* PAL_BG */ | ||
| 120 | #define PAL_I 2 | ||
| 121 | #define NTSC 3 | ||
| 122 | #define SECAM 4 | ||
| 123 | #define ATSC 5 | ||
| 124 | #define RADIO 6 | ||
| 125 | |||
| 126 | #define NoTuner 0 | ||
| 127 | #define Philips 1 | ||
| 128 | #define TEMIC 2 | ||
| 129 | #define Sony 3 | ||
| 130 | #define Alps 4 | ||
| 131 | #define LGINNOTEK 5 | ||
| 132 | #define SHARP 6 | ||
| 133 | #define Samsung 7 | ||
| 134 | #define Microtune 8 | ||
| 135 | #define HITACHI 9 | ||
| 136 | #define Panasonic 10 | ||
| 137 | #define TCL 11 | ||
| 138 | #define THOMSON 12 | ||
| 139 | |||
| 140 | #define TUNER_SET_TYPE_ADDR _IOW('T',3,int) | ||
| 141 | #define TUNER_SET_STANDBY _IOW('T',4,int) | ||
| 142 | #define TDA9887_SET_CONFIG _IOW('t',5,int) | ||
| 143 | |||
| 144 | /* tv card specific */ | 118 | /* tv card specific */ |
| 145 | # define TDA9887_PRESENT (1<<0) | 119 | #define TDA9887_PRESENT (1<<0) |
| 146 | # define TDA9887_PORT1_INACTIVE (1<<1) | 120 | #define TDA9887_PORT1_INACTIVE (1<<1) |
| 147 | # define TDA9887_PORT2_INACTIVE (1<<2) | 121 | #define TDA9887_PORT2_INACTIVE (1<<2) |
| 148 | # define TDA9887_QSS (1<<3) | 122 | #define TDA9887_QSS (1<<3) |
| 149 | # define TDA9887_INTERCARRIER (1<<4) | 123 | #define TDA9887_INTERCARRIER (1<<4) |
| 150 | # define TDA9887_PORT1_ACTIVE (1<<5) | 124 | #define TDA9887_PORT1_ACTIVE (1<<5) |
| 151 | # define TDA9887_PORT2_ACTIVE (1<<6) | 125 | #define TDA9887_PORT2_ACTIVE (1<<6) |
| 152 | # define TDA9887_INTERCARRIER_NTSC (1<<7) | 126 | #define TDA9887_INTERCARRIER_NTSC (1<<7) |
| 127 | /* Tuner takeover point adjustment, in dB, -16 <= top <= 15 */ | ||
| 128 | #define TDA9887_TOP_MASK (0x3f << 8) | ||
| 129 | #define TDA9887_TOP_SET (1 << 13) | ||
| 130 | #define TDA9887_TOP(top) (TDA9887_TOP_SET | (((16 + (top)) & 0x1f) << 8)) | ||
| 131 | |||
| 153 | /* config options */ | 132 | /* config options */ |
| 154 | # define TDA9887_DEEMPHASIS_MASK (3<<16) | 133 | #define TDA9887_DEEMPHASIS_MASK (3<<16) |
| 155 | # define TDA9887_DEEMPHASIS_NONE (1<<16) | 134 | #define TDA9887_DEEMPHASIS_NONE (1<<16) |
| 156 | # define TDA9887_DEEMPHASIS_50 (2<<16) | 135 | #define TDA9887_DEEMPHASIS_50 (2<<16) |
| 157 | # define TDA9887_DEEMPHASIS_75 (3<<16) | 136 | #define TDA9887_DEEMPHASIS_75 (3<<16) |
| 158 | # define TDA9887_AUTOMUTE (1<<18) | 137 | #define TDA9887_AUTOMUTE (1<<18) |
| 159 | 138 | ||
| 160 | #ifdef __KERNEL__ | 139 | #ifdef __KERNEL__ |
| 161 | 140 | ||
| @@ -167,10 +146,26 @@ enum tuner_mode { | |||
| 167 | T_STANDBY = 1 << 31 | 146 | T_STANDBY = 1 << 31 |
| 168 | }; | 147 | }; |
| 169 | 148 | ||
| 149 | /* Older boards only had a single tuner device. Nowadays multiple tuner | ||
| 150 | devices may be present on a single board. Using TUNER_SET_TYPE_ADDR | ||
| 151 | to pass the tuner_setup structure it is possible to setup each tuner | ||
| 152 | device in turn. | ||
| 153 | |||
| 154 | Since multiple devices may be present it is no longer sufficient to | ||
| 155 | send a command to a single i2c device. Instead you should broadcast | ||
| 156 | the command to all i2c devices. | ||
| 157 | |||
| 158 | By setting the mode_mask correctly you can select which commands are | ||
| 159 | accepted by a specific tuner device. For example, set mode_mask to | ||
| 160 | T_RADIO if the device is a radio-only tuner. That specific tuner will | ||
| 161 | only accept commands when the tuner is in radio mode and ignore them | ||
| 162 | when the tuner is set to TV mode. | ||
| 163 | */ | ||
| 164 | |||
| 170 | struct tuner_setup { | 165 | struct tuner_setup { |
| 171 | unsigned short addr; | 166 | unsigned short addr; /* I2C address */ |
| 172 | unsigned int type; | 167 | unsigned int type; /* Tuner type */ |
| 173 | unsigned int mode_mask; | 168 | unsigned int mode_mask; /* Allowed tuner modes */ |
| 174 | }; | 169 | }; |
| 175 | 170 | ||
| 176 | struct tuner { | 171 | struct tuner { |
| @@ -207,7 +202,6 @@ struct tuner { | |||
| 207 | void (*standby)(struct i2c_client *c); | 202 | void (*standby)(struct i2c_client *c); |
| 208 | }; | 203 | }; |
| 209 | 204 | ||
| 210 | extern unsigned int tuner_debug; | ||
| 211 | extern unsigned const int tuner_count; | 205 | extern unsigned const int tuner_count; |
| 212 | 206 | ||
| 213 | extern int microtune_init(struct i2c_client *c); | 207 | extern int microtune_init(struct i2c_client *c); |
| @@ -219,15 +213,15 @@ extern int tea5767_autodetection(struct i2c_client *c); | |||
| 219 | 213 | ||
| 220 | #define tuner_warn(fmt, arg...) do {\ | 214 | #define tuner_warn(fmt, arg...) do {\ |
| 221 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 215 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 222 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 216 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 223 | #define tuner_info(fmt, arg...) do {\ | 217 | #define tuner_info(fmt, arg...) do {\ |
| 224 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 218 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 225 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 219 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 226 | #define tuner_dbg(fmt, arg...) do {\ | 220 | #define tuner_dbg(fmt, arg...) do {\ |
| 227 | if (tuner_debug) \ | 221 | extern int debug; \ |
| 228 | printk(KERN_DEBUG "%s %d-%04x: " fmt, \ | 222 | if (debug) \ |
| 229 | t->i2c.driver->driver.name, \ | 223 | printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 230 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 224 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 231 | 225 | ||
| 232 | #endif /* __KERNEL__ */ | 226 | #endif /* __KERNEL__ */ |
| 233 | 227 | ||
