diff options
Diffstat (limited to 'drivers/media/common/tuners/mxl5005s.h')
-rw-r--r-- | drivers/media/common/tuners/mxl5005s.h | 143 |
1 files changed, 99 insertions, 44 deletions
diff --git a/drivers/media/common/tuners/mxl5005s.h b/drivers/media/common/tuners/mxl5005s.h index 7d0727d44536..687cf146c2a0 100644 --- a/drivers/media/common/tuners/mxl5005s.h +++ b/drivers/media/common/tuners/mxl5005s.h | |||
@@ -1,63 +1,118 @@ | |||
1 | /* | 1 | /* |
2 | * For the Realtek RTL chip RTL2831U | 2 | MaxLinear MXL5005S VSB/QAM/DVBT tuner driver |
3 | * Realtek Release Date: 2008-03-14, ver 080314 | ||
4 | * Realtek version RTL2831 Linux driver version 080314 | ||
5 | * ver 080314 | ||
6 | * | ||
7 | * for linux kernel version 2.6.21.4 - 2.6.22-14 | ||
8 | * support MXL5005s and MT2060 tuners (support tuner auto-detecting) | ||
9 | * support two IR types -- RC5 and NEC | ||
10 | * | ||
11 | * Known boards with Realtek RTL chip RTL2821U | ||
12 | * Freecom USB stick 14aa:0160 (version 4) | ||
13 | * Conceptronic CTVDIGRCU | ||
14 | * | ||
15 | * Copyright (c) 2008 Realtek | ||
16 | * Copyright (c) 2008 Jan Hoogenraad, Barnaby Shearer, Andy Hasper | ||
17 | * This code is placed under the terms of the GNU General Public License | ||
18 | * | ||
19 | * Released by Realtek under GPLv2. | ||
20 | * Thanks to Realtek for a lot of support we received ! | ||
21 | * | ||
22 | * Revision: 080314 - original version | ||
23 | */ | ||
24 | 3 | ||
4 | Copyright (C) 2008 MaxLinear | ||
5 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | |||
21 | */ | ||
25 | 22 | ||
26 | #ifndef __MXL5005S_H | 23 | #ifndef __MXL5005S_H |
27 | #define __MXL5005S_H | 24 | #define __MXL5005S_H |
28 | 25 | ||
29 | #include <linux/dvb/frontend.h> | 26 | #include <linux/dvb/frontend.h> |
30 | 27 | ||
31 | /* IF frequency */ | ||
32 | enum IF_FREQ_HZ | ||
33 | { | ||
34 | IF_FREQ_4570000HZ = 4570000, ///< IF frequency = 4.57 MHz | ||
35 | IF_FREQ_4571429HZ = 4571429, ///< IF frequency = 4.571 MHz | ||
36 | IF_FREQ_5380000HZ = 5380000, ///< IF frequency = 5.38 MHz | ||
37 | IF_FREQ_36000000HZ = 36000000, ///< IF frequency = 36.000 MHz | ||
38 | IF_FREQ_36125000HZ = 36125000, ///< IF frequency = 36.125 MHz | ||
39 | IF_FREQ_36166667HZ = 36166667, ///< IF frequency = 36.167 MHz | ||
40 | IF_FREQ_44000000HZ = 44000000, ///< IF frequency = 44.000 MHz | ||
41 | }; | ||
42 | |||
43 | /* Crystal frequency */ | ||
44 | enum CRYSTAL_FREQ_HZ | ||
45 | { | ||
46 | CRYSTAL_FREQ_4000000HZ = 4000000, ///< Crystal frequency = 4.0 MHz | ||
47 | CRYSTAL_FREQ_16000000HZ = 16000000, ///< Crystal frequency = 16.0 MHz | ||
48 | CRYSTAL_FREQ_25000000HZ = 25000000, ///< Crystal frequency = 25.0 MHz | ||
49 | CRYSTAL_FREQ_28800000HZ = 28800000, ///< Crystal frequency = 28.8 MHz | ||
50 | }; | ||
51 | |||
52 | struct mxl5005s_config | 28 | struct mxl5005s_config |
53 | { | 29 | { |
30 | /* 7 bit i2c address */ | ||
54 | u8 i2c_address; | 31 | u8 i2c_address; |
55 | 32 | ||
33 | #define IF_FREQ_4570000HZ 4570000 | ||
34 | #define IF_FREQ_4571429HZ 4571429 | ||
35 | #define IF_FREQ_5380000HZ 5380000 | ||
36 | #define IF_FREQ_36000000HZ 36000000 | ||
37 | #define IF_FREQ_36125000HZ 36125000 | ||
38 | #define IF_FREQ_36166667HZ 36166667 | ||
39 | #define IF_FREQ_44000000HZ 44000000 | ||
40 | u32 if_freq; | ||
41 | |||
42 | #define CRYSTAL_FREQ_4000000HZ 4000000 | ||
43 | #define CRYSTAL_FREQ_16000000HZ 16000000 | ||
44 | #define CRYSTAL_FREQ_25000000HZ 25000000 | ||
45 | #define CRYSTAL_FREQ_28800000HZ 28800000 | ||
46 | u32 xtal_freq; | ||
47 | |||
48 | #define MXL_DUAL_AGC 0 | ||
49 | #define MXL_SINGLE_AGC 1 | ||
50 | u8 agc_mode; | ||
51 | |||
52 | #define MXL_TF_DEFAULT 0 | ||
53 | #define MXL_TF_OFF 1 | ||
54 | #define MXL_TF_C 2 | ||
55 | #define MXL_TF_C_H 3 | ||
56 | #define MXL_TF_D 4 | ||
57 | #define MXL_TF_D_L 5 | ||
58 | #define MXL_TF_E 6 | ||
59 | #define MXL_TF_F 7 | ||
60 | #define MXL_TF_E_2 8 | ||
61 | #define MXL_TF_E_NA 9 | ||
62 | #define MXL_TF_G 10 | ||
63 | u8 tracking_filter; | ||
64 | |||
65 | #define MXL_RSSI_DISABLE 0 | ||
66 | #define MXL_RSSI_ENABLE 1 | ||
67 | u8 rssi_enable; | ||
68 | |||
69 | #define MXL_CAP_SEL_DISABLE 0 | ||
70 | #define MXL_CAP_SEL_ENABLE 1 | ||
71 | u8 cap_select; | ||
72 | |||
73 | #define MXL_DIV_OUT_1 0 | ||
74 | #define MXL_DIV_OUT_4 1 | ||
75 | u8 div_out; | ||
76 | |||
77 | #define MXL_CLOCK_OUT_DISABLE 0 | ||
78 | #define MXL_CLOCK_OUT_ENABLE 1 | ||
79 | u8 clock_out; | ||
80 | |||
81 | #define MXL5005S_IF_OUTPUT_LOAD_200_OHM 200 | ||
82 | #define MXL5005S_IF_OUTPUT_LOAD_300_OHM 300 | ||
83 | u32 output_load; | ||
84 | |||
85 | #define MXL5005S_TOP_5P5 55 | ||
86 | #define MXL5005S_TOP_7P2 72 | ||
87 | #define MXL5005S_TOP_9P2 92 | ||
88 | #define MXL5005S_TOP_11P0 110 | ||
89 | #define MXL5005S_TOP_12P9 129 | ||
90 | #define MXL5005S_TOP_14P7 147 | ||
91 | #define MXL5005S_TOP_16P8 168 | ||
92 | #define MXL5005S_TOP_19P4 194 | ||
93 | #define MXL5005S_TOP_21P2 212 | ||
94 | #define MXL5005S_TOP_23P2 232 | ||
95 | #define MXL5005S_TOP_25P2 252 | ||
96 | #define MXL5005S_TOP_27P1 271 | ||
97 | #define MXL5005S_TOP_29P2 292 | ||
98 | #define MXL5005S_TOP_31P7 317 | ||
99 | #define MXL5005S_TOP_34P9 349 | ||
100 | u32 top; | ||
101 | |||
102 | #define MXL_ANALOG_MODE 0 | ||
103 | #define MXL_DIGITAL_MODE 1 | ||
104 | u8 mod_mode; | ||
105 | |||
106 | #define MXL_ZERO_IF 0 | ||
107 | #define MXL_LOW_IF 1 | ||
108 | u8 if_mode; | ||
109 | |||
56 | /* Stuff I don't know what to do with */ | 110 | /* Stuff I don't know what to do with */ |
57 | u8 AgcMasterByte; | 111 | u8 AgcMasterByte; |
58 | }; | 112 | }; |
59 | 113 | ||
60 | #if defined(CONFIG_MEDIA_TUNER_MXL5005S) || (defined(CONFIG_MEDIA_TUNER_MXL5005S_MODULE) && defined(MODULE)) | 114 | #if defined(CONFIG_MEDIA_TUNER_MXL5005S) || \ |
115 | (defined(CONFIG_MEDIA_TUNER_MXL5005S_MODULE) && defined(MODULE)) | ||
61 | extern struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe, | 116 | extern struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe, |
62 | struct i2c_adapter *i2c, | 117 | struct i2c_adapter *i2c, |
63 | struct mxl5005s_config *config); | 118 | struct mxl5005s_config *config); |