18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  mxl111sf-reg.h - driver for the MaxLinear MXL111SF
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _DVB_USB_MXL111SF_REG_H_
98c2ecf20Sopenharmony_ci#define _DVB_USB_MXL111SF_REG_H_
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define CHIP_ID_REG                  0xFC
128c2ecf20Sopenharmony_ci#define TOP_CHIP_REV_ID_REG          0xFA
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define V6_SNR_RB_LSB_REG            0x27
158c2ecf20Sopenharmony_ci#define V6_SNR_RB_MSB_REG            0x28
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define V6_N_ACCUMULATE_REG          0x11
188c2ecf20Sopenharmony_ci#define V6_RS_AVG_ERRORS_LSB_REG     0x2C
198c2ecf20Sopenharmony_ci#define V6_RS_AVG_ERRORS_MSB_REG     0x2D
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define V6_IRQ_STATUS_REG            0x24
228c2ecf20Sopenharmony_ci#define  IRQ_MASK_FEC_LOCK       0x10
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define V6_SYNC_LOCK_REG             0x28
258c2ecf20Sopenharmony_ci#define SYNC_LOCK_MASK           0x10
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define V6_RS_LOCK_DET_REG           0x28
288c2ecf20Sopenharmony_ci#define  RS_LOCK_DET_MASK        0x08
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define V6_INITACQ_NODETECT_REG    0x20
318c2ecf20Sopenharmony_ci#define V6_FORCE_NFFT_CPSIZE_REG   0x20
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define V6_CODE_RATE_TPS_REG       0x29
348c2ecf20Sopenharmony_ci#define V6_CODE_RATE_TPS_MASK      0x07
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define V6_CP_LOCK_DET_REG        0x28
388c2ecf20Sopenharmony_ci#define V6_CP_LOCK_DET_MASK       0x04
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define V6_TPS_HIERACHY_REG        0x29
418c2ecf20Sopenharmony_ci#define V6_TPS_HIERARCHY_INFO_MASK  0x40
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define V6_MODORDER_TPS_REG        0x2A
448c2ecf20Sopenharmony_ci#define V6_PARAM_CONSTELLATION_MASK   0x30
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define V6_MODE_TPS_REG            0x2A
478c2ecf20Sopenharmony_ci#define V6_PARAM_FFT_MODE_MASK        0x0C
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define V6_CP_TPS_REG             0x29
518c2ecf20Sopenharmony_ci#define V6_PARAM_GI_MASK              0x30
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define V6_TPS_LOCK_REG           0x2A
548c2ecf20Sopenharmony_ci#define V6_PARAM_TPS_LOCK_MASK        0x40
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define V6_FEC_PER_COUNT_REG      0x2E
578c2ecf20Sopenharmony_ci#define V6_FEC_PER_SCALE_REG      0x2B
588c2ecf20Sopenharmony_ci#define V6_FEC_PER_SCALE_MASK        0x03
598c2ecf20Sopenharmony_ci#define V6_FEC_PER_CLR_REG        0x20
608c2ecf20Sopenharmony_ci#define V6_FEC_PER_CLR_MASK          0x01
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define V6_PIN_MUX_MODE_REG       0x1B
638c2ecf20Sopenharmony_ci#define V6_ENABLE_PIN_MUX            0x1E
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define V6_I2S_NUM_SAMPLES_REG    0x16
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define V6_MPEG_IN_CLK_INV_REG    0x17
688c2ecf20Sopenharmony_ci#define V6_MPEG_IN_CTRL_REG       0x18
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define V6_INVERTED_CLK_PHASE       0x20
718c2ecf20Sopenharmony_ci#define V6_MPEG_IN_DATA_PARALLEL    0x01
728c2ecf20Sopenharmony_ci#define V6_MPEG_IN_DATA_SERIAL      0x02
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#define V6_INVERTED_MPEG_SYNC       0x04
758c2ecf20Sopenharmony_ci#define V6_INVERTED_MPEG_VALID      0x08
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci#define TSIF_INPUT_PARALLEL         0
788c2ecf20Sopenharmony_ci#define TSIF_INPUT_SERIAL           1
798c2ecf20Sopenharmony_ci#define TSIF_NORMAL                 0
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci#define V6_MPEG_INOUT_BIT_ORDER_CTRL_REG  0x19
828c2ecf20Sopenharmony_ci#define V6_MPEG_SER_MSB_FIRST                0x80
838c2ecf20Sopenharmony_ci#define MPEG_SER_MSB_FIRST_ENABLED        0x01
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci#define V6_656_I2S_BUFF_STATUS_REG   0x2F
868c2ecf20Sopenharmony_ci#define V6_656_OVERFLOW_MASK_BIT         0x08
878c2ecf20Sopenharmony_ci#define V6_I2S_OVERFLOW_MASK_BIT         0x01
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define V6_I2S_STREAM_START_BIT_REG  0x14
908c2ecf20Sopenharmony_ci#define V6_I2S_STREAM_END_BIT_REG    0x15
918c2ecf20Sopenharmony_ci#define I2S_RIGHT_JUSTIFIED     0
928c2ecf20Sopenharmony_ci#define I2S_LEFT_JUSTIFIED      1
938c2ecf20Sopenharmony_ci#define I2S_DATA_FORMAT         2
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define V6_TUNER_LOOP_THRU_CONTROL_REG  0x09
968c2ecf20Sopenharmony_ci#define V6_ENABLE_LOOP_THRU               0x01
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define TOTAL_NUM_IF_OUTPUT_FREQ       16
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define TUNER_NORMAL_IF_SPECTRUM       0x0
1018c2ecf20Sopenharmony_ci#define TUNER_INVERT_IF_SPECTRUM       0x10
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define V6_TUNER_IF_SEL_REG              0x06
1048c2ecf20Sopenharmony_ci#define V6_TUNER_IF_FCW_REG              0x3C
1058c2ecf20Sopenharmony_ci#define V6_TUNER_IF_FCW_BYP_REG          0x3D
1068c2ecf20Sopenharmony_ci#define V6_RF_LOCK_STATUS_REG            0x23
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define NUM_DIG_TV_CHANNEL     1000
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#define V6_DIG_CLK_FREQ_SEL_REG  0x07
1118c2ecf20Sopenharmony_ci#define V6_REF_SYNTH_INT_REG     0x5C
1128c2ecf20Sopenharmony_ci#define V6_REF_SYNTH_REMAIN_REG  0x58
1138c2ecf20Sopenharmony_ci#define V6_DIG_RFREFSELECT_REG   0x32
1148c2ecf20Sopenharmony_ci#define V6_XTAL_CLK_OUT_GAIN_REG   0x31
1158c2ecf20Sopenharmony_ci#define V6_TUNER_LOOP_THRU_CTRL_REG      0x09
1168c2ecf20Sopenharmony_ci#define V6_DIG_XTAL_ENABLE_REG  0x06
1178c2ecf20Sopenharmony_ci#define V6_DIG_XTAL_BIAS_REG  0x66
1188c2ecf20Sopenharmony_ci#define V6_XTAL_CAP_REG    0x08
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci#define V6_GPO_CTRL_REG     0x18
1218c2ecf20Sopenharmony_ci#define MXL_GPO_0           0x00
1228c2ecf20Sopenharmony_ci#define MXL_GPO_1           0x01
1238c2ecf20Sopenharmony_ci#define V6_GPO_0_MASK       0x10
1248c2ecf20Sopenharmony_ci#define V6_GPO_1_MASK       0x20
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define V6_111SF_GPO_CTRL_REG     0x19
1278c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_1               0x00
1288c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_2               0x01
1298c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_3               0x02
1308c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_4               0x03
1318c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_5               0x04
1328c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_6               0x05
1338c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_7               0x06
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_0_MASK          0x01
1368c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_1_MASK          0x02
1378c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_2_MASK          0x04
1388c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_3_MASK          0x08
1398c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_4_MASK          0x10
1408c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_5_MASK          0x20
1418c2ecf20Sopenharmony_ci#define MXL_111SF_GPO_6_MASK          0x40
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci#define V6_ATSC_CONFIG_REG  0x0A
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci#define MXL_MODE_REG    0x03
1468c2ecf20Sopenharmony_ci#define START_TUNE_REG  0x1C
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci#define V6_IDAC_HYSTERESIS_REG    0x0B
1498c2ecf20Sopenharmony_ci#define V6_IDAC_SETTINGS_REG      0x0C
1508c2ecf20Sopenharmony_ci#define IDAC_MANUAL_CONTROL             1
1518c2ecf20Sopenharmony_ci#define IDAC_CURRENT_SINKING_ENABLE     1
1528c2ecf20Sopenharmony_ci#define IDAC_MANUAL_CONTROL_BIT_MASK      0x80
1538c2ecf20Sopenharmony_ci#define IDAC_CURRENT_SINKING_BIT_MASK     0x40
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci#define V8_SPI_MODE_REG  0xE9
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci#define V6_DIG_RF_PWR_LSB_REG  0x46
1588c2ecf20Sopenharmony_ci#define V6_DIG_RF_PWR_MSB_REG  0x47
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#endif /* _DVB_USB_MXL111SF_REG_H_ */
161