diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 17:17:53 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 17:17:53 +0000 |
commit | b2ad5f821b1381492d792ca10b1eb7a107b48f14 (patch) | |
tree | 954a648692e7da983db1d2470953705f6a729264 /drivers/sound | |
parent | c9c06167e7933d93a6e396174c68abf242294abb (diff) |
Merge with Linux 2.4.0-prerelease. Big Makefile rewrite, test your
Makefiles.
Diffstat (limited to 'drivers/sound')
-rw-r--r-- | drivers/sound/Makefile | 65 | ||||
-rw-r--r-- | drivers/sound/cmpci.c | 25 | ||||
-rw-r--r-- | drivers/sound/cs4281.c | 22 | ||||
-rw-r--r-- | drivers/sound/dmasound/Makefile | 17 | ||||
-rw-r--r-- | drivers/sound/emu10k1/Makefile | 16 | ||||
-rw-r--r-- | drivers/sound/es1370.c | 14 | ||||
-rw-r--r-- | drivers/sound/es1371.c | 14 | ||||
-rw-r--r-- | drivers/sound/esssolo1.c | 14 | ||||
-rw-r--r-- | drivers/sound/i810_audio.c | 89 | ||||
-rw-r--r-- | drivers/sound/mad16.c | 128 | ||||
-rw-r--r-- | drivers/sound/maestro.c | 23 | ||||
-rw-r--r-- | drivers/sound/sb_card.c | 33 | ||||
-rw-r--r-- | drivers/sound/sonicvibes.c | 14 | ||||
-rw-r--r-- | drivers/sound/trident.c | 21 | ||||
-rw-r--r-- | drivers/sound/via82cxxx_audio.c | 10 | ||||
-rw-r--r-- | drivers/sound/wavfront.c | 8 | ||||
-rw-r--r-- | drivers/sound/ymf_sb.c | 11 |
17 files changed, 247 insertions, 277 deletions
diff --git a/drivers/sound/Makefile b/drivers/sound/Makefile index 0a29d73d0..e7ee317e6 100644 --- a/drivers/sound/Makefile +++ b/drivers/sound/Makefile @@ -4,14 +4,6 @@ # Rewritten to use lists instead of if-statements. - -# My subdirectories. - -SUB_DIRS := -MOD_SUB_DIRS := -MOD_IN_SUB_DIRS := -ALL_SUB_DIRS := $(SUB_DIRS) emu10k1 - # All of the (potential) objects that export symbols. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. @@ -20,17 +12,6 @@ export-objs := ad1848.o audio_syms.o midi_syms.o mpu401.o \ sound_core.o sound_syms.o uart401.o \ nm256_audio.o ac97.o ac97_codec.o - - -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - - - # Each configuration option enables a list of files. obj-$(CONFIG_SOUND) += soundcore.o @@ -83,23 +64,16 @@ obj-$(CONFIG_SOUND_CS4281) += cs4281.o obj-$(CONFIG_SOUND_MAESTRO) += maestro.o obj-$(CONFIG_SOUND_TRIDENT) += trident.o ac97_codec.o +subdir-$(CONFIG_SOUND_EMU10K1) += emu10k1 + ifeq ($(CONFIG_SOUND_EMU10K1),y) - SUB_DIRS += emu10k1 obj-y += emu10k1/emu10k1.o -else - ifeq ($(CONFIG_SOUND_EMU10K1),m) - MOD_SUB_DIRS += emu10k1 - endif endif +subdir-$(CONFIG_DMASOUND) += dmasound + ifeq ($(CONFIG_DMASOUND),y) - SUB_DIRS += dmasound - MOD_IN_SUB_DIRS += dmasound obj-y += dmasound/dmasound.o -else - ifeq ($(CONFIG_DMASOUND),m) - MOD_IN_SUB_DIRS += dmasound - endif endif @@ -124,39 +98,8 @@ vidc_mod-objs := vidc.o vidc_fill.o wavefront-objs := wavfront.o wf_midi.o yss225.o -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - - - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - - - -# Translate to Rules.make lists. - O_TARGET := sounddrivers.o -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) -MI_OBJS := $(sort $(filter-out $(export-objs), $(int-m))) -MIX_OBJS := $(sort $(filter $(export-objs), $(int-m))) - include $(TOPDIR)/Rules.make diff --git a/drivers/sound/cmpci.c b/drivers/sound/cmpci.c index 38ac2abf4..b9f345f8b 100644 --- a/drivers/sound/cmpci.c +++ b/drivers/sound/cmpci.c @@ -1373,10 +1373,17 @@ static unsigned int cm_poll(struct file *file, struct poll_table_struct *wait) unsigned int mask = 0; VALIDATE_STATE(s); - if (file->f_mode & FMODE_WRITE) + if (file->f_mode & FMODE_WRITE) { + if (!s->dma_dac.ready && prog_dmabuf(s, 0)) + return 0; poll_wait(file, &s->dma_dac.wait, wait); - if (file->f_mode & FMODE_READ) + } + if (file->f_mode & FMODE_READ) { + if (!s->dma_adc.ready && prog_dmabuf(s, 1)) + return 0; poll_wait(file, &s->dma_adc.wait, wait); + } + spin_lock_irqsave(&s->lock, flags); cm_update_ptr(s); if (file->f_mode & FMODE_READ) { @@ -1604,8 +1611,8 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!(s->enable & CM_CENABLE_PE) && (val = prog_dmabuf(s, 0)) != 0) - return val; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); cm_update_ptr(s); abinfo.fragsize = s->dma_dac.fragsize; @@ -1618,8 +1625,8 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!(s->enable & CM_CENABLE_RE) && (val = prog_dmabuf(s, 1)) != 0) - return val; + if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) + return ret; spin_lock_irqsave(&s->lock, flags); cm_update_ptr(s); abinfo.fragsize = s->dma_adc.fragsize; @@ -1636,6 +1643,8 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); cm_update_ptr(s); val = s->dma_dac.count; @@ -1645,6 +1654,8 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) + return ret; spin_lock_irqsave(&s->lock, flags); cm_update_ptr(s); cinfo.bytes = s->dma_adc.total_bytes; @@ -1658,6 +1669,8 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); cm_update_ptr(s); cinfo.bytes = s->dma_dac.total_bytes; diff --git a/drivers/sound/cs4281.c b/drivers/sound/cs4281.c index 661caa214..13f1b6c92 100644 --- a/drivers/sound/cs4281.c +++ b/drivers/sound/cs4281.c @@ -2489,14 +2489,19 @@ static unsigned int cs4281_poll(struct file *file, CS_DBGOUT(CS_FUNCTION | CS_WAVE_WRITE | CS_WAVE_READ, 4, printk(KERN_INFO "cs4281: cs4281_poll() wait on FMODE_WRITE\n")); + if (!s->dma_dac.ready && prog_dmabuf_dac(s)) + return 0; poll_wait(file, &s->dma_dac.wait, wait); } if (file->f_mode & FMODE_READ) { CS_DBGOUT(CS_FUNCTION | CS_WAVE_WRITE | CS_WAVE_READ, 4, printk(KERN_INFO "cs4281: cs4281_poll() wait on FMODE_READ\n")); + if (!s->dma_adc.ready && prog_dmabuf_adc(s)) + return 0; poll_wait(file, &s->dma_adc.wait, wait); } + spin_lock_irqsave(&s->lock, flags); cs4281_update_ptr(s); if (file->f_mode & FMODE_WRITE) { @@ -2516,8 +2521,8 @@ static unsigned int cs4281_poll(struct file *file, } else if (file->f_mode & FMODE_READ) { if (s->dma_adc.mapped) { if (s->dma_adc.count >= - (signed) s->dma_adc.fragsize) mask |= - POLLIN | POLLRDNORM; + (signed) s->dma_adc.fragsize) + mask |= POLLIN | POLLRDNORM; } else { if (s->dma_adc.count > 0) mask |= POLLIN | POLLRDNORM; @@ -2836,8 +2841,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file, case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!(s->ena & FMODE_WRITE) - && (val = prog_dmabuf_dac(s)) != 0) + if (!s->dma_adc.ready && (val = prog_dmabuf_adc(s))) return val; spin_lock_irqsave(&s->lock, flags); cs4281_update_ptr(s); @@ -2865,8 +2869,8 @@ static int cs4281_ioctl(struct inode *inode, struct file *file, case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!(s->ena & FMODE_READ) - && (val = prog_dmabuf_adc(s)) != 0) return val; + if (!s->dma_dac.ready && (val = prog_dmabuf_dac(s))) + return val; spin_lock_irqsave(&s->lock, flags); cs4281_update_ptr(s); if (s->conversion) { @@ -2893,6 +2897,8 @@ static int cs4281_ioctl(struct inode *inode, struct file *file, case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_adc.ready && (val = prog_dmabuf_adc(s))) + return val; spin_lock_irqsave(&s->lock, flags); cs4281_update_ptr(s); val = s->dma_dac.count; @@ -2902,6 +2908,8 @@ static int cs4281_ioctl(struct inode *inode, struct file *file, case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!s->dma_dac.ready && (val = prog_dmabuf_dac(s))) + return val; spin_lock_irqsave(&s->lock, flags); cs4281_update_ptr(s); cinfo.bytes = s->dma_adc.total_bytes; @@ -2933,6 +2941,8 @@ static int cs4281_ioctl(struct inode *inode, struct file *file, case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_adc.ready && (val = prog_dmabuf_adc(s))) + return val; spin_lock_irqsave(&s->lock, flags); cs4281_update_ptr(s); cinfo.bytes = s->dma_dac.total_bytes; diff --git a/drivers/sound/dmasound/Makefile b/drivers/sound/dmasound/Makefile index 535146de2..09f8c09b3 100644 --- a/drivers/sound/dmasound/Makefile +++ b/drivers/sound/dmasound/Makefile @@ -7,12 +7,6 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -O_TARGET := -O_OBJS := -OX_OBJS := -M_OBJS := -MX_OBJS := - export-objs := dmasound_core.o obj-$(CONFIG_DMASOUND_ATARI) += dmasound_core.o dmasound_atari.o @@ -20,17 +14,6 @@ obj-$(CONFIG_DMASOUND_AWACS) += dmasound_core.o dmasound_awacs.o obj-$(CONFIG_DMASOUND_PAULA) += dmasound_core.o dmasound_paula.o obj-$(CONFIG_DMASOUND_Q40) += dmasound_core.o dmasound_q40.o -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - ifeq ($(CONFIG_DMASOUND),y) O_TARGET = dmasound.o endif diff --git a/drivers/sound/emu10k1/Makefile b/drivers/sound/emu10k1/Makefile index 0ae315140..17945f53b 100644 --- a/drivers/sound/emu10k1/Makefile +++ b/drivers/sound/emu10k1/Makefile @@ -2,20 +2,12 @@ # # 12 Apr 2000 Rui Sousa -ifeq ($(CONFIG_SOUND_EMU10K1),y) - O_TARGET := emu10k1.o - O_OBJS = audio.o cardmi.o cardmo.o cardwi.o cardwo.o ecard.o \ - emuadxmg.o hwaccess.o irqmgr.o main.o midi.o mixer.o \ - recmgr.o timer.o voicemgr.o -else - ifeq ($(CONFIG_SOUND_EMU10K1),m) - M_OBJS := emu10k1.o - O_TARGET := emu10k1.o - O_OBJS = audio.o cardmi.o cardmo.o cardwi.o cardwo.o ecard.o \ +O_TARGET := emu10k1.o + +obj-y := audio.o cardmi.o cardmo.o cardwi.o cardwo.o ecard.o \ emuadxmg.o hwaccess.o irqmgr.o main.o midi.o mixer.o \ recmgr.o timer.o voicemgr.o - endif -endif +obj-m := $(O_TARGET) ifdef DEBUG EXTRA_CFLAGS += -DEMU10K1_DEBUG diff --git a/drivers/sound/es1370.c b/drivers/sound/es1370.c index 9da701604..885612f8c 100644 --- a/drivers/sound/es1370.c +++ b/drivers/sound/es1370.c @@ -1537,8 +1537,8 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!(s->ctrl & CTRL_DAC2_EN) && (val = prog_dmabuf_dac2(s)) != 0) - return val; + if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1370_update_ptr(s); abinfo.fragsize = s->dma_dac2.fragsize; @@ -1554,8 +1554,8 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!(s->ctrl & CTRL_ADC_EN) && (val = prog_dmabuf_adc(s)) != 0) - return val; + if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1370_update_ptr(s); abinfo.fragsize = s->dma_adc.fragsize; @@ -1575,6 +1575,8 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1370_update_ptr(s); count = s->dma_dac2.count; @@ -1586,6 +1588,8 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1370_update_ptr(s); cinfo.bytes = s->dma_adc.total_bytes; @@ -1602,6 +1606,8 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1370_update_ptr(s); cinfo.bytes = s->dma_dac2.total_bytes; diff --git a/drivers/sound/es1371.c b/drivers/sound/es1371.c index 6c5253550..ae22d6cac 100644 --- a/drivers/sound/es1371.c +++ b/drivers/sound/es1371.c @@ -1717,8 +1717,8 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!(s->ctrl & CTRL_DAC2_EN) && (val = prog_dmabuf_dac2(s)) != 0) - return val; + if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1371_update_ptr(s); abinfo.fragsize = s->dma_dac2.fragsize; @@ -1734,8 +1734,8 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!(s->ctrl & CTRL_ADC_EN) && (val = prog_dmabuf_adc(s)) != 0) - return val; + if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1371_update_ptr(s); abinfo.fragsize = s->dma_adc.fragsize; @@ -1755,6 +1755,8 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1371_update_ptr(s); count = s->dma_dac2.count; @@ -1766,6 +1768,8 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1371_update_ptr(s); cinfo.bytes = s->dma_adc.total_bytes; @@ -1782,6 +1786,8 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s))) + return ret; spin_lock_irqsave(&s->lock, flags); es1371_update_ptr(s); cinfo.bytes = s->dma_dac2.total_bytes; diff --git a/drivers/sound/esssolo1.c b/drivers/sound/esssolo1.c index c06c57633..ac2b6d243 100644 --- a/drivers/sound/esssolo1.c +++ b/drivers/sound/esssolo1.c @@ -1389,8 +1389,8 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!(s->ena & FMODE_WRITE) && (val = prog_dmabuf_dac(s)) != 0) - return val; + if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s))) + return ret; spin_lock_irqsave(&s->lock, flags); solo1_update_ptr(s); abinfo.fragsize = s->dma_dac.fragsize; @@ -1406,8 +1406,8 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!(s->ena & FMODE_READ) && (val = prog_dmabuf_adc(s)) != 0) - return val; + if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s))) + return ret; spin_lock_irqsave(&s->lock, flags); solo1_update_ptr(s); abinfo.fragsize = s->dma_adc.fragsize; @@ -1424,6 +1424,8 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s))) + return ret; spin_lock_irqsave(&s->lock, flags); solo1_update_ptr(s); count = s->dma_dac.count; @@ -1435,6 +1437,8 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s))) + return ret; spin_lock_irqsave(&s->lock, flags); solo1_update_ptr(s); cinfo.bytes = s->dma_adc.total_bytes; @@ -1448,6 +1452,8 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s))) + return ret; spin_lock_irqsave(&s->lock, flags); solo1_update_ptr(s); cinfo.bytes = s->dma_dac.total_bytes; diff --git a/drivers/sound/i810_audio.c b/drivers/sound/i810_audio.c index c4d2c50ce..204034131 100644 --- a/drivers/sound/i810_audio.c +++ b/drivers/sound/i810_audio.c @@ -507,21 +507,19 @@ static void i810_rec_setup(struct i810_state *state) extern __inline__ unsigned i810_get_dma_addr(struct i810_state *state) { struct dmabuf *dmabuf = &state->dmabuf; - u32 offset; + unsigned int civ, offset; struct i810_channel *c = dmabuf->channel; if (!dmabuf->enable) return 0; - offset = inb(state->card->iobase+c->port+OFF_CIV); - offset++; - offset&=31; - /* Offset has to compensate for the fact we finished the segment - on the IRQ so we are at next_segment,0 */ -// printk("BANK%d ", offset); - offset *= (dmabuf->dmasize/SG_LEN); -// printk("DMASZ=%d", dmabuf->dmasize); -// offset += 1024-(4*inw(state->card->iobase+c->port+OFF_PICB)); -// printk("OFF%d ", offset); + do { + civ = inb(state->card->iobase+c->port+OFF_CIV); + offset = (civ + 1) * (dmabuf->dmasize/SG_LEN) - + 2 * inw(state->card->iobase+c->port+OFF_PICB); + /* CIV changed before we read PICB (very seldom) ? + * then PICB was rubbish, so try again */ + } while (civ != inb(state->card->iobase+c->port+OFF_CIV)); + return offset; } @@ -730,10 +728,13 @@ static int prog_dmabuf(struct i810_state *state, unsigned rec) sg->control|=CON_IOC; sg++; } + spin_lock_irqsave(&state->card->lock, flags); + outb(2, state->card->iobase+dmabuf->channel->port+OFF_CR); /* reset DMA machine */ outl(virt_to_bus(&dmabuf->channel->sg[0]), state->card->iobase+dmabuf->channel->port+OFF_BDBAR); outb(16, state->card->iobase+dmabuf->channel->port+OFF_LVI); outb(0, state->card->iobase+dmabuf->channel->port+OFF_CIV); + if (rec) { i810_rec_setup(state); } else { @@ -753,14 +754,10 @@ static int prog_dmabuf(struct i810_state *state, unsigned rec) return 0; } - -/* we are doing quantum mechanics here, the buffer can only be empty, half or full filled i.e. - |------------|------------| or |xxxxxxxxxxxx|------------| or |xxxxxxxxxxxx|xxxxxxxxxxxx| - but we almost always get this - |xxxxxx------|------------| or |xxxxxxxxxxxx|xxxxx-------| - so we have to clear the tail space to "silence" - |xxxxxx000000|------------| or |xxxxxxxxxxxx|xxxxxx000000| -*/ +/* + * Clear the rest of the last i810 dma buffer, normally there is no rest + * because the OSS fragment size is the same as the size of this buffer. + */ static void i810_clear_tail(struct i810_state *state) { struct dmabuf *dmabuf = &state->dmabuf; @@ -773,14 +770,8 @@ static void i810_clear_tail(struct i810_state *state) swptr = dmabuf->swptr; spin_unlock_irqrestore(&state->card->lock, flags); - if (swptr == 0 || swptr == dmabuf->dmasize / 2 || swptr == dmabuf->dmasize) - return; - - if (swptr < dmabuf->dmasize/2) - len = dmabuf->dmasize/2 - swptr; - else - len = dmabuf->dmasize - swptr; - + len = swptr % (dmabuf->dmasize/SG_LEN); + memset(dmabuf->rawbuf + swptr, silence, len); spin_lock_irqsave(&state->card->lock, flags); @@ -1188,11 +1179,16 @@ static unsigned int i810_poll(struct file *file, struct poll_table_struct *wait) unsigned long flags; unsigned int mask = 0; - if (file->f_mode & FMODE_WRITE) + if (file->f_mode & FMODE_WRITE) { + if (!dmabuf->ready && prog_dmabuf(state, 0)) + return 0; poll_wait(file, &dmabuf->wait, wait); - if (file->f_mode & FMODE_READ) + } + if (file->f_mode & FMODE_READ) { + if (!dmabuf->ready && prog_dmabuf(state, 1)) + return 0; poll_wait(file, &dmabuf->wait, wait); - + } spin_lock_irqsave(&state->card->lock, flags); i810_update_ptr(state); if (file->f_mode & FMODE_READ) { @@ -1531,7 +1527,6 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int i810_open(struct inode *inode, struct file *file) { int i = 0; - int minor = MINOR(inode->i_rdev); struct i810_card *card = devs; struct i810_state *state = NULL; struct dmabuf *dmabuf = NULL; @@ -1779,18 +1774,42 @@ static int __init i810_ac97_init(struct i810_card *card) card->ac97_features = eid; + /* Now check the codec for useful features to make up for + the dumbness of the 810 hardware engine */ + if(!(eid&0x0001)) printk(KERN_WARNING "i810_audio: only 48Khz playback available.\n"); - + else + { + /* Enable variable rate mode */ + i810_ac97_set(codec, AC97_EXTENDED_STATUS, 9); + i810_ac97_set(codec,AC97_EXTENDED_STATUS, + i810_ac97_get(codec, AC97_EXTENDED_STATUS)|0xE800); + /* power up everything, modify this when implementing power saving */ + i810_ac97_set(codec, AC97_POWER_CONTROL, + i810_ac97_get(codec, AC97_POWER_CONTROL) & ~0x7f00); + /* wait for analog ready */ + for (i=10; + i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) & 0xf) != 0xf); + i--) + { + current->state = TASK_UNINTERRUPTIBLE; + schedule_timeout(HZ/20); + } + + if(!(i810_ac97_get(codec, AC97_EXTENDED_STATUS)&1)) + { + printk(KERN_WARNING "i810_audio: Codec refused to allow VRA, using 48Khz only.\n"); + card->ac97_features&=~1; + } + } + if ((codec->dev_mixer = register_sound_mixer(&i810_mixer_fops, -1)) < 0) { printk(KERN_ERR "i810_audio: couldn't register mixer!\n"); kfree(codec); break; } - /* Now check the codec for useful features to make up for - the dumbness of the 810 hardware engine */ - card->ac97_codec[num_ac97] = codec; /* if there is no secondary codec at all, don't probe any more */ diff --git a/drivers/sound/mad16.c b/drivers/sound/mad16.c index 31ec19d10..11fe42012 100644 --- a/drivers/sound/mad16.c +++ b/drivers/sound/mad16.c @@ -20,38 +20,6 @@ * issues of the card, using the OTI-605 chip, have an MPU-401 compatable Midi * port. This port is configured differently to that of the OPTi audio chips. * - * NOTE! If you want to set CD-ROM address and/or joystick enable, define - * MAD16_CONF in local.h as combination of the following bits: - * - * 0x01 - joystick disabled - * - * CD-ROM type selection (select just one): - * 0x00 - none - * 0x02 - Sony 31A - * 0x04 - Mitsumi - * 0x06 - Panasonic (type "LaserMate", not "Sound Blaster") - * 0x08 - Secondary IDE (address 0x170) - * 0x0a - Primary IDE (address 0x1F0) - * - * For example Mitsumi with joystick disabled = 0x04|0x01 = 0x05 - * For example LaserMate (for use with sbpcd) plus joystick = 0x06 - * - * MAD16_CDSEL: - * This defaults to CD I/O 0x340, no IRQ and DMA3 - * (DMA5 with Mitsumi or IDE). If you like to change these, define - * MAD16_CDSEL with the following bits: - * - * CD-ROM port: 0x00=340, 0x40=330, 0x80=360 or 0xc0=320 - * OPL4 select: 0x20=OPL4, 0x00=OPL3 - * CD-ROM irq: 0x00=disabled, 0x04=IRQ5, 0x08=IRQ7, 0x0c=IRQ3, 0x10=IRQ9, - * 0x14=IRQ10 and 0x18=IRQ11. - * - * CD-ROM DMA (Sony or Panasonic): 0x00=DMA3, 0x01=DMA2, 0x02=DMA1 or 0x03=disabled - * or - * CD-ROM DMA (Mitsumi or IDE): 0x00=DMA5, 0x01=DMA6, 0x02=DMA7 or 0x03=disabled - * - * For use with sbpcd, address 0x340, set MAD16_CDSEL to 0x03 or 0x23. - * * Changes * * Alan Cox Clean up, added module selections. @@ -67,6 +35,8 @@ * 25-Nov-1999 * Christoph Hellwig Adapted to module_init/module_exit. * Arnaldo C. de Melo got rid of attach_uart401 21-Sep-2000 + * + * Pavel Rabel Clean up Nov-2000 */ #include <linux/config.h> @@ -395,10 +365,6 @@ static int __init init_c930(struct address_info *hw_config) { unsigned char cfg = 0; -#ifdef MAD16_CONF - cfg |= (0x0f & MAD16_CONF); -#endif - if(c931_detected) { /* Bit 0 has reversd meaning. Bits 1 and 2 sese @@ -435,14 +401,9 @@ static int __init init_c930(struct address_info *hw_config) /* bit 2 of MC4 reverses it's meaning between the C930 and the C931. */ cfg = c931_detected ? 0x04 : 0x00; -#ifdef MAD16_CDSEL - if(MAD16_CDSEL & 0x20) - mad_write(MC4_PORT, 0x62|cfg); /* opl4 */ - else - mad_write(MC4_PORT, 0x52|cfg); /* opl3 */ -#else + mad_write(MC4_PORT, 0x52|cfg); -#endif + mad_write(MC5_PORT, 0x3C); /* Init it into mode2 */ mad_write(MC6_PORT, 0x02); /* Enable WSS, Disable MPU and SB */ mad_write(MC7_PORT, 0xCB); @@ -590,20 +551,9 @@ static int __init probe_mad16(struct address_info *hw_config) */ tmp &= ~0x0f; -#if defined(MAD16_CONF) - tmp |= ((MAD16_CONF) & 0x0f); /* CD-ROM and joystick bits */ -#endif mad_write(MC1_PORT, tmp); -#if defined(MAD16_CONF) && defined(MAD16_CDSEL) - tmp = MAD16_CDSEL; -#else tmp = mad_read(MC2_PORT); -#endif - -#ifdef MAD16_OPL4 - tmp |= 0x20; /* Enable OPL4 access */ -#endif mad_write(MC2_PORT, tmp); mad_write(MC3_PORT, 0xf0); /* Disable SB */ @@ -718,13 +668,7 @@ static void __init attach_mad16(struct address_info *hw_config) static int __init probe_mad16_mpu(struct address_info *hw_config) { static int mpu_attached = 0; - static int valid_ports[] = { - 0x330, 0x320, 0x310, 0x300 - }; - - static short valid_irqs[] = {9, 10, 5, 7}; unsigned char tmp; - int i; /* A variable with secret power */ if (!already_initialized) /* The MSS port must be initialized first */ return 0; @@ -737,7 +681,6 @@ static int __init probe_mad16_mpu(struct address_info *hw_config) { #ifdef CONFIG_MAD16_OLDCARD - unsigned char tmp; tmp = mad_read(MC3_PORT); @@ -787,9 +730,6 @@ static int __init probe_mad16_mpu(struct address_info *hw_config) * to set MPU register. TODO - add probing */ - - unsigned char tmp; - tmp = mad_read(MC8_PORT); switch (hw_config->irq) @@ -840,42 +780,50 @@ static int __init probe_mad16_mpu(struct address_info *hw_config) tmp = mad_read(MC6_PORT) & 0x83; tmp |= 0x80; /* MPU-401 enable */ -/* - * Set the MPU base bits - */ + /* Set the MPU base bits */ - for (i = 0; i < 5; i++) + switch (hw_config->io_base) { - if (i > 3) /* Out of array bounds */ - { - printk(KERN_ERR "MAD16 / Mozart: Invalid MIDI port 0x%x\n", hw_config->io_base); - return 0; - } - if (valid_ports[i] == hw_config->io_base) - { - tmp |= i << 5; + case 0x300: + tmp |= 0x60; break; - } + case 0x310: + tmp |= 0x40; + break; + case 0x320: + tmp |= 0x20; + break; + case 0x330: + tmp |= 0x00; + break; + default: + printk(KERN_ERR "MAD16: Invalid MIDI port 0x%x\n", hw_config->io_base); + return 0; } -/* - * Set the MPU IRQ bits - */ + /* Set the MPU IRQ bits */ - for (i = 0; i < 5; i++) + switch (hw_config->irq) { - if (i > 3) /* Out of array bounds */ - { - printk(KERN_ERR "MAD16 / Mozart: Invalid MIDI IRQ %d\n", hw_config->irq); - return 0; - } - if (valid_irqs[i] == hw_config->irq) - { - tmp |= i << 3; + case 5: + tmp |= 0x10; + break; + case 7: + tmp |= 0x18; + break; + case 9: + tmp |= 0x00; + break; + case 10: + tmp |= 0x08; + break; + default: + printk(KERN_ERR "MAD16: Invalid MIDI IRQ %d\n", hw_config->irq); break; - } } + mad_write(MC6_PORT, tmp); /* Write MPU401 config */ + #ifndef CONFIG_MAD16_OLDCARD probe_401: #endif diff --git a/drivers/sound/maestro.c b/drivers/sound/maestro.c index 7529c1db3..6bdb2ade8 100644 --- a/drivers/sound/maestro.c +++ b/drivers/sound/maestro.c @@ -2394,18 +2394,17 @@ static unsigned int ess_poll(struct file *file, struct poll_table_struct *wait) struct ess_state *s = (struct ess_state *)file->private_data; unsigned long flags; unsigned int mask = 0; - int ret; VALIDATE_STATE(s); /* In 0.14 prog_dmabuf always returns success anyway ... */ if (file->f_mode & FMODE_WRITE) { - if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) - return POLLERR; + if (!s->dma_dac.ready && prog_dmabuf(s, 0)) + return 0; } if (file->f_mode & FMODE_READ) { - if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) - return POLLERR; + if (!s->dma_adc.ready && prog_dmabuf(s, 1)) + return 0; } if (file->f_mode & FMODE_WRITE) @@ -2655,8 +2654,8 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!(s->enable & DAC_RUNNING) && (val = prog_dmabuf(s, 0)) != 0) - return val; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); ess_update_ptr(s); abinfo.fragsize = s->dma_dac.fragsize; @@ -2669,8 +2668,8 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!(s->enable & ADC_RUNNING) && (val = prog_dmabuf(s, 1)) != 0) - return val; + if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) + return ret; spin_lock_irqsave(&s->lock, flags); ess_update_ptr(s); abinfo.fragsize = s->dma_adc.fragsize; @@ -2687,6 +2686,8 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); ess_update_ptr(s); val = s->dma_dac.count; @@ -2696,6 +2697,8 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) + return ret; spin_lock_irqsave(&s->lock, flags); ess_update_ptr(s); cinfo.bytes = s->dma_adc.total_bytes; @@ -2709,6 +2712,8 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); ess_update_ptr(s); cinfo.bytes = s->dma_dac.total_bytes; diff --git a/drivers/sound/sb_card.c b/drivers/sound/sb_card.c index e6846f887..782bb46f1 100644 --- a/drivers/sound/sb_card.c +++ b/drivers/sound/sb_card.c @@ -50,6 +50,9 @@ * * 21-09-2000 Got rid of attach_sbmpu * Arnaldo Carvalho de Melo <acme@conectiva.com.br> + * + * 28-10-2000 Added pnplegacy support + * Daniel Church <dchurch@mbhs.edu> */ #include <linux/config.h> @@ -64,7 +67,7 @@ #include "sb.h" #if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE -#define SB_CARDS_MAX 4 +#define SB_CARDS_MAX 5 #else #define SB_CARDS_MAX 1 #endif @@ -194,6 +197,7 @@ struct pci_dev *sb_dev[SB_CARDS_MAX] = {NULL}, static int isapnp = 1; static int isapnpjump = 0; static int multiple = 1; +static int pnplegacy = 0; static int reverse = 0; static int uart401 = 0; @@ -203,6 +207,7 @@ static int opl_activated[SB_CARDS_MAX] = {0}; #else static int isapnp = 0; static int multiple = 0; +static int pnplegacy = 0; #endif MODULE_DESCRIPTION("Soundblaster driver"); @@ -221,11 +226,13 @@ MODULE_PARM(acer, "i"); MODULE_PARM(isapnp, "i"); MODULE_PARM(isapnpjump, "i"); MODULE_PARM(multiple, "i"); +MODULE_PARM(pnplegacy, "i"); MODULE_PARM(reverse, "i"); MODULE_PARM(uart401, "i"); MODULE_PARM_DESC(isapnp, "When set to 0, Plug & Play support will be disabled"); MODULE_PARM_DESC(isapnpjump, "Jumps to a specific slot in the driver's PnP table. Use the source, Luke."); MODULE_PARM_DESC(multiple, "When set to 0, will not search for multiple cards"); +MODULE_PARM_DESC(pnplegacy, "When set to 1, will search for a legacy SB card along with any PnP cards."); MODULE_PARM_DESC(reverse, "When set to 1, will reverse ISAPnP search order"); MODULE_PARM_DESC(uart401, "When set to 1, will attempt to detect and enable the mpu on some clones"); #endif @@ -659,7 +666,7 @@ static int __init init_sb(void) /* Please remember that even with CONFIG_ISAPNP defined one * should still be able to disable PNP support for this * single driver! */ - if(isapnp && (sb_isapnp_probe(&cfg[card], &cfg_mpu[card], card) < 0) ) { + if((!pnplegacy||card>0) && isapnp && (sb_isapnp_probe(&cfg[card], &cfg_mpu[card], card) < 0) ) { if(!sb_cards_num) { /* Found no ISAPnP cards, so check for a non-pnp * card and set the detection loop for 1 cycle @@ -674,7 +681,7 @@ static int __init init_sb(void) } #endif - if(!isapnp) { + if(!isapnp || (pnplegacy&&card==0)) { cfg[card].io_base = io; cfg[card].irq = irq; cfg[card].dma = dma; @@ -695,15 +702,29 @@ static int __init init_sb(void) card--; sb_cards_num--; continue; + } else if(pnplegacy && isapnp) { + printk(KERN_NOTICE "sb: No legacy SoundBlaster cards " \ + "found. Continuing with PnP detection.\n"); + pnplegacy=0; + card--; + continue; } else return -ENODEV; } attach_sb_card(&cfg[card]); - if(cfg[card].slots[0]==-1) - return -ENODEV; + if(cfg[card].slots[0]==-1) { + if(card==0 && pnplegacy && isapnp) { + printk(KERN_NOTICE "sb: No legacy SoundBlaster cards " \ + "found. Continuing with PnP detection.\n"); + pnplegacy=0; + card--; + continue; + } else + return -ENODEV; + } - if (!isapnp) + if (!isapnp||(pnplegacy&&card==0)) cfg_mpu[card].io_base = mpu_io; if (probe_sbmpu(&cfg_mpu[card], THIS_MODULE)) sbmpu[card] = 1; diff --git a/drivers/sound/sonicvibes.c b/drivers/sound/sonicvibes.c index 14f11dcaf..c0f337a4c 100644 --- a/drivers/sound/sonicvibes.c +++ b/drivers/sound/sonicvibes.c @@ -1723,8 +1723,8 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!(s->enable & SV_CENABLE_PE) && (val = prog_dmabuf(s, 0)) != 0) - return val; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); sv_update_ptr(s); abinfo.fragsize = s->dma_dac.fragsize; @@ -1740,8 +1740,8 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!(s->enable & SV_CENABLE_RE) && (val = prog_dmabuf(s, 1)) != 0) - return val; + if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) + return ret; spin_lock_irqsave(&s->lock, flags); sv_update_ptr(s); abinfo.fragsize = s->dma_adc.fragsize; @@ -1761,6 +1761,8 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); sv_update_ptr(s); count = s->dma_dac.count; @@ -1772,6 +1774,8 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) + return ret; spin_lock_irqsave(&s->lock, flags); sv_update_ptr(s); cinfo.bytes = s->dma_adc.total_bytes; @@ -1788,6 +1792,8 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) + return ret; spin_lock_irqsave(&s->lock, flags); sv_update_ptr(s); cinfo.bytes = s->dma_dac.total_bytes; diff --git a/drivers/sound/trident.c b/drivers/sound/trident.c index 9e32811ac..db5f2b611 100644 --- a/drivers/sound/trident.c +++ b/drivers/sound/trident.c @@ -1595,10 +1595,17 @@ static unsigned int trident_poll(struct file *file, struct poll_table_struct *wa unsigned int mask = 0; VALIDATE_STATE(state); - if (file->f_mode & FMODE_WRITE) + + if (file->f_mode & FMODE_WRITE) { + if (!dmabuf->ready && prog_dmabuf(state, 0)) + return 0; poll_wait(file, &dmabuf->wait, wait); - if (file->f_mode & FMODE_READ) + } + if (file->f_mode & FMODE_READ) { + if (!dmabuf->ready && prog_dmabuf(state, 1)) + return 0; poll_wait(file, &dmabuf->wait, wait); + } spin_lock_irqsave(&state->card->lock, flags); trident_update_ptr(state); @@ -1866,7 +1873,7 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm case SNDCTL_DSP_GETOSPACE: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; - if (!dmabuf->enable && (val = prog_dmabuf(state, 0)) != 0) + if (!dmabuf->ready && (val = prog_dmabuf(state, 0)) != 0) return val; spin_lock_irqsave(&state->card->lock, flags); trident_update_ptr(state); @@ -1880,7 +1887,7 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) return -EINVAL; - if (!dmabuf->enable && (val = prog_dmabuf(state, 1)) != 0) + if (!dmabuf->ready && (val = prog_dmabuf(state, 1)) != 0) return val; spin_lock_irqsave(&state->card->lock, flags); trident_update_ptr(state); @@ -1931,6 +1938,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm case SNDCTL_DSP_GETIPTR: if (!(file->f_mode & FMODE_READ)) return -EINVAL; + if (!dmabuf->ready && (val = prog_dmabuf(state, 1)) != 0) + return val; spin_lock_irqsave(&state->card->lock, flags); trident_update_ptr(state); cinfo.bytes = dmabuf->total_bytes; @@ -1944,6 +1953,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm case SNDCTL_DSP_GETOPTR: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!dmabuf->ready && (val = prog_dmabuf(state, 0)) != 0) + return val; spin_lock_irqsave(&state->card->lock, flags); trident_update_ptr(state); cinfo.bytes = dmabuf->total_bytes; @@ -1960,6 +1971,8 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm case SNDCTL_DSP_GETODELAY: if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; + if (!dmabuf->ready && (val = prog_dmabuf(state, 0)) != 0) + return val; spin_lock_irqsave(&state->card->lock, flags); trident_update_ptr(state); val = dmabuf->count; diff --git a/drivers/sound/via82cxxx_audio.c b/drivers/sound/via82cxxx_audio.c index 7470ffb03..f609d1e2b 100644 --- a/drivers/sound/via82cxxx_audio.c +++ b/drivers/sound/via82cxxx_audio.c @@ -1727,18 +1727,18 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma, } -#ifndef VM_RESERVE +#ifndef VM_RESERVED static int via_mm_swapout (struct page *page, struct file *filp) { return 0; } -#endif /* VM_RESERVE */ +#endif /* VM_RESERVED */ struct vm_operations_struct via_mm_ops = { nopage: via_mm_nopage, -#ifndef VM_RESERVE +#ifndef VM_RESERVED swapout: via_mm_swapout, #endif }; @@ -1789,8 +1789,8 @@ static int via_dsp_mmap(struct file *file, struct vm_area_struct *vma) vma->vm_ops = &via_mm_ops; vma->vm_private_data = card; -#ifdef VM_RESERVE - vma->vm_flags |= VM_RESERVE; +#ifdef VM_RESERVED + vma->vm_flags |= VM_RESERVED; #endif if (rd) diff --git a/drivers/sound/wavfront.c b/drivers/sound/wavfront.c index 521f2045a..8e8106917 100644 --- a/drivers/sound/wavfront.c +++ b/drivers/sound/wavfront.c @@ -92,14 +92,14 @@ #if defined(__alpha__) #ifdef CONFIG_SMP -#define LOOPS_PER_SEC cpu_data[smp_processor_id()].loops_per_sec +#define LOOPS_PER_TICK cpu_data[smp_processor_id()].loops_per_jiffy #else -#define LOOPS_PER_SEC loops_per_sec +#define LOOPS_PER_TICK loops_per_sec #endif #endif #if defined(__i386__) -#define LOOPS_PER_SEC current_cpu_data.loops_per_sec +#define LOOPS_PER_TICK current_cpu_data.loops_per_jiffy #endif #define _MIDI_SYNTH_C_ @@ -460,7 +460,7 @@ wavefront_wait (int mask) if (short_loop_cnt == 0) { short_loop_cnt = wait_usecs * - (LOOPS_PER_SEC / 1000000); + (LOOPS_PER_TICK / (1000000 / HZ)); } /* Spin for a short period of time, because >99% of all diff --git a/drivers/sound/ymf_sb.c b/drivers/sound/ymf_sb.c index 26a062a8f..37a5d917a 100644 --- a/drivers/sound/ymf_sb.c +++ b/drivers/sound/ymf_sb.c @@ -43,10 +43,6 @@ Thu Sep 21 05:32:51 BRT 2000 0.0.5 * got rid of attach_uart401 and attach_sbmpu Arnaldo Carvalho de Melo <acme@conectiva.com.br> - - Fri Nov 10 21:24:11 CET 2000 0.0.6 - * added some __init and __initdata to entries in 724hwmcode.h - Bartlomiej Zolnierkiewicz <bkz@linux-ide.org> */ #include <linux/module.h> @@ -436,7 +432,7 @@ static int __init setupLegacyIO( struct pci_dev *pcidev ) printk(PFX "set DMA address at 0x%x\n",sb_data[cards].dma); #endif - v = 0x0000 | ((dma<<6)&0x03) | 0x003f; + v = 0x0000 | ((dma & 0x03) << 6) | 0x003f; pci_write_config_word(pcidev, YMFSB_PCIR_LEGCTRL, v); #ifdef YMF_DEBUG printk(PFX "LEGCTRL: 0x%x\n",v); @@ -446,7 +442,9 @@ static int __init setupLegacyIO( struct pci_dev *pcidev ) case PCI_DEVICE_ID_YMF740: case PCI_DEVICE_ID_YMF724F: case PCI_DEVICE_ID_YMF740C: - v = 0x8800 | ((mpuio<<4)&0x03) | ((sbio<<2)&0x03) | (oplio&0x03); + v = 0x8800 | ((mpuio & 0x03) << 4) + | ((sbio & 0x03) << 2) + | (oplio & 0x03); pci_write_config_word(pcidev, YMFSB_PCIR_ELEGCTRL, v); #ifdef YMF_DEBUG printk(PFX "ELEGCTRL: 0x%x\n",v); @@ -843,6 +841,7 @@ static void __exit cleanup_ymf7xxsb_module(void) } free_iomaps(); + pci_unregister_driver(&ymf7xxsb_driver); } |