1 #include <linux/config.h>
5 #define DSP_RESET (devc->base + 0x6)
6 #define DSP_READ (devc->base + 0xA)
7 #define DSP_WRITE (devc->base + 0xC)
8 #define DSP_COMMAND (devc->base + 0xC)
9 #define DSP_STATUS (devc->base + 0xC)
10 #define DSP_DATA_AVAIL (devc->base + 0xE)
11 #define DSP_DATA_AVL16 (devc->base + 0xF)
12 #define MIXER_ADDR (devc->base + 0x4)
13 #define MIXER_DATA (devc->base + 0x5)
14 #define OPL3_LEFT (devc->base + 0x0)
15 #define OPL3_RIGHT (devc->base + 0x2)
16 #define OPL3_BOTH (devc->base + 0x8)
19 #define DSP_CMD_SPKON 0xD1
20 #define DSP_CMD_SPKOFF 0xD3
21 #define DSP_CMD_DMAON 0xD0
22 #define DSP_CMD_DMAOFF 0xD4
25 #define IMODE_OUTPUT PCM_ENABLE_OUTPUT
26 #define IMODE_INPUT PCM_ENABLE_INPUT
38 #define MDL_SB1 1 /* SB1.0 or 1.5 */
39 #define MDL_SB2 2 /* SB2.0 */
40 #define MDL_SB201 3 /* SB2.01 */
41 #define MDL_SBPRO 4 /* SB Pro */
42 #define MDL_SB16 5 /* SB16/32/AWE */
43 #define MDL_SBPNP 6 /* SB16/32/AWE PnP */
44 #define MDL_JAZZ 10 /* Media Vision Jazz16 */
45 #define MDL_SMW 11 /* Logitech SoundMan Wave (Jazz16) */
46 #define MDL_ESS 12 /* ESS ES688 and ES1688 */
47 #define MDL_AZTECH 13 /* Aztech Sound Galaxy family */
48 #define MDL_ES1868MIDI 14 /* MIDI port of ESS1868 */
49 #define MDL_AEDSP 15 /* Audio Excel DSP 16 */
51 #define SUBMDL_ALS007 42 /* ALS-007 differs from SB16 only in mixer */
52 /* register assignment */
56 #define SB_NO_MIDI 0x00000001
57 #define SB_NO_MIXER 0x00000002
58 #define SB_NO_AUDIO 0x00000004
59 #define SB_NO_RECORDING 0x00000008 /* No audio recording */
60 #define SB_MIDI_ONLY (SB_NO_AUDIO|SB_NO_MIXER)
63 unsigned int regno
: 8;
64 unsigned int bitoffs
:4;
68 typedef struct mixer_def mixer_tab
[32][2];
69 typedef struct mixer_def mixer_ent
;
71 typedef struct sb_devc
{
74 /* Hardware parameters */
80 # define SBCAP_STEREO 0x00000001
81 # define SBCAP_16BITS 0x00000002
83 /* Hardware resources */
90 int speed
, bits
, channels
;
92 volatile int intr_active
, irq_mode
;
97 int mixer_caps
, recmask
, supported_devices
;
98 int supported_rec_devices
;
103 unsigned long trg_buf
;
108 unsigned char tconst
;
115 void (*midi_input_intr
) (int dev
, unsigned char data
);
116 void *midi_irq_cookie
; /* IRQ cookie for the midi */
119 int sb_dsp_command (sb_devc
*devc
, unsigned char val
);
120 int sb_dsp_reset (sb_devc
*devc
);
121 void sb_setmixer (sb_devc
*devc
, unsigned int port
, unsigned int value
);
122 unsigned int sb_getmixer (sb_devc
*devc
, unsigned int port
);
123 int sb_dsp_detect (struct address_info
*hw_config
);
124 int sb_dsp_init (struct address_info
*hw_config
);
125 void sb_dsp_unload(struct address_info
*hw_config
, int sbmpu
);
126 int sb_mixer_init(sb_devc
*devc
);
127 void sb_mixer_set_stereo (sb_devc
*devc
, int mode
);
128 void smw_mixer_init(sb_devc
*devc
);
129 void sb_dsp_midi_init (sb_devc
*devc
);
130 void sb_audio_init (sb_devc
*devc
, char *name
);
131 void sb_midi_interrupt (sb_devc
*devc
);
132 int ess_write (sb_devc
*devc
, unsigned char reg
, unsigned char data
);
133 int ess_read (sb_devc
*devc
, unsigned char reg
);
136 extern sb_devc
*last_sb
;