Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
stv0367_priv.h
Go to the documentation of this file.
1 /*
2  * stv0367_priv.h
3  *
4  * Driver for ST STV0367 DVB-T & DVB-C demodulator IC.
5  *
6  * Copyright (C) ST Microelectronics.
7  * Copyright (C) 2010,2011 NetUP Inc.
8  * Copyright (C) 2010,2011 Igor M. Liplianin <[email protected]>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  *
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 /* Common driver error constants */
26 
27 #ifndef STV0367_PRIV_H
28 #define STV0367_PRIV_H
29 
30 #ifndef TRUE
31  #define TRUE (1 == 1)
32 #endif
33 #ifndef FALSE
34  #define FALSE (!TRUE)
35 #endif
36 
37 #ifndef NULL
38 #define NULL 0
39 #endif
40 
41 /* MACRO definitions */
42 #define ABS(X) ((X) < 0 ? (-1 * (X)) : (X))
43 #define MAX(X, Y) ((X) >= (Y) ? (X) : (Y))
44 #define MIN(X, Y) ((X) <= (Y) ? (X) : (Y))
45 #define INRANGE(X, Y, Z) \
46  ((((X) <= (Y)) && ((Y) <= (Z))) || \
47  (((Z) <= (Y)) && ((Y) <= (X))) ? 1 : 0)
48 
49 #ifndef MAKEWORD
50 #define MAKEWORD(X, Y) (((X) << 8) + (Y))
51 #endif
52 
53 #define LSB(X) (((X) & 0xff))
54 #define MSB(Y) (((Y) >> 8) & 0xff)
55 #define MMSB(Y)(((Y) >> 16) & 0xff)
56 
72 };
73 
80 };
81 
86 };
87 
92 };
93 
94 #if 0
95 enum FE_TER_Rate_TPS {
96  FE_TER_TPS_1_2 = 0,
97  FE_TER_TPS_2_3 = 1,
98  FE_TER_TPS_3_4 = 2,
99  FE_TER_TPS_5_6 = 3,
100  FE_TER_TPS_7_8 = 4
101 };
102 #endif
103 
108 };
109 #if 0
110 enum FE_TER_Hierarchy_Alpha {
111  FE_TER_HIER_ALPHA_NONE, /* Regular modulation */
112  FE_TER_HIER_ALPHA_1, /* Hierarchical modulation a = 1*/
113  FE_TER_HIER_ALPHA_2, /* Hierarchical modulation a = 2*/
114  FE_TER_HIER_ALPHA_4 /* Hierarchical modulation a = 4*/
115 };
116 #endif
118  FE_TER_HIER_NONE, /*Hierarchy None*/
119  FE_TER_HIER_LOW_PRIO, /*Hierarchy : Low Priority*/
120  FE_TER_HIER_HIGH_PRIO, /*Hierarchy : High Priority*/
121  FE_TER_HIER_PRIO_ANY /*Hierarchy :Any*/
122 };
123 
124 #if 0
125 enum fe_stv0367_ter_spec {
126  FE_TER_INVERSION_NONE = 0,
127  FE_TER_INVERSION = 1,
128  FE_TER_INVERSION_AUTO = 2,
129  FE_TER_INVERSION_UNK = 4
130 };
131 #endif
132 
137 
138 };
139 
140 #if 0
141 enum FE_TER_FECRate {
142  FE_TER_FEC_NONE = 0x00, /* no FEC rate specified */
143  FE_TER_FEC_ALL = 0xFF, /* Logical OR of all FECs */
144  FE_TER_FEC_1_2 = 1,
145  FE_TER_FEC_2_3 = (1 << 1),
146  FE_TER_FEC_3_4 = (1 << 2),
147  FE_TER_FEC_4_5 = (1 << 3),
148  FE_TER_FEC_5_6 = (1 << 4),
149  FE_TER_FEC_6_7 = (1 << 5),
150  FE_TER_FEC_7_8 = (1 << 6),
151  FE_TER_FEC_8_9 = (1 << 7)
152 };
153 
154 enum FE_TER_Rate {
155  FE_TER_FE_1_2 = 0,
156  FE_TER_FE_2_3 = 1,
157  FE_TER_FE_3_4 = 2,
158  FE_TER_FE_5_6 = 3,
159  FE_TER_FE_6_7 = 4,
160  FE_TER_FE_7_8 = 5
161 };
162 #endif
163 
167 };
168 
178 };
179 #if 0
180 enum {
181  FE_CAB_FEC_A = 1, /* J83 Annex A */
182  FE_CAB_FEC_B = (1 << 1),/* J83 Annex B */
183  FE_CAB_FEC_C = (1 << 2) /* J83 Annex C */
184 } FE_CAB_FECType_t;
185 #endif
187  int locked;
188  u32 frequency; /* kHz */
189  u32 symbol_rate; /* Mbds */
192  s32 Power_dBmx10; /* Power of the RF signal (dBm x 10) */
193  u32 CN_dBx10; /* Carrier to noise ratio (dB x 10) */
194  u32 BER; /* Bit error rate (x 10000000) */
195 };
196 
210 };
211 
212 #endif