* be relative to the given base -register
*/
-int translate_code = 0;
+int pas_translate_code = 0;
static int pas_intr_mask = 0;
static int pas_irq = 0;
static int pas_sb_base = 0;
-spinlock_t lock=SPIN_LOCK_UNLOCKED;
+spinlock_t pas_lock=SPIN_LOCK_UNLOCKED;
#ifndef CONFIG_PAS_JOYSTICK
static int joystick = 0;
#else
unsigned char pas_read(int ioaddr)
{
- return inb(ioaddr + translate_code);
+ return inb(ioaddr + pas_translate_code);
}
void pas_write(unsigned char data, int ioaddr)
{
- outb((data), ioaddr + translate_code);
+ outb((data), ioaddr + pas_translate_code);
}
/******************* Begin of the Interrupt Handler ********************/
outb((0xBC), 0x9A01); /* Activate first board */
outb((hw_config->io_base >> 2), 0x9A01); /* Set base address */
- translate_code = hw_config->io_base - 0x388;
+ pas_translate_code = hw_config->io_base - 0x388;
pas_write(1, 0xBF88); /* Select one wait states */
board_id = pas_read(0x0B8B);
#include "pas2.h"
-extern spinlock_t lock;
+extern spinlock_t pas_lock;
static int midi_busy = 0, input_opened = 0;
static int my_dev;
pas_write(0x20 | 0x40,
0x178b);
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
if ((err = pas_set_intr(0x10)) < 0)
{
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
return err;
}
/*
pas_write(0xff, 0x1B88);
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
midi_busy = 1;
qlen = qhead = qtail = 0;
* Drain the local queue first
*/
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
while (qlen && dump_to_midi(tmp_queue[qhead]))
{
qhead++;
}
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
/*
* Output the byte if the local queue is empty.
if (qlen >= 256)
return 0; /* Local queue full */
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
tmp_queue[qtail] = midi_byte;
qlen++;
qtail++;
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
return 1;
}
}
if (stat & (0x08 | 0x10))
{
- spin_lock(&lock);/* called in irq context */
+ spin_lock(&pas_lock);/* called in irq context */
while (qlen && dump_to_midi(tmp_queue[qhead]))
{
qhead++;
}
- spin_unlock(&lock);
+ spin_unlock(&pas_lock);
}
if (stat & 0x40)
{
#define DEB(what) /* (what) */
#endif
-extern int translate_code;
+extern int pas_translate_code;
extern char pas_model;
extern int *pas_osp;
extern int pas_audiodev;
if (pas_model == 4)
{
- outw(data | (data << 8), (ioaddr + translate_code) - 1);
+ outw(data | (data << 8), (ioaddr + pas_translate_code) - 1);
outb((0x80), 0);
} else
pas_write(data, ioaddr);
int pas_audiodev = -1;
static int open_mode = 0;
-extern spinlock_t lock;
+extern spinlock_t pas_lock;
static int pcm_set_speed(int arg)
{
pcm_filter = tmp;
#endif
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
pas_write(tmp & ~(0x40 | 0x80), 0x0B8A);
pas_write(0x00 | 0x30 | 0x04, 0x138B);
pas_write((foo >> 8) & 0xff, 0x1388);
pas_write(tmp, 0x0B8A);
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
return pcm_speed;
}
DEB(printk("pas2_pcm.c: static int pas_audio_open(int mode = %X)\n", mode));
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
if (pcm_busy)
{
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
return -EBUSY;
}
pcm_busy = 1;
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
if ((err = pas_set_intr(PAS_PCM_INTRBITS)) < 0)
return err;
DEB(printk("pas2_pcm.c: static void pas_audio_close(void)\n"));
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
pas_audio_reset(dev);
pas_remove_intr(PAS_PCM_INTRBITS);
pcm_mode = PCM_NON;
pcm_busy = 0;
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
}
static void pas_audio_output_block(int dev, unsigned long buf, int count,
cnt == pcm_count)
return;
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
pas_write(pas_read(0xF8A) & ~0x40,
0xF8A);
pcm_mode = PCM_DAC;
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
}
static void pas_audio_start_input(int dev, unsigned long buf, int count,
cnt == pcm_count)
return;
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
/* DMAbuf_start_dma (dev, buf, count, DMA_MODE_READ); */
pcm_mode = PCM_ADC;
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
}
#ifndef NO_TRIGGER
{
unsigned long flags;
- spin_lock_irqsave(&lock, flags);
+ spin_lock_irqsave(&pas_lock, flags);
state &= open_mode;
if (state & PCM_ENABLE_OUTPUT)
else
pas_write(pas_read(0xF8A) & ~0x40, 0xF8A);
- spin_unlock_irqrestore(&lock, flags);
+ spin_unlock_irqrestore(&pas_lock, flags);
}
#endif