summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2003-03-21 11:02:16 +0000
committerHolger Waechtler <devnull@localhost>2003-03-21 11:02:16 +0000
commit5673904df7d5dd00df35988fd6fda922b4000398 (patch)
treeeab25edc57a16ad23a1b0c4aef081d5ac8f0d366 /linux/drivers/media/dvb/ttpci
parentc2d841f465a26e84edd2e2ff833d3b096110decc (diff)
downloadmediapointer-dvb-s2-5673904df7d5dd00df35988fd6fda922b4000398.tar.gz
mediapointer-dvb-s2-5673904df7d5dd00df35988fd6fda922b4000398.tar.bz2
- more portability changes, move ddelay() into compat.h
- introduce kernel_thread_setup() function to encapsulate linux process model related stuff
Diffstat (limited to 'linux/drivers/media/dvb/ttpci')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c37
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-av.c13
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c13
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.c12
4 files changed, 11 insertions, 64 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 39ef32abe..a5ce92cc4 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -75,6 +75,8 @@
#include "dvb_i2c.h"
#include "dvb_frontend.h"
+#include "compat.h"
+
#if 1
#define DEBUG_VARIABLE av7110_debug
@@ -107,20 +109,6 @@ static int hw_sections = 1;
int av7110_num = 0;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- #define KBUILD_MODNAME av7110
-#endif
-
-/****************************************************************************
- * General helper functions
- ****************************************************************************/
-
-static inline void ddelay(int i)
-{
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout((HZ*i)/100);
-}
-
/****************************************************************************
* DEBI functions
@@ -326,7 +314,8 @@ recover_arm(av7110_t *av7110)
printk("OOPS, no current->files\n");
reset_arm(av7110);
}
- ddelay(10);
+
+ ddelay(100);
restart_feeds(av7110);
}
@@ -346,21 +335,9 @@ static int arm_thread(void *data)
u16 newloops = 0;
DEB_EE(("av7110: %p\n",av7110));
-
- lock_kernel();
-#if 0
- daemonize();
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- reparent_to_init ();
-#endif
-#else
- exit_mm(current);
- current->session=current->pgrp=1;
-#endif
- sigfillset(&current->blocked);
- strcpy(current->comm, "arm_mon");
+
+ kernel_thread_setup ("arm_mon");
av7110->arm_thread = current;
- unlock_kernel();
while (!av7110->arm_rmmod && !signal_pending(current)) {
interruptible_sleep_on_timeout(&av7110->arm_wait, 5*HZ);
@@ -4143,7 +4120,7 @@ int av7110_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *p
i2c_writereg(av7110, 0x80, 0x0, 0);
printk ("av7110: DVB-C analog module detected, "
"initializing MSP3400\n");
- ddelay(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
diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c
index 8d6be0828..2fa7ab6aa 100644
--- a/linux/drivers/media/dvb/ttpci/budget-av.c
+++ b/linux/drivers/media/dvb/ttpci/budget-av.c
@@ -48,13 +48,6 @@ struct budget_av {
* INITIALIZATION
****************************************************************************/
-static inline
-void ddelay(int i)
-{
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout((HZ*i)/100);
-}
-
static
u8 i2c_readreg (struct dvb_i2c_bus *i2c, u8 id, u8 reg)
@@ -175,7 +168,7 @@ int budget_av_detach (struct saa7146_dev *dev)
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
- ddelay(20);
+ ddelay(200);
saa7146_unregister_device (&budget_av->vd, dev);
@@ -221,7 +214,7 @@ int budget_av_attach (struct saa7146_dev* dev,
//test_knc_ci(av7110);
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI);
- ddelay(50);
+ ddelay(500);
if ((err = saa7113_init (budget_av))) {
budget_av_detach(dev);
@@ -246,7 +239,7 @@ 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(20);
+ ddelay(200);
/* fixme: find some sane values here... */
saa7146_write(dev, PCI_BT_V1, 0x1c00101f);
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
index 71cbcfffd..bdf81a82e 100644
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -1,21 +1,8 @@
#include "budget.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- #define KBUILD_MODNAME budget
-#endif
int budget_debug = 0;
/****************************************************************************
- * General helper functions
- ****************************************************************************/
-
-static inline void ddelay(int i)
-{
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout((HZ*i)/100);
-}
-
-/****************************************************************************
* TT budget / WinTV Nova
****************************************************************************/
diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c
index 545101f44..d4f9f7640 100644
--- a/linux/drivers/media/dvb/ttpci/budget.c
+++ b/linux/drivers/media/dvb/ttpci/budget.c
@@ -30,19 +30,9 @@
*/
#include "budget.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- #define KBUILD_MODNAME budget
-#endif
-static inline void ddelay(int i)
-{
- current->state=TASK_INTERRUPTIBLE;
- schedule_timeout((HZ*i)/100);
-}
-
-
static
void Set22K (struct budget *budget, int state)
{
@@ -110,7 +100,7 @@ int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, int burst)
udelay(12500);
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO);
}
- ddelay(2);
+ ddelay(20);
}
return 0;