diff options
author | Patrick Boettcher <pboettcher@dibcom.fr> | 2009-08-03 13:39:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:14:24 -0400 |
commit | b6e760f3097501e60e76fbcb7a313d42da930c1f (patch) | |
tree | 11c810b34f9d215003a86d2d7baa66ce63f2c106 /drivers/media/dvb | |
parent | fc27f04698275ed28e64ba615e60e4d716a11e42 (diff) |
V4L/DVB (12892): DVB-API: add support for ISDB-T and ISDB-Tsb (version 5.1)
This patch increments the DVB-API to version 5.1 in order to reflect the addition of ISDB-T and ISDB-Tsb on Linux' DVB-API.
Changes in detail:
- added a small document to describe how to use the API to tune to an ISDB-T or ISDB-Tsb channel
- added necessary fields to dtv_frontend_cache
- added a smarter clear-cache function which resets all fields of the dtv_frontend_cache
- added a TRANSMISSION_MODE_4K to fe_transmit_mode_t
Signed-off-by: Olivier Grenie <olgrenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <pboettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 202 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.h | 14 |
2 files changed, 211 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index d13ebcb0c6b6..826080416c93 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -850,6 +850,49 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe, | |||
850 | return 0; | 850 | return 0; |
851 | } | 851 | } |
852 | 852 | ||
853 | static int dvb_frontend_clear_cache(struct dvb_frontend *fe) | ||
854 | { | ||
855 | int i; | ||
856 | |||
857 | memset(&(fe->dtv_property_cache), 0, | ||
858 | sizeof(struct dtv_frontend_properties)); | ||
859 | |||
860 | fe->dtv_property_cache.state = DTV_CLEAR; | ||
861 | fe->dtv_property_cache.delivery_system = SYS_UNDEFINED; | ||
862 | fe->dtv_property_cache.inversion = INVERSION_AUTO; | ||
863 | fe->dtv_property_cache.fec_inner = FEC_AUTO; | ||
864 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_AUTO; | ||
865 | fe->dtv_property_cache.bandwidth_hz = BANDWIDTH_AUTO; | ||
866 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_AUTO; | ||
867 | fe->dtv_property_cache.hierarchy = HIERARCHY_AUTO; | ||
868 | fe->dtv_property_cache.symbol_rate = QAM_AUTO; | ||
869 | fe->dtv_property_cache.code_rate_HP = FEC_AUTO; | ||
870 | fe->dtv_property_cache.code_rate_LP = FEC_AUTO; | ||
871 | |||
872 | fe->dtv_property_cache.isdbt_partial_reception = -1; | ||
873 | fe->dtv_property_cache.isdbt_sb_mode = -1; | ||
874 | fe->dtv_property_cache.isdbt_sb_subchannel = -1; | ||
875 | fe->dtv_property_cache.isdbt_sb_segment_idx = -1; | ||
876 | fe->dtv_property_cache.isdbt_sb_segment_count = -1; | ||
877 | fe->dtv_property_cache.isdbt_layer_enabled = 0x7; | ||
878 | for (i = 0; i < 3; i++) { | ||
879 | fe->dtv_property_cache.layer[i].fec = FEC_AUTO; | ||
880 | fe->dtv_property_cache.layer[i].modulation = QAM_AUTO; | ||
881 | fe->dtv_property_cache.layer[i].interleaving = -1; | ||
882 | fe->dtv_property_cache.layer[i].segment_count = -1; | ||
883 | } | ||
884 | |||
885 | return 0; | ||
886 | } | ||
887 | |||
888 | #define _DTV_CMD(n, s, b) \ | ||
889 | [n] = { \ | ||
890 | .name = #n, \ | ||
891 | .cmd = n, \ | ||
892 | .set = s,\ | ||
893 | .buffer = b \ | ||
894 | } | ||
895 | |||
853 | static struct dtv_cmds_h dtv_cmds[] = { | 896 | static struct dtv_cmds_h dtv_cmds[] = { |
854 | [DTV_TUNE] = { | 897 | [DTV_TUNE] = { |
855 | .name = "DTV_TUNE", | 898 | .name = "DTV_TUNE", |
@@ -949,6 +992,43 @@ static struct dtv_cmds_h dtv_cmds[] = { | |||
949 | .cmd = DTV_TRANSMISSION_MODE, | 992 | .cmd = DTV_TRANSMISSION_MODE, |
950 | .set = 1, | 993 | .set = 1, |
951 | }, | 994 | }, |
995 | |||
996 | _DTV_CMD(DTV_ISDBT_PARTIAL_RECEPTION, 1, 0), | ||
997 | _DTV_CMD(DTV_ISDBT_SOUND_BROADCASTING, 1, 0), | ||
998 | _DTV_CMD(DTV_ISDBT_SB_SUBCHANNEL_ID, 1, 0), | ||
999 | _DTV_CMD(DTV_ISDBT_SB_SEGMENT_IDX, 1, 0), | ||
1000 | _DTV_CMD(DTV_ISDBT_SB_SEGMENT_COUNT, 1, 0), | ||
1001 | _DTV_CMD(DTV_ISDBT_LAYERA_FEC, 1, 0), | ||
1002 | _DTV_CMD(DTV_ISDBT_LAYERA_MODULATION, 1, 0), | ||
1003 | _DTV_CMD(DTV_ISDBT_LAYERA_SEGMENT_COUNT, 1, 0), | ||
1004 | _DTV_CMD(DTV_ISDBT_LAYERA_TIME_INTERLEAVING, 1, 0), | ||
1005 | _DTV_CMD(DTV_ISDBT_LAYERB_FEC, 1, 0), | ||
1006 | _DTV_CMD(DTV_ISDBT_LAYERB_MODULATION, 1, 0), | ||
1007 | _DTV_CMD(DTV_ISDBT_LAYERB_SEGMENT_COUNT, 1, 0), | ||
1008 | _DTV_CMD(DTV_ISDBT_LAYERB_TIME_INTERLEAVING, 1, 0), | ||
1009 | _DTV_CMD(DTV_ISDBT_LAYERC_FEC, 1, 0), | ||
1010 | _DTV_CMD(DTV_ISDBT_LAYERC_MODULATION, 1, 0), | ||
1011 | _DTV_CMD(DTV_ISDBT_LAYERC_SEGMENT_COUNT, 1, 0), | ||
1012 | _DTV_CMD(DTV_ISDBT_LAYERC_TIME_INTERLEAVING, 1, 0), | ||
1013 | |||
1014 | _DTV_CMD(DTV_ISDBT_PARTIAL_RECEPTION, 0, 0), | ||
1015 | _DTV_CMD(DTV_ISDBT_SOUND_BROADCASTING, 0, 0), | ||
1016 | _DTV_CMD(DTV_ISDBT_SB_SUBCHANNEL_ID, 0, 0), | ||
1017 | _DTV_CMD(DTV_ISDBT_SB_SEGMENT_IDX, 0, 0), | ||
1018 | _DTV_CMD(DTV_ISDBT_SB_SEGMENT_COUNT, 0, 0), | ||
1019 | _DTV_CMD(DTV_ISDBT_LAYERA_FEC, 0, 0), | ||
1020 | _DTV_CMD(DTV_ISDBT_LAYERA_MODULATION, 0, 0), | ||
1021 | _DTV_CMD(DTV_ISDBT_LAYERA_SEGMENT_COUNT, 0, 0), | ||
1022 | _DTV_CMD(DTV_ISDBT_LAYERA_TIME_INTERLEAVING, 0, 0), | ||
1023 | _DTV_CMD(DTV_ISDBT_LAYERB_FEC, 0, 0), | ||
1024 | _DTV_CMD(DTV_ISDBT_LAYERB_MODULATION, 0, 0), | ||
1025 | _DTV_CMD(DTV_ISDBT_LAYERB_SEGMENT_COUNT, 0, 0), | ||
1026 | _DTV_CMD(DTV_ISDBT_LAYERB_TIME_INTERLEAVING, 0, 0), | ||
1027 | _DTV_CMD(DTV_ISDBT_LAYERC_FEC, 0, 0), | ||
1028 | _DTV_CMD(DTV_ISDBT_LAYERC_MODULATION, 0, 0), | ||
1029 | _DTV_CMD(DTV_ISDBT_LAYERC_SEGMENT_COUNT, 0, 0), | ||
1030 | _DTV_CMD(DTV_ISDBT_LAYERC_TIME_INTERLEAVING, 0, 0), | ||
1031 | |||
952 | /* Get */ | 1032 | /* Get */ |
953 | [DTV_DISEQC_SLAVE_REPLY] = { | 1033 | [DTV_DISEQC_SLAVE_REPLY] = { |
954 | .name = "DTV_DISEQC_SLAVE_REPLY", | 1034 | .name = "DTV_DISEQC_SLAVE_REPLY", |
@@ -956,6 +1036,7 @@ static struct dtv_cmds_h dtv_cmds[] = { | |||
956 | .set = 0, | 1036 | .set = 0, |
957 | .buffer = 1, | 1037 | .buffer = 1, |
958 | }, | 1038 | }, |
1039 | |||
959 | [DTV_API_VERSION] = { | 1040 | [DTV_API_VERSION] = { |
960 | .name = "DTV_API_VERSION", | 1041 | .name = "DTV_API_VERSION", |
961 | .cmd = DTV_API_VERSION, | 1042 | .cmd = DTV_API_VERSION, |
@@ -1165,14 +1246,21 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe) | |||
1165 | if(c->delivery_system == SYS_ISDBT) { | 1246 | if(c->delivery_system == SYS_ISDBT) { |
1166 | /* Fake out a generic DVB-T request so we pass validation in the ioctl */ | 1247 | /* Fake out a generic DVB-T request so we pass validation in the ioctl */ |
1167 | p->frequency = c->frequency; | 1248 | p->frequency = c->frequency; |
1168 | p->inversion = INVERSION_AUTO; | 1249 | p->inversion = c->inversion; |
1169 | p->u.ofdm.constellation = QAM_AUTO; | 1250 | p->u.ofdm.constellation = QAM_AUTO; |
1170 | p->u.ofdm.code_rate_HP = FEC_AUTO; | 1251 | p->u.ofdm.code_rate_HP = FEC_AUTO; |
1171 | p->u.ofdm.code_rate_LP = FEC_AUTO; | 1252 | p->u.ofdm.code_rate_LP = FEC_AUTO; |
1172 | p->u.ofdm.bandwidth = BANDWIDTH_AUTO; | ||
1173 | p->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO; | 1253 | p->u.ofdm.transmission_mode = TRANSMISSION_MODE_AUTO; |
1174 | p->u.ofdm.guard_interval = GUARD_INTERVAL_AUTO; | 1254 | p->u.ofdm.guard_interval = GUARD_INTERVAL_AUTO; |
1175 | p->u.ofdm.hierarchy_information = HIERARCHY_AUTO; | 1255 | p->u.ofdm.hierarchy_information = HIERARCHY_AUTO; |
1256 | if (c->bandwidth_hz == 8000000) | ||
1257 | p->u.ofdm.bandwidth = BANDWIDTH_8_MHZ; | ||
1258 | else if (c->bandwidth_hz == 7000000) | ||
1259 | p->u.ofdm.bandwidth = BANDWIDTH_7_MHZ; | ||
1260 | else if (c->bandwidth_hz == 6000000) | ||
1261 | p->u.ofdm.bandwidth = BANDWIDTH_6_MHZ; | ||
1262 | else | ||
1263 | p->u.ofdm.bandwidth = BANDWIDTH_AUTO; | ||
1176 | } | 1264 | } |
1177 | } | 1265 | } |
1178 | 1266 | ||
@@ -1274,6 +1362,59 @@ static int dtv_property_process_get(struct dvb_frontend *fe, | |||
1274 | case DTV_HIERARCHY: | 1362 | case DTV_HIERARCHY: |
1275 | tvp->u.data = fe->dtv_property_cache.hierarchy; | 1363 | tvp->u.data = fe->dtv_property_cache.hierarchy; |
1276 | break; | 1364 | break; |
1365 | |||
1366 | /* ISDB-T Support here */ | ||
1367 | case DTV_ISDBT_PARTIAL_RECEPTION: | ||
1368 | tvp->u.data = fe->dtv_property_cache.isdbt_partial_reception; | ||
1369 | break; | ||
1370 | case DTV_ISDBT_SOUND_BROADCASTING: | ||
1371 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_mode; | ||
1372 | break; | ||
1373 | case DTV_ISDBT_SB_SUBCHANNEL_ID: | ||
1374 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_subchannel; | ||
1375 | break; | ||
1376 | case DTV_ISDBT_SB_SEGMENT_IDX: | ||
1377 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_segment_idx; | ||
1378 | break; | ||
1379 | case DTV_ISDBT_SB_SEGMENT_COUNT: | ||
1380 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_segment_count; | ||
1381 | break; | ||
1382 | case DTV_ISDBT_LAYERA_FEC: | ||
1383 | tvp->u.data = fe->dtv_property_cache.layer[0].fec; | ||
1384 | break; | ||
1385 | case DTV_ISDBT_LAYERA_MODULATION: | ||
1386 | tvp->u.data = fe->dtv_property_cache.layer[0].modulation; | ||
1387 | break; | ||
1388 | case DTV_ISDBT_LAYERA_SEGMENT_COUNT: | ||
1389 | tvp->u.data = fe->dtv_property_cache.layer[0].segment_count; | ||
1390 | break; | ||
1391 | case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: | ||
1392 | tvp->u.data = fe->dtv_property_cache.layer[0].interleaving; | ||
1393 | break; | ||
1394 | case DTV_ISDBT_LAYERB_FEC: | ||
1395 | tvp->u.data = fe->dtv_property_cache.layer[1].fec; | ||
1396 | break; | ||
1397 | case DTV_ISDBT_LAYERB_MODULATION: | ||
1398 | tvp->u.data = fe->dtv_property_cache.layer[1].modulation; | ||
1399 | break; | ||
1400 | case DTV_ISDBT_LAYERB_SEGMENT_COUNT: | ||
1401 | tvp->u.data = fe->dtv_property_cache.layer[1].segment_count; | ||
1402 | break; | ||
1403 | case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: | ||
1404 | tvp->u.data = fe->dtv_property_cache.layer[1].interleaving; | ||
1405 | break; | ||
1406 | case DTV_ISDBT_LAYERC_FEC: | ||
1407 | tvp->u.data = fe->dtv_property_cache.layer[2].fec; | ||
1408 | break; | ||
1409 | case DTV_ISDBT_LAYERC_MODULATION: | ||
1410 | tvp->u.data = fe->dtv_property_cache.layer[2].modulation; | ||
1411 | break; | ||
1412 | case DTV_ISDBT_LAYERC_SEGMENT_COUNT: | ||
1413 | tvp->u.data = fe->dtv_property_cache.layer[2].segment_count; | ||
1414 | break; | ||
1415 | case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: | ||
1416 | tvp->u.data = fe->dtv_property_cache.layer[2].interleaving; | ||
1417 | break; | ||
1277 | default: | 1418 | default: |
1278 | r = -1; | 1419 | r = -1; |
1279 | } | 1420 | } |
@@ -1302,10 +1443,8 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1302 | /* Reset a cache of data specific to the frontend here. This does | 1443 | /* Reset a cache of data specific to the frontend here. This does |
1303 | * not effect hardware. | 1444 | * not effect hardware. |
1304 | */ | 1445 | */ |
1446 | dvb_frontend_clear_cache(fe); | ||
1305 | dprintk("%s() Flushing property cache\n", __func__); | 1447 | dprintk("%s() Flushing property cache\n", __func__); |
1306 | memset(&fe->dtv_property_cache, 0, sizeof(struct dtv_frontend_properties)); | ||
1307 | fe->dtv_property_cache.state = tvp->cmd; | ||
1308 | fe->dtv_property_cache.delivery_system = SYS_UNDEFINED; | ||
1309 | break; | 1448 | break; |
1310 | case DTV_TUNE: | 1449 | case DTV_TUNE: |
1311 | /* interpret the cache of data, build either a traditional frontend | 1450 | /* interpret the cache of data, build either a traditional frontend |
@@ -1371,6 +1510,59 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1371 | case DTV_HIERARCHY: | 1510 | case DTV_HIERARCHY: |
1372 | fe->dtv_property_cache.hierarchy = tvp->u.data; | 1511 | fe->dtv_property_cache.hierarchy = tvp->u.data; |
1373 | break; | 1512 | break; |
1513 | |||
1514 | /* ISDB-T Support here */ | ||
1515 | case DTV_ISDBT_PARTIAL_RECEPTION: | ||
1516 | fe->dtv_property_cache.isdbt_partial_reception = tvp->u.data; | ||
1517 | break; | ||
1518 | case DTV_ISDBT_SOUND_BROADCASTING: | ||
1519 | fe->dtv_property_cache.isdbt_sb_mode = tvp->u.data; | ||
1520 | break; | ||
1521 | case DTV_ISDBT_SB_SUBCHANNEL_ID: | ||
1522 | fe->dtv_property_cache.isdbt_sb_subchannel = tvp->u.data; | ||
1523 | break; | ||
1524 | case DTV_ISDBT_SB_SEGMENT_IDX: | ||
1525 | fe->dtv_property_cache.isdbt_sb_segment_idx = tvp->u.data; | ||
1526 | break; | ||
1527 | case DTV_ISDBT_SB_SEGMENT_COUNT: | ||
1528 | fe->dtv_property_cache.isdbt_sb_segment_count = tvp->u.data; | ||
1529 | break; | ||
1530 | case DTV_ISDBT_LAYERA_FEC: | ||
1531 | fe->dtv_property_cache.layer[0].fec = tvp->u.data; | ||
1532 | break; | ||
1533 | case DTV_ISDBT_LAYERA_MODULATION: | ||
1534 | fe->dtv_property_cache.layer[0].modulation = tvp->u.data; | ||
1535 | break; | ||
1536 | case DTV_ISDBT_LAYERA_SEGMENT_COUNT: | ||
1537 | fe->dtv_property_cache.layer[0].segment_count = tvp->u.data; | ||
1538 | break; | ||
1539 | case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: | ||
1540 | fe->dtv_property_cache.layer[0].interleaving = tvp->u.data; | ||
1541 | break; | ||
1542 | case DTV_ISDBT_LAYERB_FEC: | ||
1543 | fe->dtv_property_cache.layer[1].fec = tvp->u.data; | ||
1544 | break; | ||
1545 | case DTV_ISDBT_LAYERB_MODULATION: | ||
1546 | fe->dtv_property_cache.layer[1].modulation = tvp->u.data; | ||
1547 | break; | ||
1548 | case DTV_ISDBT_LAYERB_SEGMENT_COUNT: | ||
1549 | fe->dtv_property_cache.layer[1].segment_count = tvp->u.data; | ||
1550 | break; | ||
1551 | case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: | ||
1552 | fe->dtv_property_cache.layer[1].interleaving = tvp->u.data; | ||
1553 | break; | ||
1554 | case DTV_ISDBT_LAYERC_FEC: | ||
1555 | fe->dtv_property_cache.layer[2].fec = tvp->u.data; | ||
1556 | break; | ||
1557 | case DTV_ISDBT_LAYERC_MODULATION: | ||
1558 | fe->dtv_property_cache.layer[2].modulation = tvp->u.data; | ||
1559 | break; | ||
1560 | case DTV_ISDBT_LAYERC_SEGMENT_COUNT: | ||
1561 | fe->dtv_property_cache.layer[2].segment_count = tvp->u.data; | ||
1562 | break; | ||
1563 | case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: | ||
1564 | fe->dtv_property_cache.layer[2].interleaving = tvp->u.data; | ||
1565 | break; | ||
1374 | default: | 1566 | default: |
1375 | r = -1; | 1567 | r = -1; |
1376 | } | 1568 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h index e176da472d7a..9e46f1772c54 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb/dvb-core/dvb_frontend.h | |||
@@ -341,6 +341,20 @@ struct dtv_frontend_properties { | |||
341 | fe_rolloff_t rolloff; | 341 | fe_rolloff_t rolloff; |
342 | 342 | ||
343 | fe_delivery_system_t delivery_system; | 343 | fe_delivery_system_t delivery_system; |
344 | |||
345 | /* ISDB-T specifics */ | ||
346 | u8 isdbt_partial_reception; | ||
347 | u8 isdbt_sb_mode; | ||
348 | u8 isdbt_sb_subchannel; | ||
349 | u32 isdbt_sb_segment_idx; | ||
350 | u32 isdbt_sb_segment_count; | ||
351 | u8 isdbt_layer_enabled; | ||
352 | struct { | ||
353 | u8 segment_count; | ||
354 | fe_code_rate_t fec; | ||
355 | fe_modulation_t modulation; | ||
356 | u8 interleaving; | ||
357 | } layer[3]; | ||
344 | }; | 358 | }; |
345 | 359 | ||
346 | struct dvb_frontend { | 360 | struct dvb_frontend { |