summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2003-04-26 11:23:43 +0000
committerMichael Hunold <devnull@localhost>2003-04-26 11:23:43 +0000
commitb80a49661205204e9e4fdd47f887355f543ba4ad (patch)
tree727a36b8683397e630e1a61187668977db74390b /linux/drivers/media
parent3e4b7360a384416bdb35dded255c518c3863759e (diff)
downloadmediapointer-dvb-s2-b80a49661205204e9e4fdd47f887355f543ba4ad.tar.gz
mediapointer-dvb-s2-b80a49661205204e9e4fdd47f887355f543ba4ad.tar.bz2
Revert ddelay() cleanup, discuss this first with Holger.
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_compat.h12
-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/ves1820.c7
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c42
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-av.c6
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.c3
10 files changed, 37 insertions, 52 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_compat.h b/linux/drivers/media/dvb/dvb-core/dvb_compat.h
index b31a8ef10..cbbaee353 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_compat.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_compat.h
@@ -10,6 +10,18 @@
/* 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_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index ef0acba79..98d15c9ed 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -195,10 +195,8 @@ 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)) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (fe->info->notifier_delay/10);
- }
+ if (((s ^ fe->status) & FE_HAS_LOCK) && (s & FE_HAS_LOCK))
+ ddelay (fe->info->notifier_delay);
fe->status = s;
diff --git a/linux/drivers/media/dvb/frontends/alps_tdmb7.c b/linux/drivers/media/dvb/frontends/alps_tdmb7.c
index 54ac21eac..df95c64a6 100644
--- a/linux/drivers/media/dvb/frontends/alps_tdmb7.c
+++ b/linux/drivers/media/dvb/frontends/alps_tdmb7.c
@@ -167,8 +167,7 @@ int cx22700_init (struct dvb_i2c_bus *i2c)
cx22700_writereg (i2c, 0x00, 0x02); /* soft reset */
cx22700_writereg (i2c, 0x00, 0x00);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay (HZ/100);
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 b8666c901..56ad686f4 100644
--- a/linux/drivers/media/dvb/frontends/at76c651.c
+++ b/linux/drivers/media/dvb/frontends/at76c651.c
@@ -105,8 +105,7 @@ at76c651_writereg(struct dvb_i2c_bus *i2c, u8 reg, u8 data)
"(reg == 0x%02x, val == 0x%02x, ret == %i)\n",
__FUNCTION__, reg, data, ret);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(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 5299a3783..534371c54 100644
--- a/linux/drivers/media/dvb/frontends/cx24110.c
+++ b/linux/drivers/media/dvb/frontends/cx24110.c
@@ -245,9 +245,7 @@ int cx24108_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
cx24108_write(i2c,pll);
cx24110_writereg(i2c,0x56,0x7f);
- /* wait a moment for the tuner pll to lock */
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (10);
+ ddelay(HZ/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) i++;
diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-491.c b/linux/drivers/media/dvb/frontends/grundig_29504-491.c
index 386c9a590..5db49c1e7 100644
--- a/linux/drivers/media/dvb/frontends/grundig_29504-491.c
+++ b/linux/drivers/media/dvb/frontends/grundig_29504-491.c
@@ -249,8 +249,7 @@ void tda8083_wait_diseqc_fifo (struct dvb_i2c_bus *i2c, int timeout)
while (jiffies - start < timeout &&
!(tda8083_readreg(i2c, 0x02) & 0x80))
{
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (5);
+ ddelay(50);
};
}
diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c
index bb61fe54c..be3a54f14 100644
--- a/linux/drivers/media/dvb/frontends/ves1820.c
+++ b/linux/drivers/media/dvb/frontends/ves1820.c
@@ -123,9 +123,7 @@ int ves1820_writereg (struct dvb_frontend *fe, u8 reg, u8 data)
"(reg == 0x%02x, val == 0x%02x, ret == %i)\n",
__FUNCTION__, reg, data, ret);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
-
+ ddelay(10);
return (ret != 1) ? -EREMOTEIO : 0;
}
@@ -211,8 +209,7 @@ int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0)
* check lock and toggle inversion bit if required...
*/
if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(10);
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 f571dee7b..bf105518a 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -317,9 +317,7 @@ recover_arm(av7110_t *av7110)
reset_arm(av7110);
}
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (10);
-
+ ddelay(100);
restart_feeds(av7110);
outcom(av7110, COMTYPE_PIDFILTER, SetIR, 1, av7110->ir_config);
}
@@ -1122,8 +1120,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) )
{
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_FREE) {
printk(KERN_ERR "%s: timeout waiting for COMMAND idle\n", __FUNCTION__);
return -1;
@@ -1134,8 +1131,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) )
{
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_SHAKE) {
printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
return -1;
@@ -1146,8 +1142,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2) & OSDQFull )
{
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_OSD) {
printk(KERN_ERR "%s: timeout waiting for !OSDQFull\n", __FUNCTION__);
return -1;
@@ -1167,8 +1162,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) )
{
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_FREE) {
printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
return -1;
@@ -1288,8 +1282,7 @@ static int CommandRequest(av7110_t *av7110, u16 *Buff, int length, u16 *buf, int
while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2) )
{
#ifdef _NOHANDSHAKE
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
#endif
if ((jiffies - start) > ARM_WAIT_FREE) {
printk("%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
@@ -1301,8 +1294,7 @@ 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 ) ) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_SHAKE) {
printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -1461,8 +1453,7 @@ static int FlushText(av7110_t *av7110)
return -ERESTARTSYS;
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_OSD) {
printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -1485,8 +1476,7 @@ static int WriteText(av7110_t *av7110, u8 win, u16 x, u16 y, u8* buf)
start = jiffies;
while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_OSD) {
printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -1496,8 +1486,7 @@ 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 ) ) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
+ ddelay(1);
if ((jiffies - start) > ARM_WAIT_SHAKE) {
printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
up(&av7110->dcomlock);
@@ -4315,8 +4304,7 @@ 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;
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (10);
+ ddelay(100);
msp_writereg(av7110, 0x12, 0x0013, 0x0c00);
msp_writereg(av7110, 0x12, 0x0000, 0x7f00); // loudspeaker + headphone
msp_writereg(av7110, 0x12, 0x0008, 0x0220); // loudspeaker source
@@ -4369,11 +4357,9 @@ int av7110_detach (struct saa7146_dev* saa)
av7110->arm_rmmod=1;
wake_up_interruptible(&av7110->arm_wait);
- while (av7110->arm_thread) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (1);
- }
-
+ while (av7110->arm_thread)
+ ddelay(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 e330273db..130b5fb9b 100644
--- a/linux/drivers/media/dvb/ttpci/budget-av.c
+++ b/linux/drivers/media/dvb/ttpci/budget-av.c
@@ -164,8 +164,7 @@ int budget_av_detach (struct saa7146_dev *dev)
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (20);
+ ddelay(200);
saa7146_unregister_device (&budget_av->vd, dev);
@@ -211,8 +210,7 @@ int budget_av_attach (struct saa7146_dev* dev,
//test_knc_ci(av7110);
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (50);
+ ddelay(500);
if ((err = saa7113_init (budget_av))) {
budget_av_detach(dev);
diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c
index 72ddb9268..de6dabc98 100644
--- a/linux/drivers/media/dvb/ttpci/budget.c
+++ b/linux/drivers/media/dvb/ttpci/budget.c
@@ -101,8 +101,7 @@ int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, int burst)
udelay(12500);
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO);
}
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (2);
+ ddelay(20);
}
return 0;