diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-21 06:27:20 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 05:26:29 -0500 |
commit | 0607d077809014082965061e9e88f38459c070ac (patch) | |
tree | 600167192feeb50e8e68c9792506b8ca6d78aa77 | |
parent | 0349471bc556d5ecd3e9214af7774fbf2d956931 (diff) |
[media] dvb_core: estimate bw for all non-terrestial systems
Instead of just estimating the bandwidth for DVB-C annex A/C,
also fill it at the core for ATSC and DVB-C annex B. This
simplifies the logic inside the tuners, as all non-satellite
tuners can just use c->bandwidth_hz for all supported
delivery systems.
It could make sense to latter use it also for satellite
systems, as several DVB-S drivers have their own calculus.
However, on DVB-S2 the bw estimation is a little more complex,
and the existing drivers have some optimized calculus for
bandwidth. So, let's not touch on it for now.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 2e4bddec9b32..7ea79dffa970 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -1180,19 +1180,38 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe) | |||
1180 | } | 1180 | } |
1181 | 1181 | ||
1182 | /* | 1182 | /* |
1183 | * On DVB-C, the bandwidth is a function of roll-off and symbol rate. | 1183 | * Be sure that the bandwidth will be filled for all |
1184 | * The bandwidth is required for DVB-C tuners, in order to avoid | 1184 | * non-satellite systems, as tuners need to know what |
1185 | * inter-channel noise. Instead of estimating the minimal required | 1185 | * low pass/Nyquist half filter should be applied, in |
1186 | * bandwidth on every single driver, calculates it here and fills | 1186 | * order to avoid inter-channel noise. |
1187 | * it at the cache bandwidth parameter. | 1187 | * |
1188 | * ISDB-T and DVB-T/T2 already sets bandwidth. | ||
1189 | * ATSC and DVB-C don't set, so, the core should fill it. | ||
1190 | * | ||
1191 | * On DVB-C Annex A and C, the bandwidth is a function of | ||
1192 | * the roll-off and symbol rate. Annex B defines different | ||
1193 | * roll-off factors depending on the modulation. Fortunately, | ||
1194 | * Annex B is only used with 6MHz, so there's no need to | ||
1195 | * calculate it. | ||
1196 | * | ||
1188 | * While not officially supported, a side effect of handling it at | 1197 | * While not officially supported, a side effect of handling it at |
1189 | * the cache level is that a program could retrieve the bandwidth | 1198 | * the cache level is that a program could retrieve the bandwidth |
1190 | * via DTV_BANDWIDTH_HZ, wich may be useful for test programs. | 1199 | * via DTV_BANDWIDTH_HZ, which may be useful for test programs. |
1191 | */ | 1200 | */ |
1192 | if (c->delivery_system == SYS_DVBC_ANNEX_A) | 1201 | switch (c->delivery_system) { |
1202 | case SYS_ATSC: | ||
1203 | case SYS_DVBC_ANNEX_B: | ||
1204 | c->bandwidth_hz = 6000000; | ||
1205 | break; | ||
1206 | case SYS_DVBC_ANNEX_A: | ||
1193 | rolloff = 115; | 1207 | rolloff = 115; |
1194 | if (c->delivery_system == SYS_DVBC_ANNEX_C) | 1208 | break; |
1209 | case SYS_DVBC_ANNEX_C: | ||
1195 | rolloff = 113; | 1210 | rolloff = 113; |
1211 | break; | ||
1212 | default: | ||
1213 | break; | ||
1214 | } | ||
1196 | if (rolloff) | 1215 | if (rolloff) |
1197 | c->bandwidth_hz = (c->symbol_rate * rolloff) / 100; | 1216 | c->bandwidth_hz = (c->symbol_rate * rolloff) / 100; |
1198 | } | 1217 | } |