Re: i810 audio patch

Nathan Bryant
2001-12-06T00:51:18Z

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Doug Ledford wrote:

> Nathan Bryant wrote:
>
> OK, on my site there is now a 0.10 version of the driver. This one
> stands a reasonable chance of working in mmap mode. Please give it a
> try and let me know what happens (see my comments in
> __i810_update_lvi() to see what I think the actual problem is).
>
> http://people.redhat.com/dledford/i810_audio.c.gz
>
>
>
>
some fixes needed, attached

[-- Attachment #2: foo --]
[-- Type: text/plain, Size: 1926 bytes --]

--- /home/nbryant/i810_audio.c Wed Dec 5 19:49:38 2001
+++ drivers/sound/i810_audio.c Wed Dec 5 19:49:00 2001
@@ -953,7 +953,7 @@
* the CIV value to the next sg segment to be played so that when
* we call start_{dac,adc}, things will operate properly
*/
- if (!dmabuf->enabled)
+ if (!dmabuf->enable)
outb((inb(port+OFF_CIV)+1)&31, port+OFF_CIV);

/* swptr - 1 is the tail of our transfer */
@@ -961,7 +961,7 @@
x /= dmabuf->fragsize;
#ifdef DEBUG_MMAP
if (dmabuf->count > dmabuf->fragsize && inb(port+OFF_CIV) == x)
- printk(KERN_DEBUG,"i810_audio: update_lvi - CIV == LVI\n");
+ printk(KERN_DEBUG "i810_audio: update_lvi - CIV == LVI\n");
#endif
outb(x, port+OFF_LVI);
}
@@ -1124,7 +1124,6 @@
if(count <= 0 || timeout) {
stop_dac(state);
synchronize_irq();
- resync_dma_ptrs(state, 0 /* record channel */);
}
if (signal_pending(current))
return -ERESTARTSYS;
@@ -1595,7 +1594,7 @@
static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
struct i810_state *state = (struct i810_state *)file->private_data;
- struct i810_channel *c;
+ struct i810_channel *c = NULL;
struct dmabuf *dmabuf = &state->dmabuf;
unsigned long flags;
audio_buf_info abinfo;
@@ -1629,10 +1628,12 @@
c = dmabuf->read_channel;
__stop_adc(state);
}
- outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
- outb(0, state->card->iobase+c->port+OFF_CIV);
- outb(0, state->card->iobase+c->port+OFF_LVI);
+ if (c != NULL) {
+ outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
+ outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+ outb(0, state->card->iobase+c->port+OFF_CIV);
+ outb(0, state->card->iobase+c->port+OFF_LVI);
+ }

spin_unlock_irqrestore(&state->card->lock, flags);
synchronize_irq();