diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-06-24 01:05:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:06:39 -0400 |
commit | ac19ecc6fa57b0ea320f01831175ff163f47d6a2 (patch) | |
tree | e57248fd223eddb98a43eed6abbac704863a0abd /drivers/media/video/saa7134/saa7134-oss.c | |
parent | 56fc08ca375491b965cb76fad65bfb98973e80d8 (diff) |
[PATCH] v4l: update for SAA7134 cards
This patch adds support for various SAA7134 cards and brings some fixes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher@laposte.net>
Signed-off-by: Hermann Pitton <hermann.pitton@onlinehome.de>.
Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-oss.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-oss.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c index 6b6a643bf1cd..81732904623f 100644 --- a/drivers/media/video/saa7134/saa7134-oss.c +++ b/drivers/media/video/saa7134/saa7134-oss.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: saa7134-oss.c,v 1.13 2004/12/10 12:33:39 kraxel Exp $ | 2 | * $Id: saa7134-oss.c,v 1.14 2005/05/18 22:45:16 hhackmann Exp $ |
3 | * | 3 | * |
4 | * device driver for philips saa7134 based TV cards | 4 | * device driver for philips saa7134 based TV cards |
5 | * oss dsp interface | 5 | * oss dsp interface |
@@ -49,7 +49,6 @@ MODULE_PARM_DESC(oss_rate,"sample rate (valid are: 32000,48000)"); | |||
49 | 49 | ||
50 | static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) | 50 | static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) |
51 | { | 51 | { |
52 | blksize &= ~0xff; | ||
53 | if (blksize < 0x100) | 52 | if (blksize < 0x100) |
54 | blksize = 0x100; | 53 | blksize = 0x100; |
55 | if (blksize > 0x10000) | 54 | if (blksize > 0x10000) |
@@ -57,8 +56,6 @@ static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks) | |||
57 | 56 | ||
58 | if (blocks < 2) | 57 | if (blocks < 2) |
59 | blocks = 2; | 58 | blocks = 2; |
60 | while ((blksize * blocks) & ~PAGE_MASK) | ||
61 | blocks++; | ||
62 | if ((blksize * blocks) > 1024*1024) | 59 | if ((blksize * blocks) > 1024*1024) |
63 | blocks = 1024*1024 / blksize; | 60 | blocks = 1024*1024 / blksize; |
64 | 61 | ||
@@ -79,7 +76,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev) | |||
79 | BUG(); | 76 | BUG(); |
80 | videobuf_dma_init(&dev->oss.dma); | 77 | videobuf_dma_init(&dev->oss.dma); |
81 | err = videobuf_dma_init_kernel(&dev->oss.dma, PCI_DMA_FROMDEVICE, | 78 | err = videobuf_dma_init_kernel(&dev->oss.dma, PCI_DMA_FROMDEVICE, |
82 | dev->oss.bufsize >> PAGE_SHIFT); | 79 | (dev->oss.bufsize + PAGE_SIZE) >> PAGE_SHIFT); |
83 | if (0 != err) | 80 | if (0 != err) |
84 | return err; | 81 | return err; |
85 | return 0; | 82 | return 0; |
@@ -163,10 +160,11 @@ static int dsp_rec_start(struct saa7134_dev *dev) | |||
163 | fmt |= 0x04; | 160 | fmt |= 0x04; |
164 | fmt |= (TV == dev->oss.input) ? 0xc0 : 0x80; | 161 | fmt |= (TV == dev->oss.input) ? 0xc0 : 0x80; |
165 | 162 | ||
166 | saa_writeb(SAA7134_NUM_SAMPLES0, (dev->oss.blksize & 0x0000ff)); | 163 | saa_writeb(SAA7134_NUM_SAMPLES0, ((dev->oss.blksize - 1) & 0x0000ff)); |
167 | saa_writeb(SAA7134_NUM_SAMPLES1, (dev->oss.blksize & 0x00ff00) >> 8); | 164 | saa_writeb(SAA7134_NUM_SAMPLES1, ((dev->oss.blksize - 1) & 0x00ff00) >> 8); |
168 | saa_writeb(SAA7134_NUM_SAMPLES2, (dev->oss.blksize & 0xff0000) >> 16); | 165 | saa_writeb(SAA7134_NUM_SAMPLES2, ((dev->oss.blksize - 1) & 0xff0000) >> 16); |
169 | saa_writeb(SAA7134_AUDIO_FORMAT_CTRL, fmt); | 166 | saa_writeb(SAA7134_AUDIO_FORMAT_CTRL, fmt); |
167 | |||
170 | break; | 168 | break; |
171 | case PCI_DEVICE_ID_PHILIPS_SAA7133: | 169 | case PCI_DEVICE_ID_PHILIPS_SAA7133: |
172 | case PCI_DEVICE_ID_PHILIPS_SAA7135: | 170 | case PCI_DEVICE_ID_PHILIPS_SAA7135: |
@@ -817,7 +815,7 @@ void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status) | |||
817 | reg = SAA7134_RS_BA1(6); | 815 | reg = SAA7134_RS_BA1(6); |
818 | } else { | 816 | } else { |
819 | /* even */ | 817 | /* even */ |
820 | if (0 == (dev->oss.dma_blk & 0x00)) | 818 | if (1 == (dev->oss.dma_blk & 0x01)) |
821 | reg = SAA7134_RS_BA2(6); | 819 | reg = SAA7134_RS_BA2(6); |
822 | } | 820 | } |
823 | if (0 == reg) { | 821 | if (0 == reg) { |