1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * NXP TDA10071 + Conexant CX24118A DVB-S/S2 demodulator + tuner driver
5 * Copyright (C) 2011 Antti Palosaari <crope@iki.fi>
11 #include <media/dvb_frontend.h>
13 #include <linux/firmware.h>
14 #include <linux/regmap.h>
17 struct dvb_frontend fe
;
18 struct i2c_client
*client
;
19 struct regmap
*regmap
;
20 struct mutex cmd_execute_mutex
;
30 enum fe_status fe_status
;
31 enum fe_delivery_system delivery_system
;
32 bool warm
; /* FW running */
37 static struct tda10071_modcod
{
38 enum fe_delivery_system delivery_system
;
39 enum fe_modulation modulation
;
40 enum fe_code_rate fec
;
42 } TDA10071_MODCOD
[] = {
44 { SYS_DVBS2
, QPSK
, FEC_AUTO
, 0x00 },
45 { SYS_DVBS2
, QPSK
, FEC_1_2
, 0x04 },
46 { SYS_DVBS2
, QPSK
, FEC_3_5
, 0x05 },
47 { SYS_DVBS2
, QPSK
, FEC_2_3
, 0x06 },
48 { SYS_DVBS2
, QPSK
, FEC_3_4
, 0x07 },
49 { SYS_DVBS2
, QPSK
, FEC_4_5
, 0x08 },
50 { SYS_DVBS2
, QPSK
, FEC_5_6
, 0x09 },
51 { SYS_DVBS2
, QPSK
, FEC_8_9
, 0x0a },
52 { SYS_DVBS2
, QPSK
, FEC_9_10
, 0x0b },
54 { SYS_DVBS2
, PSK_8
, FEC_AUTO
, 0x00 },
55 { SYS_DVBS2
, PSK_8
, FEC_3_5
, 0x0c },
56 { SYS_DVBS2
, PSK_8
, FEC_2_3
, 0x0d },
57 { SYS_DVBS2
, PSK_8
, FEC_3_4
, 0x0e },
58 { SYS_DVBS2
, PSK_8
, FEC_5_6
, 0x0f },
59 { SYS_DVBS2
, PSK_8
, FEC_8_9
, 0x10 },
60 { SYS_DVBS2
, PSK_8
, FEC_9_10
, 0x11 },
62 { SYS_DVBS
, QPSK
, FEC_AUTO
, 0x2d },
63 { SYS_DVBS
, QPSK
, FEC_1_2
, 0x2e },
64 { SYS_DVBS
, QPSK
, FEC_2_3
, 0x2f },
65 { SYS_DVBS
, QPSK
, FEC_3_4
, 0x30 },
66 { SYS_DVBS
, QPSK
, FEC_5_6
, 0x31 },
67 { SYS_DVBS
, QPSK
, FEC_7_8
, 0x32 },
70 struct tda10071_reg_val_mask
{
76 /* firmware filename */
77 #define TDA10071_FIRMWARE "dvb-fe-tda10071.fw"
79 /* firmware commands */
80 #define CMD_DEMOD_INIT 0x10
81 #define CMD_CHANGE_CHANNEL 0x11
82 #define CMD_MPEG_CONFIG 0x13
83 #define CMD_TUNER_INIT 0x15
84 #define CMD_GET_AGCACC 0x1a
86 #define CMD_LNB_CONFIG 0x20
87 #define CMD_LNB_SEND_DISEQC 0x21
88 #define CMD_LNB_SET_DC_LEVEL 0x22
89 #define CMD_LNB_PCB_CONFIG 0x23
90 #define CMD_LNB_SEND_TONEBURST 0x24
91 #define CMD_LNB_UPDATE_REPLY 0x25
93 #define CMD_GET_FW_VERSION 0x35
94 #define CMD_SET_SLEEP_MODE 0x36
95 #define CMD_BER_CONTROL 0x3e
96 #define CMD_BER_UPDATE_COUNTERS 0x3f
98 /* firmware command struct */
99 #define TDA10071_ARGLEN 30
100 struct tda10071_cmd
{
101 u8 args
[TDA10071_ARGLEN
];
106 #endif /* TDA10071_PRIV */