/* * sound/sscape.c * * Low level driver for Ensoniq SoundScape * * * Copyright (C) by Hannu Savolainen 1993-1997 * * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) * Version 2 (June 1991). See the "COPYING" file distributed with this software * for more info. * * * Thomas Sailer : ioctl code reworked (vmalloc/vfree removed) * Sergey Smitienko : ensoniq p'n'p support * Christoph Hellwig : adapted to module_init/module_exit * Bartlomiej Zolnierkiewicz : added __init to attach_sscape() * Chris Rankin : Specify that this module owns the coprocessor * Arnaldo C. de Melo : added missing restore_flags in sscape_pnp_upload_file */#include<linux/init.h>#include<linux/module.h>#include"sound_config.h"#include"sound_firmware.h"#include<linux/types.h>#include<linux/errno.h>#include<linux/signal.h>#include<linux/fcntl.h>#include<linux/ctype.h>#include<linux/stddef.h>#include<linux/kmod.h>#include<asm/dma.h>#include<asm/io.h>#include<linux/wait.h>#include<linux/slab.h>#include<linux/ioport.h>#include<linux/delay.h>#include<linux/proc_fs.h>#include<linux/spinlock.h>#include"coproc.h"#include"ad1848.h"#include"mpu401.h"/* * I/O ports */#define MIDI_DATA 0#define MIDI_CTRL 1#define HOST_CTRL 2#define TX_READY 0x02#define RX_READY 0x01#define HOST_DATA 3#define ODIE_ADDR 4#define ODIE_DATA 5/* * Indirect registers */#define GA_INTSTAT_REG 0#define GA_INTENA_REG 1#define GA_DMAA_REG 2#define GA_DMAB_REG 3#define GA_INTCFG_REG 4#define GA_DMACFG_REG 5#define GA_CDCFG_REG 6#define GA_SMCFGA_REG 7#define GA_SMCFGB_REG 8#define GA_HMCTL_REG 9/* * DMA channel identifiers (A and B) */#define SSCAPE_DMA_A 0#define SSCAPE_DMA_B 1#define PORT(name) (devc->base+name)/* * Host commands recognized by the OBP microcode */#define CMD_GEN_HOST_ACK 0x80#define CMD_GEN_MPU_ACK 0x81#define CMD_GET_BOARD_TYPE 0x82#define CMD_SET_CONTROL 0x88 /* Old firmware only */#define CMD_GET_CONTROL 0x89 /* Old firmware only */#define CT