Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/paulus/ppc64-2.6
[linux-2.6/mini2440.git] / include / media / tuner.h
blob4794c563236085d25670f0f3b3931f554e37df64
2 /* $Id: tuner.h,v 1.33 2005/06/21 14:58:08 mkrufky Exp $
4 tuner.h - definition for different tuners
6 Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
7 minor modifications by Ralph Metzler (rjkm@thp.uni-koeln.de)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _TUNER_H
25 #define _TUNER_H
27 #include <linux/videodev2.h>
29 #include "id.h"
31 #define ADDR_UNSET (255)
33 #define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */
34 #define TUNER_PHILIPS_PAL_I 1
35 #define TUNER_PHILIPS_NTSC 2
36 #define TUNER_PHILIPS_SECAM 3 /* you must actively select B/G, L, L` */
38 #define TUNER_ABSENT 4
39 #define TUNER_PHILIPS_PAL 5
40 #define TUNER_TEMIC_NTSC 6 /* 4032 FY5 (3X 7004, 9498, 9789) */
41 #define TUNER_TEMIC_PAL_I 7 /* 4062 FY5 (3X 8501, 9957) */
43 #define TUNER_TEMIC_4036FY5_NTSC 8 /* 4036 FY5 (3X 1223, 1981, 7686) */
44 #define TUNER_ALPS_TSBH1_NTSC 9
45 #define TUNER_ALPS_TSBE1_PAL 10
46 #define TUNER_ALPS_TSBB5_PAL_I 11
48 #define TUNER_ALPS_TSBE5_PAL 12
49 #define TUNER_ALPS_TSBC5_PAL 13
50 #define TUNER_TEMIC_4006FH5_PAL 14 /* 4006 FH5 (3X 9500, 9501, 7291) */
51 #define TUNER_ALPS_TSHC6_NTSC 15
53 #define TUNER_TEMIC_PAL_DK 16 /* 4016 FY5 (3X 1392, 1393) */
54 #define TUNER_PHILIPS_NTSC_M 17
55 #define TUNER_TEMIC_4066FY5_PAL_I 18 /* 4066 FY5 (3X 7032, 7035) */
56 #define TUNER_TEMIC_4006FN5_MULTI_PAL 19 /* B/G, I and D/K autodetected (3X 7595, 7606, 7657)*/
58 #define TUNER_TEMIC_4009FR5_PAL 20 /* incl. FM radio (3X 7607, 7488, 7711)*/
59 #define TUNER_TEMIC_4039FR5_NTSC 21 /* incl. FM radio (3X 7246, 7578, 7732)*/
60 #define TUNER_TEMIC_4046FM5 22 /* you must actively select B/G, D/K, I, L, L` ! (3X 7804, 7806, 8103, 8104)*/
61 #define TUNER_PHILIPS_PAL_DK 23
63 #define TUNER_PHILIPS_FQ1216ME 24 /* you must actively select B/G/D/K, I, L, L` */
64 #define TUNER_LG_PAL_I_FM 25
65 #define TUNER_LG_PAL_I 26
66 #define TUNER_LG_NTSC_FM 27
68 #define TUNER_LG_PAL_FM 28
69 #define TUNER_LG_PAL 29
70 #define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30 /* B/G, I and D/K autodetected (3X 8155, 8160, 8163)*/
71 #define TUNER_SHARP_2U5JF5540_NTSC 31
73 #define TUNER_Samsung_PAL_TCPM9091PD27 32
74 #define TUNER_MT2032 33
75 #define TUNER_TEMIC_4106FH5 34 /* 4106 FH5 (3X 7808, 7865)*/
76 #define TUNER_TEMIC_4012FY5 35 /* 4012 FY5 (3X 0971, 1099)*/
78 #define TUNER_TEMIC_4136FY5 36 /* 4136 FY5 (3X 7708, 7746)*/
79 #define TUNER_LG_PAL_NEW_TAPC 37
80 #define TUNER_PHILIPS_FM1216ME_MK3 38
81 #define TUNER_LG_NTSC_NEW_TAPC 39
83 #define TUNER_HITACHI_NTSC 40
84 #define TUNER_PHILIPS_PAL_MK 41
85 #define TUNER_PHILIPS_ATSC 42
86 #define TUNER_PHILIPS_FM1236_MK3 43
88 #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */
89 /* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */
90 #define TUNER_MICROTUNE_4049FM5 45
91 #define TUNER_LG_NTSC_TAPE 47
93 #define TUNER_TNF_8831BGFF 48
94 #define TUNER_MICROTUNE_4042FI5 49 /* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */
95 #define TUNER_TCL_2002N 50
96 #define TUNER_PHILIPS_FM1256_IH3 51
98 #define TUNER_THOMSON_DTT7610 52
99 #define TUNER_PHILIPS_FQ1286 53
100 #define TUNER_PHILIPS_TDA8290 54
101 #define TUNER_LG_PAL_TAPE 55 /* Hauppauge PVR-150 PAL */
103 #define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */
104 #define TUNER_PHILIPS_FQ1236A_MK4 57 /* Hauppauge PVR-500MCE NTSC */
106 #define TUNER_YMEC_TVF_8531MF 58
107 #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */
108 #define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */
109 #define TUNER_TENA_9533_DI 61
111 #define TUNER_TEA5767 62 /* Only FM Radio Tuner */
112 #define TUNER_PHILIPS_FMD1216ME_MK3 63
114 #define TEA5767_TUNER_NAME "Philips TEA5767HN FM Radio"
116 #define NOTUNER 0
117 #define PAL 1 /* PAL_BG */
118 #define PAL_I 2
119 #define NTSC 3
120 #define SECAM 4
121 #define ATSC 5
122 #define RADIO 6
124 #define NoTuner 0
125 #define Philips 1
126 #define TEMIC 2
127 #define Sony 3
128 #define Alps 4
129 #define LGINNOTEK 5
130 #define SHARP 6
131 #define Samsung 7
132 #define Microtune 8
133 #define HITACHI 9
134 #define Panasonic 10
135 #define TCL 11
136 #define THOMSON 12
138 enum v4l_radio_tuner {
139 TEA5767_LOW_LO_32768 = 0,
140 TEA5767_HIGH_LO_32768 = 1,
141 TEA5767_LOW_LO_13MHz = 2,
142 TEA5767_HIGH_LO_13MHz = 3,
146 #define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */
147 #define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */
148 #define TUNER_SET_TYPE_ADDR _IOW('T',3,int) /* set tuner type and I2C addr */
150 #define TDA9887_SET_CONFIG _IOW('t',5,int)
152 /* tv card specific */
153 # define TDA9887_PRESENT (1<<0)
154 # define TDA9887_PORT1_INACTIVE (1<<1)
155 # define TDA9887_PORT2_INACTIVE (1<<2)
156 # define TDA9887_QSS (1<<3)
157 # define TDA9887_INTERCARRIER (1<<4)
158 # define TDA9887_PORT1_ACTIVE (1<<5)
159 # define TDA9887_PORT2_ACTIVE (1<<6)
160 /* config options */
161 # define TDA9887_DEEMPHASIS_MASK (3<<16)
162 # define TDA9887_DEEMPHASIS_NONE (1<<16)
163 # define TDA9887_DEEMPHASIS_50 (2<<16)
164 # define TDA9887_DEEMPHASIS_75 (3<<16)
165 # define TDA9887_AUTOMUTE (1<<18)
167 #ifdef __KERNEL__
169 #define I2C_ADDR_TDA8290 0x4b
170 #define I2C_ADDR_TDA8275 0x61
172 struct tuner_addr {
173 enum v4l2_tuner_type v4l2_tuner;
174 unsigned int type;
175 unsigned short addr;
178 struct tuner {
179 /* device */
180 struct i2c_client i2c;
182 /* state + config */
183 unsigned int initialized;
184 unsigned int type; /* chip type */
185 unsigned int freq; /* keep track of the current settings */
186 v4l2_std_id std;
187 int using_v4l2;
189 enum v4l2_tuner_type mode;
190 unsigned int input;
192 /* used by MT2032 */
193 unsigned int xogc;
194 unsigned int radio_if2;
196 /* used by tda8290 */
197 unsigned char i2c_easy_mode[2];
198 unsigned char i2c_set_freq[8];
200 /* used to keep track of audmode */
201 unsigned int audmode;
203 /* function ptrs */
204 void (*tv_freq)(struct i2c_client *c, unsigned int freq);
205 void (*radio_freq)(struct i2c_client *c, unsigned int freq);
206 int (*has_signal)(struct i2c_client *c);
207 int (*is_stereo)(struct i2c_client *c);
208 int (*set_tuner)(struct i2c_client *c, struct v4l2_tuner *v);
211 extern unsigned int tuner_debug;
212 extern unsigned const int tuner_count;
214 extern int microtune_init(struct i2c_client *c);
215 extern int tda8290_init(struct i2c_client *c);
216 extern int tea5767_tuner_init(struct i2c_client *c);
217 extern int default_tuner_init(struct i2c_client *c);
219 #define tuner_warn(fmt, arg...) \
220 dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg)
221 #define tuner_info(fmt, arg...) \
222 dev_printk(KERN_INFO , &t->i2c.dev , fmt , ## arg)
223 #define tuner_dbg(fmt, arg...) \
224 if (tuner_debug) dev_printk(KERN_DEBUG , &t->i2c.dev , fmt , ## arg)
226 #endif /* __KERNEL__ */
228 #endif
231 * Overrides for Emacs so that we follow Linus's tabbing style.
232 * ---------------------------------------------------------------------------
233 * Local variables:
234 * c-basic-offset: 8
235 * End: