aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-22 06:56:48 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 06:08:14 -0500
commiteeacf1477b4460e2dbc37c9164bb46a65ab8f084 (patch)
treeb130913f6fc7a55619f2b14dd387be83aa32f16d /drivers
parent14d24d148c7521b2b88b396652e36f55d061e195 (diff)
[media] dvb-core: allow demods to specify the supported delsys
The dvb were originally written for DVB-T/C/S and ATSC. So, the original frontend struct has fields to describe only those three standards. While 2nd gen standards are similar to these, new standards like DSS, ISDB and CTTB don't fit on any of the above types. While there's a way for the drivers to explicitly change whatever default DELSYS were filled inside the core, still a fake value is needed there, and a "compat" code to allow DVBv3 applications to work with those delivery systems is needed. This is good for a short term solution, while applications aren't using DVBv5 directly. However, at long term, this is bad, as the compat code runs even if the application is using DVBv5. Also, the compat code is not perfect, and only works when the frontend is capable of auto-detecting the parameters that aren't visible by the faked delivery systems. So, let the frontend fill the supported delivery systems at the device properties directly. The future plan is that the drivers will stop filling ops->info.type, filling, instead, ops->delsys. This will allow multi-frontend devices like drx-k to use just one frontend structure for all supported delivery systems. Of course, the core will keep using it, in order to keep allowing DVBv3 calls. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c13
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.h8
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 7ea79dffa97..001804744d4 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1252,6 +1252,19 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
1252 const struct dvb_frontend_info *info = &fe->ops.info; 1252 const struct dvb_frontend_info *info = &fe->ops.info;
1253 u32 ncaps = 0; 1253 u32 ncaps = 0;
1254 1254
1255 /*
1256 * If the frontend explicitly sets a list, use it, instead of
1257 * filling based on the info->type
1258 */
1259 if (fe->ops.delsys[ncaps]) {
1260 while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
1261 p->u.buffer.data[ncaps] = fe->ops.delsys[ncaps];
1262 ncaps++;
1263 }
1264 p->u.buffer.len = ncaps;
1265 return;
1266 }
1267
1255 switch (info->type) { 1268 switch (info->type) {
1256 case FE_QPSK: 1269 case FE_QPSK:
1257 p->u.buffer.data[ncaps++] = SYS_DVBS; 1270 p->u.buffer.data[ncaps++] = SYS_DVBS;
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h
index 895f88f06f5..95f2134a162 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.h
@@ -42,6 +42,12 @@
42 42
43#include "dvbdev.h" 43#include "dvbdev.h"
44 44
45/*
46 * Maximum number of Delivery systems per frontend. It
47 * should be smaller or equal to 32
48 */
49#define MAX_DELSYS 8
50
45struct dvb_frontend_tune_settings { 51struct dvb_frontend_tune_settings {
46 int min_delay_ms; 52 int min_delay_ms;
47 int step_size; 53 int step_size;
@@ -254,6 +260,8 @@ struct dvb_frontend_ops {
254 260
255 struct dvb_frontend_info info; 261 struct dvb_frontend_info info;
256 262
263 u8 delsys[MAX_DELSYS];
264
257 void (*release)(struct dvb_frontend* fe); 265 void (*release)(struct dvb_frontend* fe);
258 void (*release_sec)(struct dvb_frontend* fe); 266 void (*release_sec)(struct dvb_frontend* fe);
259 267