summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2002-10-18 11:53:42 +0000
committerHolger Waechtler <devnull@localhost>2002-10-18 11:53:42 +0000
commite5031d018089f26a3551a42e474a8b37f838bf47 (patch)
tree442b550d14cc9a7708ab3367bd45c2245e83c6ac /linux/drivers/media/dvb
parent3a00ed96026e71929590fa371dc9ad66cd8ec637 (diff)
downloadmediapointer-dvb-s2-e5031d018089f26a3551a42e474a8b37f838bf47.tar.gz
mediapointer-dvb-s2-e5031d018089f26a3551a42e474a8b37f838bf47.tar.bz2
follow zigzag changes and C99 cleanups
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index ca25535a4..0c7531f44 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -336,9 +336,6 @@ int dvb_frontend_set_parameters (struct dvb_frontend_data *fe,
struct dvb_frontend *frontend = &fe->frontend;
int err;
- dprintk ("%s: f == %i, drift == %i\n",
- __FUNCTION__, param->frequency, fe->lnb_drift);
-
dvb_bend_frequency (fe, 0);
if (first_trial) {
@@ -352,6 +349,9 @@ int dvb_frontend_set_parameters (struct dvb_frontend_data *fe,
sizeof (struct dvb_frontend_parameters));
}
+ dprintk ("%s: f == %i, drift == %i\n",
+ __FUNCTION__, param->frequency, fe->lnb_drift);
+
param->frequency += fe->lnb_drift + fe->bending;
err = dvb_frontend_internal_ioctl (frontend, FE_SET_FRONTEND, param);
param->frequency -= fe->lnb_drift + fe->bending;
@@ -368,8 +368,7 @@ void dvb_frontend_init (struct dvb_frontend_data *fe)
struct dvb_frontend_parameters *init_param;
printk ("DVB: initialising frontend %i:%i (%s)...\n",
- frontend->i2c->adapter->num, frontend->i2c->id,
- fe->info->name);
+ frontend->i2c->adapter->num, frontend->i2c->id, fe->info->name);
dvb_frontend_internal_ioctl (frontend, FE_INIT, NULL);
@@ -436,15 +435,20 @@ void dvb_frontend_recover (struct dvb_frontend_data *fe)
*/
{
int j = fe->lost_sync_count;
- int stepsize = fe->info->frequency_stepsize;
-
- if (j % 32 == 0)
- fe->lnb_drift = 0;
+ int stepsize;
- if (j % 2)
- fe->lnb_drift += stepsize * ((j+1)/2);
+ if (fe->info->type == FE_QPSK)
+ stepsize = fe->parameters.u.qpsk.symbol_rate / 16000;
else
+ stepsize = fe->info->frequency_stepsize * 2;
+
+ if (j % 32 == 0) {
+ fe->lnb_drift = 0;
+ } else {
fe->lnb_drift = -fe->lnb_drift;
+ if (j % 2)
+ fe->lnb_drift += stepsize;
+ }
dvb_frontend_set_parameters (fe, &fe->parameters, 0);
}
@@ -511,7 +515,6 @@ int dvb_frontend_thread (void *data)
fe->lost_sync_count = 0;
} else {
fe->lost_sync_count++;
-
dvb_frontend_recover (fe);
delay = HZ/5;
if (jiffies - fe->lost_sync_jiffies > TIMEOUT) {
@@ -845,9 +848,11 @@ dvb_register_frontend (int (*ioctl) (struct dvb_frontend *frontend,
{
struct list_head *entry;
struct dvb_frontend_data *fe;
- struct dvb_device dvbdev_template = { users: 1, writers: 1,
- fops: &dvb_frontend_fops,
- kernel_ioctl: dvb_frontend_ioctl
+ static const struct dvb_device dvbdev_template = {
+ .users = 1,
+ .writers = 1,
+ .fops = &dvb_frontend_fops,
+ .kernel_ioctl = dvb_frontend_ioctl
};
dprintk ("%s\n", __FUNCTION__);
@@ -878,7 +883,9 @@ dvb_register_frontend (int (*ioctl) (struct dvb_frontend *frontend,
list_for_each (entry, &frontend_ioctl_list) {
struct dvb_frontend_ioctl_data *ioctl;
- ioctl = list_entry (entry, struct dvb_frontend_ioctl_data, list_head);
+ ioctl = list_entry (entry,
+ struct dvb_frontend_ioctl_data,
+ list_head);
if (ioctl->adapter == i2c->adapter) {
fe->frontend.before_ioctl = ioctl->before_ioctl;
@@ -936,3 +943,4 @@ MODULE_PARM(dvb_frontend_debug,"i");
MODULE_PARM(dvb_shutdown_timeout,"i");
MODULE_PARM_DESC(dvb_frontend_debug, "enable verbose debug messages");
MODULE_PARM_DESC(dvb_shutdown_timeout, "wait <shutdown_timeout> seconds after close() before suspending hardware");
+