blob: 5978f9a8c8b20bc9a99c50f43bfdde767def0439 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __SOUND_MINORS_H
2#define __SOUND_MINORS_H
3
4/*
5 * MINOR numbers
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
Pawel MOLLf90c06a2008-07-30 12:46:40 +010024#define SNDRV_OS_MINORS 256
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#define SNDRV_MINOR_DEVICES 32
27#define SNDRV_MINOR_CARD(minor) ((minor) >> 5)
28#define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f)
29#define SNDRV_MINOR(card, dev) (((card) << 5) | (dev))
30
Clemens Ladisch332682b2005-11-20 14:07:47 +010031/* these minors can still be used for autoloading devices (/dev/aload*) */
32#define SNDRV_MINOR_CONTROL 0 /* 0 */
Clemens Ladisch3939e712005-10-24 17:02:03 +020033#define SNDRV_MINOR_GLOBAL 1 /* 1 */
Kay Sievers03cfe6f2010-11-23 17:43:19 +010034#define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */
35#define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */
Clemens Ladisch332682b2005-11-20 14:07:47 +010036
37#ifndef CONFIG_SND_DYNAMIC_MINORS
Omair Mohammed Abdullah3eafc952011-12-23 10:36:36 +053038#define SNDRV_MINOR_COMPRESS 2 /* 2 - 3 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070039#define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */
42#define SNDRV_MINOR_PCM_CAPTURE 24 /* 24 - 31 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Clemens Ladisch332682b2005-11-20 14:07:47 +010044/* same as first respective minor number to make minor allocation easier */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#define SNDRV_DEVICE_TYPE_CONTROL SNDRV_MINOR_CONTROL
46#define SNDRV_DEVICE_TYPE_HWDEP SNDRV_MINOR_HWDEP
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#define SNDRV_DEVICE_TYPE_RAWMIDI SNDRV_MINOR_RAWMIDI
48#define SNDRV_DEVICE_TYPE_PCM_PLAYBACK SNDRV_MINOR_PCM_PLAYBACK
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER
51#define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER
Omair Mohammed Abdullah3eafc952011-12-23 10:36:36 +053052#define SNDRV_DEVICE_TYPE_COMPRESS SNDRV_MINOR_COMPRESS
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Clemens Ladisch332682b2005-11-20 14:07:47 +010054#else /* CONFIG_SND_DYNAMIC_MINORS */
55
56enum {
57 SNDRV_DEVICE_TYPE_CONTROL,
58 SNDRV_DEVICE_TYPE_SEQUENCER,
59 SNDRV_DEVICE_TYPE_TIMER,
60 SNDRV_DEVICE_TYPE_HWDEP,
61 SNDRV_DEVICE_TYPE_RAWMIDI,
62 SNDRV_DEVICE_TYPE_PCM_PLAYBACK,
63 SNDRV_DEVICE_TYPE_PCM_CAPTURE,
Omair Mohammed Abdullah3eafc952011-12-23 10:36:36 +053064 SNDRV_DEVICE_TYPE_COMPRESS,
Clemens Ladisch332682b2005-11-20 14:07:47 +010065};
66
67#endif /* CONFIG_SND_DYNAMIC_MINORS */
68
69#define SNDRV_MINOR_HWDEPS 4
70#define SNDRV_MINOR_RAWMIDIS 8
71#define SNDRV_MINOR_PCMS 8
72
73
Linus Torvalds1da177e2005-04-16 15:20:36 -070074#ifdef CONFIG_SND_OSSEMUL
75
76#define SNDRV_MINOR_OSS_DEVICES 16
77#define SNDRV_MINOR_OSS_CARD(minor) ((minor) >> 4)
78#define SNDRV_MINOR_OSS_DEVICE(minor) ((minor) & 0x000f)
79#define SNDRV_MINOR_OSS(card, dev) (((card) << 4) | (dev))
80
81#define SNDRV_MINOR_OSS_MIXER 0 /* /dev/mixer - OSS 3.XX compatible */
82#define SNDRV_MINOR_OSS_SEQUENCER 1 /* /dev/sequencer - OSS 3.XX compatible */
83#define SNDRV_MINOR_OSS_MIDI 2 /* /dev/midi - native midi interface - OSS 3.XX compatible - UART */
84#define SNDRV_MINOR_OSS_PCM 3 /* alias */
85#define SNDRV_MINOR_OSS_PCM_8 3 /* /dev/dsp - 8bit PCM - OSS 3.XX compatible */
86#define SNDRV_MINOR_OSS_AUDIO 4 /* /dev/audio - SunSparc compatible */
87#define SNDRV_MINOR_OSS_PCM_16 5 /* /dev/dsp16 - 16bit PCM - OSS 3.XX compatible */
88#define SNDRV_MINOR_OSS_SNDSTAT 6 /* /dev/sndstat - for compatibility with OSS */
89#define SNDRV_MINOR_OSS_RESERVED7 7 /* reserved for future use */
90#define SNDRV_MINOR_OSS_MUSIC 8 /* /dev/music - OSS 3.XX compatible */
91#define SNDRV_MINOR_OSS_DMMIDI 9 /* /dev/dmmidi0 - this device can have another minor # with OSS */
92#define SNDRV_MINOR_OSS_DMFM 10 /* /dev/dmfm0 - this device can have another minor # with OSS */
93#define SNDRV_MINOR_OSS_MIXER1 11 /* alternate mixer */
94#define SNDRV_MINOR_OSS_PCM1 12 /* alternate PCM (GF-A-1) */
95#define SNDRV_MINOR_OSS_MIDI1 13 /* alternate midi - SYNTH */
96#define SNDRV_MINOR_OSS_DMMIDI1 14 /* alternate dmmidi - SYNTH */
97#define SNDRV_MINOR_OSS_RESERVED15 15 /* reserved for future use */
98
99#define SNDRV_OSS_DEVICE_TYPE_MIXER 0
100#define SNDRV_OSS_DEVICE_TYPE_SEQUENCER 1
101#define SNDRV_OSS_DEVICE_TYPE_PCM 2
102#define SNDRV_OSS_DEVICE_TYPE_MIDI 3
103#define SNDRV_OSS_DEVICE_TYPE_DMFM 4
104#define SNDRV_OSS_DEVICE_TYPE_SNDSTAT 5
105#define SNDRV_OSS_DEVICE_TYPE_MUSIC 6
106
107#define MODULE_ALIAS_SNDRV_MINOR(type) \
108 MODULE_ALIAS("sound-service-?-" __stringify(type))
109
110#endif
111
112#endif /* __SOUND_MINORS_H */