xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/dvb/dvb-frontend-parameters.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun.. c:type:: dvb_frontend_parameters
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun*******************
6*4882a593Smuzhiyunfrontend parameters
7*4882a593Smuzhiyun*******************
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThe kind of parameters passed to the frontend device for tuning depend
10*4882a593Smuzhiyunon the kind of hardware you are using.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThe struct ``dvb_frontend_parameters`` uses a union with specific
13*4882a593Smuzhiyunper-system parameters. However, as newer delivery systems required more
14*4882a593Smuzhiyundata, the structure size weren't enough to fit, and just extending its
15*4882a593Smuzhiyunsize would break the existing applications. So, those parameters were
16*4882a593Smuzhiyunreplaced by the usage of
17*4882a593Smuzhiyun:ref:`FE_GET_PROPERTY/FE_SET_PROPERTY <FE_GET_PROPERTY>`
18*4882a593Smuzhiyunioctl's. The new API is flexible enough to add new parameters to
19*4882a593Smuzhiyunexisting delivery systems, and to add newer delivery systems.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunSo, newer applications should use
22*4882a593Smuzhiyun:ref:`FE_GET_PROPERTY/FE_SET_PROPERTY <FE_GET_PROPERTY>`
23*4882a593Smuzhiyuninstead, in order to be able to support the newer System Delivery like
24*4882a593SmuzhiyunDVB-S2, DVB-T2, DVB-C2, ISDB, etc.
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunAll kinds of parameters are combined as a union in the
27*4882a593Smuzhiyun``dvb_frontend_parameters`` structure:
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun.. code-block:: c
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun    struct dvb_frontend_parameters {
33*4882a593Smuzhiyun	uint32_t frequency;     /* (absolute) frequency in Hz for QAM/OFDM */
34*4882a593Smuzhiyun		    /* intermediate frequency in kHz for QPSK */
35*4882a593Smuzhiyun	fe_spectral_inversion_t inversion;
36*4882a593Smuzhiyun	union {
37*4882a593Smuzhiyun	    struct dvb_qpsk_parameters qpsk;
38*4882a593Smuzhiyun	    struct dvb_qam_parameters  qam;
39*4882a593Smuzhiyun	    struct dvb_ofdm_parameters ofdm;
40*4882a593Smuzhiyun	    struct dvb_vsb_parameters  vsb;
41*4882a593Smuzhiyun	} u;
42*4882a593Smuzhiyun    };
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunIn the case of QPSK frontends the ``frequency`` field specifies the
45*4882a593Smuzhiyunintermediate frequency, i.e. the offset which is effectively added to
46*4882a593Smuzhiyunthe local oscillator frequency (LOF) of the LNB. The intermediate
47*4882a593Smuzhiyunfrequency has to be specified in units of kHz. For QAM and OFDM
48*4882a593Smuzhiyunfrontends the ``frequency`` specifies the absolute frequency and is
49*4882a593Smuzhiyungiven in Hz.
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun.. c:type:: dvb_qpsk_parameters
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunQPSK parameters
55*4882a593Smuzhiyun===============
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunFor satellite QPSK frontends you have to use the ``dvb_qpsk_parameters``
58*4882a593Smuzhiyunstructure:
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun.. code-block:: c
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun     struct dvb_qpsk_parameters {
64*4882a593Smuzhiyun	 uint32_t        symbol_rate;  /* symbol rate in Symbols per second */
65*4882a593Smuzhiyun	 fe_code_rate_t  fec_inner;    /* forward error correction (see above) */
66*4882a593Smuzhiyun     };
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun.. c:type:: dvb_qam_parameters
70*4882a593Smuzhiyun
71*4882a593SmuzhiyunQAM parameters
72*4882a593Smuzhiyun==============
73*4882a593Smuzhiyun
74*4882a593Smuzhiyunfor cable QAM frontend you use the ``dvb_qam_parameters`` structure:
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun.. code-block:: c
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun     struct dvb_qam_parameters {
80*4882a593Smuzhiyun	 uint32_t         symbol_rate; /* symbol rate in Symbols per second */
81*4882a593Smuzhiyun	 fe_code_rate_t   fec_inner;   /* forward error correction (see above) */
82*4882a593Smuzhiyun	 fe_modulation_t  modulation;  /* modulation type (see above) */
83*4882a593Smuzhiyun     };
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun.. c:type:: dvb_vsb_parameters
87*4882a593Smuzhiyun
88*4882a593SmuzhiyunVSB parameters
89*4882a593Smuzhiyun==============
90*4882a593Smuzhiyun
91*4882a593SmuzhiyunATSC frontends are supported by the ``dvb_vsb_parameters`` structure:
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun.. code-block:: c
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun    struct dvb_vsb_parameters {
97*4882a593Smuzhiyun	fe_modulation_t modulation; /* modulation type (see above) */
98*4882a593Smuzhiyun    };
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun.. c:type:: dvb_ofdm_parameters
102*4882a593Smuzhiyun
103*4882a593SmuzhiyunOFDM parameters
104*4882a593Smuzhiyun===============
105*4882a593Smuzhiyun
106*4882a593SmuzhiyunDVB-T frontends are supported by the ``dvb_ofdm_parameters`` structure:
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun.. code-block:: c
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun     struct dvb_ofdm_parameters {
112*4882a593Smuzhiyun	 fe_bandwidth_t      bandwidth;
113*4882a593Smuzhiyun	 fe_code_rate_t      code_rate_HP;  /* high priority stream code rate */
114*4882a593Smuzhiyun	 fe_code_rate_t      code_rate_LP;  /* low priority stream code rate */
115*4882a593Smuzhiyun	 fe_modulation_t     constellation; /* modulation type (see above) */
116*4882a593Smuzhiyun	 fe_transmit_mode_t  transmission_mode;
117*4882a593Smuzhiyun	 fe_guard_interval_t guard_interval;
118*4882a593Smuzhiyun	 fe_hierarchy_t      hierarchy_information;
119*4882a593Smuzhiyun     };
120