Commit e68b286a authored by Michael Hunold's avatar Michael Hunold Committed by Linus Torvalds

[PATCH] DVB: Fixes for frontend drivers

 - ves1820: increase mdelay from 30 to 50 to be more reliable with bad
   reception quality (Andreas Oberritter)
 - dst: remove AUTO_INVERSION for capabilities, allow params
   dst_type_flags and dst_type to have multiple values for multiple
   cards in one machine (Jamie Honan)
parent d07c7afd
...@@ -44,12 +44,15 @@ MODULE_PARM_DESC(dst_verbose, ...@@ -44,12 +44,15 @@ MODULE_PARM_DESC(dst_verbose,
MODULE_PARM(dst_debug, "i"); MODULE_PARM(dst_debug, "i");
MODULE_PARM_DESC(dst_debug, "debug messages, default is 0 (no)"); MODULE_PARM_DESC(dst_debug, "debug messages, default is 0 (no)");
unsigned int dst_type = (-1U); #define DST_MAX_CARDS 6
unsigned int dst_type_flags = (-1U); unsigned int dst_cur_no = 0;
MODULE_PARM(dst_type, "i");
unsigned int dst_type[DST_MAX_CARDS] = { [0 ... (DST_MAX_CARDS-1)] = (-1U)};
unsigned int dst_type_flags[DST_MAX_CARDS] = { [0 ... (DST_MAX_CARDS-1)] = (-1U)};
MODULE_PARM(dst_type, "1-" __stringify(DST_MAX_CARDS) "i");
MODULE_PARM_DESC(dst_type, MODULE_PARM_DESC(dst_type,
"Type of DST card, 0 Satellite, 1 terrestial TV, 2 Cable, default driver determined"); "Type of DST card, 0 Satellite, 1 terrestial TV, 2 Cable, default driver determined");
MODULE_PARM(dst_type_flags, "i"); MODULE_PARM(dst_type_flags, "1-" __stringify(DST_MAX_CARDS) "i");
MODULE_PARM_DESC(dst_type_flags, MODULE_PARM_DESC(dst_type_flags,
"Type flags of DST card, bitfield 1=10 byte tuner, 2=TS is 204, 4=symdiv"); "Type flags of DST card, bitfield 1=10 byte tuner, 2=TS is 204, 4=symdiv");
...@@ -102,8 +105,7 @@ static struct dvb_frontend_info dst_info_sat = { ...@@ -102,8 +105,7 @@ static struct dvb_frontend_info dst_info_sat = {
.symbol_rate_max = 45000000, .symbol_rate_max = 45000000,
/* . symbol_rate_tolerance = ???,*/ /* . symbol_rate_tolerance = ???,*/
.notifier_delay = 50, /* 1/20 s */ .notifier_delay = 50, /* 1/20 s */
.caps = FE_CAN_INVERSION_AUTO | .caps = FE_CAN_FEC_AUTO |
FE_CAN_FEC_AUTO |
FE_CAN_QPSK FE_CAN_QPSK
}; };
...@@ -117,8 +119,7 @@ static struct dvb_frontend_info dst_info_cable = { ...@@ -117,8 +119,7 @@ static struct dvb_frontend_info dst_info_cable = {
.symbol_rate_max = 45000000, .symbol_rate_max = 45000000,
/* . symbol_rate_tolerance = ???,*/ /* . symbol_rate_tolerance = ???,*/
.notifier_delay = 50, /* 1/20 s */ .notifier_delay = 50, /* 1/20 s */
.caps = FE_CAN_INVERSION_AUTO | .caps = FE_CAN_FEC_AUTO |
FE_CAN_FEC_AUTO |
FE_CAN_QAM_AUTO FE_CAN_QAM_AUTO
}; };
...@@ -128,8 +129,7 @@ static struct dvb_frontend_info dst_info_tv = { ...@@ -128,8 +129,7 @@ static struct dvb_frontend_info dst_info_tv = {
.frequency_min = 137000000, .frequency_min = 137000000,
.frequency_max = 858000000, .frequency_max = 858000000,
.frequency_stepsize = 166667, .frequency_stepsize = 166667,
.caps = FE_CAN_INVERSION_AUTO | .caps = FE_CAN_FEC_AUTO |
FE_CAN_FEC_AUTO |
FE_CAN_QAM_AUTO | FE_CAN_QAM_AUTO |
FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO
}; };
...@@ -421,8 +421,6 @@ static int dst_set_inversion (struct dst_data *dst, fe_spectral_inversion_t inve ...@@ -421,8 +421,6 @@ static int dst_set_inversion (struct dst_data *dst, fe_spectral_inversion_t inve
case INVERSION_ON: case INVERSION_ON:
val[8] |= 0x80; val[8] |= 0x80;
break; break;
case INVERSION_AUTO:
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -607,25 +605,25 @@ static int dst_check_ci (struct dst_data *dst) ...@@ -607,25 +605,25 @@ static int dst_check_ci (struct dst_data *dst)
use_dst_type = DST_TYPE_IS_SAT; use_dst_type = DST_TYPE_IS_SAT;
use_type_flags = DST_TYPE_HAS_SYMDIV; use_type_flags = DST_TYPE_HAS_SYMDIV;
} }
switch (dst_type) { switch (dst_type[dst_cur_no]) {
case (-1U): case (-1U):
/* not used */ /* not used */
break; break;
case DST_TYPE_IS_SAT: case DST_TYPE_IS_SAT:
case DST_TYPE_IS_TERR: case DST_TYPE_IS_TERR:
case DST_TYPE_IS_CABLE: case DST_TYPE_IS_CABLE:
use_dst_type = (u8)dst_type; use_dst_type = (u8)(dst_type[dst_cur_no]);
break; break;
default: default:
printk("%s: invalid user override dst type %d, not used\n", printk("%s: invalid user override dst type %d, not used\n",
__FUNCTION__, dst_type); __FUNCTION__, dst_type[dst_cur_no]);
break; break;
} }
dst_type_print(use_dst_type); dst_type_print(use_dst_type);
if (dst_type_flags != (-1U)) { if (dst_type_flags[dst_cur_no] != (-1U)) {
printk("%s: user override dst type flags 0x%x\n", printk("%s: user override dst type flags 0x%x\n",
__FUNCTION__, dst_type_flags); __FUNCTION__, dst_type_flags[dst_cur_no]);
use_type_flags = dst_type_flags; use_type_flags = dst_type_flags[dst_cur_no];
} }
dst->type_flags = use_type_flags; dst->type_flags = use_type_flags;
dst->dst_type= use_dst_type; dst->dst_type= use_dst_type;
...@@ -1129,6 +1127,10 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -1129,6 +1127,10 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data)
struct dvb_frontend_info *info; struct dvb_frontend_info *info;
dprintk("%s: check ci\n", __FUNCTION__); dprintk("%s: check ci\n", __FUNCTION__);
if (dst_cur_no >= DST_MAX_CARDS) {
dprintk("%s: can't have more than %d cards\n", __FUNCTION__, DST_MAX_CARDS);
return -ENODEV;
}
bt = bt878_find_by_dvb_adap(i2c->adapter); bt = bt878_find_by_dvb_adap(i2c->adapter);
if (!bt) if (!bt)
return -ENODEV; return -ENODEV;
...@@ -1157,7 +1159,7 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data) ...@@ -1157,7 +1159,7 @@ static int dst_attach (struct dvb_i2c_bus *i2c, void **data)
info = &dst_info_cable; info = &dst_info_cable;
dvb_register_frontend (dst_ioctl, i2c, dst, info); dvb_register_frontend (dst_ioctl, i2c, dst, info);
dst_cur_no++;
return 0; return 0;
} }
......
...@@ -233,7 +233,7 @@ static int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0, ...@@ -233,7 +233,7 @@ static int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0,
* check lock and toggle inversion bit if required... * check lock and toggle inversion bit if required...
*/ */
if (INVERSION_AUTO == inversion && !(ves1820_readreg (fe, 0x11) & 0x08)) { if (INVERSION_AUTO == inversion && !(ves1820_readreg (fe, 0x11) & 0x08)) {
mdelay(30); mdelay(50);
if (!(ves1820_readreg (fe, 0x11) & 0x08)) { if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
reg0 ^= 0x20; reg0 ^= 0x20;
ves1820_writereg (fe, 0x00, reg0 & 0xfe); ves1820_writereg (fe, 0x00, reg0 & 0xfe);
...@@ -349,7 +349,7 @@ static int ves1820_set_parameters (struct dvb_frontend *fe, ...@@ -349,7 +349,7 @@ static int ves1820_set_parameters (struct dvb_frontend *fe,
/* yes, this speeds things up: userspace reports lock in about 8 ms /* yes, this speeds things up: userspace reports lock in about 8 ms
instead of 500 to 1200 ms after calling FE_SET_FRONTEND. */ instead of 500 to 1200 ms after calling FE_SET_FRONTEND. */
mdelay(30); mdelay(50);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment