diff options
author | Gerd Knorr <devnull@localhost> | 2004-09-22 11:47:11 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-09-22 11:47:11 +0000 |
commit | 953f8692136acd6aa9201f9388697a7005756894 (patch) | |
tree | 4cf405b99592bc05d8eb87ce66da1190e2a5e819 /linux/drivers/media/video | |
parent | 0802f274f50202af378705c56feba19cd5abb5ee (diff) | |
download | mediapointer-dvb-s2-953f8692136acd6aa9201f9388697a7005756894.tar.gz mediapointer-dvb-s2-953f8692136acd6aa9201f9388697a7005756894.tar.bz2 |
- misc sleep cleanups.
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/bttv-i2c.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-cards.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-core.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/msp3400-driver.c | 18 | ||||
-rw-r--r-- | linux/drivers/media/video/msp3400.c | 18 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-tvaudio.c | 21 | ||||
-rw-r--r-- | linux/drivers/media/video/tda9887.c | 9 |
7 files changed, 44 insertions, 38 deletions
diff --git a/linux/drivers/media/video/bttv-i2c.c b/linux/drivers/media/video/bttv-i2c.c index 6d11393cd..131231718 100644 --- a/linux/drivers/media/video/bttv-i2c.c +++ b/linux/drivers/media/video/bttv-i2c.c @@ -1,5 +1,5 @@ /* - $Id: bttv-i2c.c,v 1.7 2004/09/16 08:43:57 kraxel Exp $ + $Id: bttv-i2c.c,v 1.8 2004/09/22 11:47:11 kraxel Exp $ bttv-i2c.c -- all the i2c code is here @@ -141,10 +141,8 @@ bttv_i2c_wait_done(struct bttv *btv) int rc = 0; add_wait_queue(&btv->i2c_queue, &wait); - set_current_state(TASK_INTERRUPTIBLE); if (0 == btv->i2c_done) - schedule_timeout(HZ/50+1); - set_current_state(TASK_RUNNING); + msleep_interruptible(20); remove_wait_queue(&btv->i2c_queue, &wait); if (0 == btv->i2c_done) diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index a1f61eb8f..ac5c20451 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-cards.c,v 1.39 2004/09/20 11:53:23 kraxel Exp $ + * $Id: cx88-cards.c,v 1.40 2004/09/22 11:47:11 kraxel Exp $ * * device driver for Conexant 2388x based TV cards * card-specific stuff. @@ -155,6 +155,7 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, + .gpio1 = 0x3004, },{ .type = CX88_VMUX_COMPOSITE2, .vmux = 2, @@ -220,6 +221,7 @@ struct cx88_board cx88_boards[] = { .radio = { .type = CX88_RADIO, }, + .blackbird = 1, }, [CX88_BOARD_IODATA_GVVCP3PCI] = { .name = "IODATA GV-VCP3/PCI", diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index 5edc9e9c2..d9458efdb 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-core.c,v 1.10 2004/09/16 07:05:48 kraxel Exp $ + * $Id: cx88-core.c,v 1.11 2004/09/22 11:47:11 kraxel Exp $ * * device driver for Conexant 2388x based TV cards * driver core @@ -832,7 +832,7 @@ static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) dprintk(1,"set_pll: MO_PLL_REG 0x%08x [old=0x%08x,freq=%d]\n", reg, cx_read(MO_PLL_REG), ofreq); cx_write(MO_PLL_REG, reg); - for (i = 0; i < 10; i++) { + for (i = 0; i < 100; i++) { reg = cx_read(MO_DEVICE_STATUS); if (reg & (1<<2)) { dprintk(1,"pll locked [pre=%d,ofreq=%d]\n", @@ -840,7 +840,7 @@ static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) return 0; } dprintk(1,"pll not locked yet, waiting ...\n"); - msleep(100); + msleep(10); } dprintk(1,"pll NOT locked [pre=%d,ofreq=%d]\n",prescale,ofreq); return -1; diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index 44287f2bf..74e57e172 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -745,11 +745,11 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) add_wait_queue(&msp->wq, &wait); if (!msp->rmmod) { - set_current_state(TASK_INTERRUPTIBLE); - if (timeout < 0) + if (timeout < 0) { + set_current_state(TASK_INTERRUPTIBLE); schedule(); - else - schedule_timeout(timeout); + } else + msleep_interruptible(timeout); } remove_wait_queue(&msp->wq, &wait); return msp->rmmod || signal_pending(current); @@ -818,7 +818,7 @@ static int msp3400c_thread(void *data) } /* some time for the tuner to sync */ - if (msp34xx_sleep(msp,HZ/5)) + if (msp34xx_sleep(msp,200)) goto done; restart: @@ -851,7 +851,7 @@ static int msp3400c_thread(void *data) for (this = 0; this < count; this++) { msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo); - if (msp34xx_sleep(msp,HZ/10)) + if (msp34xx_sleep(msp,100)) goto done; if (msp->restart) msp->restart = 0; @@ -886,7 +886,7 @@ static int msp3400c_thread(void *data) for (this = 0; this < count; this++) { msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo); - if (msp34xx_sleep(msp,HZ/10)) + if (msp34xx_sleep(msp,100)) goto done; if (msp->restart) goto restart; @@ -1055,7 +1055,7 @@ static int msp3410d_thread(void *data) } /* some time for the tuner to sync */ - if (msp34xx_sleep(msp,HZ/5)) + if (msp34xx_sleep(msp,200)) goto done; restart: @@ -1114,7 +1114,7 @@ static int msp3410d_thread(void *data) } else { /* triggered autodetect */ for (;;) { - if (msp34xx_sleep(msp,HZ/10)) + if (msp34xx_sleep(msp,100)) goto done; if (msp->restart) goto restart; diff --git a/linux/drivers/media/video/msp3400.c b/linux/drivers/media/video/msp3400.c index 44287f2bf..74e57e172 100644 --- a/linux/drivers/media/video/msp3400.c +++ b/linux/drivers/media/video/msp3400.c @@ -745,11 +745,11 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) add_wait_queue(&msp->wq, &wait); if (!msp->rmmod) { - set_current_state(TASK_INTERRUPTIBLE); - if (timeout < 0) + if (timeout < 0) { + set_current_state(TASK_INTERRUPTIBLE); schedule(); - else - schedule_timeout(timeout); + } else + msleep_interruptible(timeout); } remove_wait_queue(&msp->wq, &wait); return msp->rmmod || signal_pending(current); @@ -818,7 +818,7 @@ static int msp3400c_thread(void *data) } /* some time for the tuner to sync */ - if (msp34xx_sleep(msp,HZ/5)) + if (msp34xx_sleep(msp,200)) goto done; restart: @@ -851,7 +851,7 @@ static int msp3400c_thread(void *data) for (this = 0; this < count; this++) { msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo); - if (msp34xx_sleep(msp,HZ/10)) + if (msp34xx_sleep(msp,100)) goto done; if (msp->restart) msp->restart = 0; @@ -886,7 +886,7 @@ static int msp3400c_thread(void *data) for (this = 0; this < count; this++) { msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo); - if (msp34xx_sleep(msp,HZ/10)) + if (msp34xx_sleep(msp,100)) goto done; if (msp->restart) goto restart; @@ -1055,7 +1055,7 @@ static int msp3410d_thread(void *data) } /* some time for the tuner to sync */ - if (msp34xx_sleep(msp,HZ/5)) + if (msp34xx_sleep(msp,200)) goto done; restart: @@ -1114,7 +1114,7 @@ static int msp3410d_thread(void *data) } else { /* triggered autodetect */ for (;;) { - if (msp34xx_sleep(msp,HZ/10)) + if (msp34xx_sleep(msp,100)) goto done; if (msp->restart) goto restart; diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c index 786c17d71..2e8b3d0b0 100644 --- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-tvaudio.c,v 1.12 2004/09/20 13:53:37 kraxel Exp $ + * $Id: saa7134-tvaudio.c,v 1.13 2004/09/22 11:47:11 kraxel Exp $ * * device driver for philips saa7134 based TV cards * tv audio decoder (fm stereo, nicam, ...) @@ -58,9 +58,10 @@ MODULE_PARM_DESC(audio_clock_tweak, "Audio clock tick fine tuning for cards with #define print_regb(reg) printk("%s: reg 0x%03x [%-16s]: 0x%02x\n", \ dev->name,(SAA7134_##reg),(#reg),saa_readb((SAA7134_##reg))) -#define SCAN_INITIAL_DELAY (HZ) -#define SCAN_SAMPLE_DELAY (HZ/5) -#define SCAN_SUBCARRIER_DELAY (HZ*2) +/* msecs */ +#define SCAN_INITIAL_DELAY 1000 +#define SCAN_SAMPLE_DELAY 200 +#define SCAN_SUBCARRIER_DELAY 2000 /* ------------------------------------------------------------------ */ /* saa7134 code */ @@ -326,11 +327,11 @@ static int tvaudio_sleep(struct saa7134_dev *dev, int timeout) add_wait_queue(&dev->thread.wq, &wait); if (dev->thread.scan1 == dev->thread.scan2 && !dev->thread.shutdown) { - set_current_state(TASK_INTERRUPTIBLE); - if (timeout < 0) + if (timeout < 0) { + set_current_state(TASK_INTERRUPTIBLE); schedule(); - else - schedule_timeout(timeout); + } else + msleep_interruptible(timeout); } remove_wait_queue(&dev->thread.wq, &wait); return dev->thread.scan1 != dev->thread.scan2; @@ -612,7 +613,7 @@ static int tvaudio_thread(void *data) lastmode = 42; for (;;) { - if (tvaudio_sleep(dev,5*HZ)) + if (tvaudio_sleep(dev,5000)) goto restart; if (dev->thread.shutdown || signal_pending(current)) break; @@ -840,7 +841,7 @@ static int tvaudio_thread_ddep(void *data) saa_dsp_writel(dev, 0x464 >> 2, 0x000000); saa_dsp_writel(dev, 0x470 >> 2, 0x101010); - if (tvaudio_sleep(dev,3*HZ)) + if (tvaudio_sleep(dev,3000)) goto restart; value = saa_readl(0x528 >> 2) & 0xffffff; diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index 9cf8a8b69..779a98a4a 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -6,6 +6,7 @@ #include <linux/init.h> #include <linux/errno.h> #include <linux/slab.h> +#include <linux/delay.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "audiochip.h" @@ -541,6 +542,11 @@ static int tda9887_configure(struct tda9887 *t) tda9887_set_config(t,buf); tda9887_set_insmod(t,buf); + if (t->std & V4L2_STD_SECAM_L) { + /* secam fixup (FIXME: move this to tvnorms array?) */ + buf[1] &= ~cOutputPort2Inactive; + } + dprintk(PREFIX "writing: b=0x%02x c=0x%02x e=0x%02x\n", buf[1],buf[2],buf[3]); if (debug > 1) @@ -550,8 +556,7 @@ static int tda9887_configure(struct tda9887 *t) printk(PREFIX "i2c i/o error: rc == %d (should be 4)\n",rc); if (debug > 2) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ); + msleep(1000); tda9887_status(t); } return 0; |