diff options
Diffstat (limited to 'include/media/tuner.h')
| -rw-r--r-- | include/media/tuner.h | 109 |
1 files changed, 54 insertions, 55 deletions
diff --git a/include/media/tuner.h b/include/media/tuner.h index faa0f8e3091b..a5beeac495c7 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #define _TUNER_H | 23 | #define _TUNER_H |
| 24 | 24 | ||
| 25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
| 26 | #include <media/tuner-types.h> | ||
| 26 | 27 | ||
| 27 | #define ADDR_UNSET (255) | 28 | #define ADDR_UNSET (255) |
| 28 | 29 | ||
| @@ -82,9 +83,9 @@ | |||
| 82 | #define TUNER_PHILIPS_FM1236_MK3 43 | 83 | #define TUNER_PHILIPS_FM1236_MK3 43 |
| 83 | 84 | ||
| 84 | #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ | 85 | #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 */ | 86 | /* Microtune merged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ |
| 86 | #define TUNER_MICROTUNE_4049FM5 45 | 87 | #define TUNER_MICROTUNE_4049FM5 45 |
| 87 | #define TUNER_MICROTUNE_4042_FI5 46 | 88 | #define TUNER_PANASONIC_VP27 46 |
| 88 | #define TUNER_LG_NTSC_TAPE 47 | 89 | #define TUNER_LG_NTSC_TAPE 47 |
| 89 | 90 | ||
| 90 | #define TUNER_TNF_8831BGFF 48 | 91 | #define TUNER_TNF_8831BGFF 48 |
| @@ -102,7 +103,7 @@ | |||
| 102 | #define TUNER_YMEC_TVF_8531MF 58 | 103 | #define TUNER_YMEC_TVF_8531MF 58 |
| 103 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ | 104 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ |
| 104 | 105 | ||
| 105 | #define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */ | 106 | #define TUNER_THOMSON_DTT761X 60 /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ |
| 106 | #define TUNER_TENA_9533_DI 61 | 107 | #define TUNER_TENA_9533_DI 61 |
| 107 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ | 108 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ |
| 108 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 | 109 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 |
| @@ -114,48 +115,28 @@ | |||
| 114 | 115 | ||
| 115 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ | 116 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ |
| 116 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ | 117 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ |
| 117 | 118 | #define TUNER_SAMSUNG_TCPN_2121P30A 70 /* Hauppauge PVR-500MCE NTSC */ | |
| 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 | 119 | ||
| 144 | /* tv card specific */ | 120 | /* tv card specific */ |
| 145 | # define TDA9887_PRESENT (1<<0) | 121 | #define TDA9887_PRESENT (1<<0) |
| 146 | # define TDA9887_PORT1_INACTIVE (1<<1) | 122 | #define TDA9887_PORT1_INACTIVE (1<<1) |
| 147 | # define TDA9887_PORT2_INACTIVE (1<<2) | 123 | #define TDA9887_PORT2_INACTIVE (1<<2) |
| 148 | # define TDA9887_QSS (1<<3) | 124 | #define TDA9887_QSS (1<<3) |
| 149 | # define TDA9887_INTERCARRIER (1<<4) | 125 | #define TDA9887_INTERCARRIER (1<<4) |
| 150 | # define TDA9887_PORT1_ACTIVE (1<<5) | 126 | #define TDA9887_PORT1_ACTIVE (1<<5) |
| 151 | # define TDA9887_PORT2_ACTIVE (1<<6) | 127 | #define TDA9887_PORT2_ACTIVE (1<<6) |
| 152 | # define TDA9887_INTERCARRIER_NTSC (1<<7) | 128 | #define TDA9887_INTERCARRIER_NTSC (1<<7) |
| 129 | /* Tuner takeover point adjustment, in dB, -16 <= top <= 15 */ | ||
| 130 | #define TDA9887_TOP_MASK (0x3f << 8) | ||
| 131 | #define TDA9887_TOP_SET (1 << 13) | ||
| 132 | #define TDA9887_TOP(top) (TDA9887_TOP_SET | (((16 + (top)) & 0x1f) << 8)) | ||
| 133 | |||
| 153 | /* config options */ | 134 | /* config options */ |
| 154 | # define TDA9887_DEEMPHASIS_MASK (3<<16) | 135 | #define TDA9887_DEEMPHASIS_MASK (3<<16) |
| 155 | # define TDA9887_DEEMPHASIS_NONE (1<<16) | 136 | #define TDA9887_DEEMPHASIS_NONE (1<<16) |
| 156 | # define TDA9887_DEEMPHASIS_50 (2<<16) | 137 | #define TDA9887_DEEMPHASIS_50 (2<<16) |
| 157 | # define TDA9887_DEEMPHASIS_75 (3<<16) | 138 | #define TDA9887_DEEMPHASIS_75 (3<<16) |
| 158 | # define TDA9887_AUTOMUTE (1<<18) | 139 | #define TDA9887_AUTOMUTE (1<<18) |
| 159 | 140 | ||
| 160 | #ifdef __KERNEL__ | 141 | #ifdef __KERNEL__ |
| 161 | 142 | ||
| @@ -167,10 +148,26 @@ enum tuner_mode { | |||
| 167 | T_STANDBY = 1 << 31 | 148 | T_STANDBY = 1 << 31 |
| 168 | }; | 149 | }; |
| 169 | 150 | ||
| 151 | /* Older boards only had a single tuner device. Nowadays multiple tuner | ||
| 152 | devices may be present on a single board. Using TUNER_SET_TYPE_ADDR | ||
| 153 | to pass the tuner_setup structure it is possible to setup each tuner | ||
| 154 | device in turn. | ||
| 155 | |||
| 156 | Since multiple devices may be present it is no longer sufficient to | ||
| 157 | send a command to a single i2c device. Instead you should broadcast | ||
| 158 | the command to all i2c devices. | ||
| 159 | |||
| 160 | By setting the mode_mask correctly you can select which commands are | ||
| 161 | accepted by a specific tuner device. For example, set mode_mask to | ||
| 162 | T_RADIO if the device is a radio-only tuner. That specific tuner will | ||
| 163 | only accept commands when the tuner is in radio mode and ignore them | ||
| 164 | when the tuner is set to TV mode. | ||
| 165 | */ | ||
| 166 | |||
| 170 | struct tuner_setup { | 167 | struct tuner_setup { |
| 171 | unsigned short addr; | 168 | unsigned short addr; /* I2C address */ |
| 172 | unsigned int type; | 169 | unsigned int type; /* Tuner type */ |
| 173 | unsigned int mode_mask; | 170 | unsigned int mode_mask; /* Allowed tuner modes */ |
| 174 | }; | 171 | }; |
| 175 | 172 | ||
| 176 | struct tuner { | 173 | struct tuner { |
| @@ -182,7 +179,9 @@ struct tuner { | |||
| 182 | unsigned int mode; | 179 | unsigned int mode; |
| 183 | unsigned int mode_mask; /* Combination of allowable modes */ | 180 | unsigned int mode_mask; /* Combination of allowable modes */ |
| 184 | 181 | ||
| 185 | unsigned int freq; /* keep track of the current settings */ | 182 | unsigned int tv_freq; /* keep track of the current settings */ |
| 183 | unsigned int radio_freq; | ||
| 184 | u16 last_div; | ||
| 186 | unsigned int audmode; | 185 | unsigned int audmode; |
| 187 | v4l2_std_id std; | 186 | v4l2_std_id std; |
| 188 | 187 | ||
| @@ -200,14 +199,13 @@ struct tuner { | |||
| 200 | unsigned int sgIF; | 199 | unsigned int sgIF; |
| 201 | 200 | ||
| 202 | /* function ptrs */ | 201 | /* function ptrs */ |
| 203 | void (*tv_freq)(struct i2c_client *c, unsigned int freq); | 202 | void (*set_tv_freq)(struct i2c_client *c, unsigned int freq); |
| 204 | void (*radio_freq)(struct i2c_client *c, unsigned int freq); | 203 | void (*set_radio_freq)(struct i2c_client *c, unsigned int freq); |
| 205 | int (*has_signal)(struct i2c_client *c); | 204 | int (*has_signal)(struct i2c_client *c); |
| 206 | int (*is_stereo)(struct i2c_client *c); | 205 | int (*is_stereo)(struct i2c_client *c); |
| 207 | void (*standby)(struct i2c_client *c); | 206 | void (*standby)(struct i2c_client *c); |
| 208 | }; | 207 | }; |
| 209 | 208 | ||
| 210 | extern unsigned int tuner_debug; | ||
| 211 | extern unsigned const int tuner_count; | 209 | extern unsigned const int tuner_count; |
| 212 | 210 | ||
| 213 | extern int microtune_init(struct i2c_client *c); | 211 | extern int microtune_init(struct i2c_client *c); |
| @@ -218,15 +216,16 @@ extern int default_tuner_init(struct i2c_client *c); | |||
| 218 | extern int tea5767_autodetection(struct i2c_client *c); | 216 | extern int tea5767_autodetection(struct i2c_client *c); |
| 219 | 217 | ||
| 220 | #define tuner_warn(fmt, arg...) do {\ | 218 | #define tuner_warn(fmt, arg...) do {\ |
| 221 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->name, \ | 219 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 222 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 220 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 223 | #define tuner_info(fmt, arg...) do {\ | 221 | #define tuner_info(fmt, arg...) do {\ |
| 224 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->name, \ | 222 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 225 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 223 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 226 | #define tuner_dbg(fmt, arg...) do {\ | 224 | #define tuner_dbg(fmt, arg...) do {\ |
| 225 | extern int tuner_debug; \ | ||
| 227 | if (tuner_debug) \ | 226 | if (tuner_debug) \ |
| 228 | printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \ | 227 | printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 229 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 228 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 230 | 229 | ||
| 231 | #endif /* __KERNEL__ */ | 230 | #endif /* __KERNEL__ */ |
| 232 | 231 | ||
