OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [sound/] [sb.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
#define DSP_RESET       (devc->base + 0x6)
2
#define DSP_READ        (devc->base + 0xA)
3
#define DSP_WRITE       (devc->base + 0xC)
4
#define DSP_COMMAND     (devc->base + 0xC)
5
#define DSP_STATUS      (devc->base + 0xC)
6
#define DSP_DATA_AVAIL  (devc->base + 0xE)
7
#define DSP_DATA_AVL16  (devc->base + 0xF)
8
#define MIXER_ADDR      (devc->base + 0x4)
9
#define MIXER_DATA      (devc->base + 0x5)
10
#define OPL3_LEFT       (devc->base + 0x0)
11
#define OPL3_RIGHT      (devc->base + 0x2)
12
#define OPL3_BOTH       (devc->base + 0x8)
13
/* DSP Commands */
14
 
15
#define DSP_CMD_SPKON           0xD1
16
#define DSP_CMD_SPKOFF          0xD3
17
#define DSP_CMD_DMAON           0xD0
18
#define DSP_CMD_DMAOFF          0xD4
19
 
20
#define IMODE_NONE              0
21
#define IMODE_OUTPUT            PCM_ENABLE_OUTPUT
22
#define IMODE_INPUT             PCM_ENABLE_INPUT
23
#define IMODE_INIT              3
24
#define IMODE_MIDI              4
25
 
26
#define NORMAL_MIDI     0
27
#define UART_MIDI       1
28
 
29
 
30
/*
31
 * Device models
32
 */
33
#define MDL_NONE        0
34
#define MDL_SB1         1       /* SB1.0 or 1.5 */
35
#define MDL_SB2         2       /* SB2.0 */
36
#define MDL_SB201       3       /* SB2.01 */
37
#define MDL_SBPRO       4       /* SB Pro */
38
#define MDL_SB16        5       /* SB16/32/AWE */
39
#define MDL_JAZZ        10      /* Media Vision Jazz16 */
40
#define MDL_SMW         11      /* Logitech SoundMan Wave (Jazz16) */
41
#define MDL_ESS         12      /* ESS ES688 and ES1688 */
42
#define MDL_AZTECH      13      /* Aztech Sound Galaxy family */
43
 
44
/*
45
 * Config flags
46
 */
47
#define SB_NO_MIDI      0x00000001
48
#define SB_NO_MIXER     0x00000002
49
#define SB_NO_AUDIO     0x00000004
50
#define SB_NO_RECORDING 0x00000008 /* No audio recording */
51
#define SB_MIDI_ONLY    (SB_NO_AUDIO|SB_NO_MIXER)
52
 
53
struct mixer_def {
54
        unsigned int regno: 8;
55
        unsigned int bitoffs:4;
56
        unsigned int nbits:4;
57
};
58
 
59
typedef struct mixer_def mixer_tab[32][2];
60
typedef struct mixer_def mixer_ent;
61
 
62
typedef struct sb_devc {
63
           int dev;
64
 
65
        /* Hardware parameters */
66
           int *osp;
67
           int minor, major;
68
           int type;
69
           int model, submodel;
70
           int caps;
71
#       define SBCAP_STEREO     0x00000001
72
#       define SBCAP_16BITS     0x00000002
73
 
74
        /* Hardware resources */
75
           int base;
76
           int irq;
77
           int dma8, dma16;
78
 
79
        /* State variables */
80
           int opened;
81
           int speed, bits, channels;
82
           volatile int irq_ok;
83
           volatile int intr_active, irq_mode;
84
 
85
        /* Mixer fields */
86
           unsigned short levels[SOUND_MIXER_NRDEVICES];
87
           mixer_tab *iomap;
88
           int mixer_caps, recmask, supported_devices;
89
           int supported_rec_devices;
90
           int my_mixerdev;
91
 
92
        /* Audio fields */
93
           unsigned long trg_buf;
94
           int      trigger_bits;
95
           int      trg_bytes;
96
           int      trg_intrflag;
97
           int      trg_restart;
98
           unsigned char tconst;
99
           int my_dev;
100
 
101
        /* MIDI fields */
102
           int my_mididev;
103
           int input_opened;
104
           void (*midi_input_intr) (int dev, unsigned char data);
105
        } sb_devc;
106
 
107
int sb_dsp_command (sb_devc *devc, unsigned char val);
108
int sb_dsp_get_byte (sb_devc *devc);
109
int sb_dsp_reset (sb_devc *devc);
110
void sb_setmixer (sb_devc *devc, unsigned int port, unsigned int value);
111
unsigned int sb_getmixer (sb_devc *devc, unsigned int port);
112
int sb_dsp_detect (struct address_info *hw_config);
113
void sb_dsp_init (struct address_info *hw_config);
114
void sb_dsp_unload(struct address_info *hw_config);
115
int sb_mixer_init(sb_devc *devc);
116
void smw_mixer_init(sb_devc *devc);
117
void sb_dsp_midi_init (sb_devc *devc);
118
void sb_audio_init (sb_devc *devc, char *name);
119
void sb_midi_interrupt (sb_devc *devc);
120
int ess_write (sb_devc *devc, unsigned char reg, unsigned char data);
121
int ess_read (sb_devc *devc, unsigned char reg);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.