summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2009-07-11 02:03:43 +0300
committerAntti Palosaari <crope@iki.fi>2009-07-11 02:03:43 +0300
commit4e59bbd4f49a574bb00ea82a9394afe1f62cd317 (patch)
tree1dad14cd9a0e1bf1ae972a9d10282287241d8ed6 /linux/drivers/media/dvb
parent4ef8b7305c8cbfe9bf28c600f843848987377571 (diff)
downloadmediapointer-dvb-s2-4e59bbd4f49a574bb00ea82a9394afe1f62cd317.tar.gz
mediapointer-dvb-s2-4e59bbd4f49a574bb00ea82a9394afe1f62cd317.tar.bz2
af9013: auto-detect parameters in case of garbage given by app
From: Antti Palosaari <crope@iki.fi> Request demodulator auto-detect transmission parameters in case of garbage parameters provided by application for compatibility. That's needed at least for MPlayer compatibility currently. Thanks to Jelle de Jong for reporting issue and providing SSH access to Devin for debugging. Thanks to Devin Heitmueller for hard debug work he did to find that bug. Priority: high Signed-off-by: Antti Palosaari <crope@iki.fi> Cc: Devin Heitmueller <dheitmueller@kernellabs.com> Cc: Jelle de Jong <jelledejong@powercraft.nl>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/frontends/af9013.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/frontends/af9013.c b/linux/drivers/media/dvb/frontends/af9013.c
index d12d99802..62d3185ee 100644
--- a/linux/drivers/media/dvb/frontends/af9013.c
+++ b/linux/drivers/media/dvb/frontends/af9013.c
@@ -528,6 +528,10 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
u8 i, buf[3] = {0, 0, 0};
*auto_mode = 0; /* set if parameters are requested to auto set */
+ /* Try auto-detect transmission parameters in case of AUTO requested or
+ garbage parameters given by application for compatibility.
+ MPlayer seems to provide garbage parameters currently. */
+
switch (params->transmission_mode) {
case TRANSMISSION_MODE_AUTO:
*auto_mode = 1;
@@ -537,7 +541,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
buf[0] |= (1 << 0);
break;
default:
- return -EINVAL;
+ deb_info("%s: invalid transmission_mode\n", __func__);
+ *auto_mode = 1;
}
switch (params->guard_interval) {
@@ -555,7 +560,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
buf[0] |= (3 << 2);
break;
default:
- return -EINVAL;
+ deb_info("%s: invalid guard_interval\n", __func__);
+ *auto_mode = 1;
}
switch (params->hierarchy_information) {
@@ -573,7 +579,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
buf[0] |= (3 << 4);
break;
default:
- return -EINVAL;
+ deb_info("%s: invalid hierarchy_information\n", __func__);
+ *auto_mode = 1;
};
switch (params->constellation) {
@@ -588,7 +595,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
buf[1] |= (2 << 6);
break;
default:
- return -EINVAL;
+ deb_info("%s: invalid constellation\n", __func__);
+ *auto_mode = 1;
}
/* Use HP. How and which case we can switch to LP? */
@@ -612,7 +620,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
buf[2] |= (4 << 0);
break;
default:
- return -EINVAL;
+ deb_info("%s: invalid code_rate_HP\n", __func__);
+ *auto_mode = 1;
}
switch (params->code_rate_LP) {
@@ -639,7 +648,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
if (params->hierarchy_information == HIERARCHY_AUTO)
break;
default:
- return -EINVAL;
+ deb_info("%s: invalid code_rate_LP\n", __func__);
+ *auto_mode = 1;
}
switch (params->bandwidth) {
@@ -652,7 +662,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
buf[1] |= (2 << 2);
break;
default:
- return -EINVAL;
+ deb_info("%s: invalid bandwidth\n", __func__);
+ buf[1] |= (2 << 2); /* cannot auto-detect BW, try 8 MHz */
}
/* program */