Thomas Gleixner | 1a59d1b8 | 2019-05-27 08:55:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifndef __SOUND_MINORS_H |
| 3 | #define __SOUND_MINORS_H |
| 4 | |
| 5 | /* |
| 6 | * MINOR numbers |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
Pawel MOLL | f90c06a | 2008-07-30 12:46:40 +0100 | [diff] [blame] | 9 | #define SNDRV_OS_MINORS 256 |
| 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #define SNDRV_MINOR_DEVICES 32 |
| 12 | #define SNDRV_MINOR_CARD(minor) ((minor) >> 5) |
| 13 | #define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f) |
| 14 | #define SNDRV_MINOR(card, dev) (((card) << 5) | (dev)) |
| 15 | |
Clemens Ladisch | 332682b | 2005-11-20 14:07:47 +0100 | [diff] [blame] | 16 | /* these minors can still be used for autoloading devices (/dev/aload*) */ |
| 17 | #define SNDRV_MINOR_CONTROL 0 /* 0 */ |
Clemens Ladisch | 3939e71 | 2005-10-24 17:02:03 +0200 | [diff] [blame] | 18 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ |
Kay Sievers | 03cfe6f | 2010-11-23 17:43:19 +0100 | [diff] [blame] | 19 | #define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */ |
| 20 | #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ |
Clemens Ladisch | 332682b | 2005-11-20 14:07:47 +0100 | [diff] [blame] | 21 | |
| 22 | #ifndef CONFIG_SND_DYNAMIC_MINORS |
Omair Mohammed Abdullah | 3eafc95 | 2011-12-23 10:36:36 +0530 | [diff] [blame] | 23 | #define SNDRV_MINOR_COMPRESS 2 /* 2 - 3 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */ |
| 27 | #define SNDRV_MINOR_PCM_CAPTURE 24 /* 24 - 31 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Clemens Ladisch | 332682b | 2005-11-20 14:07:47 +0100 | [diff] [blame] | 29 | /* same as first respective minor number to make minor allocation easier */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #define SNDRV_DEVICE_TYPE_CONTROL SNDRV_MINOR_CONTROL |
| 31 | #define SNDRV_DEVICE_TYPE_HWDEP SNDRV_MINOR_HWDEP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #define SNDRV_DEVICE_TYPE_RAWMIDI SNDRV_MINOR_RAWMIDI |
| 33 | #define SNDRV_DEVICE_TYPE_PCM_PLAYBACK SNDRV_MINOR_PCM_PLAYBACK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | #define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | #define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER |
| 36 | #define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER |
Omair Mohammed Abdullah | 3eafc95 | 2011-12-23 10:36:36 +0530 | [diff] [blame] | 37 | #define SNDRV_DEVICE_TYPE_COMPRESS SNDRV_MINOR_COMPRESS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Clemens Ladisch | 332682b | 2005-11-20 14:07:47 +0100 | [diff] [blame] | 39 | #else /* CONFIG_SND_DYNAMIC_MINORS */ |
| 40 | |
| 41 | enum { |
| 42 | SNDRV_DEVICE_TYPE_CONTROL, |
| 43 | SNDRV_DEVICE_TYPE_SEQUENCER, |
| 44 | SNDRV_DEVICE_TYPE_TIMER, |
| 45 | SNDRV_DEVICE_TYPE_HWDEP, |
| 46 | SNDRV_DEVICE_TYPE_RAWMIDI, |
| 47 | SNDRV_DEVICE_TYPE_PCM_PLAYBACK, |
| 48 | SNDRV_DEVICE_TYPE_PCM_CAPTURE, |
Omair Mohammed Abdullah | 3eafc95 | 2011-12-23 10:36:36 +0530 | [diff] [blame] | 49 | SNDRV_DEVICE_TYPE_COMPRESS, |
Clemens Ladisch | 332682b | 2005-11-20 14:07:47 +0100 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | #endif /* CONFIG_SND_DYNAMIC_MINORS */ |
| 53 | |
| 54 | #define SNDRV_MINOR_HWDEPS 4 |
| 55 | #define SNDRV_MINOR_RAWMIDIS 8 |
| 56 | #define SNDRV_MINOR_PCMS 8 |
| 57 | |
| 58 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | #ifdef CONFIG_SND_OSSEMUL |
| 60 | |
| 61 | #define SNDRV_MINOR_OSS_DEVICES 16 |
| 62 | #define SNDRV_MINOR_OSS_CARD(minor) ((minor) >> 4) |
| 63 | #define SNDRV_MINOR_OSS_DEVICE(minor) ((minor) & 0x000f) |
| 64 | #define SNDRV_MINOR_OSS(card, dev) (((card) << 4) | (dev)) |
| 65 | |
| 66 | #define SNDRV_MINOR_OSS_MIXER 0 /* /dev/mixer - OSS 3.XX compatible */ |
| 67 | #define SNDRV_MINOR_OSS_SEQUENCER 1 /* /dev/sequencer - OSS 3.XX compatible */ |
| 68 | #define SNDRV_MINOR_OSS_MIDI 2 /* /dev/midi - native midi interface - OSS 3.XX compatible - UART */ |
| 69 | #define SNDRV_MINOR_OSS_PCM 3 /* alias */ |
| 70 | #define SNDRV_MINOR_OSS_PCM_8 3 /* /dev/dsp - 8bit PCM - OSS 3.XX compatible */ |
| 71 | #define SNDRV_MINOR_OSS_AUDIO 4 /* /dev/audio - SunSparc compatible */ |
| 72 | #define SNDRV_MINOR_OSS_PCM_16 5 /* /dev/dsp16 - 16bit PCM - OSS 3.XX compatible */ |
| 73 | #define SNDRV_MINOR_OSS_SNDSTAT 6 /* /dev/sndstat - for compatibility with OSS */ |
| 74 | #define SNDRV_MINOR_OSS_RESERVED7 7 /* reserved for future use */ |
| 75 | #define SNDRV_MINOR_OSS_MUSIC 8 /* /dev/music - OSS 3.XX compatible */ |
| 76 | #define SNDRV_MINOR_OSS_DMMIDI 9 /* /dev/dmmidi0 - this device can have another minor # with OSS */ |
| 77 | #define SNDRV_MINOR_OSS_DMFM 10 /* /dev/dmfm0 - this device can have another minor # with OSS */ |
| 78 | #define SNDRV_MINOR_OSS_MIXER1 11 /* alternate mixer */ |
| 79 | #define SNDRV_MINOR_OSS_PCM1 12 /* alternate PCM (GF-A-1) */ |
| 80 | #define SNDRV_MINOR_OSS_MIDI1 13 /* alternate midi - SYNTH */ |
| 81 | #define SNDRV_MINOR_OSS_DMMIDI1 14 /* alternate dmmidi - SYNTH */ |
| 82 | #define SNDRV_MINOR_OSS_RESERVED15 15 /* reserved for future use */ |
| 83 | |
| 84 | #define SNDRV_OSS_DEVICE_TYPE_MIXER 0 |
| 85 | #define SNDRV_OSS_DEVICE_TYPE_SEQUENCER 1 |
| 86 | #define SNDRV_OSS_DEVICE_TYPE_PCM 2 |
| 87 | #define SNDRV_OSS_DEVICE_TYPE_MIDI 3 |
| 88 | #define SNDRV_OSS_DEVICE_TYPE_DMFM 4 |
| 89 | #define SNDRV_OSS_DEVICE_TYPE_SNDSTAT 5 |
| 90 | #define SNDRV_OSS_DEVICE_TYPE_MUSIC 6 |
| 91 | |
| 92 | #define MODULE_ALIAS_SNDRV_MINOR(type) \ |
| 93 | MODULE_ALIAS("sound-service-?-" __stringify(type)) |
| 94 | |
| 95 | #endif |
| 96 | |
| 97 | #endif /* __SOUND_MINORS_H */ |