linux/sound/isa/msnd/msnd.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*********************************************************************
 *
 * msnd.h
 *
 * Turtle Beach MultiSound Sound Card Driver for Linux
 *
 * Some parts of this header file were derived from the Turtle Beach
 * MultiSound Driver Development Kit.
 *
 * Copyright (C) 1998 Andrew Veliath
 * Copyright (C) 1993 Turtle Beach Systems, Inc.
 *
 ********************************************************************/
#ifndef __MSND_H
#define __MSND_H

#define DEFSAMPLERATE
#define DEFSAMPLESIZE
#define DEFCHANNELS

#define SRAM_BANK_SIZE
#define SRAM_CNTL_START
#define SMA_STRUCT_START

#define DSP_BASE_ADDR
#define DSP_BANK_BASE

#define AGND
#define SIGNAL

#define EXT_DSP_BIT_DCAL
#define EXT_DSP_BIT_MIDI_CON

#define BUFFSIZE
#define HOSTQ_SIZE

#define DAP_BUFF_SIZE

#define DAPQ_STRUCT_SIZE
#define DARQ_STRUCT_SIZE
#define DAPQ_BUFF_SIZE
#define DARQ_BUFF_SIZE
#define MODQ_BUFF_SIZE

#define DAPQ_DATA_BUFF
#define DARQ_DATA_BUFF
#define MODQ_DATA_BUFF
#define MIDQ_DATA_BUFF

#define DAPQ_OFFSET
#define DARQ_OFFSET
#define MODQ_OFFSET
#define MIDQ_OFFSET
#define DSPQ_OFFSET

#define HP_ICR
#define HP_CVR
#define HP_ISR
#define HP_IVR
#define HP_NU
#define HP_INFO
#define HP_TXH
#define HP_RXH
#define HP_TXM
#define HP_RXM
#define HP_TXL
#define HP_RXL

#define HP_ICR_DEF
#define HP_CVR_DEF
#define HP_ISR_DEF
#define HP_IVR_DEF
#define HP_NU_DEF

#define HP_IRQM

#define HPR_BLRC
#define HPR_SPR1
#define HPR_SPR2
#define HPR_TCL0
#define HPR_TCL1
#define HPR_TCL2
#define HPR_TCL3
#define HPR_TCL4

#define HPICR_INIT
#define HPICR_HM1
#define HPICR_HM0
#define HPICR_HF1
#define HPICR_HF0
#define HPICR_TREQ
#define HPICR_RREQ

#define HPCVR_HC

#define HPISR_HREQ
#define HPISR_DMA
#define HPISR_HF3
#define HPISR_HF2
#define HPISR_TRDY
#define HPISR_TXDE
#define HPISR_RXDF

#define HPIO_290
#define HPIO_260
#define HPIO_250
#define HPIO_240
#define HPIO_230
#define HPIO_220
#define HPIO_210
#define HPIO_3E0

#define HPMEM_NONE
#define HPMEM_B000
#define HPMEM_C800
#define HPMEM_D000
#define HPMEM_D400
#define HPMEM_D800
#define HPMEM_E000
#define HPMEM_E800

#define HPIRQ_NONE
#define HPIRQ_5
#define HPIRQ_7
#define HPIRQ_9
#define HPIRQ_10
#define HPIRQ_11
#define HPIRQ_12
#define HPIRQ_15

#define HIMT_PLAY_DONE
#define HIMT_RECORD_DONE
#define HIMT_MIDI_EOS
#define HIMT_MIDI_OUT

#define HIMT_MIDI_IN_UCHAR
#define HIMT_DSP

#define HDEX_BASE
#define HDEX_PLAY_START
#define HDEX_PLAY_STOP
#define HDEX_PLAY_PAUSE
#define HDEX_PLAY_RESUME
#define HDEX_RECORD_START
#define HDEX_RECORD_STOP
#define HDEX_MIDI_IN_START
#define HDEX_MIDI_IN_STOP
#define HDEX_MIDI_OUT_START
#define HDEX_MIDI_OUT_STOP
#define HDEX_AUX_REQ

#define HDEXAR_CLEAR_PEAKS
#define HDEXAR_IN_SET_POTS
#define HDEXAR_AUX_SET_POTS
#define HDEXAR_CAL_A_TO_D
#define HDEXAR_RD_EXT_DSP_BITS

/* Pinnacle only HDEXAR defs */
#define HDEXAR_SET_ANA_IN
#define HDEXAR_SET_SYNTH_IN
#define HDEXAR_READ_DAT_IN
#define HDEXAR_MIC_SET_POTS
#define HDEXAR_SET_DAT_IN

#define HDEXAR_SET_SYNTH_48
#define HDEXAR_SET_SYNTH_44

#define HIWORD(l)
#define LOWORD(l)
#define HIBYTE(w)
#define LOBYTE(w)
#define MAKELONG(low, hi)
#define MAKEWORD(low, hi)

#define PCTODSP_OFFSET(w)
#define PCTODSP_BASED(w)
#define DSPTOPC_BASED(w)

#ifdef SLOWIO
#  undef outb
#  undef inb
#define outb
#define inb
#endif

/* JobQueueStruct */
#define JQS_wStart
#define JQS_wSize
#define JQS_wHead
#define JQS_wTail
#define JQS__size

/* DAQueueDataStruct */
#define DAQDS_wStart
#define DAQDS_wSize
#define DAQDS_wFormat
#define DAQDS_wSampleSize
#define DAQDS_wChannels
#define DAQDS_wSampleRate
#define DAQDS_wIntMsg
#define DAQDS_wFlags
#define DAQDS__size

#include <sound/pcm.h>

struct snd_msnd {};

void snd_msnd_init_queue(void __iomem *base, int start, int size);

int snd_msnd_send_dsp_cmd(struct snd_msnd *chip, u8 cmd);
int snd_msnd_send_word(struct snd_msnd *chip,
			   unsigned char high,
			   unsigned char mid,
			   unsigned char low);
int snd_msnd_upload_host(struct snd_msnd *chip,
			     const u8 *bin, int len);
int snd_msnd_enable_irq(struct snd_msnd *chip);
int snd_msnd_disable_irq(struct snd_msnd *chip);
void snd_msnd_dsp_halt(struct snd_msnd *chip, struct file *file);
int snd_msnd_DAPQ(struct snd_msnd *chip, int start);
int snd_msnd_DARQ(struct snd_msnd *chip, int start);
int snd_msnd_pcm(struct snd_card *card, int device);

int snd_msndmidi_new(struct snd_card *card, int device);
void snd_msndmidi_input_read(void *mpu);

void snd_msndmix_setup(struct snd_msnd *chip);
int snd_msndmix_new(struct snd_card *card);
int snd_msndmix_force_recsrc(struct snd_msnd *chip, int recsrc);
#endif /* __MSND_H */