~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/sound/sb16_csp.h

Version: ~ [ linux-6.1-rc7 ] ~ [ linux-6.0.10 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.80 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.156 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.225 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.267 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.300 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.334 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
  3  *                        Takashi Iwai <tiwai@suse.de>
  4  *
  5  *  SB16ASP/AWE32 CSP control
  6  *
  7  *   This program is free software; you can redistribute it and/or modify 
  8  *   it under the terms of the GNU General Public License as published by
  9  *   the Free Software Foundation; either version 2 of the License, or
 10  *   (at your option) any later version.
 11  *
 12  *   This program is distributed in the hope that it will be useful,
 13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15  *   GNU General Public License for more details.
 16  *
 17  *   You should have received a copy of the GNU General Public License
 18  *   along with this program; if not, write to the Free Software
 19  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 20  *
 21  */
 22 #ifndef _UAPI__SOUND_SB16_CSP_H
 23 #define _UAPI__SOUND_SB16_CSP_H
 24 
 25 
 26 /* CSP modes */
 27 #define SNDRV_SB_CSP_MODE_NONE          0x00
 28 #define SNDRV_SB_CSP_MODE_DSP_READ      0x01    /* Record from DSP */
 29 #define SNDRV_SB_CSP_MODE_DSP_WRITE     0x02    /* Play to DSP */
 30 #define SNDRV_SB_CSP_MODE_QSOUND                0x04    /* QSound */
 31 
 32 /* CSP load flags */
 33 #define SNDRV_SB_CSP_LOAD_FROMUSER      0x01
 34 #define SNDRV_SB_CSP_LOAD_INITBLOCK     0x02
 35 
 36 /* CSP sample width */
 37 #define SNDRV_SB_CSP_SAMPLE_8BIT                0x01
 38 #define SNDRV_SB_CSP_SAMPLE_16BIT               0x02
 39 
 40 /* CSP channels */
 41 #define SNDRV_SB_CSP_MONO                       0x01
 42 #define SNDRV_SB_CSP_STEREO             0x02
 43 
 44 /* CSP rates */
 45 #define SNDRV_SB_CSP_RATE_8000          0x01
 46 #define SNDRV_SB_CSP_RATE_11025         0x02
 47 #define SNDRV_SB_CSP_RATE_22050         0x04
 48 #define SNDRV_SB_CSP_RATE_44100         0x08
 49 #define SNDRV_SB_CSP_RATE_ALL           0x0f
 50 
 51 /* CSP running state */
 52 #define SNDRV_SB_CSP_ST_IDLE            0x00
 53 #define SNDRV_SB_CSP_ST_LOADED          0x01
 54 #define SNDRV_SB_CSP_ST_RUNNING         0x02
 55 #define SNDRV_SB_CSP_ST_PAUSED          0x04
 56 #define SNDRV_SB_CSP_ST_AUTO            0x08
 57 #define SNDRV_SB_CSP_ST_QSOUND          0x10
 58 
 59 /* maximum QSound value (180 degrees right) */
 60 #define SNDRV_SB_CSP_QSOUND_MAX_RIGHT   0x20
 61 
 62 /* maximum microcode RIFF file size */
 63 #define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE    0x3000
 64 
 65 /* microcode header */
 66 struct snd_sb_csp_mc_header {
 67         char codec_name[16];            /* id name of codec */
 68         unsigned short func_req;        /* requested function */
 69 };
 70 
 71 /* microcode to be loaded */
 72 struct snd_sb_csp_microcode {
 73         struct snd_sb_csp_mc_header info;
 74         unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
 75 };
 76 
 77 /* start CSP with sample_width in mono/stereo */
 78 struct snd_sb_csp_start {
 79         int sample_width;       /* sample width, look above */
 80         int channels;           /* channels, look above */
 81 };
 82 
 83 /* CSP information */
 84 struct snd_sb_csp_info {
 85         char codec_name[16];            /* id name of codec */
 86         unsigned short func_nr;         /* function number */
 87         unsigned int acc_format;        /* accepted PCM formats */
 88         unsigned short acc_channels;    /* accepted channels */
 89         unsigned short acc_width;       /* accepted sample width */
 90         unsigned short acc_rates;       /* accepted sample rates */
 91         unsigned short csp_mode;        /* CSP mode, see above */
 92         unsigned short run_channels;    /* current channels  */
 93         unsigned short run_width;       /* current sample width */
 94         unsigned short version;         /* version id: 0x10 - 0x1f */
 95         unsigned short state;           /* state bits */
 96 };
 97 
 98 /* HWDEP controls */
 99 /* get CSP information */
100 #define SNDRV_SB_CSP_IOCTL_INFO         _IOR('H', 0x10, struct snd_sb_csp_info)
101 /* load microcode to CSP */
102 /* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
103  * defined for some architectures like MIPS, and it leads to build errors.
104  * (x86 and co have 14-bit size, thus it's valid, though.)
105  * As a workaround for skipping the size-limit check, here we don't use the
106  * normal _IOW() macro but _IOC() with the manual argument.
107  */
108 #define SNDRV_SB_CSP_IOCTL_LOAD_CODE    \
109         _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
110 /* unload microcode from CSP */
111 #define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE  _IO('H', 0x12)
112 /* start CSP */
113 #define SNDRV_SB_CSP_IOCTL_START                _IOW('H', 0x13, struct snd_sb_csp_start)
114 /* stop CSP */
115 #define SNDRV_SB_CSP_IOCTL_STOP         _IO('H', 0x14)
116 /* pause CSP and DMA transfer */
117 #define SNDRV_SB_CSP_IOCTL_PAUSE                _IO('H', 0x15)
118 /* restart CSP and DMA transfer */
119 #define SNDRV_SB_CSP_IOCTL_RESTART      _IO('H', 0x16)
120 
121 
122 #endif /* _UAPI__SOUND_SB16_CSP_H */
123 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp