Path: blob/master/thirdparty/linuxbsd_headers/alsa/sound/sb16_csp.h
9918 views
#ifndef __SOUND_SB16_CSP_H1#define __SOUND_SB16_CSP_H23/*4* Copyright (c) 1999 by Uros Bizjak <[email protected]>5* Takashi Iwai <[email protected]>6*7* SB16ASP/AWE32 CSP control8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License as published by11* the Free Software Foundation; either version 2 of the License, or12* (at your option) any later version.13*14* This program is distributed in the hope that it will be useful,15* but WITHOUT ANY WARRANTY; without even the implied warranty of16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17* GNU General Public License for more details.18*19* You should have received a copy of the GNU General Public License20* along with this program; if not, write to the Free Software21* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA22*23*/2425/* CSP modes */26#define SNDRV_SB_CSP_MODE_NONE 0x0027#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */28#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */29#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */3031/* CSP load flags */32#define SNDRV_SB_CSP_LOAD_FROMUSER 0x0133#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x023435/* CSP sample width */36#define SNDRV_SB_CSP_SAMPLE_8BIT 0x0137#define SNDRV_SB_CSP_SAMPLE_16BIT 0x023839/* CSP channels */40#define SNDRV_SB_CSP_MONO 0x0141#define SNDRV_SB_CSP_STEREO 0x024243/* CSP rates */44#define SNDRV_SB_CSP_RATE_8000 0x0145#define SNDRV_SB_CSP_RATE_11025 0x0246#define SNDRV_SB_CSP_RATE_22050 0x0447#define SNDRV_SB_CSP_RATE_44100 0x0848#define SNDRV_SB_CSP_RATE_ALL 0x0f4950/* CSP running state */51#define SNDRV_SB_CSP_ST_IDLE 0x0052#define SNDRV_SB_CSP_ST_LOADED 0x0153#define SNDRV_SB_CSP_ST_RUNNING 0x0254#define SNDRV_SB_CSP_ST_PAUSED 0x0455#define SNDRV_SB_CSP_ST_AUTO 0x0856#define SNDRV_SB_CSP_ST_QSOUND 0x105758/* maximum QSound value (180 degrees right) */59#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x206061/* maximum microcode RIFF file size */62#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x30006364/* microcode header */65typedef struct snd_sb_csp_mc_header {66char codec_name[16]; /* id name of codec */67unsigned short func_req; /* requested function */68} snd_sb_csp_mc_header_t;6970/* microcode to be loaded */71typedef struct snd_sb_csp_microcode {72snd_sb_csp_mc_header_t info;73unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];74} snd_sb_csp_microcode_t;7576/* start CSP with sample_width in mono/stereo */77typedef struct snd_sb_csp_start {78int sample_width; /* sample width, look above */79int channels; /* channels, look above */80} snd_sb_csp_start_t;8182/* CSP information */83typedef struct snd_sb_csp_info {84char codec_name[16]; /* id name of codec */85unsigned short func_nr; /* function number */86unsigned int acc_format; /* accepted PCM formats */87unsigned short acc_channels; /* accepted channels */88unsigned short acc_width; /* accepted sample width */89unsigned short acc_rates; /* accepted sample rates */90unsigned short csp_mode; /* CSP mode, see above */91unsigned short run_channels; /* current channels */92unsigned short run_width; /* current sample width */93unsigned short version; /* version id: 0x10 - 0x1f */94unsigned short state; /* state bits */95} snd_sb_csp_info_t;9697/* HWDEP controls */98/* get CSP information */99#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, snd_sb_csp_info_t)100/* load microcode to CSP */101#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, snd_sb_csp_microcode_t)102/* unload microcode from CSP */103#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)104/* start CSP */105#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, snd_sb_csp_start_t)106/* stop CSP */107#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)108/* pause CSP and DMA transfer */109#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)110/* restart CSP and DMA transfer */111#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)112113114#endif /* __SOUND_SB16_CSP */115116117