summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dmxdev.c44
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_compat.h12
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.c116
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c6
-rw-r--r--linux/drivers/media/dvb/frontends/alps_tdmb7.c3
-rw-r--r--linux/drivers/media/dvb/frontends/at76c651.c3
-rw-r--r--linux/drivers/media/dvb/frontends/cx24110.c4
-rw-r--r--linux/drivers/media/dvb/frontends/grundig_29504-491.c3
-rw-r--r--linux/drivers/media/dvb/frontends/stv0299.c6
-rw-r--r--linux/drivers/media/dvb/frontends/ves1820.c7
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c48
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-av.c14
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.c3
13 files changed, 127 insertions, 142 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c
index b158fca78..9abef670b 100644
--- a/linux/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c
@@ -35,12 +35,6 @@
#include "dmxdev.h"
#include "dvb_compat.h"
-
-//MODULE_DESCRIPTION("");
-//MODULE_AUTHOR("Ralph Metzler, Marcus Metzler");
-//#ifdef MODULE_LICENSE
-//MODULE_LICENSE("GPL");
-//#endif
MODULE_PARM(debug,"i");
static int debug = 0;
@@ -1027,8 +1021,7 @@ int dvb_demux_release(struct inode *inode, struct file *file)
}
-static
-struct file_operations dvb_demux_fops = {
+static struct file_operations dvb_demux_fops = {
.owner = THIS_MODULE,
.read = dvb_demux_read,
.ioctl = dvb_demux_ioctl,
@@ -1038,8 +1031,7 @@ struct file_operations dvb_demux_fops = {
};
-static
-struct dvb_device dvbdev_demux = {
+static struct dvb_device dvbdev_demux = {
.priv = 0,
.users = 1,
.writers = 1,
@@ -1047,8 +1039,7 @@ struct dvb_device dvbdev_demux = {
};
-static
-int dvb_dvr_do_ioctl(struct inode *inode, struct file *file,
+static int dvb_dvr_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *parg)
{
struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
@@ -1073,8 +1064,7 @@ int dvb_dvr_do_ioctl(struct inode *inode, struct file *file,
}
-static
-int dvb_dvr_ioctl(struct inode *inode, struct file *file,
+static int dvb_dvr_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
return dvb_usercopy(inode, file, cmd, arg, dvb_dvr_do_ioctl);
@@ -1116,7 +1106,8 @@ struct file_operations dvb_dvr_fops = {
.poll = dvb_dvr_poll,
};
-static struct dvb_device dvbdev_dvr = {
+static
+struct dvb_device dvbdev_dvr = {
.priv = 0,
.users = 1,
.writers = 1,
@@ -1126,18 +1117,16 @@ static struct dvb_device dvbdev_dvr = {
int
dvb_dmxdev_init(dmxdev_t *dmxdev, struct dvb_adapter *dvb_adapter)
{
- int i, err;
+ int i;
- if ((err = dmxdev->demux->open(dmxdev->demux)) < 0)
- return err;
+ if (dmxdev->demux->open(dmxdev->demux) < 0)
+ return -EUSERS;
dmxdev->filter = vmalloc(dmxdev->filternum*sizeof(dmxdev_filter_t));
-
if (!dmxdev->filter)
return -ENOMEM;
dmxdev->dvr = vmalloc(dmxdev->filternum*sizeof(dmxdev_dvr_t));
-
if (!dmxdev->dvr) {
vfree(dmxdev->filter);
dmxdev->filter = NULL;
@@ -1146,24 +1135,18 @@ dvb_dmxdev_init(dmxdev_t *dmxdev, struct dvb_adapter *dvb_adapter)
sema_init(&dmxdev->mutex, 1);
spin_lock_init(&dmxdev->lock);
-
for (i=0; i<dmxdev->filternum; i++) {
dmxdev->filter[i].dev=dmxdev;
dmxdev->filter[i].buffer.data=0;
- dvb_dmxdev_filter_state_set(&dmxdev->filter[i],
- DMXDEV_STATE_FREE);
+ dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
dmxdev->dvr[i].dev=dmxdev;
dmxdev->dvr[i].buffer.data=0;
- dvb_dmxdev_filter_state_set(&dmxdev->filter[i],
- DMXDEV_STATE_FREE);
+ dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
dvb_dmxdev_dvr_state_set(&dmxdev->dvr[i], DMXDEV_STATE_FREE);
}
- dvb_register_device(dvb_adapter, &dmxdev->dvbdev,
- &dvbdev_demux, dmxdev, DVB_DEVICE_DEMUX);
-
- dvb_register_device(dvb_adapter, &dmxdev->dvr_dvbdev,
- &dvbdev_dvr, dmxdev, DVB_DEVICE_DVR);
+ dvb_register_device(dvb_adapter, &dmxdev->dvbdev, &dvbdev_demux, dmxdev, DVB_DEVICE_DEMUX);
+ dvb_register_device(dvb_adapter, &dmxdev->dvr_dvbdev, &dvbdev_dvr, dmxdev, DVB_DEVICE_DVR);
dvb_dmxdev_buffer_init(&dmxdev->dvr_buffer);
@@ -1185,7 +1168,6 @@ dvb_dmxdev_release(dmxdev_t *dmxdev)
vfree(dmxdev->dvr);
dmxdev->dvr=0;
}
-
dmxdev->demux->close(dmxdev->demux);
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_compat.h b/linux/drivers/media/dvb/dvb-core/dvb_compat.h
index cbbaee353..b31a8ef10 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_compat.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_compat.h
@@ -10,18 +10,6 @@
/* necessary dummy functions due to the > 2.5.67 kernel i2c changes */
#define i2c_get_adapdata(adapter) (struct saa7146_dev*)adapter->data;
-/**
- * a sleeping delay function, waits i ms
- *
- */
-static
-inline void ddelay(int i)
-{
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout((HZ*i)/1000);
-}
-
-
static inline
void kernel_thread_setup (const char *thread_name)
{
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
index e67004020..7aab48830 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -44,12 +44,11 @@ int dmx_register_demux(dmx_demux_t *demux)
return 0;
}
-
int dmx_unregister_demux(dmx_demux_t* demux)
{
- struct list_head *pos, *n;
+ struct list_head *pos, *n, *head=&dmx_muxs;
- list_for_each_safe (pos, n, &dmx_muxs) {
+ list_for_each_safe (pos, n, head) {
if (DMX_DIR_ENTRY(pos) == demux) {
if (demux->users>0)
return -EINVAL;
@@ -385,10 +384,10 @@ void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, const u8 *buf)
void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
{
struct dvb_demux_feed *feed;
- struct list_head *pos;
+ struct list_head *pos, *head=&demux->feed_list;
u16 pid = ts_pid(buf);
- list_for_each(pos, &demux->feed_list) {
+ list_for_each(pos, head) {
feed = list_entry(pos, struct dvb_demux_feed, list_head);
if (feed->pid == pid)
dvb_dmx_swfilter_packet_type (feed, buf);
@@ -483,7 +482,7 @@ static
int dmx_pid_set (u16 pid, struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
- struct list_head *pos, *n;
+ struct list_head *pos, *n, *head=&demux->feed_list;
if (pid > DMX_MAX_PID)
return -EINVAL;
@@ -492,7 +491,7 @@ int dmx_pid_set (u16 pid, struct dvb_demux_feed *feed)
return 0;
if (feed->pid <= DMX_MAX_PID) {
- list_for_each_safe(pos, n, &demux->feed_list) {
+ list_for_each_safe(pos, n, head) {
if (DMX_FEED_ENTRY(pos)->pid == feed->pid) {
list_del(pos);
break;
@@ -500,7 +499,7 @@ int dmx_pid_set (u16 pid, struct dvb_demux_feed *feed)
}
}
- list_add(&feed->list_head, &demux->feed_list);
+ list_add(&feed->list_head, head);
feed->pid = pid;
return 0;
@@ -699,7 +698,7 @@ int dvbdmx_release_ts_feed(dmx_demux_t *dmx, dmx_ts_feed_t *ts_feed)
{
struct dvb_demux *demux = (struct dvb_demux *) dmx;
struct dvb_demux_feed *feed = (struct dvb_demux_feed *) ts_feed;
- struct list_head *pos, *n;
+ struct list_head *pos, *n, *head=&demux->feed_list;
if (down_interruptible (&demux->mutex))
return -ERESTARTSYS;
@@ -720,7 +719,7 @@ int dvbdmx_release_ts_feed(dmx_demux_t *dmx, dmx_ts_feed_t *ts_feed)
feed->filter->state = DMX_STATE_FREE;
if (feed->pid <= DMX_MAX_PID) {
- list_for_each_safe(pos, n, &demux->feed_list)
+ list_for_each_safe(pos, n, head)
if (DMX_FEED_ENTRY(pos)->pid == feed->pid) {
list_del(pos);
break;
@@ -740,8 +739,8 @@ int dvbdmx_release_ts_feed(dmx_demux_t *dmx, dmx_ts_feed_t *ts_feed)
* dmx_section_feed API calls
******************************************************************************/
-static
-int dmx_section_feed_allocate_filter(struct dmx_section_feed_s* feed,
+static int
+dmx_section_feed_allocate_filter(struct dmx_section_feed_s* feed,
dmx_section_filter_t** filter)
{
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed;
@@ -754,7 +753,7 @@ int dmx_section_feed_allocate_filter(struct dmx_section_feed_s* feed,
dvbdmxfilter = dvb_dmx_filter_alloc(dvbdemux);
if (!dvbdmxfilter) {
up(&dvbdemux->mutex);
- return -EBUSY;
+ return -ENOSPC;
}
spin_lock_irq(&dvbdemux->lock);
@@ -773,14 +772,14 @@ int dmx_section_feed_allocate_filter(struct dmx_section_feed_s* feed,
}
-static
-int dmx_section_feed_set(struct dmx_section_feed_s* feed,
+static int
+dmx_section_feed_set(struct dmx_section_feed_s* feed,
u16 pid, size_t circular_buffer_size,
int descramble, int check_crc)
{
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed;
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
- struct list_head *pos, *n;
+ struct list_head *pos, *n, *head=&dvbdmx->feed_list;
if (pid > 0x1fff)
return -EINVAL;
@@ -789,7 +788,7 @@ int dmx_section_feed_set(struct dmx_section_feed_s* feed,
return -ERESTARTSYS;
if (dvbdmxfeed->pid <= DMX_MAX_PID) {
- list_for_each_safe(pos, n, &dvbdmx->feed_list) {
+ list_for_each_safe(pos, n, head) {
if (DMX_FEED_ENTRY(pos)->pid == dvbdmxfeed->pid) {
list_del(pos);
break;
@@ -797,12 +796,11 @@ int dmx_section_feed_set(struct dmx_section_feed_s* feed,
}
}
- list_add(&dvbdmxfeed->list_head, &dvbdmx->feed_list);
+ list_add(&dvbdmxfeed->list_head, head);
dvbdmxfeed->pid = pid;
dvbdmxfeed->buffer_size = circular_buffer_size;
dvbdmxfeed->descramble = descramble;
-
if (dvbdmxfeed->descramble) {
up(&dvbdmx->mutex);
return -ENOSYS;
@@ -826,17 +824,15 @@ int dmx_section_feed_set(struct dmx_section_feed_s* feed,
}
-static
-void prepare_secfilters(struct dvb_demux_feed *dvbdmxfeed)
+static void prepare_secfilters(struct dvb_demux_feed *dvbdmxfeed)
{
- struct dvb_demux_filter *f = dvbdmxfeed->filter;
+ int i;
+ struct dvb_demux_filter *f;
dmx_section_filter_t *sf;
u8 mask, mode, doneq;
- int i;
- if (!f)
+ if (!(f=dvbdmxfeed->filter)
return;
-
do {
sf = &f->filter;
doneq = 0;
@@ -896,8 +892,8 @@ dmx_section_feed_start_filtering(dmx_section_feed_t *feed)
}
-static
-int dmx_section_feed_stop_filtering(struct dmx_section_feed_s* feed)
+static int
+dmx_section_feed_stop_filtering(struct dmx_section_feed_s* feed)
{
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed;
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
@@ -927,10 +923,9 @@ static int
dmx_section_feed_release_filter(dmx_section_feed_t *feed,
dmx_section_filter_t* filter)
{
- struct dvb_demux_filter *dvbdmxfilter = (struct dvb_demux_filter *) filter;
+ struct dvb_demux_filter *dvbdmxfilter = (struct dvb_demux_filter *) filter, *f;
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed;
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
- struct dvb_demux_filter *f;
if (down_interruptible (&dvbdmx->mutex))
return -ERESTARTSYS;
@@ -986,7 +981,7 @@ static int dvbdmx_allocate_section_feed(dmx_demux_t *demux,
(*feed)=&dvbdmxfeed->feed.sec;
(*feed)->is_filtering = 0;
(*feed)->parent = demux;
- (*feed)->priv = NULL;
+ (*feed)->priv = 0;
(*feed)->set = dmx_section_feed_set;
(*feed)->allocate_filter = dmx_section_feed_allocate_filter;
@@ -1003,7 +998,7 @@ static int dvbdmx_release_section_feed(dmx_demux_t *demux,
{
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed;
struct dvb_demux *dvbdmx = (struct dvb_demux *) demux;
- struct list_head *pos, *n;
+ struct list_head *pos, *n, *head = &dvbdmx->feed_list;
if (down_interruptible (&dvbdmx->mutex))
return -ERESTARTSYS;
@@ -1021,7 +1016,7 @@ static int dvbdmx_release_section_feed(dmx_demux_t *demux,
dvbdmxfeed->state=DMX_STATE_FREE;
if (dvbdmxfeed->pid <= DMX_MAX_PID) {
- list_for_each_safe(pos, n, &dvbdmx->feed_list) {
+ list_for_each_safe(pos, n, head) {
if (DMX_FEED_ENTRY(pos)->pid == dvbdmxfeed->pid) {
list_del(pos);
break;
@@ -1039,8 +1034,7 @@ static int dvbdmx_release_section_feed(dmx_demux_t *demux,
* dvb_demux kernel data API calls
******************************************************************************/
-static
-int dvbdmx_open(dmx_demux_t *demux)
+static int dvbdmx_open(dmx_demux_t *demux)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
@@ -1052,8 +1046,7 @@ int dvbdmx_open(dmx_demux_t *demux)
}
-static
-int dvbdmx_close(struct dmx_demux_s *demux)
+static int dvbdmx_close(struct dmx_demux_s *demux)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
@@ -1066,8 +1059,7 @@ int dvbdmx_close(struct dmx_demux_s *demux)
}
-static
-int dvbdmx_write(dmx_demux_t *demux, const char *buf, size_t count)
+static int dvbdmx_write(dmx_demux_t *demux, const char *buf, size_t count)
{
struct dvb_demux *dvbdemux=(struct dvb_demux *) demux;
@@ -1084,24 +1076,24 @@ int dvbdmx_write(dmx_demux_t *demux, const char *buf, size_t count)
}
-static
-int dvbdmx_add_frontend(dmx_demux_t *demux, dmx_frontend_t *frontend)
+static int dvbdmx_add_frontend(dmx_demux_t *demux, dmx_frontend_t *frontend)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
-
- list_add(&(frontend->connectivity_list), &dvbdemux->frontend_list);
+ struct list_head *pos, *head = &dvbdemux->frontend_list;
+
+ list_add(&(frontend->connectivity_list), head);
return 0;
}
-static
-int dvbdmx_remove_frontend(dmx_demux_t *demux, dmx_frontend_t *frontend)
+static int
+dvbdmx_remove_frontend(dmx_demux_t *demux, dmx_frontend_t *frontend)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
- struct list_head *pos, *n;
+ struct list_head *pos, *n, *head = &dvbdemux->frontend_list;
- list_for_each_safe (pos, n, &dvbdemux->frontend_list) {
+ list_for_each_safe (pos, n, head) {
if (DMX_FE_ENTRY(pos) == frontend) {
list_del(pos);
return 0;
@@ -1112,8 +1104,8 @@ int dvbdmx_remove_frontend(dmx_demux_t *demux, dmx_frontend_t *frontend)
}
-static
-struct list_head* dvbdmx_get_frontends(dmx_demux_t *demux)
+static struct list_head*
+dvbdmx_get_frontends(dmx_demux_t *demux)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
@@ -1124,7 +1116,7 @@ struct list_head* dvbdmx_get_frontends(dmx_demux_t *demux)
}
-int dvbdmx_connect_frontend(dmx_demux_t *demux,
+static int dvbdmx_connect_frontend(dmx_demux_t *demux,
dmx_frontend_t *frontend)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
@@ -1140,7 +1132,7 @@ int dvbdmx_connect_frontend(dmx_demux_t *demux,
return 0;
}
-int dvbdmx_disconnect_frontend(dmx_demux_t *demux)
+static int dvbdmx_disconnect_frontend(dmx_demux_t *demux)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
@@ -1154,8 +1146,7 @@ int dvbdmx_disconnect_frontend(dmx_demux_t *demux)
}
-static
-int dvbdmx_get_pes_pids(dmx_demux_t *demux, u16 *pids)
+static int dvbdmx_get_pes_pids(dmx_demux_t *demux, u16 *pids)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *) demux;
@@ -1164,10 +1155,11 @@ int dvbdmx_get_pes_pids(dmx_demux_t *demux, u16 *pids)
}
-int dvb_dmx_init(struct dvb_demux *dvbdemux)
+int
+dvb_dmx_init(struct dvb_demux *dvbdemux)
{
- dmx_demux_t *dmx = &dvbdemux->dmx;
int i, err;
+ dmx_demux_t *dmx = &dvbdemux->dmx;
dvbdemux->users = 0;
dvbdemux->filter = vmalloc(dvbdemux->filternum*sizeof(struct dvb_demux_filter));
@@ -1176,7 +1168,6 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
return -ENOMEM;
dvbdemux->feed = vmalloc(dvbdemux->feednum*sizeof(struct dvb_demux_feed));
-
if (!dvbdemux->feed) {
vfree(dvbdemux->filter);
return -ENOMEM;
@@ -1190,8 +1181,9 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
for (i=0; i<dvbdemux->feednum; i++)
dvbdemux->feed[i].state = DMX_STATE_FREE;
- dvbdemux->frontend_list.next = &dvbdemux->frontend_list;
- dvbdemux->frontend_list.prev = &dvbdemux->frontend_list;
+ dvbdemux->frontend_list.next=
+ dvbdemux->frontend_list.prev=
+ &dvbdemux->frontend_list;
for (i=0; i<DMX_TS_PES_OTHER; i++) {
dvbdemux->pesfilter[i] = NULL;
@@ -1211,8 +1203,7 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
dvbdemux->memcopy = dvb_dmx_memcopy;
dmx->frontend = 0;
- dmx->reg_list.prev = &dmx->reg_list;
- dmx->reg_list.next = &dmx->reg_list;
+ dmx->reg_list.prev = dmx->reg_list.next = &dmx->reg_list;
dmx->priv = (void *) dvbdemux;
dmx->open = dvbdmx_open;
dmx->close = dvbdmx_close;
@@ -1254,10 +1245,3 @@ dvb_dmx_release(struct dvb_demux *dvbdemux)
vfree(dvbdemux->feed);
return 0;
}
-
-#if 0
-MODULE_DESCRIPTION("Software MPEG Demultiplexer");
-MODULE_AUTHOR("Ralph Metzler, Markus Metzler");
-MODULE_LICENSE("GPL");
-#endif
-
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index 98d15c9ed..ef0acba79 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -195,8 +195,10 @@ void dvb_call_frontend_notifiers (struct dvb_frontend_data *fe,
if ((fe->status & FE_HAS_LOCK) && !(s & FE_HAS_LOCK))
fe->lost_sync_jiffies = jiffies;
- if (((s ^ fe->status) & FE_HAS_LOCK) && (s & FE_HAS_LOCK))
- ddelay (fe->info->notifier_delay);
+ if (((s ^ fe->status) & FE_HAS_LOCK) && (s & FE_HAS_LOCK)) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (fe->info->notifier_delay/10);
+ }
fe->status = s;
diff --git a/linux/drivers/media/dvb/frontends/alps_tdmb7.c b/linux/drivers/media/dvb/frontends/alps_tdmb7.c
index df95c64a6..54ac21eac 100644
--- a/linux/drivers/media/dvb/frontends/alps_tdmb7.c
+++ b/linux/drivers/media/dvb/frontends/alps_tdmb7.c
@@ -167,7 +167,8 @@ int cx22700_init (struct dvb_i2c_bus *i2c)
cx22700_writereg (i2c, 0x00, 0x02); /* soft reset */
cx22700_writereg (i2c, 0x00, 0x00);
- ddelay (HZ/100);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
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 56ad686f4..b8666c901 100644
--- a/linux/drivers/media/dvb/frontends/at76c651.c
+++ b/linux/drivers/media/dvb/frontends/at76c651.c
@@ -105,7 +105,8 @@ at76c651_writereg(struct dvb_i2c_bus *i2c, u8 reg, u8 data)
"(reg == 0x%02x, val == 0x%02x, ret == %i)\n",
__FUNCTION__, reg, data, ret);
- ddelay(10);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
return (ret != 1) ? -EREMOTEIO : 0;
diff --git a/linux/drivers/media/dvb/frontends/cx24110.c b/linux/drivers/media/dvb/frontends/cx24110.c
index 534371c54..5299a3783 100644
--- a/linux/drivers/media/dvb/frontends/cx24110.c
+++ b/linux/drivers/media/dvb/frontends/cx24110.c
@@ -245,7 +245,9 @@ int cx24108_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
cx24108_write(i2c,pll);
cx24110_writereg(i2c,0x56,0x7f);
- ddelay(HZ/10); /* wait a moment for the tuner pll to lock */
+ /* wait a moment for the tuner pll to lock */
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (10);
/* tuner pll lock can be monitored on GPIO pin 4 of cx24110 */
while(!(cx24110_readreg(i2c,0x66)&0x20)&&i<1000) i++;
diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-491.c b/linux/drivers/media/dvb/frontends/grundig_29504-491.c
index 5db49c1e7..386c9a590 100644
--- a/linux/drivers/media/dvb/frontends/grundig_29504-491.c
+++ b/linux/drivers/media/dvb/frontends/grundig_29504-491.c
@@ -249,7 +249,8 @@ void tda8083_wait_diseqc_fifo (struct dvb_i2c_bus *i2c, int timeout)
while (jiffies - start < timeout &&
!(tda8083_readreg(i2c, 0x02) & 0x80))
{
- ddelay(50);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (5);
};
}
diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c
index f9a9f3c2a..a88a8b792 100644
--- a/linux/drivers/media/dvb/frontends/stv0299.c
+++ b/linux/drivers/media/dvb/frontends/stv0299.c
@@ -439,7 +439,8 @@ int stv0299_wait_diseqc_fifo (struct dvb_i2c_bus *i2c, int timeout)
dprintk ("%s: timeout!!\n", __FUNCTION__);
return -ETIMEDOUT;
}
- ddelay(10);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
};
return 0;
@@ -458,7 +459,8 @@ int stv0299_wait_diseqc_idle (struct dvb_i2c_bus *i2c, int timeout)
dprintk ("%s: timeout!!\n", __FUNCTION__);
return -ETIMEDOUT;
}
- ddelay(10);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
};
return 0;
diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c
index be3a54f14..bb61fe54c 100644
--- a/linux/drivers/media/dvb/frontends/ves1820.c
+++ b/linux/drivers/media/dvb/frontends/ves1820.c
@@ -123,7 +123,9 @@ int ves1820_writereg (struct dvb_frontend *fe, u8 reg, u8 data)
"(reg == 0x%02x, val == 0x%02x, ret == %i)\n",
__FUNCTION__, reg, data, ret);
- ddelay(10);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
+
return (ret != 1) ? -EREMOTEIO : 0;
}
@@ -209,7 +211,8 @@ int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0)
* check lock and toggle inversion bit if required...
*/
if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
- ddelay(10);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
reg0 ^= 0x20;
ves1820_writereg (fe, 0x00, reg0 & 0xfe);
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index afc9879b3..c7d77b2eb 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -317,7 +317,9 @@ recover_arm(av7110_t *av7110)
reset_arm(av7110);
}
- ddelay(100);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (10);
+
restart_feeds(av7110);
outcom(av7110, COMTYPE_PIDFILTER, SetIR, 1, av7110->ir_config);
}
@@ -1120,7 +1122,8 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) )
{
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_FREE) {
printk(KERN_ERR "%s: timeout waiting for COMMAND idle\n", __FUNCTION__);
return -1;
@@ -1131,7 +1134,8 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) )
{
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_SHAKE) {
printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
return -1;
@@ -1142,7 +1146,8 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2) & OSDQFull )
{
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_OSD) {
printk(KERN_ERR "%s: timeout waiting for !OSDQFull\n", __FUNCTION__);
return -1;
@@ -1162,7 +1167,8 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) )
{
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_FREE) {
printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
return -1;
@@ -1282,7 +1288,8 @@ static int CommandRequest(av7110_t *av7110, u16 *Buff, int length, u16 *buf, int
while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2) )
{
#ifdef _NOHANDSHAKE
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
#endif
if ((jiffies - start) > ARM_WAIT_FREE) {
printk("%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
@@ -1294,7 +1301,8 @@ static int CommandRequest(av7110_t *av7110, u16 *Buff, int length, u16 *buf, int
#ifndef _NOHANDSHAKE
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) ) {
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_SHAKE) {
printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -1453,7 +1461,8 @@ static int FlushText(av7110_t *av7110)
return -ERESTARTSYS;
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) {
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_OSD) {
printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -1476,7 +1485,8 @@ static int WriteText(av7110_t *av7110, u8 win, u16 x, u16 y, u8* buf)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) {
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_OSD) {
printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -1486,7 +1496,8 @@ static int WriteText(av7110_t *av7110, u8 win, u16 x, u16 y, u8* buf)
#ifndef _NOHANDSHAKE
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) ) {
- ddelay(1);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
if ((jiffies - start) > ARM_WAIT_SHAKE) {
printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -1582,7 +1593,7 @@ LoadBitmap(av7110_t *av7110, u16 format, u16 dx, u16 dy, int inc, u8* data)
break;
schedule();
}
- current->state=TASK_RUNNING;
+ set_current_state(TASK_RUNNING)
remove_wait_queue(&av7110->bmpq, &wait);
}
if (av7110->bmp_state==BMP_LOADING)
@@ -1640,7 +1651,7 @@ BlitBitmap(av7110_t *av7110, u16 win, u16 x, u16 y, u16 trans)
break;
schedule();
}
- current->state=TASK_RUNNING;
+ set_current_state(TASK_RUNNING)
remove_wait_queue(&av7110->bmpq, &wait);
}
if (av7110->bmp_state==BMP_LOADED)
@@ -2035,7 +2046,7 @@ bootarm(av7110_t *av7110)
wait_for_debi_done(av7110);
saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTHI);
- current->state=TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
DEB_D(("bootarm: load dram code\n"));
@@ -4304,7 +4315,8 @@ int av7110_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *p
printk ("av7110: DVB-C analog module detected, "
"initializing MSP3400\n");
av7110->adac_type = DVB_ADAC_MSP;
- ddelay(100);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (10);
msp_writereg(av7110, 0x12, 0x0013, 0x0c00);
msp_writereg(av7110, 0x12, 0x0000, 0x7f00); // loudspeaker + headphone
msp_writereg(av7110, 0x12, 0x0008, 0x0220); // loudspeaker source
@@ -4357,9 +4369,11 @@ int av7110_detach (struct saa7146_dev* saa)
av7110->arm_rmmod=1;
wake_up_interruptible(&av7110->arm_wait);
- while (av7110->arm_thread)
- ddelay(1);
-
+ while (av7110->arm_thread) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (1);
+ }
+
dvb_unregister(av7110);
IER_DISABLE(saa, (MASK_19 | MASK_03));
diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c
index 0b48cc961..e330273db 100644
--- a/linux/drivers/media/dvb/ttpci/budget-av.c
+++ b/linux/drivers/media/dvb/ttpci/budget-av.c
@@ -164,7 +164,8 @@ int budget_av_detach (struct saa7146_dev *dev)
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
- ddelay(200);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (20);
saa7146_unregister_device (&budget_av->vd, dev);
@@ -210,7 +211,8 @@ int budget_av_attach (struct saa7146_dev* dev,
//test_knc_ci(av7110);
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI);
- ddelay(500);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (50);
if ((err = saa7113_init (budget_av))) {
budget_av_detach(dev);
@@ -234,9 +236,11 @@ int budget_av_attach (struct saa7146_dev* dev,
/* what is this? since we don't support open()/close()
notifications, we simply put this into the release handler... */
-// saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
- ddelay(200);
-
+/*
+ saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (20);
+*/
/* fixme: find some sane values here... */
saa7146_write(dev, PCI_BT_V1, 0x1c00101f);
diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c
index de6dabc98..72ddb9268 100644
--- a/linux/drivers/media/dvb/ttpci/budget.c
+++ b/linux/drivers/media/dvb/ttpci/budget.c
@@ -101,7 +101,8 @@ int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, int burst)
udelay(12500);
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO);
}
- ddelay(20);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout (2);
}
return 0;