diff options
author | Andreas Oberritter <obi@linuxtv.org> | 2011-05-09 03:03:40 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-21 02:53:00 +0400 |
commit | a5959dbea37973a2440eeba39fba32c79d862ec2 (patch) | |
tree | d34fd3f7f92578b6738818468b4da7c27215bb81 /drivers/media/dvb | |
parent | 507277193253cd4ea44d0a55ade37bdef20f3a44 (diff) | |
download | linux-a5959dbea37973a2440eeba39fba32c79d862ec2.tar.xz |
[media] DVB: dvb_frontend: add parameters_out
- Holds the parameters detected by the demod.
- Updated on every call to get_frontend, either through ioctl or when
a frontend event occurs.
- Reset to input parameters after every call to set_frontend, tune or
search/track.
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 4a05a2c61aba..3666529e2dd4 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -106,6 +106,7 @@ struct dvb_frontend_private { /* thread/frontend values */ struct dvb_device *dvbdev; struct dvb_frontend_parameters parameters_in; + struct dvb_frontend_parameters parameters_out; struct dvb_fe_events events; struct semaphore sem; struct list_head list_head; @@ -160,12 +161,11 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status) e = &events->events[events->eventw]; - memcpy (&e->parameters, &fepriv->parameters_in, - sizeof (struct dvb_frontend_parameters)); - if (status & FE_HAS_LOCK) if (fe->ops.get_frontend) - fe->ops.get_frontend(fe, &e->parameters); + fe->ops.get_frontend(fe, &fepriv->parameters_out); + + e->parameters = fepriv->parameters_out; events->eventw = wp; @@ -353,6 +353,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra fepriv->parameters_in.inversion = fepriv->inversion; if (fe->ops.set_frontend) fe_set_err = fe->ops.set_frontend(fe, &fepriv->parameters_in); + fepriv->parameters_out = fepriv->parameters_in; if (fe_set_err < 0) { fepriv->state = FESTATE_ERROR; return fe_set_err; @@ -384,6 +385,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) if (fe->ops.set_frontend) retval = fe->ops.set_frontend(fe, &fepriv->parameters_in); + fepriv->parameters_out = fepriv->parameters_in; if (retval < 0) fepriv->state = FESTATE_ERROR; else @@ -600,6 +602,8 @@ restart: if (fe->ops.tune) fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s); + if (params) + fepriv->parameters_out = *params; if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) { dprintk("%s: state changed, adding current state\n", __func__); @@ -639,6 +643,7 @@ restart: fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN; fepriv->delay = HZ / 2; } + fepriv->parameters_out = fepriv->parameters_in; fe->ops.read_status(fe, &s); if (s != fepriv->status) { dvb_frontend_add_event(fe, s); /* update event list */ @@ -1880,8 +1885,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file, case FE_GET_FRONTEND: if (fe->ops.get_frontend) { - memcpy (parg, &fepriv->parameters_in, sizeof (struct dvb_frontend_parameters)); - err = fe->ops.get_frontend(fe, (struct dvb_frontend_parameters*) parg); + err = fe->ops.get_frontend(fe, &fepriv->parameters_out); + memcpy(parg, &fepriv->parameters_out, sizeof(struct dvb_frontend_parameters)); } break; |