Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / drivers / media / dvb-frontends / as102_fe_types.h
CommitLineData
41b44e04
PH
1/*
2 * Abilis Systems Single DVB-T Receiver
3 * Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
41b44e04
PH
14 */
15#ifndef _AS10X_TYPES_H_
16#define _AS10X_TYPES_H_
17
41b44e04
PH
18/*********************************/
19/* MACRO DEFINITIONS */
20/*********************************/
21
22/* bandwidth constant values */
14e0e4bf
SN
23#define BW_5_MHZ 0x00
24#define BW_6_MHZ 0x01
25#define BW_7_MHZ 0x02
26#define BW_8_MHZ 0x03
41b44e04
PH
27
28/* hierarchy priority selection values */
14e0e4bf
SN
29#define HIER_NO_PRIORITY 0x00
30#define HIER_LOW_PRIORITY 0x01
31#define HIER_HIGH_PRIORITY 0x02
41b44e04
PH
32
33/* constellation available values */
14e0e4bf
SN
34#define CONST_QPSK 0x00
35#define CONST_QAM16 0x01
36#define CONST_QAM64 0x02
37#define CONST_UNKNOWN 0xFF
41b44e04
PH
38
39/* hierarchy available values */
14e0e4bf
SN
40#define HIER_NONE 0x00
41#define HIER_ALPHA_1 0x01
42#define HIER_ALPHA_2 0x02
43#define HIER_ALPHA_4 0x03
44#define HIER_UNKNOWN 0xFF
41b44e04
PH
45
46/* interleaving available values */
14e0e4bf
SN
47#define INTLV_NATIVE 0x00
48#define INTLV_IN_DEPTH 0x01
49#define INTLV_UNKNOWN 0xFF
41b44e04
PH
50
51/* code rate available values */
14e0e4bf
SN
52#define CODE_RATE_1_2 0x00
53#define CODE_RATE_2_3 0x01
54#define CODE_RATE_3_4 0x02
55#define CODE_RATE_5_6 0x03
56#define CODE_RATE_7_8 0x04
57#define CODE_RATE_UNKNOWN 0xFF
41b44e04
PH
58
59/* guard interval available values */
14e0e4bf
SN
60#define GUARD_INT_1_32 0x00
61#define GUARD_INT_1_16 0x01
62#define GUARD_INT_1_8 0x02
63#define GUARD_INT_1_4 0x03
64#define GUARD_UNKNOWN 0xFF
41b44e04
PH
65
66/* transmission mode available values */
14e0e4bf
SN
67#define TRANS_MODE_2K 0x00
68#define TRANS_MODE_8K 0x01
69#define TRANS_MODE_4K 0x02
70#define TRANS_MODE_UNKNOWN 0xFF
41b44e04
PH
71
72/* DVBH signalling available values */
14e0e4bf
SN
73#define TIMESLICING_PRESENT 0x01
74#define MPE_FEC_PRESENT 0x02
41b44e04
PH
75
76/* tune state available */
14e0e4bf
SN
77#define TUNE_STATUS_NOT_TUNED 0x00
78#define TUNE_STATUS_IDLE 0x01
79#define TUNE_STATUS_LOCKING 0x02
80#define TUNE_STATUS_SIGNAL_DVB_OK 0x03
81#define TUNE_STATUS_STREAM_DETECTED 0x04
82#define TUNE_STATUS_STREAM_TUNED 0x05
83#define TUNE_STATUS_ERROR 0xFF
41b44e04
PH
84
85/* available TS FID filter types */
14e0e4bf
SN
86#define TS_PID_TYPE_TS 0
87#define TS_PID_TYPE_PSI_SI 1
88#define TS_PID_TYPE_MPE 2
41b44e04
PH
89
90/* number of echos available */
14e0e4bf 91#define MAX_ECHOS 15
41b44e04
PH
92
93/* Context types */
14e0e4bf
SN
94#define CONTEXT_LNA 1010
95#define CONTEXT_ELNA_HYSTERESIS 4003
96#define CONTEXT_ELNA_GAIN 4004
97#define CONTEXT_MER_THRESHOLD 5005
98#define CONTEXT_MER_OFFSET 5006
99#define CONTEXT_IR_STATE 7000
100#define CONTEXT_TSOUT_MSB_FIRST 7004
101#define CONTEXT_TSOUT_FALLING_EDGE 7005
41b44e04
PH
102
103/* Configuration modes */
14e0e4bf
SN
104#define CFG_MODE_ON 0
105#define CFG_MODE_OFF 1
106#define CFG_MODE_AUTO 2
41b44e04 107
41b44e04 108struct as10x_tps {
dfc64384 109 uint8_t modulation;
14e0e4bf
SN
110 uint8_t hierarchy;
111 uint8_t interleaving_mode;
112 uint8_t code_rate_HP;
113 uint8_t code_rate_LP;
114 uint8_t guard_interval;
115 uint8_t transmission_mode;
116 uint8_t DVBH_mask_HP;
117 uint8_t DVBH_mask_LP;
118 uint16_t cell_ID;
fa1a13f6 119} __packed;
41b44e04
PH
120
121struct as10x_tune_args {
14e0e4bf
SN
122 /* frequency */
123 uint32_t freq;
124 /* bandwidth */
125 uint8_t bandwidth;
126 /* hierarchy selection */
127 uint8_t hier_select;
128 /* constellation */
dfc64384 129 uint8_t modulation;
14e0e4bf
SN
130 /* hierarchy */
131 uint8_t hierarchy;
132 /* interleaving mode */
133 uint8_t interleaving_mode;
134 /* code rate */
135 uint8_t code_rate;
136 /* guard interval */
137 uint8_t guard_interval;
138 /* transmission mode */
139 uint8_t transmission_mode;
fa1a13f6 140} __packed;
41b44e04
PH
141
142struct as10x_tune_status {
14e0e4bf
SN
143 /* tune status */
144 uint8_t tune_state;
145 /* signal strength */
146 int16_t signal_strength;
147 /* packet error rate 10^-4 */
148 uint16_t PER;
149 /* bit error rate 10^-4 */
150 uint16_t BER;
fa1a13f6 151} __packed;
41b44e04
PH
152
153struct as10x_demod_stats {
14e0e4bf
SN
154 /* frame counter */
155 uint32_t frame_count;
156 /* Bad frame counter */
157 uint32_t bad_frame_count;
158 /* Number of wrong bytes fixed by Reed-Solomon */
159 uint32_t bytes_fixed_by_rs;
160 /* Averaged MER */
161 uint16_t mer;
162 /* statistics calculation state indicator (started or not) */
163 uint8_t has_started;
fa1a13f6 164} __packed;
41b44e04
PH
165
166struct as10x_ts_filter {
14e0e4bf
SN
167 uint16_t pid; /* valid PID value 0x00 : 0x2000 */
168 uint8_t type; /* Red TS_PID_TYPE_<N> values */
169 uint8_t idx; /* index in filtering table */
fa1a13f6 170} __packed;
41b44e04
PH
171
172struct as10x_register_value {
14e0e4bf
SN
173 uint8_t mode;
174 union {
175 uint8_t value8; /* 8 bit value */
176 uint16_t value16; /* 16 bit value */
177 uint32_t value32; /* 32 bit value */
abf9d005 178 } __packed u;
fa1a13f6 179} __packed;
41b44e04
PH
180
181struct as10x_register_addr {
14e0e4bf
SN
182 /* register addr */
183 uint32_t addr;
184 /* register mode access */
185 uint8_t mode;
41b44e04
PH
186};
187
41b44e04 188#endif
This page took 0.259668 seconds and 5 git commands to generate.