1b3ce3a83SMauro Carvalho Chehab 2ca3355a9SDevin Heitmueller /* 3ca3355a9SDevin Heitmueller Copyright (c), 2004-2005,2007-2010 Trident Microsystems, Inc. 4ca3355a9SDevin Heitmueller All rights reserved. 5ca3355a9SDevin Heitmueller 6ca3355a9SDevin Heitmueller Redistribution and use in source and binary forms, with or without 7ca3355a9SDevin Heitmueller modification, are permitted provided that the following conditions are met: 8ca3355a9SDevin Heitmueller 9ca3355a9SDevin Heitmueller * Redistributions of source code must retain the above copyright notice, 10ca3355a9SDevin Heitmueller this list of conditions and the following disclaimer. 11ca3355a9SDevin Heitmueller * Redistributions in binary form must reproduce the above copyright notice, 12ca3355a9SDevin Heitmueller this list of conditions and the following disclaimer in the documentation 13ca3355a9SDevin Heitmueller and/or other materials provided with the distribution. 14ca3355a9SDevin Heitmueller * Neither the name of Trident Microsystems nor Hauppauge Computer Works 15ca3355a9SDevin Heitmueller nor the names of its contributors may be used to endorse or promote 16ca3355a9SDevin Heitmueller products derived from this software without specific prior written 17ca3355a9SDevin Heitmueller permission. 18ca3355a9SDevin Heitmueller 19ca3355a9SDevin Heitmueller THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20ca3355a9SDevin Heitmueller AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21ca3355a9SDevin Heitmueller IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22ca3355a9SDevin Heitmueller ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23ca3355a9SDevin Heitmueller LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24ca3355a9SDevin Heitmueller CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25ca3355a9SDevin Heitmueller SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26ca3355a9SDevin Heitmueller INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27ca3355a9SDevin Heitmueller CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28ca3355a9SDevin Heitmueller ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29ca3355a9SDevin Heitmueller POSSIBILITY OF SUCH DAMAGE. 30ca3355a9SDevin Heitmueller 312f1f7333SMauro Carvalho Chehab DRXJ specific header file 322f1f7333SMauro Carvalho Chehab 332f1f7333SMauro Carvalho Chehab Authors: Dragan Savic, Milos Nikolic, Mihajlo Katona, Tao Ding, Paul Janssen 3438b2df95SDevin Heitmueller */ 3538b2df95SDevin Heitmueller 3638b2df95SDevin Heitmueller #ifndef __DRXJ_H__ 3738b2df95SDevin Heitmueller #define __DRXJ_H__ 3838b2df95SDevin Heitmueller /*------------------------------------------------------------------------- 3938b2df95SDevin Heitmueller INCLUDES 4038b2df95SDevin Heitmueller -------------------------------------------------------------------------*/ 4138b2df95SDevin Heitmueller 4238b2df95SDevin Heitmueller #include "drx_driver.h" 4338b2df95SDevin Heitmueller #include "drx_dap_fasi.h" 4438b2df95SDevin Heitmueller 4538b2df95SDevin Heitmueller /* Check DRX-J specific dap condition */ 4638b2df95SDevin Heitmueller /* Multi master mode and short addr format only will not work. 4738b2df95SDevin Heitmueller RMW, CRC reset, broadcast and switching back to single master mode 4838b2df95SDevin Heitmueller cannot be done with short addr only in multi master mode. */ 4938b2df95SDevin Heitmueller #if ((DRXDAP_SINGLE_MASTER == 0) && (DRXDAPFASI_LONG_ADDR_ALLOWED == 0)) 5038b2df95SDevin Heitmueller #error "Multi master mode and short addressing only is an illegal combination" 5138b2df95SDevin Heitmueller *; /* Generate a fatal compiler error to make sure it stops here, 5238b2df95SDevin Heitmueller this is necesarry because not all compilers stop after a #error. */ 5338b2df95SDevin Heitmueller #endif 5438b2df95SDevin Heitmueller 5538b2df95SDevin Heitmueller /*------------------------------------------------------------------------- 5638b2df95SDevin Heitmueller TYPEDEFS 5738b2df95SDevin Heitmueller -------------------------------------------------------------------------*/ 5838b2df95SDevin Heitmueller /*============================================================================*/ 5938b2df95SDevin Heitmueller /*============================================================================*/ 6038b2df95SDevin Heitmueller /*== code support ============================================================*/ 6138b2df95SDevin Heitmueller /*============================================================================*/ 6238b2df95SDevin Heitmueller /*============================================================================*/ 6338b2df95SDevin Heitmueller 6438b2df95SDevin Heitmueller /*============================================================================*/ 6538b2df95SDevin Heitmueller /*============================================================================*/ 6638b2df95SDevin Heitmueller /*== SCU cmd if =============================================================*/ 6738b2df95SDevin Heitmueller /*============================================================================*/ 6838b2df95SDevin Heitmueller /*============================================================================*/ 6938b2df95SDevin Heitmueller 70b3ce3a83SMauro Carvalho Chehab struct drxjscu_cmd { 7143a431e4SMauro Carvalho Chehab u16 command; 72*b95b0c98SMauro Carvalho Chehab /*< Command number */ 7357afe2f0SMauro Carvalho Chehab u16 parameter_len; 74*b95b0c98SMauro Carvalho Chehab /*< Data length in byte */ 7557afe2f0SMauro Carvalho Chehab u16 result_len; 76*b95b0c98SMauro Carvalho Chehab /*< result length in byte */ 7743a431e4SMauro Carvalho Chehab u16 *parameter; 78*b95b0c98SMauro Carvalho Chehab /*< General purpous param */ 7943a431e4SMauro Carvalho Chehab u16 *result; 80*b95b0c98SMauro Carvalho Chehab /*< General purpous param */}; 8138b2df95SDevin Heitmueller 8238b2df95SDevin Heitmueller /*============================================================================*/ 8338b2df95SDevin Heitmueller /*============================================================================*/ 8438b2df95SDevin Heitmueller /*== CTRL CFG related data structures ========================================*/ 8538b2df95SDevin Heitmueller /*============================================================================*/ 8638b2df95SDevin Heitmueller /*============================================================================*/ 8738b2df95SDevin Heitmueller 8838b2df95SDevin Heitmueller /* extra intermediate lock state for VSB,QAM,NTSC */ 8938b2df95SDevin Heitmueller #define DRXJ_DEMOD_LOCK (DRX_LOCK_STATE_1) 9038b2df95SDevin Heitmueller 9138b2df95SDevin Heitmueller /* OOB lock states */ 9238b2df95SDevin Heitmueller #define DRXJ_OOB_AGC_LOCK (DRX_LOCK_STATE_1) /* analog gain control lock */ 9338b2df95SDevin Heitmueller #define DRXJ_OOB_SYNC_LOCK (DRX_LOCK_STATE_2) /* digital gain control lock */ 9438b2df95SDevin Heitmueller 9538b2df95SDevin Heitmueller /* Intermediate powermodes for DRXJ */ 9638b2df95SDevin Heitmueller #define DRXJ_POWER_DOWN_MAIN_PATH DRX_POWER_MODE_8 9738b2df95SDevin Heitmueller #define DRXJ_POWER_DOWN_CORE DRX_POWER_MODE_9 9838b2df95SDevin Heitmueller #define DRXJ_POWER_DOWN_PLL DRX_POWER_MODE_10 9938b2df95SDevin Heitmueller 10038b2df95SDevin Heitmueller /* supstition for GPIO FNC mux */ 10138b2df95SDevin Heitmueller #define APP_O (0x0000) 10238b2df95SDevin Heitmueller 10338b2df95SDevin Heitmueller /*#define DRX_CTRL_BASE (0x0000)*/ 10438b2df95SDevin Heitmueller 10538b2df95SDevin Heitmueller #define DRXJ_CTRL_CFG_BASE (0x1000) 106b3ce3a83SMauro Carvalho Chehab enum drxj_cfg_type { 10738b2df95SDevin Heitmueller DRXJ_CFG_AGC_RF = DRXJ_CTRL_CFG_BASE, 10838b2df95SDevin Heitmueller DRXJ_CFG_AGC_IF, 10938b2df95SDevin Heitmueller DRXJ_CFG_AGC_INTERNAL, 11038b2df95SDevin Heitmueller DRXJ_CFG_PRE_SAW, 11138b2df95SDevin Heitmueller DRXJ_CFG_AFE_GAIN, 11238b2df95SDevin Heitmueller DRXJ_CFG_SYMBOL_CLK_OFFSET, 11338b2df95SDevin Heitmueller DRXJ_CFG_ACCUM_CR_RS_CW_ERR, 11438b2df95SDevin Heitmueller DRXJ_CFG_FEC_MERS_SEQ_COUNT, 11538b2df95SDevin Heitmueller DRXJ_CFG_OOB_MISC, 11638b2df95SDevin Heitmueller DRXJ_CFG_SMART_ANT, 11738b2df95SDevin Heitmueller DRXJ_CFG_OOB_PRE_SAW, 11838b2df95SDevin Heitmueller DRXJ_CFG_VSB_MISC, 11938b2df95SDevin Heitmueller DRXJ_CFG_RESET_PACKET_ERR, 12038b2df95SDevin Heitmueller 12138b2df95SDevin Heitmueller /* ATV (FM) */ 12238b2df95SDevin Heitmueller DRXJ_CFG_ATV_OUTPUT, /* also for FM (SIF control) but not likely */ 12338b2df95SDevin Heitmueller DRXJ_CFG_ATV_MISC, 12438b2df95SDevin Heitmueller DRXJ_CFG_ATV_EQU_COEF, 12538b2df95SDevin Heitmueller DRXJ_CFG_ATV_AGC_STATUS, /* also for FM ( IF,RF, audioAGC ) */ 12638b2df95SDevin Heitmueller 12738b2df95SDevin Heitmueller DRXJ_CFG_MPEG_OUTPUT_MISC, 12838b2df95SDevin Heitmueller DRXJ_CFG_HW_CFG, 12938b2df95SDevin Heitmueller DRXJ_CFG_OOB_LO_POW, 13038b2df95SDevin Heitmueller 131b3ce3a83SMauro Carvalho Chehab DRXJ_CFG_MAX /* dummy, never to be used */}; 13238b2df95SDevin Heitmueller 133*b95b0c98SMauro Carvalho Chehab /* 134b3ce3a83SMauro Carvalho Chehab * /struct enum drxj_cfg_smart_ant_io * smart antenna i/o. 13538b2df95SDevin Heitmueller */ 136b3ce3a83SMauro Carvalho Chehab enum drxj_cfg_smart_ant_io { 13738b2df95SDevin Heitmueller DRXJ_SMT_ANT_OUTPUT = 0, 13838b2df95SDevin Heitmueller DRXJ_SMT_ANT_INPUT 139b3ce3a83SMauro Carvalho Chehab }; 14038b2df95SDevin Heitmueller 141*b95b0c98SMauro Carvalho Chehab /* 142b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_cfg_smart_ant * Set smart antenna. 14338b2df95SDevin Heitmueller */ 144b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_smart_ant { 145b3ce3a83SMauro Carvalho Chehab enum drxj_cfg_smart_ant_io io; 14657afe2f0SMauro Carvalho Chehab u16 ctrl_data; 147b3ce3a83SMauro Carvalho Chehab }; 14838b2df95SDevin Heitmueller 149*b95b0c98SMauro Carvalho Chehab /* 15038b2df95SDevin Heitmueller * /struct DRXJAGCSTATUS_t 15138b2df95SDevin Heitmueller * AGC status information from the DRXJ-IQM-AF. 15238b2df95SDevin Heitmueller */ 153b3ce3a83SMauro Carvalho Chehab struct drxj_agc_status { 15443a431e4SMauro Carvalho Chehab u16 IFAGC; 15543a431e4SMauro Carvalho Chehab u16 RFAGC; 15657afe2f0SMauro Carvalho Chehab u16 digital_agc; 157b3ce3a83SMauro Carvalho Chehab }; 15838b2df95SDevin Heitmueller 15938b2df95SDevin Heitmueller /* DRXJ_CFG_AGC_RF, DRXJ_CFG_AGC_IF */ 16038b2df95SDevin Heitmueller 161*b95b0c98SMauro Carvalho Chehab /* 162b3ce3a83SMauro Carvalho Chehab * /struct enum drxj_agc_ctrl_mode * Available AGCs modes in the DRXJ. 16338b2df95SDevin Heitmueller */ 164b3ce3a83SMauro Carvalho Chehab enum drxj_agc_ctrl_mode { 16538b2df95SDevin Heitmueller DRX_AGC_CTRL_AUTO = 0, 16638b2df95SDevin Heitmueller DRX_AGC_CTRL_USER, 167b3ce3a83SMauro Carvalho Chehab DRX_AGC_CTRL_OFF}; 16838b2df95SDevin Heitmueller 169*b95b0c98SMauro Carvalho Chehab /* 170b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_cfg_agc * Generic interface for all AGCs present on the DRXJ. 17138b2df95SDevin Heitmueller */ 172b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_agc { 17361263c75SMauro Carvalho Chehab enum drx_standard standard; /* standard for which these settings apply */ 174b3ce3a83SMauro Carvalho Chehab enum drxj_agc_ctrl_mode ctrl_mode; /* off, user, auto */ 17557afe2f0SMauro Carvalho Chehab u16 output_level; /* range dependent on AGC */ 17657afe2f0SMauro Carvalho Chehab u16 min_output_level; /* range dependent on AGC */ 17757afe2f0SMauro Carvalho Chehab u16 max_output_level; /* range dependent on AGC */ 17843a431e4SMauro Carvalho Chehab u16 speed; /* range dependent on AGC */ 17943a431e4SMauro Carvalho Chehab u16 top; /* rf-agc take over point */ 18057afe2f0SMauro Carvalho Chehab u16 cut_off_current; /* rf-agc is accelerated if output current 181b3ce3a83SMauro Carvalho Chehab is below cut-off current */}; 18238b2df95SDevin Heitmueller 18338b2df95SDevin Heitmueller /* DRXJ_CFG_PRE_SAW */ 18438b2df95SDevin Heitmueller 185*b95b0c98SMauro Carvalho Chehab /* 186b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_cfg_pre_saw * Interface to configure pre SAW sense. 18738b2df95SDevin Heitmueller */ 188b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_pre_saw { 18961263c75SMauro Carvalho Chehab enum drx_standard standard; /* standard to which these settings apply */ 19043a431e4SMauro Carvalho Chehab u16 reference; /* pre SAW reference value, range 0 .. 31 */ 191b3ce3a83SMauro Carvalho Chehab bool use_pre_saw; /* true algorithms must use pre SAW sense */}; 19238b2df95SDevin Heitmueller 19338b2df95SDevin Heitmueller /* DRXJ_CFG_AFE_GAIN */ 19438b2df95SDevin Heitmueller 195*b95b0c98SMauro Carvalho Chehab /* 196b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_cfg_afe_gain * Interface to configure gain of AFE (LNA + PGA). 19738b2df95SDevin Heitmueller */ 198b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_afe_gain { 19961263c75SMauro Carvalho Chehab enum drx_standard standard; /* standard to which these settings apply */ 200b3ce3a83SMauro Carvalho Chehab u16 gain; /* gain in 0.1 dB steps, DRXJ range 140 .. 335 */}; 20138b2df95SDevin Heitmueller 202*b95b0c98SMauro Carvalho Chehab /* 203b3ce3a83SMauro Carvalho Chehab * /struct drxjrs_errors 20438b2df95SDevin Heitmueller * Available failure information in DRXJ_FEC_RS. 20538b2df95SDevin Heitmueller * 20638b2df95SDevin Heitmueller * Container for errors that are received in the most recently finished measurment period 20738b2df95SDevin Heitmueller * 20838b2df95SDevin Heitmueller */ 209b3ce3a83SMauro Carvalho Chehab struct drxjrs_errors { 21057afe2f0SMauro Carvalho Chehab u16 nr_bit_errors; 211*b95b0c98SMauro Carvalho Chehab /*< no of pre RS bit errors */ 21257afe2f0SMauro Carvalho Chehab u16 nr_symbol_errors; 213*b95b0c98SMauro Carvalho Chehab /*< no of pre RS symbol errors */ 21457afe2f0SMauro Carvalho Chehab u16 nr_packet_errors; 215*b95b0c98SMauro Carvalho Chehab /*< no of pre RS packet errors */ 21657afe2f0SMauro Carvalho Chehab u16 nr_failures; 217*b95b0c98SMauro Carvalho Chehab /*< no of post RS failures to decode */ 21857afe2f0SMauro Carvalho Chehab u16 nr_snc_par_fail_count; 219*b95b0c98SMauro Carvalho Chehab /*< no of post RS bit erros */ 220b3ce3a83SMauro Carvalho Chehab }; 22138b2df95SDevin Heitmueller 222*b95b0c98SMauro Carvalho Chehab /* 223b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_cfg_vsb_misc * symbol error rate 22438b2df95SDevin Heitmueller */ 225b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_vsb_misc { 22657afe2f0SMauro Carvalho Chehab u32 symb_error; 227*b95b0c98SMauro Carvalho Chehab /*< symbol error rate sps */}; 22838b2df95SDevin Heitmueller 229*b95b0c98SMauro Carvalho Chehab /* 230b3ce3a83SMauro Carvalho Chehab * /enum enum drxj_mpeg_output_clock_rate * Mpeg output clock rate. 23138b2df95SDevin Heitmueller * 23238b2df95SDevin Heitmueller */ 233b3ce3a83SMauro Carvalho Chehab enum drxj_mpeg_start_width { 23438b2df95SDevin Heitmueller DRXJ_MPEG_START_WIDTH_1CLKCYC, 235b3ce3a83SMauro Carvalho Chehab DRXJ_MPEG_START_WIDTH_8CLKCYC}; 23638b2df95SDevin Heitmueller 237*b95b0c98SMauro Carvalho Chehab /* 238b3ce3a83SMauro Carvalho Chehab * /enum enum drxj_mpeg_output_clock_rate * Mpeg output clock rate. 23938b2df95SDevin Heitmueller * 24038b2df95SDevin Heitmueller */ 241b3ce3a83SMauro Carvalho Chehab enum drxj_mpeg_output_clock_rate { 24238b2df95SDevin Heitmueller DRXJ_MPEGOUTPUT_CLOCK_RATE_AUTO, 24338b2df95SDevin Heitmueller DRXJ_MPEGOUTPUT_CLOCK_RATE_75973K, 24438b2df95SDevin Heitmueller DRXJ_MPEGOUTPUT_CLOCK_RATE_50625K, 24538b2df95SDevin Heitmueller DRXJ_MPEGOUTPUT_CLOCK_RATE_37968K, 24638b2df95SDevin Heitmueller DRXJ_MPEGOUTPUT_CLOCK_RATE_30375K, 24738b2df95SDevin Heitmueller DRXJ_MPEGOUTPUT_CLOCK_RATE_25313K, 248b3ce3a83SMauro Carvalho Chehab DRXJ_MPEGOUTPUT_CLOCK_RATE_21696K}; 24938b2df95SDevin Heitmueller 250*b95b0c98SMauro Carvalho Chehab /* 25138b2df95SDevin Heitmueller * /struct DRXJCfgMisc_t 25238b2df95SDevin Heitmueller * Change TEI bit of MPEG output 25338b2df95SDevin Heitmueller * reverse MPEG output bit order 25438b2df95SDevin Heitmueller * set MPEG output clock rate 25538b2df95SDevin Heitmueller */ 256b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_mpeg_output_misc { 257*b95b0c98SMauro Carvalho Chehab bool disable_tei_handling; /*< if true pass (not change) TEI bit */ 258*b95b0c98SMauro Carvalho Chehab bool bit_reverse_mpeg_outout; /*< if true, parallel: msb on MD0; serial: lsb out first */ 259b3ce3a83SMauro Carvalho Chehab enum drxj_mpeg_output_clock_rate mpeg_output_clock_rate; 260*b95b0c98SMauro Carvalho Chehab /*< set MPEG output clock rate that overwirtes the derived one from symbol rate */ 261*b95b0c98SMauro Carvalho Chehab enum drxj_mpeg_start_width mpeg_start_width; /*< set MPEG output start width */}; 26238b2df95SDevin Heitmueller 263*b95b0c98SMauro Carvalho Chehab /* 264b3ce3a83SMauro Carvalho Chehab * /enum enum drxj_xtal_freq * Supported external crystal reference frequency. 26538b2df95SDevin Heitmueller */ 266b3ce3a83SMauro Carvalho Chehab enum drxj_xtal_freq { 26738b2df95SDevin Heitmueller DRXJ_XTAL_FREQ_RSVD, 26838b2df95SDevin Heitmueller DRXJ_XTAL_FREQ_27MHZ, 26938b2df95SDevin Heitmueller DRXJ_XTAL_FREQ_20P25MHZ, 270b3ce3a83SMauro Carvalho Chehab DRXJ_XTAL_FREQ_4MHZ}; 27138b2df95SDevin Heitmueller 272*b95b0c98SMauro Carvalho Chehab /* 273b3ce3a83SMauro Carvalho Chehab * /enum enum drxj_xtal_freq * Supported external crystal reference frequency. 27438b2df95SDevin Heitmueller */ 275b3ce3a83SMauro Carvalho Chehab enum drxji2c_speed { 27638b2df95SDevin Heitmueller DRXJ_I2C_SPEED_400KBPS, 277b3ce3a83SMauro Carvalho Chehab DRXJ_I2C_SPEED_100KBPS}; 27838b2df95SDevin Heitmueller 279*b95b0c98SMauro Carvalho Chehab /* 280b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_cfg_hw_cfg * Get hw configuration, such as crystal reference frequency, I2C speed, etc... 28138b2df95SDevin Heitmueller */ 282b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_hw_cfg { 283b3ce3a83SMauro Carvalho Chehab enum drxj_xtal_freq xtal_freq; 284*b95b0c98SMauro Carvalho Chehab /*< crystal reference frequency */ 285b3ce3a83SMauro Carvalho Chehab enum drxji2c_speed i2c_speed; 286*b95b0c98SMauro Carvalho Chehab /*< 100 or 400 kbps */}; 28738b2df95SDevin Heitmueller 28838b2df95SDevin Heitmueller /* 28938b2df95SDevin Heitmueller * DRXJ_CFG_ATV_MISC 29038b2df95SDevin Heitmueller */ 291b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_atv_misc { 29257afe2f0SMauro Carvalho Chehab s16 peak_filter; /* -8 .. 15 */ 293b3ce3a83SMauro Carvalho Chehab u16 noise_filter; /* 0 .. 15 */}; 29438b2df95SDevin Heitmueller 29538b2df95SDevin Heitmueller /* 296b3ce3a83SMauro Carvalho Chehab * struct drxj_cfg_oob_misc */ 29738b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_RESET 0x0 29838b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_AGN_HUNT 0x1 29938b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_DGN_HUNT 0x2 30038b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_AGC_HUNT 0x3 30138b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_FRQ_HUNT 0x4 30238b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_PHA_HUNT 0x8 30338b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_TIM_HUNT 0x10 30438b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_EQU_HUNT 0x20 30538b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_EQT_HUNT 0x30 30638b2df95SDevin Heitmueller #define DRXJ_OOB_STATE_SYNC 0x40 30738b2df95SDevin Heitmueller 308b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_oob_misc { 309b3ce3a83SMauro Carvalho Chehab struct drxj_agc_status agc; 31057afe2f0SMauro Carvalho Chehab bool eq_lock; 31157afe2f0SMauro Carvalho Chehab bool sym_timing_lock; 31257afe2f0SMauro Carvalho Chehab bool phase_lock; 31357afe2f0SMauro Carvalho Chehab bool freq_lock; 31457afe2f0SMauro Carvalho Chehab bool dig_gain_lock; 31557afe2f0SMauro Carvalho Chehab bool ana_gain_lock; 31643a431e4SMauro Carvalho Chehab u8 state; 317b3ce3a83SMauro Carvalho Chehab }; 31838b2df95SDevin Heitmueller 31938b2df95SDevin Heitmueller /* 32038b2df95SDevin Heitmueller * Index of in array of coef 32138b2df95SDevin Heitmueller */ 322b3ce3a83SMauro Carvalho Chehab enum drxj_cfg_oob_lo_power { 32338b2df95SDevin Heitmueller DRXJ_OOB_LO_POW_MINUS0DB = 0, 32438b2df95SDevin Heitmueller DRXJ_OOB_LO_POW_MINUS5DB, 32538b2df95SDevin Heitmueller DRXJ_OOB_LO_POW_MINUS10DB, 32638b2df95SDevin Heitmueller DRXJ_OOB_LO_POW_MINUS15DB, 327b3ce3a83SMauro Carvalho Chehab DRXJ_OOB_LO_POW_MAX}; 32838b2df95SDevin Heitmueller 32938b2df95SDevin Heitmueller /* 33038b2df95SDevin Heitmueller * DRXJ_CFG_ATV_EQU_COEF 33138b2df95SDevin Heitmueller */ 332b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_atv_equ_coef { 33343a431e4SMauro Carvalho Chehab s16 coef0; /* -256 .. 255 */ 33443a431e4SMauro Carvalho Chehab s16 coef1; /* -256 .. 255 */ 33543a431e4SMauro Carvalho Chehab s16 coef2; /* -256 .. 255 */ 336b3ce3a83SMauro Carvalho Chehab s16 coef3; /* -256 .. 255 */}; 33738b2df95SDevin Heitmueller 33838b2df95SDevin Heitmueller /* 33938b2df95SDevin Heitmueller * Index of in array of coef 34038b2df95SDevin Heitmueller */ 341b3ce3a83SMauro Carvalho Chehab enum drxj_coef_array_index { 34238b2df95SDevin Heitmueller DRXJ_COEF_IDX_MN = 0, 34338b2df95SDevin Heitmueller DRXJ_COEF_IDX_FM, 34438b2df95SDevin Heitmueller DRXJ_COEF_IDX_L, 34538b2df95SDevin Heitmueller DRXJ_COEF_IDX_LP, 34638b2df95SDevin Heitmueller DRXJ_COEF_IDX_BG, 34738b2df95SDevin Heitmueller DRXJ_COEF_IDX_DK, 34838b2df95SDevin Heitmueller DRXJ_COEF_IDX_I, 349b3ce3a83SMauro Carvalho Chehab DRXJ_COEF_IDX_MAX}; 35038b2df95SDevin Heitmueller 35138b2df95SDevin Heitmueller /* 35238b2df95SDevin Heitmueller * DRXJ_CFG_ATV_OUTPUT 35338b2df95SDevin Heitmueller */ 35438b2df95SDevin Heitmueller 355*b95b0c98SMauro Carvalho Chehab /* 35638b2df95SDevin Heitmueller * /enum DRXJAttenuation_t 35738b2df95SDevin Heitmueller * Attenuation setting for SIF AGC. 35838b2df95SDevin Heitmueller * 35938b2df95SDevin Heitmueller */ 360b3ce3a83SMauro Carvalho Chehab enum drxjsif_attenuation { 36138b2df95SDevin Heitmueller DRXJ_SIF_ATTENUATION_0DB, 36238b2df95SDevin Heitmueller DRXJ_SIF_ATTENUATION_3DB, 36338b2df95SDevin Heitmueller DRXJ_SIF_ATTENUATION_6DB, 364b3ce3a83SMauro Carvalho Chehab DRXJ_SIF_ATTENUATION_9DB}; 36538b2df95SDevin Heitmueller 366*b95b0c98SMauro Carvalho Chehab /* 367b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_cfg_atv_output * SIF attenuation setting. 36838b2df95SDevin Heitmueller * 36938b2df95SDevin Heitmueller */ 370b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_atv_output { 37157afe2f0SMauro Carvalho Chehab bool enable_cvbs_output; /* true= enabled */ 37257afe2f0SMauro Carvalho Chehab bool enable_sif_output; /* true= enabled */ 373b3ce3a83SMauro Carvalho Chehab enum drxjsif_attenuation sif_attenuation; 374b3ce3a83SMauro Carvalho Chehab }; 37538b2df95SDevin Heitmueller 37638b2df95SDevin Heitmueller /* 37738b2df95SDevin Heitmueller DRXJ_CFG_ATV_AGC_STATUS (get only) 37838b2df95SDevin Heitmueller */ 37938b2df95SDevin Heitmueller /* TODO : AFE interface not yet finished, subject to change */ 380b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_atv_agc_status { 38157afe2f0SMauro Carvalho Chehab u16 rf_agc_gain; /* 0 .. 877 uA */ 38257afe2f0SMauro Carvalho Chehab u16 if_agc_gain; /* 0 .. 877 uA */ 38357afe2f0SMauro Carvalho Chehab s16 video_agc_gain; /* -75 .. 1972 in 0.1 dB steps */ 38457afe2f0SMauro Carvalho Chehab s16 audio_agc_gain; /* -4 .. 1020 in 0.1 dB steps */ 38557afe2f0SMauro Carvalho Chehab u16 rf_agc_loop_gain; /* 0 .. 7 */ 38657afe2f0SMauro Carvalho Chehab u16 if_agc_loop_gain; /* 0 .. 7 */ 387b3ce3a83SMauro Carvalho Chehab u16 video_agc_loop_gain; /* 0 .. 7 */}; 38838b2df95SDevin Heitmueller 38938b2df95SDevin Heitmueller /*============================================================================*/ 39038b2df95SDevin Heitmueller /*============================================================================*/ 39138b2df95SDevin Heitmueller /*== CTRL related data structures ============================================*/ 39238b2df95SDevin Heitmueller /*============================================================================*/ 39338b2df95SDevin Heitmueller /*============================================================================*/ 39438b2df95SDevin Heitmueller 39538b2df95SDevin Heitmueller /* NONE */ 39638b2df95SDevin Heitmueller 39738b2df95SDevin Heitmueller /*============================================================================*/ 39838b2df95SDevin Heitmueller /*============================================================================*/ 39938b2df95SDevin Heitmueller 40038b2df95SDevin Heitmueller /*========================================*/ 401*b95b0c98SMauro Carvalho Chehab /* 402b3ce3a83SMauro Carvalho Chehab * /struct struct drxj_data * DRXJ specific attributes. 40338b2df95SDevin Heitmueller * 40438b2df95SDevin Heitmueller * Global data container for DRXJ specific data. 40538b2df95SDevin Heitmueller * 40638b2df95SDevin Heitmueller */ 407b3ce3a83SMauro Carvalho Chehab struct drxj_data { 40857afe2f0SMauro Carvalho Chehab /* device capabilties (determined during drx_open()) */ 409*b95b0c98SMauro Carvalho Chehab bool has_lna; /*< true if LNA (aka PGA) present */ 410*b95b0c98SMauro Carvalho Chehab bool has_oob; /*< true if OOB supported */ 411*b95b0c98SMauro Carvalho Chehab bool has_ntsc; /*< true if NTSC supported */ 412*b95b0c98SMauro Carvalho Chehab bool has_btsc; /*< true if BTSC supported */ 413*b95b0c98SMauro Carvalho Chehab bool has_smatx; /*< true if mat_tx is available */ 414*b95b0c98SMauro Carvalho Chehab bool has_smarx; /*< true if mat_rx is available */ 415*b95b0c98SMauro Carvalho Chehab bool has_gpio; /*< true if GPIO is available */ 416*b95b0c98SMauro Carvalho Chehab bool has_irqn; /*< true if IRQN is available */ 41738b2df95SDevin Heitmueller /* A1/A2/A... */ 418*b95b0c98SMauro Carvalho Chehab u8 mfx; /*< metal fix */ 41938b2df95SDevin Heitmueller 42038b2df95SDevin Heitmueller /* tuner settings */ 421*b95b0c98SMauro Carvalho Chehab bool mirror_freq_spect_oob;/*< tuner inversion (true = tuner mirrors the signal */ 42238b2df95SDevin Heitmueller 42338b2df95SDevin Heitmueller /* standard/channel settings */ 424*b95b0c98SMauro Carvalho Chehab enum drx_standard standard; /*< current standard information */ 42561263c75SMauro Carvalho Chehab enum drx_modulation constellation; 426*b95b0c98SMauro Carvalho Chehab /*< current constellation */ 427*b95b0c98SMauro Carvalho Chehab s32 frequency; /*< center signal frequency in KHz */ 42857afe2f0SMauro Carvalho Chehab enum drx_bandwidth curr_bandwidth; 429*b95b0c98SMauro Carvalho Chehab /*< current channel bandwidth */ 430*b95b0c98SMauro Carvalho Chehab enum drx_mirror mirror; /*< current channel mirror */ 43138b2df95SDevin Heitmueller 43238b2df95SDevin Heitmueller /* signal quality information */ 433*b95b0c98SMauro Carvalho Chehab u32 fec_bits_desired; /*< BER accounting period */ 434*b95b0c98SMauro Carvalho Chehab u16 fec_vd_plen; /*< no of trellis symbols: VD SER measurement period */ 435*b95b0c98SMauro Carvalho Chehab u16 qam_vd_prescale; /*< Viterbi Measurement Prescale */ 436*b95b0c98SMauro Carvalho Chehab u16 qam_vd_period; /*< Viterbi Measurement period */ 437*b95b0c98SMauro Carvalho Chehab u16 fec_rs_plen; /*< defines RS BER measurement period */ 438*b95b0c98SMauro Carvalho Chehab u16 fec_rs_prescale; /*< ReedSolomon Measurement Prescale */ 439*b95b0c98SMauro Carvalho Chehab u16 fec_rs_period; /*< ReedSolomon Measurement period */ 440*b95b0c98SMauro Carvalho Chehab bool reset_pkt_err_acc; /*< Set a flag to reset accumulated packet error */ 441*b95b0c98SMauro Carvalho Chehab u16 pkt_err_acc_start; /*< Set a flag to reset accumulated packet error */ 44238b2df95SDevin Heitmueller 44338b2df95SDevin Heitmueller /* HI configuration */ 444*b95b0c98SMauro Carvalho Chehab u16 hi_cfg_timing_div; /*< HI Configure() parameter 2 */ 445*b95b0c98SMauro Carvalho Chehab u16 hi_cfg_bridge_delay; /*< HI Configure() parameter 3 */ 446*b95b0c98SMauro Carvalho Chehab u16 hi_cfg_wake_up_key; /*< HI Configure() parameter 4 */ 447*b95b0c98SMauro Carvalho Chehab u16 hi_cfg_ctrl; /*< HI Configure() parameter 5 */ 448*b95b0c98SMauro Carvalho Chehab u16 hi_cfg_transmit; /*< HI Configure() parameter 6 */ 44938b2df95SDevin Heitmueller 4502c149601SMasahiro Yamada /* UIO configuration */ 451*b95b0c98SMauro Carvalho Chehab enum drxuio_mode uio_sma_rx_mode;/*< current mode of SmaRx pin */ 452*b95b0c98SMauro Carvalho Chehab enum drxuio_mode uio_sma_tx_mode;/*< current mode of SmaTx pin */ 453*b95b0c98SMauro Carvalho Chehab enum drxuio_mode uio_gpio_mode; /*< current mode of ASEL pin */ 454*b95b0c98SMauro Carvalho Chehab enum drxuio_mode uio_irqn_mode; /*< current mode of IRQN pin */ 45538b2df95SDevin Heitmueller 45638b2df95SDevin Heitmueller /* IQM fs frequecy shift and inversion */ 457*b95b0c98SMauro Carvalho Chehab u32 iqm_fs_rate_ofs; /*< frequency shifter setting after setchannel */ 458*b95b0c98SMauro Carvalho Chehab bool pos_image; /*< Ture: positive image */ 45938b2df95SDevin Heitmueller /* IQM RC frequecy shift */ 460*b95b0c98SMauro Carvalho Chehab u32 iqm_rc_rate_ofs; /*< frequency shifter setting after setchannel */ 46138b2df95SDevin Heitmueller 4622c149601SMasahiro Yamada /* ATV configuration */ 463*b95b0c98SMauro Carvalho Chehab u32 atv_cfg_changed_flags; /*< flag: flags cfg changes */ 464*b95b0c98SMauro Carvalho Chehab s16 atv_top_equ0[DRXJ_COEF_IDX_MAX]; /*< shadow of ATV_TOP_EQU0__A */ 465*b95b0c98SMauro Carvalho Chehab s16 atv_top_equ1[DRXJ_COEF_IDX_MAX]; /*< shadow of ATV_TOP_EQU1__A */ 466*b95b0c98SMauro Carvalho Chehab s16 atv_top_equ2[DRXJ_COEF_IDX_MAX]; /*< shadow of ATV_TOP_EQU2__A */ 467*b95b0c98SMauro Carvalho Chehab s16 atv_top_equ3[DRXJ_COEF_IDX_MAX]; /*< shadow of ATV_TOP_EQU3__A */ 468*b95b0c98SMauro Carvalho Chehab bool phase_correction_bypass;/*< flag: true=bypass */ 469*b95b0c98SMauro Carvalho Chehab s16 atv_top_vid_peak; /*< shadow of ATV_TOP_VID_PEAK__A */ 470*b95b0c98SMauro Carvalho Chehab u16 atv_top_noise_th; /*< shadow of ATV_TOP_NOISE_TH__A */ 471*b95b0c98SMauro Carvalho Chehab bool enable_cvbs_output; /*< flag CVBS ouput enable */ 472*b95b0c98SMauro Carvalho Chehab bool enable_sif_output; /*< flag SIF ouput enable */ 473b3ce3a83SMauro Carvalho Chehab enum drxjsif_attenuation sif_attenuation; 474*b95b0c98SMauro Carvalho Chehab /*< current SIF att setting */ 47538b2df95SDevin Heitmueller /* Agc configuration for QAM and VSB */ 476*b95b0c98SMauro Carvalho Chehab struct drxj_cfg_agc qam_rf_agc_cfg; /*< qam RF AGC config */ 477*b95b0c98SMauro Carvalho Chehab struct drxj_cfg_agc qam_if_agc_cfg; /*< qam IF AGC config */ 478*b95b0c98SMauro Carvalho Chehab struct drxj_cfg_agc vsb_rf_agc_cfg; /*< vsb RF AGC config */ 479*b95b0c98SMauro Carvalho Chehab struct drxj_cfg_agc vsb_if_agc_cfg; /*< vsb IF AGC config */ 48038b2df95SDevin Heitmueller 48138b2df95SDevin Heitmueller /* PGA gain configuration for QAM and VSB */ 482*b95b0c98SMauro Carvalho Chehab u16 qam_pga_cfg; /*< qam PGA config */ 483*b95b0c98SMauro Carvalho Chehab u16 vsb_pga_cfg; /*< vsb PGA config */ 48438b2df95SDevin Heitmueller 48538b2df95SDevin Heitmueller /* Pre SAW configuration for QAM and VSB */ 486b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_pre_saw qam_pre_saw_cfg; 487*b95b0c98SMauro Carvalho Chehab /*< qam pre SAW config */ 488b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_pre_saw vsb_pre_saw_cfg; 489*b95b0c98SMauro Carvalho Chehab /*< qam pre SAW config */ 49038b2df95SDevin Heitmueller 49138b2df95SDevin Heitmueller /* Version information */ 492*b95b0c98SMauro Carvalho Chehab char v_text[2][12]; /*< allocated text versions */ 493*b95b0c98SMauro Carvalho Chehab struct drx_version v_version[2]; /*< allocated versions structs */ 4941bfc9e15SMauro Carvalho Chehab struct drx_version_list v_list_elements[2]; 495*b95b0c98SMauro Carvalho Chehab /*< allocated version list */ 49638b2df95SDevin Heitmueller 49738b2df95SDevin Heitmueller /* smart antenna configuration */ 49857afe2f0SMauro Carvalho Chehab bool smart_ant_inverted; 49938b2df95SDevin Heitmueller 50038b2df95SDevin Heitmueller /* Tracking filter setting for OOB */ 50157afe2f0SMauro Carvalho Chehab u16 oob_trk_filter_cfg[8]; 50257afe2f0SMauro Carvalho Chehab bool oob_power_on; 50338b2df95SDevin Heitmueller 50438b2df95SDevin Heitmueller /* MPEG static bitrate setting */ 505*b95b0c98SMauro Carvalho Chehab u32 mpeg_ts_static_bitrate; /*< bitrate static MPEG output */ 506*b95b0c98SMauro Carvalho Chehab bool disable_te_ihandling; /*< MPEG TS TEI handling */ 507*b95b0c98SMauro Carvalho Chehab bool bit_reverse_mpeg_outout;/*< MPEG output bit order */ 508b3ce3a83SMauro Carvalho Chehab enum drxj_mpeg_output_clock_rate mpeg_output_clock_rate; 509*b95b0c98SMauro Carvalho Chehab /*< MPEG output clock rate */ 510b3ce3a83SMauro Carvalho Chehab enum drxj_mpeg_start_width mpeg_start_width; 511*b95b0c98SMauro Carvalho Chehab /*< MPEG Start width */ 51238b2df95SDevin Heitmueller 51338b2df95SDevin Heitmueller /* Pre SAW & Agc configuration for ATV */ 514b3ce3a83SMauro Carvalho Chehab struct drxj_cfg_pre_saw atv_pre_saw_cfg; 515*b95b0c98SMauro Carvalho Chehab /*< atv pre SAW config */ 516*b95b0c98SMauro Carvalho Chehab struct drxj_cfg_agc atv_rf_agc_cfg; /*< atv RF AGC config */ 517*b95b0c98SMauro Carvalho Chehab struct drxj_cfg_agc atv_if_agc_cfg; /*< atv IF AGC config */ 518*b95b0c98SMauro Carvalho Chehab u16 atv_pga_cfg; /*< atv pga config */ 51938b2df95SDevin Heitmueller 52057afe2f0SMauro Carvalho Chehab u32 curr_symbol_rate; 52138b2df95SDevin Heitmueller 52238b2df95SDevin Heitmueller /* pin-safe mode */ 523*b95b0c98SMauro Carvalho Chehab bool pdr_safe_mode; /*< PDR safe mode activated */ 52457afe2f0SMauro Carvalho Chehab u16 pdr_safe_restore_val_gpio; 52557afe2f0SMauro Carvalho Chehab u16 pdr_safe_restore_val_v_sync; 52657afe2f0SMauro Carvalho Chehab u16 pdr_safe_restore_val_sma_rx; 52757afe2f0SMauro Carvalho Chehab u16 pdr_safe_restore_val_sma_tx; 52838b2df95SDevin Heitmueller 52938b2df95SDevin Heitmueller /* OOB pre-saw value */ 53057afe2f0SMauro Carvalho Chehab u16 oob_pre_saw; 531b3ce3a83SMauro Carvalho Chehab enum drxj_cfg_oob_lo_power oob_lo_pow; 53238b2df95SDevin Heitmueller 5331bfc9e15SMauro Carvalho Chehab struct drx_aud_data aud_data; 534*b95b0c98SMauro Carvalho Chehab /*< audio storage */}; 53538b2df95SDevin Heitmueller 53638b2df95SDevin Heitmueller /*------------------------------------------------------------------------- 53738b2df95SDevin Heitmueller Access MACROS 53838b2df95SDevin Heitmueller -------------------------------------------------------------------------*/ 539*b95b0c98SMauro Carvalho Chehab /* 54038b2df95SDevin Heitmueller * \brief Compilable references to attributes 54138b2df95SDevin Heitmueller * \param d pointer to demod instance 54238b2df95SDevin Heitmueller * 54338b2df95SDevin Heitmueller * Used as main reference to an attribute field. 54438b2df95SDevin Heitmueller * Can be used by both macro implementation and function implementation. 54538b2df95SDevin Heitmueller * These macros are defined to avoid duplication of code in macro and function 54638b2df95SDevin Heitmueller * definitions that handle access of demod common or extended attributes. 54738b2df95SDevin Heitmueller * 54838b2df95SDevin Heitmueller */ 54938b2df95SDevin Heitmueller 55038b2df95SDevin Heitmueller #define DRXJ_ATTR_BTSC_DETECT(d) \ 551b3ce3a83SMauro Carvalho Chehab (((struct drxj_data *)(d)->my_ext_attr)->aud_data.btsc_detect) 55238b2df95SDevin Heitmueller 55338b2df95SDevin Heitmueller /*------------------------------------------------------------------------- 55438b2df95SDevin Heitmueller DEFINES 55538b2df95SDevin Heitmueller -------------------------------------------------------------------------*/ 55638b2df95SDevin Heitmueller 557*b95b0c98SMauro Carvalho Chehab /* 55838b2df95SDevin Heitmueller * \def DRXJ_NTSC_CARRIER_FREQ_OFFSET 55938b2df95SDevin Heitmueller * \brief Offset from picture carrier to centre frequency in kHz, in RF domain 56038b2df95SDevin Heitmueller * 56138b2df95SDevin Heitmueller * For NTSC standard. 56238b2df95SDevin Heitmueller * NTSC channels are listed by their picture carrier frequency (Fpc). 56338b2df95SDevin Heitmueller * The function DRX_CTRL_SET_CHANNEL requires the centre frequency as input. 56438b2df95SDevin Heitmueller * In case the tuner module is not used the DRX-J requires that the tuner is 56538b2df95SDevin Heitmueller * tuned to the centre frequency of the channel: 56638b2df95SDevin Heitmueller * 56738b2df95SDevin Heitmueller * Fcentre = Fpc + DRXJ_NTSC_CARRIER_FREQ_OFFSET 56838b2df95SDevin Heitmueller * 56938b2df95SDevin Heitmueller */ 57073f7065bSMauro Carvalho Chehab #define DRXJ_NTSC_CARRIER_FREQ_OFFSET ((s32)(1750)) 57138b2df95SDevin Heitmueller 572*b95b0c98SMauro Carvalho Chehab /* 57338b2df95SDevin Heitmueller * \def DRXJ_PAL_SECAM_BG_CARRIER_FREQ_OFFSET 57438b2df95SDevin Heitmueller * \brief Offset from picture carrier to centre frequency in kHz, in RF domain 57538b2df95SDevin Heitmueller * 57638b2df95SDevin Heitmueller * For PAL/SECAM - BG standard. This define is needed in case the tuner module 57738b2df95SDevin Heitmueller * is NOT used. PAL/SECAM channels are listed by their picture carrier frequency (Fpc). 57838b2df95SDevin Heitmueller * The DRX-J requires that the tuner is tuned to: 57938b2df95SDevin Heitmueller * Fpc + DRXJ_PAL_SECAM_BG_CARRIER_FREQ_OFFSET 58038b2df95SDevin Heitmueller * 58138b2df95SDevin Heitmueller * In case the tuner module is used the drxdriver takes care of this. 58238b2df95SDevin Heitmueller * In case the tuner module is NOT used the application programmer must take 58338b2df95SDevin Heitmueller * care of this. 58438b2df95SDevin Heitmueller * 58538b2df95SDevin Heitmueller */ 58673f7065bSMauro Carvalho Chehab #define DRXJ_PAL_SECAM_BG_CARRIER_FREQ_OFFSET ((s32)(2375)) 58738b2df95SDevin Heitmueller 588*b95b0c98SMauro Carvalho Chehab /* 58938b2df95SDevin Heitmueller * \def DRXJ_PAL_SECAM_DKIL_CARRIER_FREQ_OFFSET 59038b2df95SDevin Heitmueller * \brief Offset from picture carrier to centre frequency in kHz, in RF domain 59138b2df95SDevin Heitmueller * 59238b2df95SDevin Heitmueller * For PAL/SECAM - DK, I, L standards. This define is needed in case the tuner module 59338b2df95SDevin Heitmueller * is NOT used. PAL/SECAM channels are listed by their picture carrier frequency (Fpc). 59438b2df95SDevin Heitmueller * The DRX-J requires that the tuner is tuned to: 59538b2df95SDevin Heitmueller * Fpc + DRXJ_PAL_SECAM_DKIL_CARRIER_FREQ_OFFSET 59638b2df95SDevin Heitmueller * 59738b2df95SDevin Heitmueller * In case the tuner module is used the drxdriver takes care of this. 59838b2df95SDevin Heitmueller * In case the tuner module is NOT used the application programmer must take 59938b2df95SDevin Heitmueller * care of this. 60038b2df95SDevin Heitmueller * 60138b2df95SDevin Heitmueller */ 60273f7065bSMauro Carvalho Chehab #define DRXJ_PAL_SECAM_DKIL_CARRIER_FREQ_OFFSET ((s32)(2775)) 60338b2df95SDevin Heitmueller 604*b95b0c98SMauro Carvalho Chehab /* 60538b2df95SDevin Heitmueller * \def DRXJ_PAL_SECAM_LP_CARRIER_FREQ_OFFSET 60638b2df95SDevin Heitmueller * \brief Offset from picture carrier to centre frequency in kHz, in RF domain 60738b2df95SDevin Heitmueller * 60838b2df95SDevin Heitmueller * For PAL/SECAM - LP standard. This define is needed in case the tuner module 60938b2df95SDevin Heitmueller * is NOT used. PAL/SECAM channels are listed by their picture carrier frequency (Fpc). 61038b2df95SDevin Heitmueller * The DRX-J requires that the tuner is tuned to: 61138b2df95SDevin Heitmueller * Fpc + DRXJ_PAL_SECAM_LP_CARRIER_FREQ_OFFSET 61238b2df95SDevin Heitmueller * 61338b2df95SDevin Heitmueller * In case the tuner module is used the drxdriver takes care of this. 61438b2df95SDevin Heitmueller * In case the tuner module is NOT used the application programmer must take 61538b2df95SDevin Heitmueller * care of this. 61638b2df95SDevin Heitmueller */ 61773f7065bSMauro Carvalho Chehab #define DRXJ_PAL_SECAM_LP_CARRIER_FREQ_OFFSET ((s32)(-3255)) 61838b2df95SDevin Heitmueller 619*b95b0c98SMauro Carvalho Chehab /* 62038b2df95SDevin Heitmueller * \def DRXJ_FM_CARRIER_FREQ_OFFSET 62138b2df95SDevin Heitmueller * \brief Offset from sound carrier to centre frequency in kHz, in RF domain 62238b2df95SDevin Heitmueller * 62338b2df95SDevin Heitmueller * For FM standard. 62438b2df95SDevin Heitmueller * FM channels are listed by their sound carrier frequency (Fsc). 62538b2df95SDevin Heitmueller * The function DRX_CTRL_SET_CHANNEL requires the Ffm frequency (see below) as 62638b2df95SDevin Heitmueller * input. 62738b2df95SDevin Heitmueller * In case the tuner module is not used the DRX-J requires that the tuner is 62838b2df95SDevin Heitmueller * tuned to the Ffm frequency of the channel. 62938b2df95SDevin Heitmueller * 63038b2df95SDevin Heitmueller * Ffm = Fsc + DRXJ_FM_CARRIER_FREQ_OFFSET 63138b2df95SDevin Heitmueller * 63238b2df95SDevin Heitmueller */ 63373f7065bSMauro Carvalho Chehab #define DRXJ_FM_CARRIER_FREQ_OFFSET ((s32)(-3000)) 63438b2df95SDevin Heitmueller 63538b2df95SDevin Heitmueller /* Revision types -------------------------------------------------------*/ 63638b2df95SDevin Heitmueller 63738b2df95SDevin Heitmueller #define DRXJ_TYPE_ID (0x3946000DUL) 63838b2df95SDevin Heitmueller 63938b2df95SDevin Heitmueller /* Macros ---------------------------------------------------------------*/ 64038b2df95SDevin Heitmueller 64138b2df95SDevin Heitmueller /* Convert OOB lock status to string */ 64238b2df95SDevin Heitmueller #define DRXJ_STR_OOB_LOCKSTATUS(x) ( \ 64338b2df95SDevin Heitmueller (x == DRX_NEVER_LOCK) ? "Never" : \ 64438b2df95SDevin Heitmueller (x == DRX_NOT_LOCKED) ? "No" : \ 64538b2df95SDevin Heitmueller (x == DRX_LOCKED) ? "Locked" : \ 64638b2df95SDevin Heitmueller (x == DRX_LOCK_STATE_1) ? "AGC lock" : \ 64738b2df95SDevin Heitmueller (x == DRX_LOCK_STATE_2) ? "sync lock" : \ 64838b2df95SDevin Heitmueller "(Invalid)") 64938b2df95SDevin Heitmueller 65038b2df95SDevin Heitmueller #endif /* __DRXJ_H__ */ 651