18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Driver for Silicon Labs SI2165 DVB-C/-T Demodulator 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2013-2017 Matthias Schwarzott <zzam@gentoo.org> 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef _DVB_SI2165_PRIV 98c2ecf20Sopenharmony_ci#define _DVB_SI2165_PRIV 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define SI2165_FIRMWARE_REV_D "dvb-demod-si2165.fw" 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cistruct si2165_config { 148c2ecf20Sopenharmony_ci /* i2c addr 158c2ecf20Sopenharmony_ci * possible values: 0x64,0x65,0x66,0x67 168c2ecf20Sopenharmony_ci */ 178c2ecf20Sopenharmony_ci u8 i2c_addr; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci /* external clock or XTAL */ 208c2ecf20Sopenharmony_ci u8 chip_mode; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci /* frequency of external clock or xtal in Hz 238c2ecf20Sopenharmony_ci * possible values: 4000000, 16000000, 20000000, 240000000, 27000000 248c2ecf20Sopenharmony_ci */ 258c2ecf20Sopenharmony_ci u32 ref_freq_hz; 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci /* invert the spectrum */ 288c2ecf20Sopenharmony_ci bool inversion; 298c2ecf20Sopenharmony_ci}; 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#define STATISTICS_PERIOD_PKT_COUNT 30000u 328c2ecf20Sopenharmony_ci#define STATISTICS_PERIOD_BIT_COUNT (STATISTICS_PERIOD_PKT_COUNT * 204 * 8) 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#define REG_CHIP_MODE 0x0000 358c2ecf20Sopenharmony_ci#define REG_CHIP_REVCODE 0x0023 368c2ecf20Sopenharmony_ci#define REV_CHIP_TYPE 0x0118 378c2ecf20Sopenharmony_ci#define REG_CHIP_INIT 0x0050 388c2ecf20Sopenharmony_ci#define REG_INIT_DONE 0x0054 398c2ecf20Sopenharmony_ci#define REG_START_INIT 0x0096 408c2ecf20Sopenharmony_ci#define REG_PLL_DIVL 0x00a0 418c2ecf20Sopenharmony_ci#define REG_RST_ALL 0x00c0 428c2ecf20Sopenharmony_ci#define REG_LOCK_TIMEOUT 0x00c4 438c2ecf20Sopenharmony_ci#define REG_AUTO_RESET 0x00cb 448c2ecf20Sopenharmony_ci#define REG_OVERSAMP 0x00e4 458c2ecf20Sopenharmony_ci#define REG_IF_FREQ_SHIFT 0x00e8 468c2ecf20Sopenharmony_ci#define REG_DVB_STANDARD 0x00ec 478c2ecf20Sopenharmony_ci#define REG_DSP_CLOCK 0x0104 488c2ecf20Sopenharmony_ci#define REG_ADC_RI8 0x0123 498c2ecf20Sopenharmony_ci#define REG_ADC_RI1 0x012a 508c2ecf20Sopenharmony_ci#define REG_ADC_RI2 0x012b 518c2ecf20Sopenharmony_ci#define REG_ADC_RI3 0x012c 528c2ecf20Sopenharmony_ci#define REG_ADC_RI4 0x012d 538c2ecf20Sopenharmony_ci#define REG_ADC_RI5 0x012e 548c2ecf20Sopenharmony_ci#define REG_ADC_RI6 0x012f 558c2ecf20Sopenharmony_ci#define REG_AGC_CRESTF_DBX8 0x0150 568c2ecf20Sopenharmony_ci#define REG_AGC_UNFREEZE_THR 0x015b 578c2ecf20Sopenharmony_ci#define REG_AGC2_MIN 0x016e 588c2ecf20Sopenharmony_ci#define REG_AGC2_KACQ 0x016c 598c2ecf20Sopenharmony_ci#define REG_AGC2_KLOC 0x016d 608c2ecf20Sopenharmony_ci#define REG_AGC2_OUTPUT 0x0170 618c2ecf20Sopenharmony_ci#define REG_AGC2_CLKDIV 0x0171 628c2ecf20Sopenharmony_ci#define REG_AGC_IF_TRI 0x018b 638c2ecf20Sopenharmony_ci#define REG_AGC_IF_SLR 0x0190 648c2ecf20Sopenharmony_ci#define REG_AAF_CRESTF_DBX8 0x01a0 658c2ecf20Sopenharmony_ci#define REG_ACI_CRESTF_DBX8 0x01c8 668c2ecf20Sopenharmony_ci#define REG_SWEEP_STEP 0x0232 678c2ecf20Sopenharmony_ci#define REG_KP_LOCK 0x023a 688c2ecf20Sopenharmony_ci#define REG_UNKNOWN_24C 0x024c 698c2ecf20Sopenharmony_ci#define REG_CENTRAL_TAP 0x0261 708c2ecf20Sopenharmony_ci#define REG_C_N 0x026c 718c2ecf20Sopenharmony_ci#define REG_EQ_AUTO_CONTROL 0x0278 728c2ecf20Sopenharmony_ci#define REG_UNKNOWN_27C 0x027c 738c2ecf20Sopenharmony_ci#define REG_START_SYNCHRO 0x02e0 748c2ecf20Sopenharmony_ci#define REG_REQ_CONSTELLATION 0x02f4 758c2ecf20Sopenharmony_ci#define REG_T_BANDWIDTH 0x0308 768c2ecf20Sopenharmony_ci#define REG_FREQ_SYNC_RANGE 0x030c 778c2ecf20Sopenharmony_ci#define REG_IMPULSIVE_NOISE_REM 0x031c 788c2ecf20Sopenharmony_ci#define REG_WDOG_AND_BOOT 0x0341 798c2ecf20Sopenharmony_ci#define REG_PATCH_VERSION 0x0344 808c2ecf20Sopenharmony_ci#define REG_ADDR_JUMP 0x0348 818c2ecf20Sopenharmony_ci#define REG_UNKNOWN_350 0x0350 828c2ecf20Sopenharmony_ci#define REG_EN_RST_ERROR 0x035c 838c2ecf20Sopenharmony_ci#define REG_DCOM_CONTROL_BYTE 0x0364 848c2ecf20Sopenharmony_ci#define REG_DCOM_ADDR 0x0368 858c2ecf20Sopenharmony_ci#define REG_DCOM_DATA 0x036c 868c2ecf20Sopenharmony_ci#define REG_RST_CRC 0x0379 878c2ecf20Sopenharmony_ci#define REG_GP_REG0_LSB 0x0384 888c2ecf20Sopenharmony_ci#define REG_GP_REG0_MSB 0x0387 898c2ecf20Sopenharmony_ci#define REG_CRC 0x037a 908c2ecf20Sopenharmony_ci#define REG_CHECK_SIGNAL 0x03a8 918c2ecf20Sopenharmony_ci#define REG_CBER_RST 0x0424 928c2ecf20Sopenharmony_ci#define REG_CBER_BIT 0x0428 938c2ecf20Sopenharmony_ci#define REG_CBER_ERR 0x0430 948c2ecf20Sopenharmony_ci#define REG_CBER_AVAIL 0x0434 958c2ecf20Sopenharmony_ci#define REG_PS_LOCK 0x0440 968c2ecf20Sopenharmony_ci#define REG_UNCOR_CNT 0x0468 978c2ecf20Sopenharmony_ci#define REG_BER_RST 0x046c 988c2ecf20Sopenharmony_ci#define REG_BER_PKT 0x0470 998c2ecf20Sopenharmony_ci#define REG_BER_BIT 0x0478 1008c2ecf20Sopenharmony_ci#define REG_BER_AVAIL 0x047c 1018c2ecf20Sopenharmony_ci#define REG_FEC_LOCK 0x04e0 1028c2ecf20Sopenharmony_ci#define REG_TS_DATA_MODE 0x04e4 1038c2ecf20Sopenharmony_ci#define REG_TS_CLK_MODE 0x04e5 1048c2ecf20Sopenharmony_ci#define REG_TS_TRI 0x04ef 1058c2ecf20Sopenharmony_ci#define REG_TS_SLR 0x04f4 1068c2ecf20Sopenharmony_ci#define REG_RSSI_ENABLE 0x0641 1078c2ecf20Sopenharmony_ci#define REG_RSSI_PAD_CTRL 0x0646 1088c2ecf20Sopenharmony_ci#define REG_TS_PARALLEL_MODE 0x08f8 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci#endif /* _DVB_SI2165_PRIV */ 111