Skip to content

Commit 224b664

Browse files
palosaariMauro Carvalho Chehab
authored andcommitted
[media] add DTMB support for DVB API
Cc: Patrick Boettcher <[email protected]> Cc: Andreas Oberritter <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Acked-by: Patrick Boettcher <[email protected]> Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 991452a commit 224b664

File tree

8 files changed

+74
-11
lines changed

8 files changed

+74
-11
lines changed

Documentation/DocBook/media/dvb/dvbproperty.xml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ get/set up to 64 properties. The actual meaning of each property is described on
194194
APSK_16,
195195
APSK_32,
196196
DQPSK,
197+
QAM_4_NR,
197198
} fe_modulation_t;
198199
</programlisting>
199200
</section>
@@ -265,6 +266,7 @@ typedef enum fe_code_rate {
265266
FEC_AUTO,
266267
FEC_3_5,
267268
FEC_9_10,
269+
FEC_2_5,
268270
} fe_code_rate_t;
269271
</programlisting>
270272
<para>which correspond to error correction rates of 1/2, 2/3, etc.,
@@ -351,7 +353,7 @@ typedef enum fe_delivery_system {
351353
SYS_ISDBC,
352354
SYS_ATSC,
353355
SYS_ATSCMH,
354-
SYS_DMBTH,
356+
SYS_DTMB,
355357
SYS_CMMB,
356358
SYS_DAB,
357359
SYS_DVBT2,
@@ -735,6 +737,9 @@ typedef enum fe_guard_interval {
735737
GUARD_INTERVAL_1_128,
736738
GUARD_INTERVAL_19_128,
737739
GUARD_INTERVAL_19_256,
740+
GUARD_INTERVAL_PN420,
741+
GUARD_INTERVAL_PN595,
742+
GUARD_INTERVAL_PN945,
738743
} fe_guard_interval_t;
739744
</programlisting>
740745

@@ -743,6 +748,7 @@ typedef enum fe_guard_interval {
743748
try to find the correct guard interval (if capable) and will use TMCC to fill
744749
in the missing parameters.</para>
745750
<para>2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present</para>
751+
<para>3) DTMB specifies PN420, PN595 and PN945.</para>
746752
</section>
747753
<section id="DTV-TRANSMISSION-MODE">
748754
<title><constant>DTV_TRANSMISSION_MODE</constant></title>
@@ -759,6 +765,8 @@ typedef enum fe_transmit_mode {
759765
TRANSMISSION_MODE_1K,
760766
TRANSMISSION_MODE_16K,
761767
TRANSMISSION_MODE_32K,
768+
TRANSMISSION_MODE_C1,
769+
TRANSMISSION_MODE_C3780,
762770
} fe_transmit_mode_t;
763771
</programlisting>
764772
<para>Notes:</para>
@@ -770,6 +778,7 @@ typedef enum fe_transmit_mode {
770778
use TMCC to fill in the missing parameters.</para>
771779
<para>3) DVB-T specifies 2K and 8K as valid sizes.</para>
772780
<para>4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.</para>
781+
<para>5) DTMB specifies C1 and C3780.</para>
773782
</section>
774783
<section id="DTV-HIERARCHY">
775784
<title><constant>DTV_HIERARCHY</constant></title>
@@ -806,6 +815,17 @@ typedef enum fe_hierarchy {
806815
FE_GET_INFO. In the case of a legacy frontend, the result is just the same
807816
as with FE_GET_INFO, but in a more structured format </para>
808817
</section>
818+
<section id="DTV-INTERLEAVING">
819+
<title><constant>DTV_INTERLEAVING</constant></title>
820+
<para>Interleaving mode</para>
821+
<programlisting>
822+
enum fe_interleaving {
823+
INTERLEAVING_NONE,
824+
INTERLEAVING_240,
825+
INTERLEAVING_720,
826+
};
827+
</programlisting>
828+
</section>
809829
</section>
810830
<section id="frontend-property-terrestrial-systems">
811831
<title>Properties used on terrestrial delivery systems</title>
@@ -944,6 +964,24 @@ typedef enum fe_hierarchy {
944964
<listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-D"><constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant></link></para></listitem>
945965
</itemizedlist>
946966
</section>
967+
<section id="dtmb-params">
968+
<title>DTMB delivery system</title>
969+
<para>The following parameters are valid for DTMB:</para>
970+
<itemizedlist mark='opencircle'>
971+
<listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
972+
<listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
973+
<listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
974+
<listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
975+
<listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
976+
<listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
977+
<listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem>
978+
<listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
979+
<listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
980+
<listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem>
981+
<listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem>
982+
<listitem><para><link linkend="DTV-INTERLEAVING"><constant>DTV_INTERLEAVING</constant></link></para></listitem>
983+
</itemizedlist>
984+
</section>
947985
</section>
948986
<section id="frontend-property-cable-systems">
949987
<title>Properties used on cable delivery systems</title>

drivers/media/dvb/dvb-core/dvb_frontend.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static enum dvbv3_emulation_type dvbv3_type(u32 delivery_system)
179179
case SYS_DVBT:
180180
case SYS_DVBT2:
181181
case SYS_ISDBT:
182-
case SYS_DMBTH:
182+
case SYS_DTMB:
183183
return DVBV3_OFDM;
184184
case SYS_ATSC:
185185
case SYS_ATSCMH:
@@ -997,6 +997,7 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
997997
_DTV_CMD(DTV_CODE_RATE_LP, 1, 0),
998998
_DTV_CMD(DTV_GUARD_INTERVAL, 1, 0),
999999
_DTV_CMD(DTV_TRANSMISSION_MODE, 1, 0),
1000+
_DTV_CMD(DTV_INTERLEAVING, 1, 0),
10001001

10011002
_DTV_CMD(DTV_ISDBT_PARTIAL_RECEPTION, 1, 0),
10021003
_DTV_CMD(DTV_ISDBT_SOUND_BROADCASTING, 1, 0),
@@ -1028,6 +1029,7 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
10281029
_DTV_CMD(DTV_GUARD_INTERVAL, 0, 0),
10291030
_DTV_CMD(DTV_TRANSMISSION_MODE, 0, 0),
10301031
_DTV_CMD(DTV_HIERARCHY, 0, 0),
1032+
_DTV_CMD(DTV_INTERLEAVING, 0, 0),
10311033

10321034
_DTV_CMD(DTV_ENUM_DELSYS, 0, 0),
10331035

@@ -1326,6 +1328,9 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
13261328
case DTV_HIERARCHY:
13271329
tvp->u.data = c->hierarchy;
13281330
break;
1331+
case DTV_INTERLEAVING:
1332+
tvp->u.data = c->interleaving;
1333+
break;
13291334

13301335
/* ISDB-T Support here */
13311336
case DTV_ISDBT_PARTIAL_RECEPTION:
@@ -1593,7 +1598,7 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
15931598
* The DVBv3 or DVBv5 call is requesting a different system. So,
15941599
* emulation is needed.
15951600
*
1596-
* Emulate newer delivery systems like ISDBT, DVBT and DMBTH
1601+
* Emulate newer delivery systems like ISDBT, DVBT and DTMB
15971602
* for older DVBv5 applications. The emulation will try to use
15981603
* the auto mode for most things, and will assume that the desired
15991604
* delivery system is the last one at the ops.delsys[] array
@@ -1715,6 +1720,9 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
17151720
case DTV_HIERARCHY:
17161721
c->hierarchy = tvp->u.data;
17171722
break;
1723+
case DTV_INTERLEAVING:
1724+
c->interleaving = tvp->u.data;
1725+
break;
17181726

17191727
/* ISDB-T Support here */
17201728
case DTV_ISDBT_PARTIAL_RECEPTION:
@@ -2012,7 +2020,7 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
20122020
case SYS_DVBT:
20132021
case SYS_DVBT2:
20142022
case SYS_ISDBT:
2015-
case SYS_DMBTH:
2023+
case SYS_DTMB:
20162024
fepriv->min_delay = HZ / 20;
20172025
fepriv->step_size = fe->ops.info.frequency_stepsize * 2;
20182026
fepriv->max_drift = (fe->ops.info.frequency_stepsize * 2) + 1;

drivers/media/dvb/dvb-core/dvb_frontend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ struct dtv_frontend_properties {
354354

355355
fe_delivery_system_t delivery_system;
356356

357+
enum fe_interleaving interleaving;
358+
357359
/* ISDB-T specifics */
358360
u8 isdbt_partial_reception;
359361
u8 isdbt_sb_mode;

drivers/media/dvb/frontends/atbm8830.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static int atbm8830_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
428428
}
429429

430430
static struct dvb_frontend_ops atbm8830_ops = {
431-
.delsys = { SYS_DMBTH },
431+
.delsys = { SYS_DTMB },
432432
.info = {
433433
.name = "AltoBeam ATBM8830/8831 DMB-TH",
434434
.frequency_min = 474000000,

drivers/media/dvb/frontends/lgs8gl5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ EXPORT_SYMBOL(lgs8gl5_attach);
412412

413413

414414
static struct dvb_frontend_ops lgs8gl5_ops = {
415-
.delsys = { SYS_DMBTH },
415+
.delsys = { SYS_DTMB },
416416
.info = {
417417
.name = "Legend Silicon LGS-8GL5 DMB-TH",
418418
.frequency_min = 474000000,

drivers/media/dvb/frontends/lgs8gxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ static int lgs8gxx_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
995995
}
996996

997997
static struct dvb_frontend_ops lgs8gxx_ops = {
998-
.delsys = { SYS_DMBTH },
998+
.delsys = { SYS_DTMB },
999999
.info = {
10001000
.name = "Legend Silicon LGS8913/LGS8GXX DMB-TH",
10011001
.frequency_min = 474000000,

include/linux/dvb/frontend.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ typedef enum fe_code_rate {
152152
FEC_AUTO,
153153
FEC_3_5,
154154
FEC_9_10,
155+
FEC_2_5,
155156
} fe_code_rate_t;
156157

157158

@@ -169,6 +170,7 @@ typedef enum fe_modulation {
169170
APSK_16,
170171
APSK_32,
171172
DQPSK,
173+
QAM_4_NR,
172174
} fe_modulation_t;
173175

174176
typedef enum fe_transmit_mode {
@@ -179,6 +181,8 @@ typedef enum fe_transmit_mode {
179181
TRANSMISSION_MODE_1K,
180182
TRANSMISSION_MODE_16K,
181183
TRANSMISSION_MODE_32K,
184+
TRANSMISSION_MODE_C1,
185+
TRANSMISSION_MODE_C3780,
182186
} fe_transmit_mode_t;
183187

184188
#if defined(__DVB_CORE__) || !defined (__KERNEL__)
@@ -202,6 +206,9 @@ typedef enum fe_guard_interval {
202206
GUARD_INTERVAL_1_128,
203207
GUARD_INTERVAL_19_128,
204208
GUARD_INTERVAL_19_256,
209+
GUARD_INTERVAL_PN420,
210+
GUARD_INTERVAL_PN595,
211+
GUARD_INTERVAL_PN945,
205212
} fe_guard_interval_t;
206213

207214

@@ -213,6 +220,11 @@ typedef enum fe_hierarchy {
213220
HIERARCHY_AUTO
214221
} fe_hierarchy_t;
215222

223+
enum fe_interleaving {
224+
INTERLEAVING_NONE,
225+
INTERLEAVING_240,
226+
INTERLEAVING_720,
227+
};
216228

217229
#if defined(__DVB_CORE__) || !defined (__KERNEL__)
218230
struct dvb_qpsk_parameters {
@@ -337,7 +349,9 @@ struct dvb_frontend_event {
337349
#define DTV_ATSCMH_SCCC_CODE_MODE_C 58
338350
#define DTV_ATSCMH_SCCC_CODE_MODE_D 59
339351

340-
#define DTV_MAX_COMMAND DTV_ATSCMH_SCCC_CODE_MODE_D
352+
#define DTV_INTERLEAVING 60
353+
354+
#define DTV_MAX_COMMAND DTV_INTERLEAVING
341355

342356
typedef enum fe_pilot {
343357
PILOT_ON,
@@ -366,16 +380,17 @@ typedef enum fe_delivery_system {
366380
SYS_ISDBC,
367381
SYS_ATSC,
368382
SYS_ATSCMH,
369-
SYS_DMBTH,
383+
SYS_DTMB,
370384
SYS_CMMB,
371385
SYS_DAB,
372386
SYS_DVBT2,
373387
SYS_TURBO,
374388
SYS_DVBC_ANNEX_C,
375389
} fe_delivery_system_t;
376390

377-
391+
/* backward compatibility */
378392
#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
393+
#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
379394

380395
/* ATSC-MH */
381396

include/linux/dvb/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
#define _DVBVERSION_H_
2525

2626
#define DVB_API_VERSION 5
27-
#define DVB_API_VERSION_MINOR 6
27+
#define DVB_API_VERSION_MINOR 7
2828

2929
#endif /*_DVBVERSION_H_*/

0 commit comments

Comments
 (0)