diff options
author | Michael Hunold <devnull@localhost> | 2004-08-18 17:44:05 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2004-08-18 17:44:05 +0000 |
commit | f9c9715b78a31c76a7c71f20925831cfe2c65506 (patch) | |
tree | e4da1641d7fbcff9933da75a2f532f3a813b547d | |
parent | 0ec6de1c0fd4aee2037559520db72b6271f2fba3 (diff) | |
download | mediapointer-dvb-s2-f9c9715b78a31c76a7c71f20925831cfe2c65506.tar.gz mediapointer-dvb-s2-f9c9715b78a31c76a7c71f20925831cfe2c65506.tar.bz2 |
- nuke dvb functions stuff
25 files changed, 149 insertions, 201 deletions
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c index 9a5449383..2a919f245 100644 --- a/linux/drivers/media/dvb/b2c2/skystar2.c +++ b/linux/drivers/media/dvb/b2c2/skystar2.c @@ -2129,7 +2129,7 @@ static int send_diseqc_msg(struct adapter *adapter, int len, u8 *msg, unsigned l udelay(12500); set_tuner_tone(adapter, 0); } - dvb_delay(20); + msleep(20); } return 0; diff --git a/linux/drivers/media/dvb/dvb-core/Makefile b/linux/drivers/media/dvb/dvb-core/Makefile index b21da2ee6..9d534602a 100644 --- a/linux/drivers/media/dvb/dvb-core/Makefile +++ b/linux/drivers/media/dvb/dvb-core/Makefile @@ -3,7 +3,7 @@ # dvb-core-objs = dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o \ - dvb_ca_en50221.o dvb_functions.o dvb_frontend.o \ + dvb_ca_en50221.o dvb_frontend.o \ dvb_net.o dvb_ksyms.o dvb_ringbuffer.o obj-$(CONFIG_DVB_CORE) += dvb-core.o diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 9567e00a8..448c0e304 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c @@ -279,7 +279,7 @@ static int dvb_ca_en50221_wait_if_status(struct dvb_ca_private* ca, int slot, u8 } /* wait for a bit */ - dvb_delay(1); + msleep(1); } dprintk("%s failed timeout:%lu\n", __FUNCTION__, jiffies - start); @@ -930,7 +930,11 @@ static int dvb_ca_en50221_thread(void* data) /* setup kernel thread */ snprintf(name, sizeof(name), "kdvb-ca-%i:%i", ca->dvbdev->adapter->num, ca->dvbdev->id); - dvb_kernel_thread_setup(name); + + lock_kernel (); + daemonize (name); + sigfillset (¤t->blocked); + unlock_kernel (); /* choose the correct initial delay */ dvb_ca_en50221_thread_update_delay(ca); @@ -1238,7 +1242,7 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file, const char __user *buf } if (status != -EAGAIN) goto exit; - dvb_delay(1); + msleep(1); } if (!written) { status = -EIO; diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index affc4dfdc..df58e8725 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -245,7 +245,7 @@ static void dvb_call_frontend_notifiers (struct dvb_frontend_data *fe, dprintk ("%s\n", __FUNCTION__); if (((s ^ fe->status) & FE_HAS_LOCK) && (s & FE_HAS_LOCK)) - dvb_delay (fe->info->notifier_delay); + msleep (fe->info->notifier_delay); fe->status = s; @@ -504,7 +504,10 @@ static int dvb_frontend_thread (void *data) snprintf (name, sizeof(name), "kdvb-fe-%i", fe->frontend.dvb_adapter->num); - dvb_kernel_thread_setup (name); + lock_kernel (); + daemonize (name); + sigfillset (¤t->blocked); + unlock_kernel (); dvb_call_frontend_notifiers (fe, 0); dvb_frontend_init (fe); diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h index e23c5f9b2..6d44705c1 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h @@ -34,6 +34,7 @@ #include <linux/i2c.h> #include <linux/module.h> #include <linux/errno.h> +#include <linux/delay.h> #include <linux/dvb/frontend.h> diff --git a/linux/drivers/media/dvb/dvb-core/dvb_functions.c b/linux/drivers/media/dvb/dvb-core/dvb_functions.c deleted file mode 100644 index 7530287f4..000000000 --- a/linux/drivers/media/dvb/dvb-core/dvb_functions.c +++ /dev/null @@ -1,88 +0,0 @@ -#include <linux/errno.h> -#include <linux/fs.h> -#include <linux/string.h> -#include <linux/module.h> -#include <linux/ioctl.h> -#include <linux/slab.h> -#include <linux/smp_lock.h> -#include <asm/uaccess.h> - -void dvb_kernel_thread_setup (const char *thread_name) -{ - lock_kernel (); - - daemonize (thread_name); - sigfillset (¤t->blocked); - - unlock_kernel (); -} - -/* if the miracle happens and "generic_usercopy()" is included into - the kernel, then this can vanish. please don't make the mistake and - define this as video_usercopy(). this will introduce a dependecy - to the v4l "videodev.o" module, which is unnecessary for some - cards (ie. the budget dvb-cards don't need the v4l module...) */ -int dvb_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)) -{ - char sbuf[128]; - void *mbuf = NULL; - void *parg = NULL; - int err = -EINVAL; - - /* Copy arguments into temp kernel buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: - /* - * For this command, the pointer is actually an integer - * argument. - */ - parg = (void *) arg; - break; - case _IOC_READ: /* some v4l ioctls are marked wrong ... */ - case _IOC_WRITE: - case (_IOC_WRITE | _IOC_READ): - if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { - parg = sbuf; - } else { - /* too big to allocate from stack */ - mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); - if (NULL == mbuf) - return -ENOMEM; - parg = mbuf; - } - - err = -EFAULT; - if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) - goto out; - break; - } - - /* call driver */ - if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) - err = -EINVAL; - - if (err < 0) - goto out; - - /* Copy results into user buffer */ - switch (_IOC_DIR(cmd)) - { - case _IOC_READ: - case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) - err = -EFAULT; - break; - } - -out: - if (mbuf) - kfree(mbuf); - - return err; -} - -EXPORT_SYMBOL(dvb_usercopy); -EXPORT_SYMBOL(dvb_kernel_thread_setup); diff --git a/linux/drivers/media/dvb/dvb-core/dvb_functions.h b/linux/drivers/media/dvb/dvb-core/dvb_functions.h deleted file mode 100644 index 0abb91c61..000000000 --- a/linux/drivers/media/dvb/dvb-core/dvb_functions.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * dvb_functions.h: isolate some Linux specific stuff from the dvb-core - * that can't be expressed as a one-liner - * in order to make porting to other environments easier - * - * Copyright (C) 2003 Convergence GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Lesser Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef __DVB_FUNCTIONS_H__ -#define __DVB_FUNCTIONS_H__ - -#include <linux/fs.h> - -/** - * a sleeping delay function, waits i ms - * - */ -static inline -void dvb_delay(int i) -{ - current->state=TASK_INTERRUPTIBLE; - schedule_timeout((HZ*i)/1000); -} - -/* we don't mess with video_usercopy() any more, -we simply define out own dvb_usercopy(), which will hopefull become -generic_usercopy() someday... */ - -extern int dvb_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)); - -extern void dvb_kernel_thread_setup (const char *thread_name); - -#endif - diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index 4cfed2a69..c62bffea9 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -321,6 +321,72 @@ int dvb_unregister_adapter(struct dvb_adapter *adap) return 0; } +/* if the miracle happens and "generic_usercopy()" is included into + the kernel, then this can vanish. please don't make the mistake and + define this as video_usercopy(). this will introduce a dependecy + to the v4l "videodev.o" module, which is unnecessary for some + cards (ie. the budget dvb-cards don't need the v4l module...) */ +int dvb_usercopy(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + int (*func)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg)) +{ + char sbuf[128]; + void *mbuf = NULL; + void *parg = NULL; + int err = -EINVAL; + + /* Copy arguments into temp kernel buffer */ + switch (_IOC_DIR(cmd)) { + case _IOC_NONE: + /* + * For this command, the pointer is actually an integer + * argument. + */ + parg = (void *) arg; + break; + case _IOC_READ: /* some v4l ioctls are marked wrong ... */ + case _IOC_WRITE: + case (_IOC_WRITE | _IOC_READ): + if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { + parg = sbuf; + } else { + /* too big to allocate from stack */ + mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); + if (NULL == mbuf) + return -ENOMEM; + parg = mbuf; + } + + err = -EFAULT; + if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) + goto out; + break; + } + + /* call driver */ + if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) + err = -EINVAL; + + if (err < 0) + goto out; + + /* Copy results into user buffer */ + switch (_IOC_DIR(cmd)) + { + case _IOC_READ: + case (_IOC_WRITE | _IOC_READ): + if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) + err = -EFAULT; + break; + } + +out: + if (mbuf) + kfree(mbuf); + + return err; +} static int __init init_dvbdev(void) { diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h index c9e0f1b03..684bd5348 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.h +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h @@ -89,5 +89,15 @@ extern int dvb_generic_open (struct inode *inode, struct file *file); extern int dvb_generic_release (struct inode *inode, struct file *file); extern int dvb_generic_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); + +/* we don't mess with video_usercopy() any more, +we simply define out own dvb_usercopy(), which will hopefully become +generic_usercopy() someday... */ + +extern int dvb_usercopy(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + int (*func)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg)); + #endif /* #ifndef _DVBDEV_H_ */ diff --git a/linux/drivers/media/dvb/frontends/alps_tdmb7.c b/linux/drivers/media/dvb/frontends/alps_tdmb7.c index 73f7b6cad..ea2e73ca1 100644 --- a/linux/drivers/media/dvb/frontends/alps_tdmb7.c +++ b/linux/drivers/media/dvb/frontends/alps_tdmb7.c @@ -167,7 +167,7 @@ static int cx22700_init (struct i2c_adapter *i2c) cx22700_writereg (i2c, 0x00, 0x02); /* soft reset */ cx22700_writereg (i2c, 0x00, 0x00); - dvb_delay(10); + msleep(10); for (i=0; i<sizeof(init_tab); i+=2) cx22700_writereg (i2c, init_tab[i], init_tab[i+1]); diff --git a/linux/drivers/media/dvb/frontends/at76c651.c b/linux/drivers/media/dvb/frontends/at76c651.c index 49bcf805c..5ceccb13a 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.c +++ b/linux/drivers/media/dvb/frontends/at76c651.c @@ -111,7 +111,7 @@ static int at76c651_writereg(struct i2c_adapter *i2c, u8 reg, u8 data) "(reg == 0x%02x, val == 0x%02x, ret == %i)\n", __FUNCTION__, reg, data, ret); - dvb_delay(10); + msleep(10); return (ret != 1) ? -EREMOTEIO : 0; } diff --git a/linux/drivers/media/dvb/frontends/cx24110.c b/linux/drivers/media/dvb/frontends/cx24110.c index 654731713..56cafb25d 100644 --- a/linux/drivers/media/dvb/frontends/cx24110.c +++ b/linux/drivers/media/dvb/frontends/cx24110.c @@ -262,7 +262,7 @@ static int cx24108_set_tv_freq (struct i2c_adapter *i2c, u32 freq) cx24108_write(i2c,pll); cx24110_writereg(i2c,0x56,0x7f); - dvb_delay(10); /* wait a moment for the tuner pll to lock */ + msleep(10); /* wait a moment for the tuner pll to lock */ /* tuner pll lock can be monitored on GPIO pin 4 of cx24110 */ while (!(cx24110_readreg(i2c,0x66)&0x20)&&i<1000) diff --git a/linux/drivers/media/dvb/frontends/dst.c b/linux/drivers/media/dvb/frontends/dst.c index 17ea19740..820594b90 100644 --- a/linux/drivers/media/dvb/frontends/dst.c +++ b/linux/drivers/media/dvb/frontends/dst.c @@ -179,12 +179,12 @@ static int dst_reset8820(struct dst_data *dst) retval = dst_gpio_outb(dst, DST_8820, DST_8820, 0); if (retval < 0) return retval; - dvb_delay(10); + msleep(10); retval = dst_gpio_outb(dst, DST_8820, DST_8820, DST_8820); if (retval < 0) return retval; /* wait for more feedback on what works here * - dvb_delay(10); + msleep(10); retval = dst_gpio_outb(dst, DST_8820, DST_8820, 0); if (retval < 0) return retval; @@ -201,7 +201,7 @@ static int dst_i2c_enable(struct dst_data *dst) if (retval < 0) return retval; // dprintk ("%s: i2c enable delay\n", __FUNCTION__); - dvb_delay(33); + msleep(33); return 0; } @@ -214,7 +214,7 @@ static int dst_i2c_disable(struct dst_data *dst) if (retval < 0) return retval; // dprintk ("%s: i2c disable delay\n", __FUNCTION__); - dvb_delay(33); + msleep(33); return 0; } @@ -231,7 +231,7 @@ static int dst_wait_dst_ready(struct dst_data *dst) dprintk("%s: dst wait ready after %d\n", __FUNCTION__, i); return 1; } - dvb_delay(5); + msleep(5); } dprintk("%s: dst wait NOT ready after %d\n", __FUNCTION__, i); return 0; @@ -253,14 +253,14 @@ static int write_dst(struct dst_data *dst, u8 * data, u8 len) } dprintk("\n"); } - dvb_delay(30); + msleep(30); for (cnt = 0; cnt < 4; cnt++) { if ((err = i2c_transfer(dst->i2c, &msg, 1)) < 0) { dprintk("%s: write_dst error (err == %i, len == 0x%02x, b0 == 0x%02x)\n", __FUNCTION__, err, len, data[0]); dst_i2c_disable(dst); - dvb_delay(500); + msleep(500); dst_i2c_enable(dst); - dvb_delay(500); + msleep(500); continue; } else break; @@ -541,7 +541,7 @@ static int dst_check_ci(struct dst_data *dst) dprintk("%s: write not successful, maybe no card?\n", __FUNCTION__); return retval; } - dvb_delay(3); + msleep(3); retval = read_dst(dst, rxbuf, 1); dst_i2c_disable(dst); if (retval < 0) { @@ -605,7 +605,7 @@ static int dst_command(struct dst_data *dst, u8 * data, u8 len) dprintk("%s: write not successful\n", __FUNCTION__); return retval; } - dvb_delay(33); + msleep(33); retval = read_dst(dst, &reply, 1); dst_i2c_disable(dst); if (retval < 0) { @@ -852,7 +852,7 @@ static int dst_write_tuna(struct dst_data *dst) dprintk("%s: write not successful\n", __FUNCTION__); return retval; } - dvb_delay(3); + msleep(3); retval = read_dst(dst, &reply, 1); dst_i2c_disable(dst); if (retval < 0) { diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-401.c b/linux/drivers/media/dvb/frontends/grundig_29504-401.c index b8508718b..1621c54de 100644 --- a/linux/drivers/media/dvb/frontends/grundig_29504-401.c +++ b/linux/drivers/media/dvb/frontends/grundig_29504-401.c @@ -554,7 +554,7 @@ int l64781_ioctl (struct dvb_frontend *fe, res = init (i2c); if ((res == 0) && (state->first)) { state->first = 0; - dvb_delay(200); + msleep(200); } return res; diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-491.c b/linux/drivers/media/dvb/frontends/grundig_29504-491.c index 4c9992066..e5f7db343 100644 --- a/linux/drivers/media/dvb/frontends/grundig_29504-491.c +++ b/linux/drivers/media/dvb/frontends/grundig_29504-491.c @@ -243,7 +243,7 @@ static void tda8083_wait_diseqc_fifo (struct i2c_adapter *i2c, int timeout) while (jiffies - start < timeout && !(tda8083_readreg(i2c, 0x02) & 0x80)) { - dvb_delay(50); + msleep(50); }; } diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index 9e730039d..9957e1fe4 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -722,7 +722,7 @@ static int stv0299_wait_diseqc_fifo (struct i2c_adapter *i2c, int timeout) dprintk ("%s: timeout!!\n", __FUNCTION__); return -ETIMEDOUT; } - dvb_delay(10); + msleep(10); }; return 0; @@ -740,7 +740,7 @@ static int stv0299_wait_diseqc_idle (struct i2c_adapter *i2c, int timeout) dprintk ("%s: timeout!!\n", __FUNCTION__); return -ETIMEDOUT; } - dvb_delay(10); + msleep(10); }; return 0; @@ -1358,7 +1358,7 @@ static int attach_adapter(struct i2c_adapter *adapter) u8 id; stv0299_writereg(adapter, 0x02, 0x34); /* standby off */ - dvb_delay(200); + msleep(200); id = stv0299_readreg(adapter, 0x00); dprintk ("%s: id == 0x%02x\n", __FUNCTION__, id); diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index 7ea4dff61..888d83f4d 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -294,7 +294,7 @@ static int tda1004x_enable_tuner_i2c(struct i2c_adapter *i2c, struct tda1004x_st dprintk("%s\n", __FUNCTION__); result = tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 2, 2); - dvb_delay(1); + msleep(1); return result; } @@ -453,7 +453,7 @@ static int tda10045_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta tda1004x_write_mask(i2c, state, TDA1004X_CONFC4, 0x10, 0); tda1004x_write_mask(i2c, state, TDA1004X_CONFC4, 8, 8); tda1004x_write_mask(i2c, state, TDA1004X_CONFC4, 8, 0); - dvb_delay(10); + msleep(10); /* set parameters */ tda10045h_set_bandwidth(i2c, state, BANDWIDTH_8_MHZ); @@ -464,7 +464,7 @@ static int tda10045_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta /* wait for DSP to initialise */ /* DSPREADY doesn't seem to work on the TDA10045H */ - dvb_delay(100); + msleep(100); ret = tda1004x_check_upload_ok(i2c, state); if (ret) @@ -488,7 +488,7 @@ static int tda10046_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta /* reset chip */ tda1004x_write_mask(i2c, state, TDA1004X_CONFC4, 1, 0); tda1004x_write_mask(i2c, state, TDA10046H_CONF_TRISTATE1, 1, 0); - dvb_delay(10); + msleep(10); /* set parameters */ tda1004x_write_byte(i2c, state, TDA10046H_CONFPLL2, 10); @@ -509,7 +509,7 @@ static int tda10046_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta printk("tda1004x: DSP failed to initialised.\n"); return -EIO; } - dvb_delay(1); + msleep(1); } ret = tda1004x_check_upload_ok(i2c, state); @@ -784,7 +784,7 @@ static int tda1004x_set_frequency(struct i2c_adapter *i2c, if (i2c_transfer(i2c, &tuner_msg, 1) != 1) { return -EIO; } - dvb_delay(1); + msleep(1); tda1004x_disable_tuner_i2c(i2c, tda_state); if (tda_state->fe_type == FE_TYPE_TDA10046H) tda1004x_write_mask(i2c, tda_state, TDA10046H_AGC_CONF, 4, 4); @@ -968,12 +968,12 @@ static int tda1004x_set_fe(struct i2c_adapter *i2c, case FE_TYPE_TDA10045H: tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 8, 8); tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 8, 0); - dvb_delay(10); + msleep(10); break; case FE_TYPE_TDA10046H: tda1004x_write_mask(i2c, tda_state, TDA1004X_AUTO, 0x40, 0x40); - dvb_delay(10); + msleep(10); break; } @@ -1394,7 +1394,7 @@ static int tda1004x_attach(struct i2c_adapter *i2c, struct tda1004x_state* state tuner_msg.buf = td1344_init; tuner_msg.len = sizeof(td1344_init); if (i2c_transfer(i2c, &tuner_msg, 1) == 1) { - dvb_delay(1); + msleep(1); tuner_address = 0x61; tuner_type = TUNER_TYPE_TD1344; printk("tda1004x: Detected Philips TD1344 tuner.\n"); @@ -1407,7 +1407,7 @@ static int tda1004x_attach(struct i2c_adapter *i2c, struct tda1004x_state* state tuner_msg.buf = td1316_init; tuner_msg.len = sizeof(td1316_init); if (i2c_transfer(i2c, &tuner_msg, 1) == 1) { - dvb_delay(1); + msleep(1); tuner_address = 0x63; tuner_type = TUNER_TYPE_TD1316; printk("tda1004x: Detected Philips TD1316 tuner.\n"); @@ -1420,7 +1420,7 @@ static int tda1004x_attach(struct i2c_adapter *i2c, struct tda1004x_state* state tuner_msg.buf = td1316_init_tda10046h; tuner_msg.len = sizeof(td1316_init_tda10046h); if (i2c_transfer(i2c, &tuner_msg, 1) == 1) { - dvb_delay(1); + msleep(1); tuner_address = 0x60; tuner_type = TUNER_TYPE_TD1316; printk("tda1004x: Detected Philips TD1316 tuner.\n"); diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index 23fff9d2d..255a40462 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -110,7 +110,7 @@ static int ves1820_writereg(struct ves1820_state *state, u8 reg, u8 data) printk("ves1820: %s(): writereg error (reg == 0x%02x," "val == 0x%02x, ret == %i)\n", __FUNCTION__, reg, data, ret); - dvb_delay(10); + msleep(10); return (ret != 1) ? -EREMOTEIO : 0; } diff --git a/linux/drivers/media/dvb/frontends/ves1x93.c b/linux/drivers/media/dvb/frontends/ves1x93.c index 27e9e0401..6b2436c66 100644 --- a/linux/drivers/media/dvb/frontends/ves1x93.c +++ b/linux/drivers/media/dvb/frontends/ves1x93.c @@ -255,7 +255,7 @@ static int ves1x93_clr_bit (struct i2c_adapter *i2c) { ves1x93_writereg (i2c, 0, init_1x93_tab[0] & 0xfe); ves1x93_writereg (i2c, 0, init_1x93_tab[0]); - dvb_delay(5); + msleep(5); return 0; } @@ -263,7 +263,7 @@ static int ves1x93_init_aquire (struct i2c_adapter *i2c) { ves1x93_writereg (i2c, 3, 0x00); ves1x93_writereg (i2c, 3, init_1x93_tab[3]); - dvb_delay(5); + msleep(5); return 0; } diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index 178167405..9a100f837 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -154,7 +154,7 @@ static void recover_arm(struct av7110 *av7110) DEB_EE(("av7110: %p\n",av7110)); av7110_bootarm(av7110); - dvb_delay(100); + msleep(100); restart_feeds(av7110); av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, av7110->ir_config); } @@ -176,7 +176,11 @@ static int arm_thread(void *data) DEB_EE(("av7110: %p\n",av7110)); - dvb_kernel_thread_setup("arm_mon"); + lock_kernel (); + daemonize ("arm_mon"); + sigfillset (¤t->blocked); + unlock_kernel (); + av7110->arm_thread = current; while (1) { @@ -1576,7 +1580,7 @@ err3: av7110->arm_rmmod = 1; wake_up_interruptible(&av7110->arm_wait); while (av7110->arm_thread) - dvb_delay(1); + msleep(1); err2: av7110_ca_exit(av7110); av7110_av_exit(av7110); @@ -1611,7 +1615,7 @@ static int av7110_detach (struct saa7146_dev* saa) wake_up_interruptible(&av7110->arm_wait); while (av7110->arm_thread) - dvb_delay(1); + msleep(1); dvb_unregister(av7110); diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c index 60adc4eda..f28869162 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_hw.c +++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c @@ -102,7 +102,7 @@ void av7110_reset_arm(struct av7110 *av7110) saa7146_write(av7110->dev, ISR, (MASK_19 | MASK_03)); saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTHI); - dvb_delay(30); /* the firmware needs some time to initialize */ + msleep(30); /* the firmware needs some time to initialize */ ARM_ResetMailBox(av7110); @@ -264,7 +264,7 @@ int av7110_bootarm(struct av7110 *av7110) return -1; } saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTHI); - dvb_delay(30); /* the firmware needs some time to initialize */ + msleep(30); /* the firmware needs some time to initialize */ //ARM_ClearIrq(av7110); ARM_ResetMailBox(av7110); @@ -298,7 +298,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) start = jiffies; while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_FREE)) { printk(KERN_ERR "%s: timeout waiting for COMMAND idle\n", __FUNCTION__); return -1; @@ -308,7 +308,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) #ifndef _NOHANDSHAKE start = jiffies; while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); return -1; @@ -318,7 +318,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) start = jiffies; while (rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2) & OSDQFull) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_OSD)) { printk(KERN_ERR "%s: timeout waiting for !OSDQFull\n", __FUNCTION__); return -1; @@ -337,7 +337,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) #ifdef COM_DEBUG start = jiffies; while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_FREE)) { printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__); @@ -454,7 +454,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf, start = jiffies; while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2)) { #ifdef _NOHANDSHAKE - dvb_delay(1); + msleep(1); #endif if (time_after(jiffies, start + ARM_WAIT_FREE)) { printk("%s: timeout waiting for COMMAND to complete\n", __FUNCTION__); @@ -466,7 +466,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf, #ifndef _NOHANDSHAKE start = jiffies; while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); up(&av7110->dcomlock); @@ -626,7 +626,7 @@ static int FlushText(struct av7110 *av7110) return -ERESTARTSYS; start = jiffies; while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_OSD)) { printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__); @@ -650,7 +650,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf) start = jiffies; while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_OSD)) { printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__); @@ -661,7 +661,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf) #ifndef _NOHANDSHAKE start = jiffies; while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2)) { - dvb_delay(1); + msleep(1); if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); diff --git a/linux/drivers/media/dvb/ttpci/av7110_v4l.c b/linux/drivers/media/dvb/ttpci/av7110_v4l.c index 213871506..c1d800f3f 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_v4l.c +++ b/linux/drivers/media/dvb/ttpci/av7110_v4l.c @@ -508,7 +508,7 @@ int av7110_init_analog_module(struct av7110 *av7110) printk("av7110(%d): DVB-C analog module detected, initializing MSP3400\n", av7110->dvb_adapter->num); av7110->adac_type = DVB_ADAC_MSP; - dvb_delay(100); // the probing above resets the msp... + msleep(100); // the probing above resets the msp... msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1); msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2); printk("av7110(%d): MSP3400 version 0x%04x 0x%04x\n", diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c index 3e1f57e83..5bc672824 100644 --- a/linux/drivers/media/dvb/ttpci/budget-av.c +++ b/linux/drivers/media/dvb/ttpci/budget-av.c @@ -176,7 +176,7 @@ static int budget_av_detach (struct saa7146_dev *dev) if ( 1 == budget_av->has_saa7113 ) { saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO); - dvb_delay(200); + msleep(200); saa7146_unregister_device (&budget_av->vd, dev); } @@ -224,7 +224,7 @@ static int budget_av_attach (struct saa7146_dev* dev, //test_knc_ci(av7110); saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI); - dvb_delay(500); + msleep(500); if ( 0 == saa7113_init(budget_av) ) { budget_av->has_saa7113 = 1; diff --git a/linux/drivers/media/dvb/ttpci/budget-ci.c b/linux/drivers/media/dvb/ttpci/budget-ci.c index afe51a149..fdf150920 100644 --- a/linux/drivers/media/dvb/ttpci/budget-ci.c +++ b/linux/drivers/media/dvb/ttpci/budget-ci.c @@ -322,7 +322,7 @@ static int ciintf_slot_reset(struct dvb_ca_en50221* ca, int slot) { saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); budget_ci->slot_status = SLOTSTATUS_RESET; budget_debiwrite(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1, 0); - dvb_delay(1); + msleep(1); budget_debiwrite(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1, CICONTROL_RESET); saa7146_setgpio(saa, 1, SAA7146_GPIO_OUTHI); @@ -482,7 +482,7 @@ static void ciintf_deinit(struct budget_ci* budget_ci) saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); tasklet_kill(&budget_ci->ciintf_irq_tasklet); budget_debiwrite(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1, 0); - dvb_delay(1); + msleep(1); budget_debiwrite(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1, CICONTROL_RESET); // disable TS data stream to CI interface diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c index 9bee908c7..4a4750383 100644 --- a/linux/drivers/media/dvb/ttpci/budget.c +++ b/linux/drivers/media/dvb/ttpci/budget.c @@ -100,7 +100,7 @@ static int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, unsigned long udelay(12500); saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); } - dvb_delay(20); + msleep(20); } return 0; |