blob: 55ad535197d282f33d269a2e655175a519712316 [file] [log] [blame]
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -03001
Devin Heitmuellerca3355a2010-07-04 18:42:11 -03002/*
3 Copyright (c), 2004-2005,2007-2010 Trident Microsystems, Inc.
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9 * Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
14 * Neither the name of Trident Microsystems nor Hauppauge Computer Works
15 nor the names of its contributors may be used to endorse or promote
16 products derived from this software without specific prior written
17 permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 POSSIBILITY OF SUCH DAMAGE.
Devin Heitmuellerca3355a2010-07-04 18:42:11 -030030
Mauro Carvalho Chehab2f1f7332014-01-17 11:51:52 -030031 DRXJ specific header file
32
33 Authors: Dragan Savic, Milos Nikolic, Mihajlo Katona, Tao Ding, Paul Janssen
Devin Heitmueller38b2df92012-08-13 21:18:02 -030034*/
35
Devin Heitmueller38b2df92012-08-13 21:18:02 -030036#ifndef __DRXJ_H__
37#define __DRXJ_H__
38/*-------------------------------------------------------------------------
39INCLUDES
40-------------------------------------------------------------------------*/
41
42#include "drx_driver.h"
43#include "drx_dap_fasi.h"
44
Devin Heitmueller38b2df92012-08-13 21:18:02 -030045/* Check DRX-J specific dap condition */
46/* Multi master mode and short addr format only will not work.
47 RMW, CRC reset, broadcast and switching back to single master mode
48 cannot be done with short addr only in multi master mode. */
Mauro Carvalho Chehab7ef66752014-01-16 11:08:15 -030049#if ((DRXDAP_SINGLE_MASTER == 0) && (DRXDAPFASI_LONG_ADDR_ALLOWED == 0))
Devin Heitmueller38b2df92012-08-13 21:18:02 -030050#error "Multi master mode and short addressing only is an illegal combination"
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -030051 *; /* Generate a fatal compiler error to make sure it stops here,
52 this is necesarry because not all compilers stop after a #error. */
Devin Heitmueller38b2df92012-08-13 21:18:02 -030053#endif
54
55/*-------------------------------------------------------------------------
56TYPEDEFS
57-------------------------------------------------------------------------*/
58/*============================================================================*/
59/*============================================================================*/
60/*== code support ============================================================*/
61/*============================================================================*/
62/*============================================================================*/
63
64/*============================================================================*/
65/*============================================================================*/
66/*== SCU cmd if =============================================================*/
67/*============================================================================*/
68/*============================================================================*/
69
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -030070 struct drxjscu_cmd {
Mauro Carvalho Chehab43a431e2012-03-20 00:49:45 -030071 u16 command;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -030072 /**< Command number */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -030073 u16 parameter_len;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -030074 /**< Data length in byte */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -030075 u16 result_len;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -030076 /**< result length in byte */
Mauro Carvalho Chehab43a431e2012-03-20 00:49:45 -030077 u16 *parameter;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -030078 /**< General purpous param */
Mauro Carvalho Chehab43a431e2012-03-20 00:49:45 -030079 u16 *result;
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -030080 /**< General purpous param */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -030081
82/*============================================================================*/
83/*============================================================================*/
84/*== CTRL CFG related data structures ========================================*/
85/*============================================================================*/
86/*============================================================================*/
87
88/* extra intermediate lock state for VSB,QAM,NTSC */
89#define DRXJ_DEMOD_LOCK (DRX_LOCK_STATE_1)
90
91/* OOB lock states */
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -030092#define DRXJ_OOB_AGC_LOCK (DRX_LOCK_STATE_1) /* analog gain control lock */
93#define DRXJ_OOB_SYNC_LOCK (DRX_LOCK_STATE_2) /* digital gain control lock */
Devin Heitmueller38b2df92012-08-13 21:18:02 -030094
95/* Intermediate powermodes for DRXJ */
96#define DRXJ_POWER_DOWN_MAIN_PATH DRX_POWER_MODE_8
97#define DRXJ_POWER_DOWN_CORE DRX_POWER_MODE_9
98#define DRXJ_POWER_DOWN_PLL DRX_POWER_MODE_10
99
100/* supstition for GPIO FNC mux */
101#define APP_O (0x0000)
102
103/*#define DRX_CTRL_BASE (0x0000)*/
104
105#define DRXJ_CTRL_CFG_BASE (0x1000)
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300106 enum drxj_cfg_type {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300107 DRXJ_CFG_AGC_RF = DRXJ_CTRL_CFG_BASE,
108 DRXJ_CFG_AGC_IF,
109 DRXJ_CFG_AGC_INTERNAL,
110 DRXJ_CFG_PRE_SAW,
111 DRXJ_CFG_AFE_GAIN,
112 DRXJ_CFG_SYMBOL_CLK_OFFSET,
113 DRXJ_CFG_ACCUM_CR_RS_CW_ERR,
114 DRXJ_CFG_FEC_MERS_SEQ_COUNT,
115 DRXJ_CFG_OOB_MISC,
116 DRXJ_CFG_SMART_ANT,
117 DRXJ_CFG_OOB_PRE_SAW,
118 DRXJ_CFG_VSB_MISC,
119 DRXJ_CFG_RESET_PACKET_ERR,
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300120
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300121 /* ATV (FM) */
122 DRXJ_CFG_ATV_OUTPUT, /* also for FM (SIF control) but not likely */
123 DRXJ_CFG_ATV_MISC,
124 DRXJ_CFG_ATV_EQU_COEF,
125 DRXJ_CFG_ATV_AGC_STATUS, /* also for FM ( IF,RF, audioAGC ) */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300126
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300127 DRXJ_CFG_MPEG_OUTPUT_MISC,
128 DRXJ_CFG_HW_CFG,
129 DRXJ_CFG_OOB_LO_POW,
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300130
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300131 DRXJ_CFG_MAX /* dummy, never to be used */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300132
133/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300134* /struct enum drxj_cfg_smart_ant_io * smart antenna i/o.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300135*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300136enum drxj_cfg_smart_ant_io {
137 DRXJ_SMT_ANT_OUTPUT = 0,
138 DRXJ_SMT_ANT_INPUT
139};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300140
141/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300142* /struct struct drxj_cfg_smart_ant * Set smart antenna.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300143*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300144 struct drxj_cfg_smart_ant {
145 enum drxj_cfg_smart_ant_io io;
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300146 u16 ctrl_data;
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300147 };
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300148
149/**
150* /struct DRXJAGCSTATUS_t
151* AGC status information from the DRXJ-IQM-AF.
152*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300153struct drxj_agc_status {
154 u16 IFAGC;
155 u16 RFAGC;
156 u16 digital_agc;
157};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300158
159/* DRXJ_CFG_AGC_RF, DRXJ_CFG_AGC_IF */
160
161/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300162* /struct enum drxj_agc_ctrl_mode * Available AGCs modes in the DRXJ.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300163*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300164 enum drxj_agc_ctrl_mode {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300165 DRX_AGC_CTRL_AUTO = 0,
166 DRX_AGC_CTRL_USER,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300167 DRX_AGC_CTRL_OFF};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300168
169/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300170* /struct struct drxj_cfg_agc * Generic interface for all AGCs present on the DRXJ.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300171*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300172 struct drxj_cfg_agc {
Mauro Carvalho Chehab61263c72012-03-20 01:18:02 -0300173 enum drx_standard standard; /* standard for which these settings apply */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300174 enum drxj_agc_ctrl_mode ctrl_mode; /* off, user, auto */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300175 u16 output_level; /* range dependent on AGC */
176 u16 min_output_level; /* range dependent on AGC */
177 u16 max_output_level; /* range dependent on AGC */
Mauro Carvalho Chehab43a431e2012-03-20 00:49:45 -0300178 u16 speed; /* range dependent on AGC */
179 u16 top; /* rf-agc take over point */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300180 u16 cut_off_current; /* rf-agc is accelerated if output current
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300181 is below cut-off current */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300182
183/* DRXJ_CFG_PRE_SAW */
184
185/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300186* /struct struct drxj_cfg_pre_saw * Interface to configure pre SAW sense.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300187*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300188 struct drxj_cfg_pre_saw {
Mauro Carvalho Chehab61263c72012-03-20 01:18:02 -0300189 enum drx_standard standard; /* standard to which these settings apply */
Mauro Carvalho Chehab43a431e2012-03-20 00:49:45 -0300190 u16 reference; /* pre SAW reference value, range 0 .. 31 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300191 bool use_pre_saw; /* true algorithms must use pre SAW sense */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300192
193/* DRXJ_CFG_AFE_GAIN */
194
195/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300196* /struct struct drxj_cfg_afe_gain * Interface to configure gain of AFE (LNA + PGA).
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300197*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300198 struct drxj_cfg_afe_gain {
Mauro Carvalho Chehab61263c72012-03-20 01:18:02 -0300199 enum drx_standard standard; /* standard to which these settings apply */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300200 u16 gain; /* gain in 0.1 dB steps, DRXJ range 140 .. 335 */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300201
202/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300203* /struct drxjrs_errors
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300204* Available failure information in DRXJ_FEC_RS.
205*
206* Container for errors that are received in the most recently finished measurment period
207*
208*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300209 struct drxjrs_errors {
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300210 u16 nr_bit_errors;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300211 /**< no of pre RS bit errors */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300212 u16 nr_symbol_errors;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300213 /**< no of pre RS symbol errors */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300214 u16 nr_packet_errors;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300215 /**< no of pre RS packet errors */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300216 u16 nr_failures;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300217 /**< no of post RS failures to decode */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300218 u16 nr_snc_par_fail_count;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300219 /**< no of post RS bit erros */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300220 };
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300221
222/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300223* /struct struct drxj_cfg_vsb_misc * symbol error rate
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300224*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300225 struct drxj_cfg_vsb_misc {
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300226 u32 symb_error;
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300227 /**< symbol error rate sps */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300228
229/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300230* /enum enum drxj_mpeg_output_clock_rate * Mpeg output clock rate.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300231*
232*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300233 enum drxj_mpeg_start_width {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300234 DRXJ_MPEG_START_WIDTH_1CLKCYC,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300235 DRXJ_MPEG_START_WIDTH_8CLKCYC};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300236
237/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300238* /enum enum drxj_mpeg_output_clock_rate * Mpeg output clock rate.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300239*
240*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300241 enum drxj_mpeg_output_clock_rate {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300242 DRXJ_MPEGOUTPUT_CLOCK_RATE_AUTO,
243 DRXJ_MPEGOUTPUT_CLOCK_RATE_75973K,
244 DRXJ_MPEGOUTPUT_CLOCK_RATE_50625K,
245 DRXJ_MPEGOUTPUT_CLOCK_RATE_37968K,
246 DRXJ_MPEGOUTPUT_CLOCK_RATE_30375K,
247 DRXJ_MPEGOUTPUT_CLOCK_RATE_25313K,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300248 DRXJ_MPEGOUTPUT_CLOCK_RATE_21696K};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300249
250/**
251* /struct DRXJCfgMisc_t
252* Change TEI bit of MPEG output
253* reverse MPEG output bit order
254* set MPEG output clock rate
255*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300256 struct drxj_cfg_mpeg_output_misc {
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300257 bool disable_tei_handling; /**< if true pass (not change) TEI bit */
258 bool bit_reverse_mpeg_outout; /**< if true, parallel: msb on MD0; serial: lsb out first */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300259 enum drxj_mpeg_output_clock_rate mpeg_output_clock_rate;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300260 /**< set MPEG output clock rate that overwirtes the derived one from symbol rate */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300261 enum drxj_mpeg_start_width mpeg_start_width; /**< set MPEG output start width */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300262
263/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300264* /enum enum drxj_xtal_freq * Supported external crystal reference frequency.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300265*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300266 enum drxj_xtal_freq {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300267 DRXJ_XTAL_FREQ_RSVD,
268 DRXJ_XTAL_FREQ_27MHZ,
269 DRXJ_XTAL_FREQ_20P25MHZ,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300270 DRXJ_XTAL_FREQ_4MHZ};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300271
272/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300273* /enum enum drxj_xtal_freq * Supported external crystal reference frequency.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300274*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300275 enum drxji2c_speed {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300276 DRXJ_I2C_SPEED_400KBPS,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300277 DRXJ_I2C_SPEED_100KBPS};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300278
279/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300280* /struct struct drxj_cfg_hw_cfg * Get hw configuration, such as crystal reference frequency, I2C speed, etc...
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300281*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300282 struct drxj_cfg_hw_cfg {
283 enum drxj_xtal_freq xtal_freq;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300284 /**< crystal reference frequency */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300285 enum drxji2c_speed i2c_speed;
286 /**< 100 or 400 kbps */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300287
288/*
289 * DRXJ_CFG_ATV_MISC
290 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300291 struct drxj_cfg_atv_misc {
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300292 s16 peak_filter; /* -8 .. 15 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300293 u16 noise_filter; /* 0 .. 15 */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300294
295/*
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300296 * struct drxj_cfg_oob_misc */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300297#define DRXJ_OOB_STATE_RESET 0x0
298#define DRXJ_OOB_STATE_AGN_HUNT 0x1
299#define DRXJ_OOB_STATE_DGN_HUNT 0x2
300#define DRXJ_OOB_STATE_AGC_HUNT 0x3
301#define DRXJ_OOB_STATE_FRQ_HUNT 0x4
302#define DRXJ_OOB_STATE_PHA_HUNT 0x8
303#define DRXJ_OOB_STATE_TIM_HUNT 0x10
304#define DRXJ_OOB_STATE_EQU_HUNT 0x20
305#define DRXJ_OOB_STATE_EQT_HUNT 0x30
306#define DRXJ_OOB_STATE_SYNC 0x40
307
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300308struct drxj_cfg_oob_misc {
309 struct drxj_agc_status agc;
310 bool eq_lock;
311 bool sym_timing_lock;
312 bool phase_lock;
313 bool freq_lock;
314 bool dig_gain_lock;
315 bool ana_gain_lock;
316 u8 state;
Mauro Carvalho Chehab2f1f7332014-01-17 11:51:52 -0300317};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300318
319/*
320 * Index of in array of coef
321 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300322 enum drxj_cfg_oob_lo_power {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300323 DRXJ_OOB_LO_POW_MINUS0DB = 0,
324 DRXJ_OOB_LO_POW_MINUS5DB,
325 DRXJ_OOB_LO_POW_MINUS10DB,
326 DRXJ_OOB_LO_POW_MINUS15DB,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300327 DRXJ_OOB_LO_POW_MAX};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300328
329/*
330 * DRXJ_CFG_ATV_EQU_COEF
331 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300332 struct drxj_cfg_atv_equ_coef {
Mauro Carvalho Chehab43a431e2012-03-20 00:49:45 -0300333 s16 coef0; /* -256 .. 255 */
334 s16 coef1; /* -256 .. 255 */
335 s16 coef2; /* -256 .. 255 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300336 s16 coef3; /* -256 .. 255 */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300337
338/*
339 * Index of in array of coef
340 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300341 enum drxj_coef_array_index {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300342 DRXJ_COEF_IDX_MN = 0,
343 DRXJ_COEF_IDX_FM,
344 DRXJ_COEF_IDX_L,
345 DRXJ_COEF_IDX_LP,
346 DRXJ_COEF_IDX_BG,
347 DRXJ_COEF_IDX_DK,
348 DRXJ_COEF_IDX_I,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300349 DRXJ_COEF_IDX_MAX};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300350
351/*
352 * DRXJ_CFG_ATV_OUTPUT
353 */
354
355/**
356* /enum DRXJAttenuation_t
357* Attenuation setting for SIF AGC.
358*
359*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300360 enum drxjsif_attenuation {
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300361 DRXJ_SIF_ATTENUATION_0DB,
362 DRXJ_SIF_ATTENUATION_3DB,
363 DRXJ_SIF_ATTENUATION_6DB,
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300364 DRXJ_SIF_ATTENUATION_9DB};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300365
366/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300367* /struct struct drxj_cfg_atv_output * SIF attenuation setting.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300368*
369*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300370struct drxj_cfg_atv_output {
371 bool enable_cvbs_output; /* true= enabled */
372 bool enable_sif_output; /* true= enabled */
373 enum drxjsif_attenuation sif_attenuation;
374};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300375
376/*
377 DRXJ_CFG_ATV_AGC_STATUS (get only)
378*/
379/* TODO : AFE interface not yet finished, subject to change */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300380 struct drxj_cfg_atv_agc_status {
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300381 u16 rf_agc_gain; /* 0 .. 877 uA */
382 u16 if_agc_gain; /* 0 .. 877 uA */
383 s16 video_agc_gain; /* -75 .. 1972 in 0.1 dB steps */
384 s16 audio_agc_gain; /* -4 .. 1020 in 0.1 dB steps */
385 u16 rf_agc_loop_gain; /* 0 .. 7 */
386 u16 if_agc_loop_gain; /* 0 .. 7 */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300387 u16 video_agc_loop_gain; /* 0 .. 7 */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300388
389/*============================================================================*/
390/*============================================================================*/
391/*== CTRL related data structures ============================================*/
392/*============================================================================*/
393/*============================================================================*/
394
395/* NONE */
396
397/*============================================================================*/
398/*============================================================================*/
399
400/*========================================*/
401/**
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300402* /struct struct drxj_data * DRXJ specific attributes.
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300403*
404* Global data container for DRXJ specific data.
405*
406*/
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300407 struct drxj_data {
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300408 /* device capabilties (determined during drx_open()) */
409 bool has_lna; /**< true if LNA (aka PGA) present */
410 bool has_oob; /**< true if OOB supported */
411 bool has_ntsc; /**< true if NTSC supported */
412 bool has_btsc; /**< true if BTSC supported */
413 bool has_smatx; /**< true if mat_tx is available */
414 bool has_smarx; /**< true if mat_rx is available */
415 bool has_gpio; /**< true if GPIO is available */
416 bool has_irqn; /**< true if IRQN is available */
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300417 /* A1/A2/A... */
Mauro Carvalho Chehab43a431e2012-03-20 00:49:45 -0300418 u8 mfx; /**< metal fix */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300419
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300420 /* tuner settings */
Mauro Carvalho Chehabe33f21932014-01-17 06:47:04 -0300421 bool mirror_freq_spect_oob;/**< tuner inversion (true = tuner mirrors the signal */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300422
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300423 /* standard/channel settings */
Mauro Carvalho Chehab61263c72012-03-20 01:18:02 -0300424 enum drx_standard standard; /**< current standard information */
425 enum drx_modulation constellation;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300426 /**< current constellation */
Mauro Carvalho Chehab73f70652012-03-20 00:59:03 -0300427 s32 frequency; /**< center signal frequency in KHz */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300428 enum drx_bandwidth curr_bandwidth;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300429 /**< current channel bandwidth */
Mauro Carvalho Chehab61263c72012-03-20 01:18:02 -0300430 enum drx_mirror mirror; /**< current channel mirror */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300431
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300432 /* signal quality information */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300433 u32 fec_bits_desired; /**< BER accounting period */
434 u16 fec_vd_plen; /**< no of trellis symbols: VD SER measurement period */
435 u16 qam_vd_prescale; /**< Viterbi Measurement Prescale */
436 u16 qam_vd_period; /**< Viterbi Measurement period */
437 u16 fec_rs_plen; /**< defines RS BER measurement period */
438 u16 fec_rs_prescale; /**< ReedSolomon Measurement Prescale */
439 u16 fec_rs_period; /**< ReedSolomon Measurement period */
440 bool reset_pkt_err_acc; /**< Set a flag to reset accumulated packet error */
Mauro Carvalho Chehabe33f21932014-01-17 06:47:04 -0300441 u16 pkt_err_acc_start; /**< Set a flag to reset accumulated packet error */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300442
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300443 /* HI configuration */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300444 u16 hi_cfg_timing_div; /**< HI Configure() parameter 2 */
445 u16 hi_cfg_bridge_delay; /**< HI Configure() parameter 3 */
446 u16 hi_cfg_wake_up_key; /**< HI Configure() parameter 4 */
447 u16 hi_cfg_ctrl; /**< HI Configure() parameter 5 */
448 u16 hi_cfg_transmit; /**< HI Configure() parameter 6 */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300449
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300450 /* UIO configuartion */
Mauro Carvalho Chehab1bfc9e12014-01-16 12:51:36 -0300451 enum drxuio_mode uio_sma_rx_mode;/**< current mode of SmaRx pin */
452 enum drxuio_mode uio_sma_tx_mode;/**< current mode of SmaTx pin */
453 enum drxuio_mode uio_gpio_mode; /**< current mode of ASEL pin */
454 enum drxuio_mode uio_irqn_mode; /**< current mode of IRQN pin */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300455
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300456 /* IQM fs frequecy shift and inversion */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300457 u32 iqm_fs_rate_ofs; /**< frequency shifter setting after setchannel */
458 bool pos_image; /**< Ture: positive image */
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300459 /* IQM RC frequecy shift */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300460 u32 iqm_rc_rate_ofs; /**< frequency shifter setting after setchannel */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300461
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300462 /* ATV configuartion */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300463 u32 atv_cfg_changed_flags; /**< flag: flags cfg changes */
464 s16 atv_top_equ0[DRXJ_COEF_IDX_MAX]; /**< shadow of ATV_TOP_EQU0__A */
465 s16 atv_top_equ1[DRXJ_COEF_IDX_MAX]; /**< shadow of ATV_TOP_EQU1__A */
466 s16 atv_top_equ2[DRXJ_COEF_IDX_MAX]; /**< shadow of ATV_TOP_EQU2__A */
467 s16 atv_top_equ3[DRXJ_COEF_IDX_MAX]; /**< shadow of ATV_TOP_EQU3__A */
468 bool phase_correction_bypass;/**< flag: true=bypass */
469 s16 atv_top_vid_peak; /**< shadow of ATV_TOP_VID_PEAK__A */
470 u16 atv_top_noise_th; /**< shadow of ATV_TOP_NOISE_TH__A */
471 bool enable_cvbs_output; /**< flag CVBS ouput enable */
472 bool enable_sif_output; /**< flag SIF ouput enable */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300473 enum drxjsif_attenuation sif_attenuation;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300474 /**< current SIF att setting */
475 /* Agc configuration for QAM and VSB */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300476 struct drxj_cfg_agc qam_rf_agc_cfg; /**< qam RF AGC config */
477 struct drxj_cfg_agc qam_if_agc_cfg; /**< qam IF AGC config */
478 struct drxj_cfg_agc vsb_rf_agc_cfg; /**< vsb RF AGC config */
479 struct drxj_cfg_agc vsb_if_agc_cfg; /**< vsb IF AGC config */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300480
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300481 /* PGA gain configuration for QAM and VSB */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300482 u16 qam_pga_cfg; /**< qam PGA config */
483 u16 vsb_pga_cfg; /**< vsb PGA config */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300484
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300485 /* Pre SAW configuration for QAM and VSB */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300486 struct drxj_cfg_pre_saw qam_pre_saw_cfg;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300487 /**< qam pre SAW config */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300488 struct drxj_cfg_pre_saw vsb_pre_saw_cfg;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300489 /**< qam pre SAW config */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300490
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300491 /* Version information */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300492 char v_text[2][12]; /**< allocated text versions */
Mauro Carvalho Chehab1bfc9e12014-01-16 12:51:36 -0300493 struct drx_version v_version[2]; /**< allocated versions structs */
494 struct drx_version_list v_list_elements[2];
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300495 /**< allocated version list */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300496
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300497 /* smart antenna configuration */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300498 bool smart_ant_inverted;
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300499
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300500 /* Tracking filter setting for OOB */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300501 u16 oob_trk_filter_cfg[8];
502 bool oob_power_on;
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300503
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300504 /* MPEG static bitrate setting */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300505 u32 mpeg_ts_static_bitrate; /**< bitrate static MPEG output */
506 bool disable_te_ihandling; /**< MPEG TS TEI handling */
507 bool bit_reverse_mpeg_outout;/**< MPEG output bit order */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300508 enum drxj_mpeg_output_clock_rate mpeg_output_clock_rate;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300509 /**< MPEG output clock rate */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300510 enum drxj_mpeg_start_width mpeg_start_width;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300511 /**< MPEG Start width */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300512
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300513 /* Pre SAW & Agc configuration for ATV */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300514 struct drxj_cfg_pre_saw atv_pre_saw_cfg;
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300515 /**< atv pre SAW config */
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300516 struct drxj_cfg_agc atv_rf_agc_cfg; /**< atv RF AGC config */
517 struct drxj_cfg_agc atv_if_agc_cfg; /**< atv IF AGC config */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300518 u16 atv_pga_cfg; /**< atv pga config */
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300519
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300520 u32 curr_symbol_rate;
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300521
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300522 /* pin-safe mode */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300523 bool pdr_safe_mode; /**< PDR safe mode activated */
524 u16 pdr_safe_restore_val_gpio;
525 u16 pdr_safe_restore_val_v_sync;
526 u16 pdr_safe_restore_val_sma_rx;
527 u16 pdr_safe_restore_val_sma_tx;
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300528
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300529 /* OOB pre-saw value */
Mauro Carvalho Chehab57afe2f2014-01-16 11:24:57 -0300530 u16 oob_pre_saw;
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300531 enum drxj_cfg_oob_lo_power oob_lo_pow;
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300532
Mauro Carvalho Chehab1bfc9e12014-01-16 12:51:36 -0300533 struct drx_aud_data aud_data;
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300534 /**< audio storage */};
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300535
536/*-------------------------------------------------------------------------
537Access MACROS
538-------------------------------------------------------------------------*/
539/**
540* \brief Compilable references to attributes
541* \param d pointer to demod instance
542*
543* Used as main reference to an attribute field.
544* Can be used by both macro implementation and function implementation.
545* These macros are defined to avoid duplication of code in macro and function
546* definitions that handle access of demod common or extended attributes.
547*
548*/
549
Mauro Carvalho Chehab7ef66752014-01-16 11:08:15 -0300550#define DRXJ_ATTR_BTSC_DETECT(d) \
Mauro Carvalho Chehabb3ce3a82014-01-16 15:33:14 -0300551 (((struct drxj_data *)(d)->my_ext_attr)->aud_data.btsc_detect)
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300552
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300553/*-------------------------------------------------------------------------
554DEFINES
555-------------------------------------------------------------------------*/
556
557/**
558* \def DRXJ_NTSC_CARRIER_FREQ_OFFSET
559* \brief Offset from picture carrier to centre frequency in kHz, in RF domain
560*
561* For NTSC standard.
562* NTSC channels are listed by their picture carrier frequency (Fpc).
563* The function DRX_CTRL_SET_CHANNEL requires the centre frequency as input.
564* In case the tuner module is not used the DRX-J requires that the tuner is
565* tuned to the centre frequency of the channel:
566*
567* Fcentre = Fpc + DRXJ_NTSC_CARRIER_FREQ_OFFSET
568*
569*/
Mauro Carvalho Chehab73f70652012-03-20 00:59:03 -0300570#define DRXJ_NTSC_CARRIER_FREQ_OFFSET ((s32)(1750))
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300571
572/**
573* \def DRXJ_PAL_SECAM_BG_CARRIER_FREQ_OFFSET
574* \brief Offset from picture carrier to centre frequency in kHz, in RF domain
575*
576* For PAL/SECAM - BG standard. This define is needed in case the tuner module
577* is NOT used. PAL/SECAM channels are listed by their picture carrier frequency (Fpc).
578* The DRX-J requires that the tuner is tuned to:
579* Fpc + DRXJ_PAL_SECAM_BG_CARRIER_FREQ_OFFSET
580*
581* In case the tuner module is used the drxdriver takes care of this.
582* In case the tuner module is NOT used the application programmer must take
583* care of this.
584*
585*/
Mauro Carvalho Chehab73f70652012-03-20 00:59:03 -0300586#define DRXJ_PAL_SECAM_BG_CARRIER_FREQ_OFFSET ((s32)(2375))
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300587
588/**
589* \def DRXJ_PAL_SECAM_DKIL_CARRIER_FREQ_OFFSET
590* \brief Offset from picture carrier to centre frequency in kHz, in RF domain
591*
592* For PAL/SECAM - DK, I, L standards. This define is needed in case the tuner module
593* is NOT used. PAL/SECAM channels are listed by their picture carrier frequency (Fpc).
594* The DRX-J requires that the tuner is tuned to:
595* Fpc + DRXJ_PAL_SECAM_DKIL_CARRIER_FREQ_OFFSET
596*
597* In case the tuner module is used the drxdriver takes care of this.
598* In case the tuner module is NOT used the application programmer must take
599* care of this.
600*
601*/
Mauro Carvalho Chehab73f70652012-03-20 00:59:03 -0300602#define DRXJ_PAL_SECAM_DKIL_CARRIER_FREQ_OFFSET ((s32)(2775))
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300603
604/**
605* \def DRXJ_PAL_SECAM_LP_CARRIER_FREQ_OFFSET
606* \brief Offset from picture carrier to centre frequency in kHz, in RF domain
607*
608* For PAL/SECAM - LP standard. This define is needed in case the tuner module
609* is NOT used. PAL/SECAM channels are listed by their picture carrier frequency (Fpc).
610* The DRX-J requires that the tuner is tuned to:
611* Fpc + DRXJ_PAL_SECAM_LP_CARRIER_FREQ_OFFSET
612*
613* In case the tuner module is used the drxdriver takes care of this.
614* In case the tuner module is NOT used the application programmer must take
615* care of this.
616*/
Mauro Carvalho Chehab73f70652012-03-20 00:59:03 -0300617#define DRXJ_PAL_SECAM_LP_CARRIER_FREQ_OFFSET ((s32)(-3255))
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300618
619/**
620* \def DRXJ_FM_CARRIER_FREQ_OFFSET
621* \brief Offset from sound carrier to centre frequency in kHz, in RF domain
622*
623* For FM standard.
624* FM channels are listed by their sound carrier frequency (Fsc).
625* The function DRX_CTRL_SET_CHANNEL requires the Ffm frequency (see below) as
626* input.
627* In case the tuner module is not used the DRX-J requires that the tuner is
628* tuned to the Ffm frequency of the channel.
629*
630* Ffm = Fsc + DRXJ_FM_CARRIER_FREQ_OFFSET
631*
632*/
Mauro Carvalho Chehab73f70652012-03-20 00:59:03 -0300633#define DRXJ_FM_CARRIER_FREQ_OFFSET ((s32)(-3000))
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300634
635/* Revision types -------------------------------------------------------*/
636
637#define DRXJ_TYPE_ID (0x3946000DUL)
638
639/* Macros ---------------------------------------------------------------*/
640
641/* Convert OOB lock status to string */
642#define DRXJ_STR_OOB_LOCKSTATUS(x) ( \
Mauro Carvalho Chehab2f1f7332014-01-17 11:51:52 -0300643 (x == DRX_NEVER_LOCK) ? "Never" : \
644 (x == DRX_NOT_LOCKED) ? "No" : \
645 (x == DRX_LOCKED) ? "Locked" : \
646 (x == DRX_LOCK_STATE_1) ? "AGC lock" : \
647 (x == DRX_LOCK_STATE_2) ? "sync lock" : \
648 "(Invalid)")
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300649
Mauro Carvalho Chehab443f18d2012-03-20 00:00:42 -0300650#endif /* __DRXJ_H__ */