Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef __SOUND_MINORS_H
0003 #define __SOUND_MINORS_H
0004 
0005 /*
0006  *  MINOR numbers
0007  */
0008 
0009 #define SNDRV_OS_MINORS         256
0010 
0011 #define SNDRV_MINOR_DEVICES     32
0012 #define SNDRV_MINOR_CARD(minor)     ((minor) >> 5)
0013 #define SNDRV_MINOR_DEVICE(minor)   ((minor) & 0x001f)
0014 #define SNDRV_MINOR(card, dev)      (((card) << 5) | (dev))
0015 
0016 /* these minors can still be used for autoloading devices (/dev/aload*) */
0017 #define SNDRV_MINOR_CONTROL     0   /* 0 */
0018 #define SNDRV_MINOR_GLOBAL      1   /* 1 */
0019 #define SNDRV_MINOR_SEQUENCER       1   /* SNDRV_MINOR_GLOBAL + 0 * 32 */
0020 #define SNDRV_MINOR_TIMER       33  /* SNDRV_MINOR_GLOBAL + 1 * 32 */
0021 
0022 #ifndef CONFIG_SND_DYNAMIC_MINORS
0023 #define SNDRV_MINOR_COMPRESS        2   /* 2 - 3 */
0024 #define SNDRV_MINOR_HWDEP       4   /* 4 - 7 */
0025 #define SNDRV_MINOR_RAWMIDI     8   /* 8 - 15 */
0026 #define SNDRV_MINOR_PCM_PLAYBACK    16  /* 16 - 23 */
0027 #define SNDRV_MINOR_PCM_CAPTURE     24  /* 24 - 31 */
0028 
0029 /* same as first respective minor number to make minor allocation easier */
0030 #define SNDRV_DEVICE_TYPE_CONTROL   SNDRV_MINOR_CONTROL
0031 #define SNDRV_DEVICE_TYPE_HWDEP     SNDRV_MINOR_HWDEP
0032 #define SNDRV_DEVICE_TYPE_RAWMIDI   SNDRV_MINOR_RAWMIDI
0033 #define SNDRV_DEVICE_TYPE_PCM_PLAYBACK  SNDRV_MINOR_PCM_PLAYBACK
0034 #define SNDRV_DEVICE_TYPE_PCM_CAPTURE   SNDRV_MINOR_PCM_CAPTURE
0035 #define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER
0036 #define SNDRV_DEVICE_TYPE_TIMER     SNDRV_MINOR_TIMER
0037 #define SNDRV_DEVICE_TYPE_COMPRESS  SNDRV_MINOR_COMPRESS
0038 
0039 #else /* CONFIG_SND_DYNAMIC_MINORS */
0040 
0041 enum {
0042     SNDRV_DEVICE_TYPE_CONTROL,
0043     SNDRV_DEVICE_TYPE_SEQUENCER,
0044     SNDRV_DEVICE_TYPE_TIMER,
0045     SNDRV_DEVICE_TYPE_HWDEP,
0046     SNDRV_DEVICE_TYPE_RAWMIDI,
0047     SNDRV_DEVICE_TYPE_PCM_PLAYBACK,
0048     SNDRV_DEVICE_TYPE_PCM_CAPTURE,
0049     SNDRV_DEVICE_TYPE_COMPRESS,
0050 };
0051 
0052 #endif /* CONFIG_SND_DYNAMIC_MINORS */
0053 
0054 #define SNDRV_MINOR_HWDEPS      4
0055 #define SNDRV_MINOR_RAWMIDIS        8
0056 #define SNDRV_MINOR_PCMS        8
0057 
0058 
0059 #ifdef CONFIG_SND_OSSEMUL
0060 
0061 #define SNDRV_MINOR_OSS_DEVICES     16
0062 #define SNDRV_MINOR_OSS_CARD(minor) ((minor) >> 4)
0063 #define SNDRV_MINOR_OSS_DEVICE(minor)   ((minor) & 0x000f)
0064 #define SNDRV_MINOR_OSS(card, dev)  (((card) << 4) | (dev))
0065 
0066 #define SNDRV_MINOR_OSS_MIXER       0   /* /dev/mixer - OSS 3.XX compatible */
0067 #define SNDRV_MINOR_OSS_SEQUENCER   1   /* /dev/sequencer - OSS 3.XX compatible */
0068 #define SNDRV_MINOR_OSS_MIDI        2   /* /dev/midi - native midi interface - OSS 3.XX compatible - UART */
0069 #define SNDRV_MINOR_OSS_PCM     3   /* alias */
0070 #define SNDRV_MINOR_OSS_PCM_8       3   /* /dev/dsp - 8bit PCM - OSS 3.XX compatible */
0071 #define SNDRV_MINOR_OSS_AUDIO       4   /* /dev/audio - SunSparc compatible */
0072 #define SNDRV_MINOR_OSS_PCM_16      5   /* /dev/dsp16 - 16bit PCM - OSS 3.XX compatible */
0073 #define SNDRV_MINOR_OSS_SNDSTAT     6   /* /dev/sndstat - for compatibility with OSS */
0074 #define SNDRV_MINOR_OSS_RESERVED7   7   /* reserved for future use */
0075 #define SNDRV_MINOR_OSS_MUSIC       8   /* /dev/music - OSS 3.XX compatible */
0076 #define SNDRV_MINOR_OSS_DMMIDI      9   /* /dev/dmmidi0 - this device can have another minor # with OSS */
0077 #define SNDRV_MINOR_OSS_DMFM        10  /* /dev/dmfm0 - this device can have another minor # with OSS */
0078 #define SNDRV_MINOR_OSS_MIXER1      11  /* alternate mixer */
0079 #define SNDRV_MINOR_OSS_PCM1        12  /* alternate PCM (GF-A-1) */
0080 #define SNDRV_MINOR_OSS_MIDI1       13  /* alternate midi - SYNTH */
0081 #define SNDRV_MINOR_OSS_DMMIDI1     14  /* alternate dmmidi - SYNTH */
0082 #define SNDRV_MINOR_OSS_RESERVED15  15  /* reserved for future use */
0083 
0084 #define SNDRV_OSS_DEVICE_TYPE_MIXER 0
0085 #define SNDRV_OSS_DEVICE_TYPE_SEQUENCER 1
0086 #define SNDRV_OSS_DEVICE_TYPE_PCM   2
0087 #define SNDRV_OSS_DEVICE_TYPE_MIDI  3
0088 #define SNDRV_OSS_DEVICE_TYPE_DMFM  4
0089 #define SNDRV_OSS_DEVICE_TYPE_SNDSTAT   5
0090 #define SNDRV_OSS_DEVICE_TYPE_MUSIC 6
0091 
0092 #define MODULE_ALIAS_SNDRV_MINOR(type) \
0093     MODULE_ALIAS("sound-service-?-" __stringify(type))
0094 
0095 #endif
0096 
0097 #endif /* __SOUND_MINORS_H */