Commit 94e24208 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] preprocessor mess in msnd

msnd #defined outb to outb_p, which wasn't a good idea on platforms
that had outb_p #defined to outb ;-)
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2ea1470b
...@@ -207,7 +207,7 @@ int msnd_wait_TXDE(multisound_dev_t *dev) ...@@ -207,7 +207,7 @@ int msnd_wait_TXDE(multisound_dev_t *dev)
register int timeout = 1000; register int timeout = 1000;
while(timeout-- > 0) while(timeout-- > 0)
if (inb(io + HP_ISR) & HPISR_TXDE) if (msnd_inb(io + HP_ISR) & HPISR_TXDE)
return 0; return 0;
return -EIO; return -EIO;
...@@ -219,7 +219,7 @@ int msnd_wait_HC0(multisound_dev_t *dev) ...@@ -219,7 +219,7 @@ int msnd_wait_HC0(multisound_dev_t *dev)
register int timeout = 1000; register int timeout = 1000;
while(timeout-- > 0) while(timeout-- > 0)
if (!(inb(io + HP_CVR) & HPCVR_HC)) if (!(msnd_inb(io + HP_CVR) & HPCVR_HC))
return 0; return 0;
return -EIO; return -EIO;
...@@ -231,7 +231,7 @@ int msnd_send_dsp_cmd(multisound_dev_t *dev, BYTE cmd) ...@@ -231,7 +231,7 @@ int msnd_send_dsp_cmd(multisound_dev_t *dev, BYTE cmd)
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
if (msnd_wait_HC0(dev) == 0) { if (msnd_wait_HC0(dev) == 0) {
outb(cmd, dev->io + HP_CVR); msnd_outb(cmd, dev->io + HP_CVR);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
return 0; return 0;
} }
...@@ -248,9 +248,9 @@ int msnd_send_word(multisound_dev_t *dev, unsigned char high, ...@@ -248,9 +248,9 @@ int msnd_send_word(multisound_dev_t *dev, unsigned char high,
register unsigned int io = dev->io; register unsigned int io = dev->io;
if (msnd_wait_TXDE(dev) == 0) { if (msnd_wait_TXDE(dev) == 0) {
outb(high, io + HP_TXH); msnd_outb(high, io + HP_TXH);
outb(mid, io + HP_TXM); msnd_outb(mid, io + HP_TXM);
outb(low, io + HP_TXL); msnd_outb(low, io + HP_TXL);
return 0; return 0;
} }
...@@ -272,8 +272,8 @@ int msnd_upload_host(multisound_dev_t *dev, char *bin, int len) ...@@ -272,8 +272,8 @@ int msnd_upload_host(multisound_dev_t *dev, char *bin, int len)
if (msnd_send_word(dev, bin[i], bin[i + 1], bin[i + 2]) != 0) if (msnd_send_word(dev, bin[i], bin[i + 1], bin[i + 2]) != 0)
return -EIO; return -EIO;
inb(dev->io + HP_RXL); msnd_inb(dev->io + HP_RXL);
inb(dev->io + HP_CVR); msnd_inb(dev->io + HP_CVR);
return 0; return 0;
} }
...@@ -289,11 +289,11 @@ int msnd_enable_irq(multisound_dev_t *dev) ...@@ -289,11 +289,11 @@ int msnd_enable_irq(multisound_dev_t *dev)
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
if (msnd_wait_TXDE(dev) == 0) { if (msnd_wait_TXDE(dev) == 0) {
outb(inb(dev->io + HP_ICR) | HPICR_TREQ, dev->io + HP_ICR); msnd_outb(msnd_inb(dev->io + HP_ICR) | HPICR_TREQ, dev->io + HP_ICR);
if (dev->type == msndClassic) if (dev->type == msndClassic)
outb(dev->irqid, dev->io + HP_IRQM); msnd_outb(dev->irqid, dev->io + HP_IRQM);
outb(inb(dev->io + HP_ICR) & ~HPICR_TREQ, dev->io + HP_ICR); msnd_outb(msnd_inb(dev->io + HP_ICR) & ~HPICR_TREQ, dev->io + HP_ICR);
outb(inb(dev->io + HP_ICR) | HPICR_RREQ, dev->io + HP_ICR); msnd_outb(msnd_inb(dev->io + HP_ICR) | HPICR_RREQ, dev->io + HP_ICR);
enable_irq(dev->irq); enable_irq(dev->irq);
msnd_init_queue(dev->DSPQ, dev->dspq_data_buff, dev->dspq_buff_size); msnd_init_queue(dev->DSPQ, dev->dspq_data_buff, dev->dspq_buff_size);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
...@@ -320,9 +320,9 @@ int msnd_disable_irq(multisound_dev_t *dev) ...@@ -320,9 +320,9 @@ int msnd_disable_irq(multisound_dev_t *dev)
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
if (msnd_wait_TXDE(dev) == 0) { if (msnd_wait_TXDE(dev) == 0) {
outb(inb(dev->io + HP_ICR) & ~HPICR_RREQ, dev->io + HP_ICR); msnd_outb(msnd_inb(dev->io + HP_ICR) & ~HPICR_RREQ, dev->io + HP_ICR);
if (dev->type == msndClassic) if (dev->type == msndClassic)
outb(HPIRQ_NONE, dev->io + HP_IRQM); msnd_outb(HPIRQ_NONE, dev->io + HP_IRQM);
disable_irq(dev->irq); disable_irq(dev->irq);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
return 0; return 0;
......
...@@ -154,10 +154,11 @@ ...@@ -154,10 +154,11 @@
#define DSPTOPC_BASED(w) (((w) - DSP_BASE_ADDR) * 2) #define DSPTOPC_BASED(w) (((w) - DSP_BASE_ADDR) * 2)
#ifdef SLOWIO #ifdef SLOWIO
# undef outb #define msnd_outb outb_p
# undef inb #define msnd_inb inb_p
# define outb outb_p #else
# define inb inb_p #define msnd_outb outb
#define msnd_inb inb
#endif #endif
/* JobQueueStruct */ /* JobQueueStruct */
......
...@@ -136,9 +136,9 @@ static void reset_record_queue(void) ...@@ -136,9 +136,9 @@ static void reset_record_queue(void)
/* Critical section: bank 1 access */ /* Critical section: bank 1 access */
spin_lock_irqsave(&dev.lock, flags); spin_lock_irqsave(&dev.lock, flags);
outb(HPBLKSEL_1, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_1, dev.io + HP_BLKS);
isa_memset_io(dev.base, 0, DAR_BUFF_SIZE * 3); isa_memset_io(dev.base, 0, DAR_BUFF_SIZE * 3);
outb(HPBLKSEL_0, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS);
spin_unlock_irqrestore(&dev.lock, flags); spin_unlock_irqrestore(&dev.lock, flags);
for (n = 0, lpDAQ = dev.base + DARQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) { for (n = 0, lpDAQ = dev.base + DARQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) {
...@@ -830,12 +830,12 @@ static __inline__ int pack_DARQ_to_DARF(register int bank) ...@@ -830,12 +830,12 @@ static __inline__ int pack_DARQ_to_DARF(register int bank)
/* Read data from the head (unprotected bank 1 access okay /* Read data from the head (unprotected bank 1 access okay
since this is only called inside an interrupt) */ since this is only called inside an interrupt) */
outb(HPBLKSEL_1, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_1, dev.io + HP_BLKS);
msnd_fifo_write( msnd_fifo_write(
&dev.DARF, &dev.DARF,
(char *)(dev.base + bank * DAR_BUFF_SIZE), (char *)(dev.base + bank * DAR_BUFF_SIZE),
size); size);
outb(HPBLKSEL_0, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS);
return 1; return 1;
} }
...@@ -1091,7 +1091,7 @@ static __inline__ void eval_dsp_msg(register WORD wMessage) ...@@ -1091,7 +1091,7 @@ static __inline__ void eval_dsp_msg(register WORD wMessage)
static irqreturn_t intr(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t intr(int irq, void *dev_id, struct pt_regs *regs)
{ {
/* Send ack to DSP */ /* Send ack to DSP */
inb(dev.io + HP_RXL); msnd_inb(dev.io + HP_RXL);
/* Evaluate queued DSP messages */ /* Evaluate queued DSP messages */
while (isa_readw(dev.DSPQ + JQS_wTail) != isa_readw(dev.DSPQ + JQS_wHead)) { while (isa_readw(dev.DSPQ + JQS_wTail) != isa_readw(dev.DSPQ + JQS_wHead)) {
...@@ -1120,15 +1120,15 @@ static int reset_dsp(void) ...@@ -1120,15 +1120,15 @@ static int reset_dsp(void)
{ {
int timeout = 100; int timeout = 100;
outb(HPDSPRESET_ON, dev.io + HP_DSPR); msnd_outb(HPDSPRESET_ON, dev.io + HP_DSPR);
mdelay(1); mdelay(1);
#ifndef MSND_CLASSIC #ifndef MSND_CLASSIC
dev.info = inb(dev.io + HP_INFO); dev.info = msnd_inb(dev.io + HP_INFO);
#endif #endif
outb(HPDSPRESET_OFF, dev.io + HP_DSPR); msnd_outb(HPDSPRESET_OFF, dev.io + HP_DSPR);
mdelay(1); mdelay(1);
while (timeout-- > 0) { while (timeout-- > 0) {
if (inb(dev.io + HP_CVR) == HP_CVR_DEF) if (msnd_inb(dev.io + HP_CVR) == HP_CVR_DEF)
return 0; return 0;
mdelay(1); mdelay(1);
} }
...@@ -1202,9 +1202,9 @@ static int init_sma(void) ...@@ -1202,9 +1202,9 @@ static int init_sma(void)
unsigned long flags; unsigned long flags;
#ifdef MSND_CLASSIC #ifdef MSND_CLASSIC
outb(dev.memid, dev.io + HP_MEMM); msnd_outb(dev.memid, dev.io + HP_MEMM);
#endif #endif
outb(HPBLKSEL_0, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS);
if (initted) { if (initted) {
mastVolLeft = isa_readw(dev.SMA + SMA_wCurrMastVolLeft); mastVolLeft = isa_readw(dev.SMA + SMA_wCurrMastVolLeft);
mastVolRight = isa_readw(dev.SMA + SMA_wCurrMastVolRight); mastVolRight = isa_readw(dev.SMA + SMA_wCurrMastVolRight);
...@@ -1214,9 +1214,9 @@ static int init_sma(void) ...@@ -1214,9 +1214,9 @@ static int init_sma(void)
/* Critical section: bank 1 access */ /* Critical section: bank 1 access */
spin_lock_irqsave(&dev.lock, flags); spin_lock_irqsave(&dev.lock, flags);
outb(HPBLKSEL_1, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_1, dev.io + HP_BLKS);
isa_memset_io(dev.base, 0, 0x8000); isa_memset_io(dev.base, 0, 0x8000);
outb(HPBLKSEL_0, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS);
spin_unlock_irqrestore(&dev.lock, flags); spin_unlock_irqrestore(&dev.lock, flags);
dev.pwDSPQData = (dev.base + DSPQ_DATA_BUFF); dev.pwDSPQData = (dev.base + DSPQ_DATA_BUFF);
...@@ -1289,7 +1289,7 @@ static int __init calibrate_adc(WORD srate) ...@@ -1289,7 +1289,7 @@ static int __init calibrate_adc(WORD srate)
static int upload_dsp_code(void) static int upload_dsp_code(void)
{ {
outb(HPBLKSEL_0, dev.io + HP_BLKS); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS);
#ifndef HAVE_DSPCODEH #ifndef HAVE_DSPCODEH
INITCODESIZE = mod_firmware_load(INITCODEFILE, &INITCODE); INITCODESIZE = mod_firmware_load(INITCODEFILE, &INITCODE);
if (!INITCODE) { if (!INITCODE) {
...@@ -1326,9 +1326,9 @@ static int upload_dsp_code(void) ...@@ -1326,9 +1326,9 @@ static int upload_dsp_code(void)
#ifdef MSND_CLASSIC #ifdef MSND_CLASSIC
static void reset_proteus(void) static void reset_proteus(void)
{ {
outb(HPPRORESET_ON, dev.io + HP_PROR); msnd_outb(HPPRORESET_ON, dev.io + HP_PROR);
mdelay(TIME_PRO_RESET); mdelay(TIME_PRO_RESET);
outb(HPPRORESET_OFF, dev.io + HP_PROR); msnd_outb(HPPRORESET_OFF, dev.io + HP_PROR);
mdelay(TIME_PRO_RESET_DONE); mdelay(TIME_PRO_RESET_DONE);
} }
#endif #endif
...@@ -1338,8 +1338,8 @@ static int initialize(void) ...@@ -1338,8 +1338,8 @@ static int initialize(void)
int err, timeout; int err, timeout;
#ifdef MSND_CLASSIC #ifdef MSND_CLASSIC
outb(HPWAITSTATE_0, dev.io + HP_WAIT); msnd_outb(HPWAITSTATE_0, dev.io + HP_WAIT);
outb(HPBITMODE_16, dev.io + HP_BITM); msnd_outb(HPBITMODE_16, dev.io + HP_BITM);
reset_proteus(); reset_proteus();
#endif #endif
...@@ -1455,9 +1455,9 @@ static void __exit unload_multisound(void) ...@@ -1455,9 +1455,9 @@ static void __exit unload_multisound(void)
static int __init msnd_write_cfg(int cfg, int reg, int value) static int __init msnd_write_cfg(int cfg, int reg, int value)
{ {
outb(reg, cfg); msnd_outb(reg, cfg);
outb(value, cfg + 1); msnd_outb(value, cfg + 1);
if (value != inb(cfg + 1)) { if (value != msnd_inb(cfg + 1)) {
printk(KERN_ERR LOGNAME ": msnd_write_cfg: I/O error\n"); printk(KERN_ERR LOGNAME ": msnd_write_cfg: I/O error\n");
return -EIO; return -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment