mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
media: dvb-frontends/stid135: Optional timeout for signal statistic retrieve.
This commit is contained in:
@@ -59,6 +59,10 @@ static unsigned int bbframe;
|
|||||||
module_param(bbframe, int, 0644);
|
module_param(bbframe, int, 0644);
|
||||||
MODULE_PARM_DESC(bbframe, "BBFrame L3 encapsulation for GCS, GSE-HEM (default:off)");
|
MODULE_PARM_DESC(bbframe, "BBFrame L3 encapsulation for GCS, GSE-HEM (default:off)");
|
||||||
|
|
||||||
|
static unsigned int timeout=5;
|
||||||
|
module_param(timeout, int, 0644);
|
||||||
|
MODULE_PARM_DESC(timeout, "Timeout for signal statistic retrieve 1-20 sec (default:5 sec)");
|
||||||
|
|
||||||
struct stv_base {
|
struct stv_base {
|
||||||
struct list_head stvlist;
|
struct list_head stvlist;
|
||||||
|
|
||||||
@@ -696,8 +700,8 @@ static int stid135_read_status(struct dvb_frontend *fe, enum fe_status *status)
|
|||||||
|
|
||||||
if (!state->stats_time ||
|
if (!state->stats_time ||
|
||||||
(time_after(jiffies, state->stats_time))) {
|
(time_after(jiffies, state->stats_time))) {
|
||||||
/* Prevent retrieving stats faster than once per 20 seconds */
|
/* Prevent retrieving stats faster than once per n seconds */
|
||||||
state->stats_time = jiffies + msecs_to_jiffies(20000);
|
state->stats_time = jiffies + msecs_to_jiffies(timeout*1000);
|
||||||
|
|
||||||
err = fe_stid135_get_signal_info(state->base->handle, state->nr + 1, &state->signal_info, 0);
|
err = fe_stid135_get_signal_info(state->base->handle, state->nr + 1, &state->signal_info, 0);
|
||||||
|
|
||||||
@@ -1122,6 +1126,12 @@ struct dvb_frontend *stid135_attach(struct i2c_adapter *i2c,
|
|||||||
if (base->mode == 2)
|
if (base->mode == 2)
|
||||||
state->rf_in = 3;
|
state->rf_in = 3;
|
||||||
|
|
||||||
|
if (timeout < 1)
|
||||||
|
timeout = 1;
|
||||||
|
|
||||||
|
if (timeout > 20)
|
||||||
|
timeout = 20;
|
||||||
|
|
||||||
dev_info(&i2c->dev, "%s demod found at adr %02X on %s\n",
|
dev_info(&i2c->dev, "%s demod found at adr %02X on %s\n",
|
||||||
state->fe.ops.info.name, cfg->adr, dev_name(&i2c->dev));
|
state->fe.ops.info.name, cfg->adr, dev_name(&i2c->dev));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user