aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c17
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 {
106 /* thread/frontend values */ 106 /* thread/frontend values */
107 struct dvb_device *dvbdev; 107 struct dvb_device *dvbdev;
108 struct dvb_frontend_parameters parameters_in; 108 struct dvb_frontend_parameters parameters_in;
109 struct dvb_frontend_parameters parameters_out;
109 struct dvb_fe_events events; 110 struct dvb_fe_events events;
110 struct semaphore sem; 111 struct semaphore sem;
111 struct list_head list_head; 112 struct list_head list_head;
@@ -160,12 +161,11 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
160 161
161 e = &events->events[events->eventw]; 162 e = &events->events[events->eventw];
162 163
163 memcpy (&e->parameters, &fepriv->parameters_in,
164 sizeof (struct dvb_frontend_parameters));
165
166 if (status & FE_HAS_LOCK) 164 if (status & FE_HAS_LOCK)
167 if (fe->ops.get_frontend) 165 if (fe->ops.get_frontend)
168 fe->ops.get_frontend(fe, &e->parameters); 166 fe->ops.get_frontend(fe, &fepriv->parameters_out);
167
168 e->parameters = fepriv->parameters_out;
169 169
170 events->eventw = wp; 170 events->eventw = wp;
171 171
@@ -353,6 +353,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
353 fepriv->parameters_in.inversion = fepriv->inversion; 353 fepriv->parameters_in.inversion = fepriv->inversion;
354 if (fe->ops.set_frontend) 354 if (fe->ops.set_frontend)
355 fe_set_err = fe->ops.set_frontend(fe, &fepriv->parameters_in); 355 fe_set_err = fe->ops.set_frontend(fe, &fepriv->parameters_in);
356 fepriv->parameters_out = fepriv->parameters_in;
356 if (fe_set_err < 0) { 357 if (fe_set_err < 0) {
357 fepriv->state = FESTATE_ERROR; 358 fepriv->state = FESTATE_ERROR;
358 return fe_set_err; 359 return fe_set_err;
@@ -384,6 +385,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
384 if (fe->ops.set_frontend) 385 if (fe->ops.set_frontend)
385 retval = fe->ops.set_frontend(fe, 386 retval = fe->ops.set_frontend(fe,
386 &fepriv->parameters_in); 387 &fepriv->parameters_in);
388 fepriv->parameters_out = fepriv->parameters_in;
387 if (retval < 0) 389 if (retval < 0)
388 fepriv->state = FESTATE_ERROR; 390 fepriv->state = FESTATE_ERROR;
389 else 391 else
@@ -600,6 +602,8 @@ restart:
600 602
601 if (fe->ops.tune) 603 if (fe->ops.tune)
602 fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s); 604 fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s);
605 if (params)
606 fepriv->parameters_out = *params;
603 607
604 if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) { 608 if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) {
605 dprintk("%s: state changed, adding current state\n", __func__); 609 dprintk("%s: state changed, adding current state\n", __func__);
@@ -639,6 +643,7 @@ restart:
639 fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN; 643 fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
640 fepriv->delay = HZ / 2; 644 fepriv->delay = HZ / 2;
641 } 645 }
646 fepriv->parameters_out = fepriv->parameters_in;
642 fe->ops.read_status(fe, &s); 647 fe->ops.read_status(fe, &s);
643 if (s != fepriv->status) { 648 if (s != fepriv->status) {
644 dvb_frontend_add_event(fe, s); /* update event list */ 649 dvb_frontend_add_event(fe, s); /* update event list */
@@ -1880,8 +1885,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
1880 1885
1881 case FE_GET_FRONTEND: 1886 case FE_GET_FRONTEND:
1882 if (fe->ops.get_frontend) { 1887 if (fe->ops.get_frontend) {
1883 memcpy (parg, &fepriv->parameters_in, sizeof (struct dvb_frontend_parameters)); 1888 err = fe->ops.get_frontend(fe, &fepriv->parameters_out);
1884 err = fe->ops.get_frontend(fe, (struct dvb_frontend_parameters*) parg); 1889 memcpy(parg, &fepriv->parameters_out, sizeof(struct dvb_frontend_parameters));
1885 } 1890 }
1886 break; 1891 break;
1887 1892