Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * tuner.h - definition for different tuners
0004  *
0005  * Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
0006  * minor modifications by Ralph Metzler (rjkm@thp.uni-koeln.de)
0007  */
0008 
0009 #ifndef _TUNER_H
0010 #define _TUNER_H
0011 #ifdef __KERNEL__
0012 
0013 #include <linux/videodev2.h>
0014 #include <media/v4l2-mc.h>
0015 
0016 #define ADDR_UNSET (255)
0017 
0018 #define TUNER_TEMIC_PAL         0        /* 4002 FH5 (3X 7756, 9483) */
0019 #define TUNER_PHILIPS_PAL_I     1
0020 #define TUNER_PHILIPS_NTSC      2
0021 #define TUNER_PHILIPS_SECAM     3   /* you must actively select B/G, L, L` */
0022 
0023 #define TUNER_ABSENT            4
0024 #define TUNER_PHILIPS_PAL       5
0025 #define TUNER_TEMIC_NTSC        6   /* 4032 FY5 (3X 7004, 9498, 9789)  */
0026 #define TUNER_TEMIC_PAL_I       7   /* 4062 FY5 (3X 8501, 9957) */
0027 
0028 #define TUNER_TEMIC_4036FY5_NTSC    8   /* 4036 FY5 (3X 1223, 1981, 7686) */
0029 #define TUNER_ALPS_TSBH1_NTSC       9
0030 #define TUNER_ALPS_TSBE1_PAL        10
0031 #define TUNER_ALPS_TSBB5_PAL_I      11
0032 
0033 #define TUNER_ALPS_TSBE5_PAL        12
0034 #define TUNER_ALPS_TSBC5_PAL        13
0035 #define TUNER_TEMIC_4006FH5_PAL     14  /* 4006 FH5 (3X 9500, 9501, 7291) */
0036 #define TUNER_ALPS_TSHC6_NTSC       15
0037 
0038 #define TUNER_TEMIC_PAL_DK      16  /* 4016 FY5 (3X 1392, 1393) */
0039 #define TUNER_PHILIPS_NTSC_M        17
0040 #define TUNER_TEMIC_4066FY5_PAL_I   18  /* 4066 FY5 (3X 7032, 7035) */
0041 #define TUNER_TEMIC_4006FN5_MULTI_PAL   19  /* B/G, I and D/K autodetected (3X 7595, 7606, 7657) */
0042 
0043 #define TUNER_TEMIC_4009FR5_PAL     20  /* incl. FM radio (3X 7607, 7488, 7711) */
0044 #define TUNER_TEMIC_4039FR5_NTSC    21  /* incl. FM radio (3X 7246, 7578, 7732) */
0045 #define TUNER_TEMIC_4046FM5     22  /* you must actively select B/G, D/K, I, L, L` !  (3X 7804, 7806, 8103, 8104) */
0046 #define TUNER_PHILIPS_PAL_DK        23
0047 
0048 #define TUNER_PHILIPS_FQ1216ME      24  /* you must actively select B/G/D/K, I, L, L` */
0049 #define TUNER_LG_PAL_I_FM       25
0050 #define TUNER_LG_PAL_I          26
0051 #define TUNER_LG_NTSC_FM        27
0052 
0053 #define TUNER_LG_PAL_FM         28
0054 #define TUNER_LG_PAL            29
0055 #define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30 /* B/G, I and D/K autodetected (3X 8155, 8160, 8163) */
0056 #define TUNER_SHARP_2U5JF5540_NTSC  31
0057 
0058 #define TUNER_Samsung_PAL_TCPM9091PD27  32
0059 #define TUNER_MT2032            33
0060 #define TUNER_TEMIC_4106FH5     34  /* 4106 FH5 (3X 7808, 7865) */
0061 #define TUNER_TEMIC_4012FY5     35  /* 4012 FY5 (3X 0971, 1099) */
0062 
0063 #define TUNER_TEMIC_4136FY5     36  /* 4136 FY5 (3X 7708, 7746) */
0064 #define TUNER_LG_PAL_NEW_TAPC       37
0065 #define TUNER_PHILIPS_FM1216ME_MK3  38
0066 #define TUNER_LG_NTSC_NEW_TAPC      39
0067 
0068 #define TUNER_HITACHI_NTSC      40
0069 #define TUNER_PHILIPS_PAL_MK        41
0070 #define TUNER_PHILIPS_FCV1236D      42
0071 #define TUNER_PHILIPS_FM1236_MK3    43
0072 
0073 #define TUNER_PHILIPS_4IN1      44  /* ATI TV Wonder Pro - Conexant */
0074     /*
0075      * Microtune merged with Temic 12/31/1999 partially financed by Alps.
0076      * these may be similar to Temic
0077      */
0078 #define TUNER_MICROTUNE_4049FM5     45
0079 #define TUNER_PANASONIC_VP27        46
0080 #define TUNER_LG_NTSC_TAPE      47
0081 
0082 #define TUNER_TNF_8831BGFF      48
0083 #define TUNER_MICROTUNE_4042FI5     49  /* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */
0084 #define TUNER_TCL_2002N         50
0085 #define TUNER_PHILIPS_FM1256_IH3    51
0086 
0087 #define TUNER_THOMSON_DTT7610       52
0088 #define TUNER_PHILIPS_FQ1286        53
0089 #define TUNER_PHILIPS_TDA8290       54
0090 #define TUNER_TCL_2002MB        55  /* Hauppauge PVR-150 PAL */
0091 
0092 #define TUNER_PHILIPS_FQ1216AME_MK4 56  /* Hauppauge PVR-150 PAL */
0093 #define TUNER_PHILIPS_FQ1236A_MK4   57  /* Hauppauge PVR-500MCE NTSC */
0094 #define TUNER_YMEC_TVF_8531MF       58
0095 #define TUNER_YMEC_TVF_5533MF       59  /* Pixelview Pro Ultra NTSC */
0096 
0097 #define TUNER_THOMSON_DTT761X       60  /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */
0098 #define TUNER_TENA_9533_DI      61
0099 #define TUNER_TEA5767           62  /* Only FM Radio Tuner */
0100 #define TUNER_PHILIPS_FMD1216ME_MK3 63
0101 
0102 #define TUNER_LG_TDVS_H06XF     64  /* TDVS H061F, H062F, H064F */
0103 #define TUNER_YMEC_TVF66T5_B_DFF    65  /* Acorp Y878F */
0104 #define TUNER_LG_TALN           66
0105 #define TUNER_PHILIPS_TD1316        67
0106 
0107 #define TUNER_PHILIPS_TUV1236D      68  /* ATI HDTV Wonder */
0108 #define TUNER_TNF_5335MF                69  /* Sabrent Bt848   */
0109 #define TUNER_SAMSUNG_TCPN_2121P30A     70  /* Hauppauge PVR-500MCE NTSC */
0110 #define TUNER_XC2028            71
0111 
0112 #define TUNER_THOMSON_FE6600        72  /* DViCO FusionHDTV DVB-T Hybrid */
0113 #define TUNER_SAMSUNG_TCPG_6121P30A     73  /* Hauppauge PVR-500 PAL */
0114 #define TUNER_TDA9887                   74      /* This tuner should be used only internally */
0115 #define TUNER_TEA5761           75  /* Only FM Radio Tuner */
0116 #define TUNER_XC5000            76  /* Xceive Silicon Tuner */
0117 #define TUNER_TCL_MF02GIP_5N        77  /* TCL MF02GIP_5N */
0118 #define TUNER_PHILIPS_FMD1216MEX_MK3    78
0119 #define TUNER_PHILIPS_FM1216MK5     79
0120 #define TUNER_PHILIPS_FQ1216LME_MK3 80  /* Active loopthrough, no FM */
0121 
0122 #define TUNER_PARTSNIC_PTI_5NF05    81
0123 #define TUNER_PHILIPS_CU1216L           82
0124 #define TUNER_NXP_TDA18271      83
0125 #define TUNER_SONY_BTF_PXN01Z       84
0126 #define TUNER_PHILIPS_FQ1236_MK5    85  /* NTSC, TDA9885, no FM radio */
0127 #define TUNER_TENA_TNF_5337     86
0128 
0129 #define TUNER_XC4000            87  /* Xceive Silicon Tuner */
0130 #define TUNER_XC5000C           88  /* Xceive Silicon Tuner */
0131 
0132 #define TUNER_SONY_BTF_PG472Z       89  /* PAL+SECAM */
0133 #define TUNER_SONY_BTF_PK467Z       90  /* NTSC_JP */
0134 #define TUNER_SONY_BTF_PB463Z       91  /* NTSC */
0135 #define TUNER_SI2157            92
0136 
0137 /* tv card specific */
0138 #define TDA9887_PRESENT         (1<<0)
0139 #define TDA9887_PORT1_INACTIVE      (1<<1)
0140 #define TDA9887_PORT2_INACTIVE      (1<<2)
0141 #define TDA9887_QSS         (1<<3)
0142 #define TDA9887_INTERCARRIER        (1<<4)
0143 #define TDA9887_PORT1_ACTIVE        (1<<5)
0144 #define TDA9887_PORT2_ACTIVE        (1<<6)
0145 #define TDA9887_INTERCARRIER_NTSC   (1<<7)
0146 /* Tuner takeover point adjustment, in dB, -16 <= top <= 15 */
0147 #define TDA9887_TOP_MASK        (0x3f << 8)
0148 #define TDA9887_TOP_SET         (1 << 13)
0149 #define TDA9887_TOP(top)        (TDA9887_TOP_SET | \
0150                      (((16 + (top)) & 0x1f) << 8))
0151 
0152 /* config options */
0153 #define TDA9887_DEEMPHASIS_MASK     (3<<16)
0154 #define TDA9887_DEEMPHASIS_NONE     (1<<16)
0155 #define TDA9887_DEEMPHASIS_50       (2<<16)
0156 #define TDA9887_DEEMPHASIS_75       (3<<16)
0157 #define TDA9887_AUTOMUTE        (1<<18)
0158 #define TDA9887_GATING_18       (1<<19)
0159 #define TDA9887_GAIN_NORMAL     (1<<20)
0160 #define TDA9887_RIF_41_3        (1<<21)  /* radio IF1 41.3 vs 33.3 */
0161 
0162 /**
0163  * enum tuner_mode      - Mode of the tuner
0164  *
0165  * @T_RADIO:        Tuner core will work in radio mode
0166  * @T_ANALOG_TV:    Tuner core will work in analog TV mode
0167  *
0168  * Older boards only had a single tuner device, but some devices have a
0169  * separate tuner for radio. In any case, the tuner-core needs to know if
0170  * the tuner chip(s) will be used in radio mode or analog TV mode, as, on
0171  * radio mode, frequencies are specified on a different range than on TV
0172  * mode. This enum is used by the tuner core in order to work with the
0173  * proper tuner range and eventually use a different tuner chip while in
0174  * radio mode.
0175  */
0176 enum tuner_mode {
0177     T_RADIO     = 1 << V4L2_TUNER_RADIO,
0178     T_ANALOG_TV     = 1 << V4L2_TUNER_ANALOG_TV,
0179     /* Don't map V4L2_TUNER_DIGITAL_TV, as tuner-core won't use it */
0180 };
0181 
0182 /**
0183  * struct tuner_setup   - setup the tuner chipsets
0184  *
0185  * @addr:       I2C address used to control the tuner device/chipset
0186  * @type:       Type of the tuner, as defined at the TUNER_* macros.
0187  *          Each different tuner model should have an unique
0188  *          identifier.
0189  * @mode_mask:      Mask with the allowed tuner modes: V4L2_TUNER_RADIO,
0190  *          V4L2_TUNER_ANALOG_TV and/or V4L2_TUNER_DIGITAL_TV,
0191  *          describing if the tuner should be used to support
0192  *          Radio, analog TV and/or digital TV.
0193  * @config:     Used to send tuner-specific configuration for complex
0194  *          tuners that require extra parameters to be set.
0195  *          Only a very few tuners require it and its usage on
0196  *          newer tuners should be avoided.
0197  * @tuner_callback: Some tuners require to call back the bridge driver,
0198  *          in order to do some tasks like rising a GPIO at the
0199  *          bridge chipset, in order to do things like resetting
0200  *          the device.
0201  *
0202  * Older boards only had a single tuner device. Nowadays multiple tuner
0203  * devices may be present on a single board. Using TUNER_SET_TYPE_ADDR
0204  * to pass the tuner_setup structure it is possible to setup each tuner
0205  * device in turn.
0206  *
0207  * Since multiple devices may be present it is no longer sufficient to
0208  * send a command to a single i2c device. Instead you should broadcast
0209  * the command to all i2c devices.
0210  *
0211  * By setting the mode_mask correctly you can select which commands are
0212  * accepted by a specific tuner device. For example, set mode_mask to
0213  * T_RADIO if the device is a radio-only tuner. That specific tuner will
0214  * only accept commands when the tuner is in radio mode and ignore them
0215  * when the tuner is set to TV mode.
0216  */
0217 
0218 struct tuner_setup {
0219     unsigned short  addr;
0220     unsigned int    type;
0221     unsigned int    mode_mask;
0222     void        *config;
0223     int (*tuner_callback)(void *dev, int component, int cmd, int arg);
0224 };
0225 
0226 #endif /* __KERNEL__ */
0227 
0228 #endif /* _TUNER_H */