diff options
| author | Michael Hunold <devnull@localhost> | 2003-04-25 08:21:35 +0000 |
|---|---|---|
| committer | Michael Hunold <devnull@localhost> | 2003-04-25 08:21:35 +0000 |
| commit | cb61a9ffb7f22d9d73d7263bf84142941b336050 (patch) | |
| tree | 15cf8cb24554e4a1af38ecf999892bf84e78cd0f /linux/drivers/media/dvb/ttpci | |
| parent | f7e91da79a7d08e9aa8d555b7a6e96ca6548b93e (diff) | |
| download | mediapointer-dvb-s2-cb61a9ffb7f22d9d73d7263bf84142941b336050.tar.gz mediapointer-dvb-s2-cb61a9ffb7f22d9d73d7263bf84142941b336050.tar.bz2 | |
Lots of cosmetic changes in order to sync the CVS with
the version that made it into the 2.5.68 kernel.
- remove unnecessary c++-style comments
- fixed some line breaks and the style function headers
are formatted: please don't argue with me about these changes,
I don't care how they are formatted.
- remove newline breaks between memory allocation and the return value
check
Some more interesing stuff:
- remove ddelay() functions completly, replace with set_current_state() and
manual schedule_timeout() calls.
- made some init data for the mxb driver static and global (patch already
send to lkml)
Some crucial changes:
- inherit some return values Mr. Alan Cox has changed -- please review
Diffstat (limited to 'linux/drivers/media/dvb/ttpci')
| -rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 48 | ||||
| -rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-av.c | 14 | ||||
| -rw-r--r-- | linux/drivers/media/dvb/ttpci/budget.c | 3 |
3 files changed, 42 insertions, 23 deletions
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; |
