tuner.h revision 633323ffffae91c3f22a08e0185fbfd3fae2a825
110b89ee387fd6cc38532a881f64b3d35f338ea0bMauro Carvalho Chehab/*
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    tuner.h - definition for different tuners
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    minor modifications by Ralph Metzler (rjkm@thp.uni-koeln.de)
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    This program is free software; you can redistribute it and/or modify
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    it under the terms of the GNU General Public License as published by
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    the Free Software Foundation; either version 2 of the License, or
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    (at your option) any later version.
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    This program is distributed in the hope that it will be useful,
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    but WITHOUT ANY WARRANTY; without even the implied warranty of
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    GNU General Public License for more details.
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    You should have received a copy of the GNU General Public License
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    along with this program; if not, write to the Free Software
191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef _TUNER_H
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _TUNER_H
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
25586b0cab2516640fec4dffc3049c4d8bca188f89Mauro Carvalho Chehab#include <linux/videodev2.h>
26586b0cab2516640fec4dffc3049c4d8bca188f89Mauro Carvalho Chehab
2756fc08ca375491b965cb76fad65bfb98973e80d8Mauro Carvalho Chehab#define ADDR_UNSET (255)
2856fc08ca375491b965cb76fad65bfb98973e80d8Mauro Carvalho Chehab
291c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_PAL			0        /* 4002 FH5 (3X 7756, 9483) */
301c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_PAL_I		1
311c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_NTSC		2
321c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_SECAM		3	/* you must actively select B/G, L, L` */
331c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
341c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_ABSENT			4
351c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_PAL		5
361c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_NTSC		6	/* 4032 FY5 (3X 7004, 9498, 9789)  */
371c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_PAL_I		7	/* 4062 FY5 (3X 8501, 9957) */
381c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
391c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4036FY5_NTSC	8	/* 4036 FY5 (3X 1223, 1981, 7686) */
401c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_ALPS_TSBH1_NTSC		9
411c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_ALPS_TSBE1_PAL		10
421c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_ALPS_TSBB5_PAL_I		11
431c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
441c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_ALPS_TSBE5_PAL		12
451c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_ALPS_TSBC5_PAL		13
461c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4006FH5_PAL		14	/* 4006 FH5 (3X 9500, 9501, 7291) */
471c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_ALPS_TSHC6_NTSC		15
481c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
491c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_PAL_DK		16	/* 4016 FY5 (3X 1392, 1393) */
501c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_NTSC_M		17
511c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4066FY5_PAL_I	18	/* 4066 FY5 (3X 7032, 7035) */
521c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4006FN5_MULTI_PAL	19	/* B/G, I and D/K autodetected (3X 7595, 7606, 7657) */
531c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
541c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4009FR5_PAL		20	/* incl. FM radio (3X 7607, 7488, 7711) */
551c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4039FR5_NTSC	21	/* incl. FM radio (3X 7246, 7578, 7732) */
561c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4046FM5		22	/* you must actively select B/G, D/K, I, L, L` !  (3X 7804, 7806, 8103, 8104) */
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define TUNER_PHILIPS_PAL_DK		23
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
591c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FQ1216ME		24	/* you must actively select B/G/D/K, I, L, L` */
601c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_PAL_I_FM		25
611c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_PAL_I			26
621c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_NTSC_FM		27
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
641c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_PAL_FM			28
651c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_PAL			29
661c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30	/* B/G, I and D/K autodetected (3X 8155, 8160, 8163) */
671c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_SHARP_2U5JF5540_NTSC	31
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
691c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_Samsung_PAL_TCPM9091PD27	32
701c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_MT2032			33
711c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4106FH5		34	/* 4106 FH5 (3X 7808, 7865) */
721c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4012FY5		35	/* 4012 FY5 (3X 0971, 1099) */
731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
741c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEMIC_4136FY5		36	/* 4136 FY5 (3X 7708, 7746) */
751c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_PAL_NEW_TAPC		37
761c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FM1216ME_MK3	38
771c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_NTSC_NEW_TAPC		39
781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
791c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_HITACHI_NTSC		40
801c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_PAL_MK		41
811c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_ATSC		42
821c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FM1236_MK3	43
831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
841c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_4IN1		44	/* ATI TV Wonder Pro - Conexant */
851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */
861c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_MICROTUNE_4049FM5 	45
871c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_MICROTUNE_4042_FI5	46
881c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_NTSC_TAPE		47
891c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
901c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TNF_8831BGFF		48
911c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_MICROTUNE_4042FI5		49	/* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */
921c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TCL_2002N			50
931c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FM1256_IH3	51
941c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
951c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_THOMSON_DTT7610		52
961c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FQ1286		53
971c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_TDA8290		54
9820f441f6900d786606583263d89653c48c7093a8Hans Verkuil#define TUNER_TCL_2002MB		55	/* Hauppauge PVR-150 PAL */
991c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
1001c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FQ1216AME_MK4	56	/* Hauppauge PVR-150 PAL */
1011c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FQ1236A_MK4	57	/* Hauppauge PVR-500MCE NTSC */
1021c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_YMEC_TVF_8531MF		58
1031c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_YMEC_TVF_5533MF		59	/* Pixelview Pro Ultra NTSC */
1041c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
1051c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_THOMSON_DTT7611		60	/* DViCO FusionHDTV 3 Gold-T */
1061c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TENA_9533_DI		61
1071c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_TEA5767			62	/* Only FM Radio Tuner */
1081c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_PHILIPS_FMD1216ME_MK3	63
1091c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab
1101c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_TDVS_H062F		64	/* DViCO FusionHDTV 5 */
1111c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_YMEC_TVF66T5_B_DFF	65	/* Acorp Y878F */
1121c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define TUNER_LG_NTSC_TALN_MINI		66
11393df3413f1b4c437b93c5b64562632f4f0e2b3caHartmut Hackmann#define TUNER_PHILIPS_TD1316		67
114793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab
115e976f93725ce16b4a493d40a6dd3bccbd74b9a8aKirk Lapray#define TUNER_PHILIPS_TUV1236D		68	/* ATI HDTV Wonder */
116633323ffffae91c3f22a08e0185fbfd3fae2a825Bill Pechter#define TUNER_TNF_5335MF                69	/* Sabrent Bt848   */
117e976f93725ce16b4a493d40a6dd3bccbd74b9a8aKirk Lapray
1181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define NOTUNER 0
1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define PAL     1	/* PAL_BG */
1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define PAL_I   2
1211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define NTSC    3
1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SECAM   4
1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define ATSC    5
1241c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#define RADIO   6
1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define NoTuner 0
1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define Philips 1
1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define TEMIC   2
1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define Sony    3
1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define Alps    4
1311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LGINNOTEK 5
1321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define SHARP   6
1331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define Samsung 7
1341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define Microtune 8
1351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define HITACHI 9
1361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define Panasonic 10
1371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define TCL     11
1381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define THOMSON 12
1391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
140f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab#define TUNER_SET_TYPE_ADDR          _IOW('T',3,int)
141793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab#define TUNER_SET_STANDBY            _IOW('T',4,int)
142f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab#define TDA9887_SET_CONFIG           _IOW('t',5,int)
143391cd727eac2e10be7685efd739a3ea9de87393cMauro Carvalho Chehab
1441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* tv card specific */
1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_PRESENT             (1<<0)
1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_PORT1_INACTIVE      (1<<1)
1471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_PORT2_INACTIVE      (1<<2)
1481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_QSS                 (1<<3)
1491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_INTERCARRIER        (1<<4)
1501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_PORT1_ACTIVE        (1<<5)
1511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_PORT2_ACTIVE        (1<<6)
1523ae1adc6ed93d55a27523f395284940fbe056401Nickolay V. Shmyrev# define TDA9887_INTERCARRIER_NTSC   (1<<7)
1531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* config options */
1541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_DEEMPHASIS_MASK     (3<<16)
1551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_DEEMPHASIS_NONE     (1<<16)
1561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_DEEMPHASIS_50       (2<<16)
1571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_DEEMPHASIS_75       (3<<16)
1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# define TDA9887_AUTOMUTE            (1<<18)
1591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef __KERNEL__
1611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
162f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehabenum tuner_mode {
163f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab	T_UNINITIALIZED = 0,
164f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab	T_RADIO		= 1 << V4L2_TUNER_RADIO,
165f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab	T_ANALOG_TV     = 1 << V4L2_TUNER_ANALOG_TV,
166f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab	T_DIGITAL_TV    = 1 << V4L2_TUNER_DIGITAL_TV,
167f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab	T_STANDBY	= 1 << 31
168f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab};
169f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab
170f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehabstruct tuner_setup {
1711c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab	unsigned short	addr;
1721c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab	unsigned int	type;
1731c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab	unsigned int	mode_mask;
174391cd727eac2e10be7685efd739a3ea9de87393cMauro Carvalho Chehab};
175391cd727eac2e10be7685efd739a3ea9de87393cMauro Carvalho Chehab
1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct tuner {
1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	/* device */
1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	struct i2c_client i2c;
1791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1801c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab	unsigned int type;	/* chip type */
181f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab
1821c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab	unsigned int mode;
1831c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab	unsigned int mode_mask;	/* Combination of allowable modes */
184f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab
1851c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab	unsigned int freq;	/* keep track of the current settings */
186f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab	unsigned int audmode;
1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	v4l2_std_id  std;
1881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
189f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehab	int          using_v4l2;
1901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	/* used by MT2032 */
1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int xogc;
1931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int radio_if2;
1941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	/* used by tda8290 */
196de48eebce8b63dbae7272ee80f4fe0eaddb61278Hartmut Hackmann	unsigned char tda8290_easy_mode;
197de48eebce8b63dbae7272ee80f4fe0eaddb61278Hartmut Hackmann	unsigned char tda827x_lpsel;
198de48eebce8b63dbae7272ee80f4fe0eaddb61278Hartmut Hackmann	unsigned char tda827x_addr;
199de48eebce8b63dbae7272ee80f4fe0eaddb61278Hartmut Hackmann	unsigned char tda827x_ver;
200de48eebce8b63dbae7272ee80f4fe0eaddb61278Hartmut Hackmann	unsigned int sgIF;
2011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	/* function ptrs */
2031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void (*tv_freq)(struct i2c_client *c, unsigned int freq);
2041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void (*radio_freq)(struct i2c_client *c, unsigned int freq);
2051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int  (*has_signal)(struct i2c_client *c);
2061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int  (*is_stereo)(struct i2c_client *c);
207793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab	void (*standby)(struct i2c_client *c);
2081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern unsigned int tuner_debug;
2111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern unsigned const int tuner_count;
2121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern int microtune_init(struct i2c_client *c);
2141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern int tda8290_init(struct i2c_client *c);
21590e9df7f186876584b938e01fcf7f40a50c950b9Hartmut Hackmannextern int tda8290_probe(struct i2c_client *c);
216586b0cab2516640fec4dffc3049c4d8bca188f89Mauro Carvalho Chehabextern int tea5767_tuner_init(struct i2c_client *c);
2171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern int default_tuner_init(struct i2c_client *c);
218f7ce3cc67052de63a29bad90110640b687d12058Mauro Carvalho Chehabextern int tea5767_autodetection(struct i2c_client *c);
2191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
220793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab#define tuner_warn(fmt, arg...) do {\
221793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab	printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->name, \
2224ac97914c6c35f6bf132071c718e034d0846b9f5Mauro Carvalho Chehab			t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0)
223793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab#define tuner_info(fmt, arg...) do {\
224793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab	printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->name, \
2254ac97914c6c35f6bf132071c718e034d0846b9f5Mauro Carvalho Chehab			t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0)
226793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab#define tuner_dbg(fmt, arg...) do {\
227793cf9e6a54c698e109a599c8b8e303658fcaae6Mauro Carvalho Chehab	if (tuner_debug) \
2284ac97914c6c35f6bf132071c718e034d0846b9f5Mauro Carvalho Chehab		printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \
2294ac97914c6c35f6bf132071c718e034d0846b9f5Mauro Carvalho Chehab			t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0)
2301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* __KERNEL__ */
2321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2331c94aeecd3fd2aed66d9a1135f5329df622e6137Mauro Carvalho Chehab#endif /* _TUNER_H */
2341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
2361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Overrides for Emacs so that we follow Linus's tabbing style.
2371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * ---------------------------------------------------------------------------
2381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Local variables:
2391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * c-basic-offset: 8
2401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * End:
2411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
242