From 512bbd6a85230f16389f0dd51925472e72fc8a91 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 13:51:18 +0100 Subject: [ALSA] Remove xxx_t typedefs: Core component Modules: ALSA Core Remove xxx_t typedefs from the core component. Signed-off-by: Takashi Iwai --- include/sound/asound.h | 540 ++++++++++++++++++++++++------------------------- include/sound/core.h | 199 ++++++++---------- sound/core/device.c | 42 ++-- sound/core/init.c | 86 ++++---- sound/core/sound.c | 32 +-- 5 files changed, 432 insertions(+), 467 deletions(-) diff --git a/include/sound/asound.h b/include/sound/asound.h index 1389704d8d6..9cc021c7ee1 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -60,7 +60,7 @@ * * ****************************************************************************/ -struct sndrv_aes_iec958 { +struct snd_aes_iec958 { unsigned char status[24]; /* AES/IEC958 channel status bits */ unsigned char subcode[147]; /* AES/IEC958 subcode bits */ unsigned char pad; /* nothing */ @@ -75,7 +75,7 @@ struct sndrv_aes_iec958 { #define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) -enum sndrv_hwdep_iface { +enum { SNDRV_HWDEP_IFACE_OPL2 = 0, SNDRV_HWDEP_IFACE_OPL3, SNDRV_HWDEP_IFACE_OPL4, @@ -97,17 +97,17 @@ enum sndrv_hwdep_iface { SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC }; -struct sndrv_hwdep_info { +struct snd_hwdep_info { unsigned int device; /* WR: device number */ int card; /* R: card number */ unsigned char id[64]; /* ID (user selectable) */ unsigned char name[80]; /* hwdep name */ - enum sndrv_hwdep_iface iface; /* hwdep interface */ + int iface; /* hwdep interface */ unsigned char reserved[64]; /* reserved for future */ }; /* generic DSP loader */ -struct sndrv_hwdep_dsp_status { +struct snd_hwdep_dsp_status { unsigned int version; /* R: driver-specific version */ unsigned char id[32]; /* R: driver-specific ID string */ unsigned int num_dsps; /* R: number of DSP images to transfer */ @@ -116,7 +116,7 @@ struct sndrv_hwdep_dsp_status { unsigned char reserved[16]; /* reserved for future use */ }; -struct sndrv_hwdep_dsp_image { +struct snd_hwdep_dsp_image { unsigned int index; /* W: DSP index */ unsigned char name[64]; /* W: ID (e.g. file name) */ unsigned char __user *image; /* W: binary image */ @@ -126,9 +126,9 @@ struct sndrv_hwdep_dsp_image { enum { SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int), - SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct sndrv_hwdep_info), - SNDRV_HWDEP_IOCTL_DSP_STATUS = _IOR('H', 0x02, struct sndrv_hwdep_dsp_status), - SNDRV_HWDEP_IOCTL_DSP_LOAD = _IOW('H', 0x03, struct sndrv_hwdep_dsp_image) + SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct snd_hwdep_info), + SNDRV_HWDEP_IOCTL_DSP_STATUS = _IOR('H', 0x02, struct snd_hwdep_dsp_status), + SNDRV_HWDEP_IOCTL_DSP_LOAD = _IOW('H', 0x03, struct snd_hwdep_dsp_image) }; /***************************************************************************** @@ -139,10 +139,10 @@ enum { #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) -typedef unsigned long sndrv_pcm_uframes_t; -typedef long sndrv_pcm_sframes_t; +typedef unsigned long snd_pcm_uframes_t; +typedef signed long snd_pcm_sframes_t; -enum sndrv_pcm_class { +enum { SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ SNDRV_PCM_CLASS_MULTI, /* multichannel device */ SNDRV_PCM_CLASS_MODEM, /* software modem class */ @@ -151,97 +151,94 @@ enum sndrv_pcm_class { SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, }; -enum sndrv_pcm_subclass { +enum { SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */ SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ /* Don't forget to change the following: */ SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, }; -enum sndrv_pcm_stream { +enum { SNDRV_PCM_STREAM_PLAYBACK = 0, SNDRV_PCM_STREAM_CAPTURE, SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, }; -enum sndrv_pcm_access { - SNDRV_PCM_ACCESS_MMAP_INTERLEAVED = 0, /* interleaved mmap */ - SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED, /* noninterleaved mmap */ - SNDRV_PCM_ACCESS_MMAP_COMPLEX, /* complex mmap */ - SNDRV_PCM_ACCESS_RW_INTERLEAVED, /* readi/writei */ - SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, /* readn/writen */ - SNDRV_PCM_ACCESS_LAST = SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, -}; - -enum sndrv_pcm_format { - SNDRV_PCM_FORMAT_S8 = 0, - SNDRV_PCM_FORMAT_U8, - SNDRV_PCM_FORMAT_S16_LE, - SNDRV_PCM_FORMAT_S16_BE, - SNDRV_PCM_FORMAT_U16_LE, - SNDRV_PCM_FORMAT_U16_BE, - SNDRV_PCM_FORMAT_S24_LE, /* low three bytes */ - SNDRV_PCM_FORMAT_S24_BE, /* low three bytes */ - SNDRV_PCM_FORMAT_U24_LE, /* low three bytes */ - SNDRV_PCM_FORMAT_U24_BE, /* low three bytes */ - SNDRV_PCM_FORMAT_S32_LE, - SNDRV_PCM_FORMAT_S32_BE, - SNDRV_PCM_FORMAT_U32_LE, - SNDRV_PCM_FORMAT_U32_BE, - SNDRV_PCM_FORMAT_FLOAT_LE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ - SNDRV_PCM_FORMAT_FLOAT_BE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ - SNDRV_PCM_FORMAT_FLOAT64_LE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ - SNDRV_PCM_FORMAT_FLOAT64_BE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ - SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, /* IEC-958 subframe, Little Endian */ - SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, /* IEC-958 subframe, Big Endian */ - SNDRV_PCM_FORMAT_MU_LAW, - SNDRV_PCM_FORMAT_A_LAW, - SNDRV_PCM_FORMAT_IMA_ADPCM, - SNDRV_PCM_FORMAT_MPEG, - SNDRV_PCM_FORMAT_GSM, - SNDRV_PCM_FORMAT_SPECIAL = 31, - SNDRV_PCM_FORMAT_S24_3LE = 32, /* in three bytes */ - SNDRV_PCM_FORMAT_S24_3BE, /* in three bytes */ - SNDRV_PCM_FORMAT_U24_3LE, /* in three bytes */ - SNDRV_PCM_FORMAT_U24_3BE, /* in three bytes */ - SNDRV_PCM_FORMAT_S20_3LE, /* in three bytes */ - SNDRV_PCM_FORMAT_S20_3BE, /* in three bytes */ - SNDRV_PCM_FORMAT_U20_3LE, /* in three bytes */ - SNDRV_PCM_FORMAT_U20_3BE, /* in three bytes */ - SNDRV_PCM_FORMAT_S18_3LE, /* in three bytes */ - SNDRV_PCM_FORMAT_S18_3BE, /* in three bytes */ - SNDRV_PCM_FORMAT_U18_3LE, /* in three bytes */ - SNDRV_PCM_FORMAT_U18_3BE, /* in three bytes */ - SNDRV_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_U18_3BE, +typedef int __bitwise snd_pcm_access_t; +#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */ +#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */ +#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */ +#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */ +#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */ +#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED + +typedef int __bitwise snd_pcm_format_t; +#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0) +#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1) +#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2) +#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3) +#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4) +#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5) +#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */ +#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */ +#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */ +#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */ +#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10) +#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11) +#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12) +#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13) +#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ +#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ +#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ +#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ +#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */ +#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */ +#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20) +#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21) +#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22) +#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23) +#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24) +#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31) +#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */ +#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */ +#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */ +#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */ +#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */ +#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */ +#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */ +#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */ +#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */ +#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ +#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ +#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ +#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE #ifdef SNDRV_LITTLE_ENDIAN - SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_LE, - SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_LE, - SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_LE, - SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_LE, - SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_LE, - SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_LE, - SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_LE, - SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_LE, - SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, +#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE +#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE +#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE +#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE +#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE +#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE +#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE +#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE +#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE #endif #ifdef SNDRV_BIG_ENDIAN - SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_BE, - SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_BE, - SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_BE, - SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_BE, - SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_BE, - SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_BE, - SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_BE, - SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_BE, - SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, +#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE +#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE +#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE +#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE +#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE +#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE +#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE +#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE +#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE #endif -}; -enum sndrv_pcm_subformat { - SNDRV_PCM_SUBFORMAT_STD = 0, - SNDRV_PCM_SUBFORMAT_LAST = SNDRV_PCM_SUBFORMAT_STD, -}; +typedef int __bitwise snd_pcm_subformat_t; +#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0) +#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD #define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ #define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */ @@ -258,18 +255,17 @@ enum sndrv_pcm_subformat { #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ -enum sndrv_pcm_state { - SNDRV_PCM_STATE_OPEN = 0, /* stream is open */ - SNDRV_PCM_STATE_SETUP, /* stream has a setup */ - SNDRV_PCM_STATE_PREPARED, /* stream is ready to start */ - SNDRV_PCM_STATE_RUNNING, /* stream is running */ - SNDRV_PCM_STATE_XRUN, /* stream reached an xrun */ - SNDRV_PCM_STATE_DRAINING, /* stream is draining */ - SNDRV_PCM_STATE_PAUSED, /* stream is paused */ - SNDRV_PCM_STATE_SUSPENDED, /* hardware is suspended */ - SNDRV_PCM_STATE_DISCONNECTED, /* hardware is disconnected */ - SNDRV_PCM_STATE_LAST = SNDRV_PCM_STATE_DISCONNECTED, -}; +typedef int __bitwise snd_pcm_state_t; +#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ +#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */ +#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */ +#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */ +#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */ +#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */ +#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */ +#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */ +#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */ +#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED enum { SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, @@ -277,55 +273,53 @@ enum { SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, }; -union sndrv_pcm_sync_id { +union snd_pcm_sync_id { unsigned char id[16]; unsigned short id16[8]; unsigned int id32[4]; }; -struct sndrv_pcm_info { +struct snd_pcm_info { unsigned int device; /* RO/WR (control): device number */ unsigned int subdevice; /* RO/WR (control): subdevice number */ - enum sndrv_pcm_stream stream; /* RO/WR (control): stream number */ + int stream; /* RO/WR (control): stream direction */ int card; /* R: card number */ unsigned char id[64]; /* ID (user selectable) */ unsigned char name[80]; /* name of this device */ unsigned char subname[32]; /* subdevice name */ - enum sndrv_pcm_class dev_class; /* SNDRV_PCM_CLASS_* */ - enum sndrv_pcm_subclass dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ + int dev_class; /* SNDRV_PCM_CLASS_* */ + int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ unsigned int subdevices_count; unsigned int subdevices_avail; - union sndrv_pcm_sync_id sync; /* hardware synchronization ID */ + union snd_pcm_sync_id sync; /* hardware synchronization ID */ unsigned char reserved[64]; /* reserved for future... */ }; -enum sndrv_pcm_hw_param { - SNDRV_PCM_HW_PARAM_ACCESS = 0, /* Access type */ - SNDRV_PCM_HW_PARAM_FIRST_MASK = SNDRV_PCM_HW_PARAM_ACCESS, - SNDRV_PCM_HW_PARAM_FORMAT, /* Format */ - SNDRV_PCM_HW_PARAM_SUBFORMAT, /* Subformat */ - SNDRV_PCM_HW_PARAM_LAST_MASK = SNDRV_PCM_HW_PARAM_SUBFORMAT, - - SNDRV_PCM_HW_PARAM_SAMPLE_BITS = 8, /* Bits per sample */ - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = SNDRV_PCM_HW_PARAM_SAMPLE_BITS, - SNDRV_PCM_HW_PARAM_FRAME_BITS, /* Bits per frame */ - SNDRV_PCM_HW_PARAM_CHANNELS, /* Channels */ - SNDRV_PCM_HW_PARAM_RATE, /* Approx rate */ - SNDRV_PCM_HW_PARAM_PERIOD_TIME, /* Approx distance between interrupts - in us */ - SNDRV_PCM_HW_PARAM_PERIOD_SIZE, /* Approx frames between interrupts */ - SNDRV_PCM_HW_PARAM_PERIOD_BYTES, /* Approx bytes between interrupts */ - SNDRV_PCM_HW_PARAM_PERIODS, /* Approx interrupts per buffer */ - SNDRV_PCM_HW_PARAM_BUFFER_TIME, /* Approx duration of buffer in us */ - SNDRV_PCM_HW_PARAM_BUFFER_SIZE, /* Size of buffer in frames */ - SNDRV_PCM_HW_PARAM_BUFFER_BYTES, /* Size of buffer in bytes */ - SNDRV_PCM_HW_PARAM_TICK_TIME, /* Approx tick duration in us */ - SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME -}; +typedef int __bitwise snd_pcm_hw_param_t; +#define SNDRV_PCM_HW_PARAM_ACCESS ((__force snd_pcm_hw_param_t) 0) /* Access type */ +#define SNDRV_PCM_HW_PARAM_FORMAT ((__force snd_pcm_hw_param_t) 1) /* Format */ +#define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */ +#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS +#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT + +#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */ +#define SNDRV_PCM_HW_PARAM_FRAME_BITS ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */ +#define SNDRV_PCM_HW_PARAM_CHANNELS ((__force snd_pcm_hw_param_t) 10) /* Channels */ +#define SNDRV_PCM_HW_PARAM_RATE ((__force snd_pcm_hw_param_t) 11) /* Approx rate */ +#define SNDRV_PCM_HW_PARAM_PERIOD_TIME ((__force snd_pcm_hw_param_t) 12) /* Approx distance between interrupts in us */ +#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE ((__force snd_pcm_hw_param_t) 13) /* Approx frames between interrupts */ +#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES ((__force snd_pcm_hw_param_t) 14) /* Approx bytes between interrupts */ +#define SNDRV_PCM_HW_PARAM_PERIODS ((__force snd_pcm_hw_param_t) 15) /* Approx interrupts per buffer */ +#define SNDRV_PCM_HW_PARAM_BUFFER_TIME ((__force snd_pcm_hw_param_t) 16) /* Approx duration of buffer in us */ +#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE ((__force snd_pcm_hw_param_t) 17) /* Size of buffer in frames */ +#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES ((__force snd_pcm_hw_param_t) 18) /* Size of buffer in bytes */ +#define SNDRV_PCM_HW_PARAM_TICK_TIME ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */ +#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS +#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ -struct sndrv_interval { +struct snd_interval { unsigned int min, max; unsigned int openmin:1, openmax:1, @@ -335,137 +329,137 @@ struct sndrv_interval { #define SNDRV_MASK_MAX 256 -struct sndrv_mask { +struct snd_mask { u_int32_t bits[(SNDRV_MASK_MAX+31)/32]; }; -struct sndrv_pcm_hw_params { +struct snd_pcm_hw_params { unsigned int flags; - struct sndrv_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - + struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; - struct sndrv_mask mres[5]; /* reserved masks */ - struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - + struct snd_mask mres[5]; /* reserved masks */ + struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; - struct sndrv_interval ires[9]; /* reserved intervals */ + struct snd_interval ires[9]; /* reserved intervals */ unsigned int rmask; /* W: requested masks */ unsigned int cmask; /* R: changed masks */ unsigned int info; /* R: Info flags for returned setup */ unsigned int msbits; /* R: used most significant bits */ unsigned int rate_num; /* R: rate numerator */ unsigned int rate_den; /* R: rate denominator */ - sndrv_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ + snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ unsigned char reserved[64]; /* reserved for future */ }; -enum sndrv_pcm_tstamp { +enum { SNDRV_PCM_TSTAMP_NONE = 0, SNDRV_PCM_TSTAMP_MMAP, SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, }; -struct sndrv_pcm_sw_params { - enum sndrv_pcm_tstamp tstamp_mode; /* timestamp mode */ +struct snd_pcm_sw_params { + int tstamp_mode; /* timestamp mode */ unsigned int period_step; unsigned int sleep_min; /* min ticks to sleep */ - sndrv_pcm_uframes_t avail_min; /* min avail frames for wakeup */ - sndrv_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ - sndrv_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ - sndrv_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ - sndrv_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ - sndrv_pcm_uframes_t silence_size; /* silence block size */ - sndrv_pcm_uframes_t boundary; /* pointers wrap point */ + snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */ + snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ + snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ + snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ + snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ + snd_pcm_uframes_t silence_size; /* silence block size */ + snd_pcm_uframes_t boundary; /* pointers wrap point */ unsigned char reserved[64]; /* reserved for future */ }; -struct sndrv_pcm_channel_info { +struct snd_pcm_channel_info { unsigned int channel; off_t offset; /* mmap offset */ unsigned int first; /* offset to first sample in bits */ unsigned int step; /* samples distance in bits */ }; -struct sndrv_pcm_status { - enum sndrv_pcm_state state; /* stream state */ +struct snd_pcm_status { + snd_pcm_state_t state; /* stream state */ struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ struct timespec tstamp; /* reference timestamp */ - sndrv_pcm_uframes_t appl_ptr; /* appl ptr */ - sndrv_pcm_uframes_t hw_ptr; /* hw ptr */ - sndrv_pcm_sframes_t delay; /* current delay in frames */ - sndrv_pcm_uframes_t avail; /* number of frames available */ - sndrv_pcm_uframes_t avail_max; /* max frames available on hw since last status */ - sndrv_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ - enum sndrv_pcm_state suspended_state; /* suspended stream state */ + snd_pcm_uframes_t appl_ptr; /* appl ptr */ + snd_pcm_uframes_t hw_ptr; /* hw ptr */ + snd_pcm_sframes_t delay; /* current delay in frames */ + snd_pcm_uframes_t avail; /* number of frames available */ + snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */ + snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ + snd_pcm_state_t suspended_state; /* suspended stream state */ unsigned char reserved[60]; /* must be filled with zero */ }; -struct sndrv_pcm_mmap_status { - enum sndrv_pcm_state state; /* RO: state - SNDRV_PCM_STATE_XXXX */ +struct snd_pcm_mmap_status { + snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */ int pad1; /* Needed for 64 bit alignment */ - sndrv_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ + snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ struct timespec tstamp; /* Timestamp */ - enum sndrv_pcm_state suspended_state; /* RO: suspended stream state */ + snd_pcm_state_t suspended_state; /* RO: suspended stream state */ }; -struct sndrv_pcm_mmap_control { - sndrv_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ - sndrv_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ +struct snd_pcm_mmap_control { + snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ + snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ }; #define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ #define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */ #define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */ -struct sndrv_pcm_sync_ptr { +struct snd_pcm_sync_ptr { unsigned int flags; union { - struct sndrv_pcm_mmap_status status; + struct snd_pcm_mmap_status status; unsigned char reserved[64]; } s; union { - struct sndrv_pcm_mmap_control control; + struct snd_pcm_mmap_control control; unsigned char reserved[64]; } c; }; -struct sndrv_xferi { - sndrv_pcm_sframes_t result; +struct snd_xferi { + snd_pcm_sframes_t result; void __user *buf; - sndrv_pcm_uframes_t frames; + snd_pcm_uframes_t frames; }; -struct sndrv_xfern { - sndrv_pcm_sframes_t result; +struct snd_xfern { + snd_pcm_sframes_t result; void __user * __user *bufs; - sndrv_pcm_uframes_t frames; + snd_pcm_uframes_t frames; }; enum { SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), - SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct sndrv_pcm_info), + SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info), SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int), - SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct sndrv_pcm_hw_params), - SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct sndrv_pcm_hw_params), + SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params), + SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params), SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), - SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct sndrv_pcm_sw_params), - SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status), - SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t), + SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct snd_pcm_sw_params), + SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct snd_pcm_status), + SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, snd_pcm_sframes_t), SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22), - SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct sndrv_pcm_sync_ptr), - SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info), + SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct snd_pcm_sync_ptr), + SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct snd_pcm_channel_info), SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40), SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41), SNDRV_PCM_IOCTL_START = _IO('A', 0x42), SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43), SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44), SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int), - SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, sndrv_pcm_uframes_t), + SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, snd_pcm_uframes_t), SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47), SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48), - SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, sndrv_pcm_uframes_t), - SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct sndrv_xferi), - SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct sndrv_xferi), - SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct sndrv_xfern), - SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct sndrv_xfern), + SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, snd_pcm_uframes_t), + SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct snd_xferi), + SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct snd_xferi), + SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct snd_xfern), + SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct snd_xfern), SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int), SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61), }; @@ -485,7 +479,7 @@ enum { #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) -enum sndrv_rawmidi_stream { +enum { SNDRV_RAWMIDI_STREAM_OUTPUT = 0, SNDRV_RAWMIDI_STREAM_INPUT, SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, @@ -495,10 +489,10 @@ enum sndrv_rawmidi_stream { #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 -struct sndrv_rawmidi_info { +struct snd_rawmidi_info { unsigned int device; /* RO/WR (control): device number */ unsigned int subdevice; /* RO/WR (control): subdevice number */ - enum sndrv_rawmidi_stream stream; /* WR: stream */ + int stream; /* WR: stream */ int card; /* R: card number */ unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ unsigned char id[64]; /* ID (user selectable) */ @@ -509,16 +503,16 @@ struct sndrv_rawmidi_info { unsigned char reserved[64]; /* reserved for future use */ }; -struct sndrv_rawmidi_params { - enum sndrv_rawmidi_stream stream; +struct snd_rawmidi_params { + int stream; size_t buffer_size; /* queue size in bytes */ size_t avail_min; /* minimum avail bytes for wakeup */ unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */ unsigned char reserved[16]; /* reserved for future use */ }; -struct sndrv_rawmidi_status { - enum sndrv_rawmidi_stream stream; +struct snd_rawmidi_status { + int stream; struct timespec tstamp; /* Timestamp */ size_t avail; /* available bytes */ size_t xruns; /* count of overruns since last status (in bytes) */ @@ -527,9 +521,9 @@ struct sndrv_rawmidi_status { enum { SNDRV_RAWMIDI_IOCTL_PVERSION = _IOR('W', 0x00, int), - SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct sndrv_rawmidi_info), - SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct sndrv_rawmidi_params), - SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct sndrv_rawmidi_status), + SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct snd_rawmidi_info), + SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct snd_rawmidi_params), + SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct snd_rawmidi_status), SNDRV_RAWMIDI_IOCTL_DROP = _IOW('W', 0x30, int), SNDRV_RAWMIDI_IOCTL_DRAIN = _IOW('W', 0x31, int), }; @@ -540,7 +534,7 @@ enum { #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) -enum sndrv_timer_class { +enum { SNDRV_TIMER_CLASS_NONE = -1, SNDRV_TIMER_CLASS_SLAVE = 0, SNDRV_TIMER_CLASS_GLOBAL, @@ -550,7 +544,7 @@ enum sndrv_timer_class { }; /* slave timer classes */ -enum sndrv_timer_slave_class { +enum { SNDRV_TIMER_SCLASS_NONE = 0, SNDRV_TIMER_SCLASS_APPLICATION, SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ @@ -566,16 +560,16 @@ enum sndrv_timer_slave_class { /* info flags */ #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ -struct sndrv_timer_id { - enum sndrv_timer_class dev_class; - enum sndrv_timer_slave_class dev_sclass; +struct snd_timer_id { + int dev_class; + int dev_sclass; int card; int device; int subdevice; }; -struct sndrv_timer_ginfo { - struct sndrv_timer_id tid; /* requested timer ID */ +struct snd_timer_ginfo { + struct snd_timer_id tid; /* requested timer ID */ unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ int card; /* card number */ unsigned char id[64]; /* timer identification */ @@ -588,27 +582,27 @@ struct sndrv_timer_ginfo { unsigned char reserved[32]; }; -struct sndrv_timer_gparams { - struct sndrv_timer_id tid; /* requested timer ID */ +struct snd_timer_gparams { + struct snd_timer_id tid; /* requested timer ID */ unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ unsigned char reserved[32]; }; -struct sndrv_timer_gstatus { - struct sndrv_timer_id tid; /* requested timer ID */ +struct snd_timer_gstatus { + struct snd_timer_id tid; /* requested timer ID */ unsigned long resolution; /* current period resolution in ns */ unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ unsigned char reserved[32]; }; -struct sndrv_timer_select { - struct sndrv_timer_id id; /* bind to timer ID */ +struct snd_timer_select { + struct snd_timer_id id; /* bind to timer ID */ unsigned char reserved[32]; /* reserved */ }; -struct sndrv_timer_info { +struct snd_timer_info { unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ int card; /* card number */ unsigned char id[64]; /* timer identificator */ @@ -622,7 +616,7 @@ struct sndrv_timer_info { #define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */ #define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */ -struct sndrv_timer_params { +struct snd_timer_params { unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ unsigned int ticks; /* requested resolution in ticks */ unsigned int queue_size; /* total size of queue (32-1024) */ @@ -631,7 +625,7 @@ struct sndrv_timer_params { unsigned char reserved[60]; /* reserved */ }; -struct sndrv_timer_status { +struct snd_timer_status { struct timespec tstamp; /* Timestamp - last update */ unsigned int resolution; /* current period resolution in ns */ unsigned int lost; /* counter of master tick lost */ @@ -642,15 +636,15 @@ struct sndrv_timer_status { enum { SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int), - SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, struct sndrv_timer_id), + SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, struct snd_timer_id), SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int), - SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct sndrv_timer_ginfo), - SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct sndrv_timer_gparams), - SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct sndrv_timer_gstatus), - SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct sndrv_timer_select), - SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), - SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), - SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), + SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct snd_timer_ginfo), + SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct snd_timer_gparams), + SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct snd_timer_gstatus), + SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct snd_timer_select), + SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct snd_timer_info), + SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct snd_timer_params), + SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct snd_timer_status), /* The following four ioctls are changed since 1.0.9 due to confliction */ SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0), SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1), @@ -658,12 +652,12 @@ enum { SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3), }; -struct sndrv_timer_read { +struct snd_timer_read { unsigned int resolution; unsigned int ticks; }; -enum sndrv_timer_event { +enum { SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ SNDRV_TIMER_EVENT_TICK, /* val = ticks */ SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ @@ -682,8 +676,8 @@ enum sndrv_timer_event { SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, }; -struct sndrv_timer_tread { - enum sndrv_timer_event event; +struct snd_timer_tread { + int event; struct timespec tstamp; unsigned int val; }; @@ -696,7 +690,7 @@ struct sndrv_timer_tread { #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) -struct sndrv_ctl_card_info { +struct snd_ctl_card_info { int card; /* card number */ int pad; /* reserved for future (was type) */ unsigned char id[16]; /* ID of card (user selectable) */ @@ -709,27 +703,25 @@ struct sndrv_ctl_card_info { unsigned char reserved[48]; /* reserved for future */ }; -enum sndrv_ctl_elem_type { - SNDRV_CTL_ELEM_TYPE_NONE = 0, /* invalid */ - SNDRV_CTL_ELEM_TYPE_BOOLEAN, /* boolean type */ - SNDRV_CTL_ELEM_TYPE_INTEGER, /* integer type */ - SNDRV_CTL_ELEM_TYPE_ENUMERATED, /* enumerated type */ - SNDRV_CTL_ELEM_TYPE_BYTES, /* byte array */ - SNDRV_CTL_ELEM_TYPE_IEC958, /* IEC958 (S/PDIF) setup */ - SNDRV_CTL_ELEM_TYPE_INTEGER64, /* 64-bit integer type */ - SNDRV_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_INTEGER64, -}; - -enum sndrv_ctl_elem_iface { - SNDRV_CTL_ELEM_IFACE_CARD = 0, /* global control */ - SNDRV_CTL_ELEM_IFACE_HWDEP, /* hardware dependent device */ - SNDRV_CTL_ELEM_IFACE_MIXER, /* virtual mixer device */ - SNDRV_CTL_ELEM_IFACE_PCM, /* PCM device */ - SNDRV_CTL_ELEM_IFACE_RAWMIDI, /* RawMidi device */ - SNDRV_CTL_ELEM_IFACE_TIMER, /* timer device */ - SNDRV_CTL_ELEM_IFACE_SEQUENCER, /* sequencer client */ - SNDRV_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_SEQUENCER, -}; +typedef int __bitwise snd_ctl_elem_type_t; +#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */ +#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */ +#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */ +#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */ +#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */ +#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */ +#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */ +#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64 + +typedef int __bitwise snd_ctl_elem_iface_t; +#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */ +#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */ +#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */ +#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */ +#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */ +#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */ +#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */ +#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER #define SNDRV_CTL_ELEM_ACCESS_READ (1<<0) #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) @@ -751,27 +743,27 @@ enum sndrv_ctl_elem_iface { #define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */ #define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */ -struct sndrv_ctl_elem_id { +struct snd_ctl_elem_id { unsigned int numid; /* numeric identifier, zero = invalid */ - enum sndrv_ctl_elem_iface iface; /* interface identifier */ + snd_ctl_elem_iface_t iface; /* interface identifier */ unsigned int device; /* device/client number */ unsigned int subdevice; /* subdevice (substream) number */ unsigned char name[44]; /* ASCII name of item */ unsigned int index; /* index of item */ }; -struct sndrv_ctl_elem_list { +struct snd_ctl_elem_list { unsigned int offset; /* W: first element ID to get */ unsigned int space; /* W: count of element IDs to get */ unsigned int used; /* R: count of element IDs set */ unsigned int count; /* R: count of all elements */ - struct sndrv_ctl_elem_id __user *pids; /* R: IDs */ + struct snd_ctl_elem_id __user *pids; /* R: IDs */ unsigned char reserved[50]; }; -struct sndrv_ctl_elem_info { - struct sndrv_ctl_elem_id id; /* W: element ID */ - enum sndrv_ctl_elem_type type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ +struct snd_ctl_elem_info { + struct snd_ctl_elem_id id; /* W: element ID */ + snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ unsigned int count; /* count of values */ pid_t owner; /* owner's PID of this control */ @@ -800,8 +792,8 @@ struct sndrv_ctl_elem_info { unsigned char reserved[64-4*sizeof(unsigned short)]; }; -struct sndrv_ctl_elem_value { - struct sndrv_ctl_elem_id id; /* W: element ID */ +struct snd_ctl_elem_value { + struct snd_ctl_elem_id id; /* W: element ID */ unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ union { union { @@ -820,7 +812,7 @@ struct sndrv_ctl_elem_value { unsigned char data[512]; unsigned char *data_ptr; } bytes; - struct sndrv_aes_iec958 iec958; + struct snd_aes_iec958 iec958; } value; /* RO */ struct timespec tstamp; unsigned char reserved[128-sizeof(struct timespec)]; @@ -828,24 +820,24 @@ struct sndrv_ctl_elem_value { enum { SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int), - SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct sndrv_ctl_card_info), - SNDRV_CTL_IOCTL_ELEM_LIST = _IOWR('U', 0x10, struct sndrv_ctl_elem_list), - SNDRV_CTL_IOCTL_ELEM_INFO = _IOWR('U', 0x11, struct sndrv_ctl_elem_info), - SNDRV_CTL_IOCTL_ELEM_READ = _IOWR('U', 0x12, struct sndrv_ctl_elem_value), - SNDRV_CTL_IOCTL_ELEM_WRITE = _IOWR('U', 0x13, struct sndrv_ctl_elem_value), - SNDRV_CTL_IOCTL_ELEM_LOCK = _IOW('U', 0x14, struct sndrv_ctl_elem_id), - SNDRV_CTL_IOCTL_ELEM_UNLOCK = _IOW('U', 0x15, struct sndrv_ctl_elem_id), + SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct snd_ctl_card_info), + SNDRV_CTL_IOCTL_ELEM_LIST = _IOWR('U', 0x10, struct snd_ctl_elem_list), + SNDRV_CTL_IOCTL_ELEM_INFO = _IOWR('U', 0x11, struct snd_ctl_elem_info), + SNDRV_CTL_IOCTL_ELEM_READ = _IOWR('U', 0x12, struct snd_ctl_elem_value), + SNDRV_CTL_IOCTL_ELEM_WRITE = _IOWR('U', 0x13, struct snd_ctl_elem_value), + SNDRV_CTL_IOCTL_ELEM_LOCK = _IOW('U', 0x14, struct snd_ctl_elem_id), + SNDRV_CTL_IOCTL_ELEM_UNLOCK = _IOW('U', 0x15, struct snd_ctl_elem_id), SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int), - SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct sndrv_ctl_elem_info), - SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct sndrv_ctl_elem_info), - SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct sndrv_ctl_elem_id), + SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct snd_ctl_elem_info), + SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct snd_ctl_elem_info), + SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct snd_ctl_elem_id), SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int), - SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct sndrv_hwdep_info), + SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct snd_hwdep_info), SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int), - SNDRV_CTL_IOCTL_PCM_INFO = _IOWR('U', 0x31, struct sndrv_pcm_info), + SNDRV_CTL_IOCTL_PCM_INFO = _IOWR('U', 0x31, struct snd_pcm_info), SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE = _IOW('U', 0x32, int), SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE = _IOWR('U', 0x40, int), - SNDRV_CTL_IOCTL_RAWMIDI_INFO = _IOWR('U', 0x41, struct sndrv_rawmidi_info), + SNDRV_CTL_IOCTL_RAWMIDI_INFO = _IOWR('U', 0x41, struct snd_rawmidi_info), SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int), SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int), SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int), @@ -865,12 +857,12 @@ enum sndrv_ctl_event_type { #define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ -struct sndrv_ctl_event { - enum sndrv_ctl_event_type type; /* event type - SNDRV_CTL_EVENT_* */ +struct snd_ctl_event { + int type; /* event type - SNDRV_CTL_EVENT_* */ union { struct { unsigned int mask; - struct sndrv_ctl_elem_id id; + struct snd_ctl_elem_id id; } elem; unsigned char data8[60]; } data; @@ -898,14 +890,14 @@ struct sndrv_ctl_event { * */ -struct sndrv_xferv { +struct snd_xferv { const struct iovec *vector; unsigned long count; }; enum { - SNDRV_IOCTL_READV = _IOW('K', 0x00, struct sndrv_xferv), - SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct sndrv_xferv), + SNDRV_IOCTL_READV = _IOW('K', 0x00, struct snd_xferv), + SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct snd_xferv), }; #endif /* __SOUND_ASOUND_H */ diff --git a/include/sound/core.h b/include/sound/core.h index 2be65ad2fd8..f867433e65f 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -28,13 +28,6 @@ #include /* struct workqueue_struct */ #include /* pm_message_t */ -/* Typedef's */ -typedef struct sndrv_interval snd_interval_t; -typedef enum sndrv_card_type snd_card_type; -typedef struct sndrv_xferi snd_xferi_t; -typedef struct sndrv_xfern snd_xfern_t; -typedef struct sndrv_xferv snd_xferv_t; - /* forward declarations */ #ifdef CONFIG_PCI struct pci_dev; @@ -47,76 +40,50 @@ struct sbus_dev; #define SNDRV_DEV_TYPE_RANGE_SIZE 0x1000 -typedef enum { - SNDRV_DEV_TOPLEVEL = (0*SNDRV_DEV_TYPE_RANGE_SIZE), - SNDRV_DEV_CONTROL, - SNDRV_DEV_LOWLEVEL_PRE, - SNDRV_DEV_LOWLEVEL_NORMAL = (1*SNDRV_DEV_TYPE_RANGE_SIZE), - SNDRV_DEV_PCM, - SNDRV_DEV_RAWMIDI, - SNDRV_DEV_TIMER, - SNDRV_DEV_SEQUENCER, - SNDRV_DEV_HWDEP, - SNDRV_DEV_INFO, - SNDRV_DEV_BUS, - SNDRV_DEV_CODEC, - SNDRV_DEV_LOWLEVEL = (2*SNDRV_DEV_TYPE_RANGE_SIZE) -} snd_device_type_t; - -typedef enum { - SNDRV_DEV_BUILD, - SNDRV_DEV_REGISTERED, - SNDRV_DEV_DISCONNECTED -} snd_device_state_t; - -typedef enum { - SNDRV_DEV_CMD_PRE = 0, - SNDRV_DEV_CMD_NORMAL = 1, - SNDRV_DEV_CMD_POST = 2 -} snd_device_cmd_t; - -typedef struct _snd_card snd_card_t; -typedef struct _snd_device snd_device_t; - -typedef int (snd_dev_free_t)(snd_device_t *device); -typedef int (snd_dev_register_t)(snd_device_t *device); -typedef int (snd_dev_disconnect_t)(snd_device_t *device); -typedef int (snd_dev_unregister_t)(snd_device_t *device); - -typedef struct { - snd_dev_free_t *dev_free; - snd_dev_register_t *dev_register; - snd_dev_disconnect_t *dev_disconnect; - snd_dev_unregister_t *dev_unregister; -} snd_device_ops_t; - -struct _snd_device { +typedef int __bitwise snd_device_type_t; +#define SNDRV_DEV_TOPLEVEL ((__force snd_device_type_t) 0) +#define SNDRV_DEV_CONTROL ((__force snd_device_type_t) 1) +#define SNDRV_DEV_LOWLEVEL_PRE ((__force snd_device_type_t) 2) +#define SNDRV_DEV_LOWLEVEL_NORMAL ((__force snd_device_type_t) 0x1000) +#define SNDRV_DEV_PCM ((__force snd_device_type_t) 0x1001) +#define SNDRV_DEV_RAWMIDI ((__force snd_device_type_t) 0x1002) +#define SNDRV_DEV_TIMER ((__force snd_device_type_t) 0x1003) +#define SNDRV_DEV_SEQUENCER ((__force snd_device_type_t) 0x1004) +#define SNDRV_DEV_HWDEP ((__force snd_device_type_t) 0x1005) +#define SNDRV_DEV_INFO ((__force snd_device_type_t) 0x1006) +#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007) +#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008) +#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000) + +typedef int __bitwise snd_device_state_t; +#define SNDRV_DEV_BUILD ((__force snd_device_state_t) 0) +#define SNDRV_DEV_REGISTERED ((__force snd_device_state_t) 1) +#define SNDRV_DEV_DISCONNECTED ((__force snd_device_state_t) 2) + +typedef int __bitwise snd_device_cmd_t; +#define SNDRV_DEV_CMD_PRE ((__force snd_device_cmd_t) 0) +#define SNDRV_DEV_CMD_NORMAL ((__force snd_device_cmd_t) 1) +#define SNDRV_DEV_CMD_POST ((__force snd_device_cmd_t) 2) + +struct snd_device; + +struct snd_device_ops { + int (*dev_free)(struct snd_device *dev); + int (*dev_register)(struct snd_device *dev); + int (*dev_disconnect)(struct snd_device *dev); + int (*dev_unregister)(struct snd_device *dev); +}; + +struct snd_device { struct list_head list; /* list of registered devices */ - snd_card_t *card; /* card which holds this device */ + struct snd_card *card; /* card which holds this device */ snd_device_state_t state; /* state of the device */ snd_device_type_t type; /* device type */ void *device_data; /* device structure */ - snd_device_ops_t *ops; /* operations */ + struct snd_device_ops *ops; /* operations */ }; -#define snd_device(n) list_entry(n, snd_device_t, list) - -/* various typedefs */ - -typedef struct snd_info_entry snd_info_entry_t; -typedef struct _snd_pcm snd_pcm_t; -typedef struct _snd_pcm_str snd_pcm_str_t; -typedef struct _snd_pcm_substream snd_pcm_substream_t; -typedef struct _snd_mixer snd_kmixer_t; -typedef struct _snd_rawmidi snd_rawmidi_t; -typedef struct _snd_ctl_file snd_ctl_file_t; -typedef struct _snd_kcontrol snd_kcontrol_t; -typedef struct _snd_timer snd_timer_t; -typedef struct _snd_timer_instance snd_timer_instance_t; -typedef struct _snd_hwdep snd_hwdep_t; -#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) -typedef struct _snd_oss_mixer snd_mixer_oss_t; -#endif +#define snd_device(n) list_entry(n, struct snd_device, list) /* monitor files for graceful shutdown (hotplug) */ @@ -129,7 +96,7 @@ struct snd_shutdown_f_ops; /* define it later in init.c */ /* main structure for soundcard */ -struct _snd_card { +struct snd_card { int number; /* number of soundcard (index to snd_cards) */ @@ -143,7 +110,7 @@ struct _snd_card { struct module *module; /* top-level module */ void *private_data; /* private data for soundcard */ - void (*private_free) (snd_card_t *card); /* callback for freeing of + void (*private_free) (struct snd_card *card); /* callback for freeing of private data */ struct list_head devices; /* devices */ @@ -155,8 +122,8 @@ struct _snd_card { struct list_head controls; /* all controls for this card */ struct list_head ctl_files; /* active control files */ - snd_info_entry_t *proc_root; /* root for soundcard specific files */ - snd_info_entry_t *proc_id; /* the card id */ + struct snd_info_entry *proc_root; /* root for soundcard specific files */ + struct snd_info_entry *proc_id; /* the card id */ struct proc_dir_entry *proc_root_link; /* number link to real id */ struct snd_monitor_file *files; /* all files associated to this card */ @@ -172,8 +139,8 @@ struct _snd_card { #endif #ifdef CONFIG_PM - int (*pm_suspend)(snd_card_t *card, pm_message_t state); - int (*pm_resume)(snd_card_t *card); + int (*pm_suspend)(struct snd_card *card, pm_message_t state); + int (*pm_resume)(struct snd_card *card); void *pm_private_data; unsigned int power_state; /* power state */ struct semaphore power_lock; /* power lock */ @@ -181,43 +148,43 @@ struct _snd_card { #endif #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) - snd_mixer_oss_t *mixer_oss; + struct snd_mixer_oss *mixer_oss; int mixer_oss_change_count; #endif }; #ifdef CONFIG_PM -static inline void snd_power_lock(snd_card_t *card) +static inline void snd_power_lock(struct snd_card *card) { down(&card->power_lock); } -static inline void snd_power_unlock(snd_card_t *card) +static inline void snd_power_unlock(struct snd_card *card) { up(&card->power_lock); } -static inline unsigned int snd_power_get_state(snd_card_t *card) +static inline unsigned int snd_power_get_state(struct snd_card *card) { return card->power_state; } -static inline void snd_power_change_state(snd_card_t *card, unsigned int state) +static inline void snd_power_change_state(struct snd_card *card, unsigned int state) { card->power_state = state; wake_up(&card->power_sleep); } /* init.c */ -int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file); +int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file); -int snd_card_set_pm_callback(snd_card_t *card, - int (*suspend)(snd_card_t *, pm_message_t), - int (*resume)(snd_card_t *), +int snd_card_set_pm_callback(struct snd_card *card, + int (*suspend)(struct snd_card *, pm_message_t), + int (*resume)(struct snd_card *), void *private_data); -int snd_card_set_generic_pm_callback(snd_card_t *card, - int (*suspend)(snd_card_t *, pm_message_t), - int (*resume)(snd_card_t *), +int snd_card_set_generic_pm_callback(struct snd_card *card, + int (*suspend)(struct snd_card *, pm_message_t), + int (*resume)(struct snd_card *), void *private_data); #define snd_card_set_isa_pm_callback(card,suspend,resume,data) \ snd_card_set_generic_pm_callback(card, suspend, resume, data) @@ -231,7 +198,7 @@ int snd_card_pci_resume(struct pci_dev *dev); #define snd_power_lock(card) do { (void)(card); } while (0) #define snd_power_unlock(card) do { (void)(card); } while (0) -static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct file *file) { return 0; } +static inline int snd_power_wait(struct snd_card *card, unsigned int state, struct file *file) { return 0; } #define snd_power_get_state(card) SNDRV_CTL_POWER_D0 #define snd_power_change_state(card, state) do { (void)(card); } while (0) #define snd_card_set_pm_callback(card,suspend,resume,data) @@ -241,7 +208,7 @@ static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct fi #endif /* CONFIG_PM */ -struct _snd_minor { +struct snd_minor { struct list_head list; /* list of all minors per card */ int number; /* minor number */ int device; /* device number */ @@ -251,8 +218,6 @@ struct _snd_minor { structure) */ }; -typedef struct _snd_minor snd_minor_t; - /* sound.c */ extern int snd_major; @@ -260,12 +225,12 @@ extern int snd_ecards_limit; void snd_request_card(int card); -int snd_register_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name); -int snd_unregister_device(int type, snd_card_t *card, int dev); +int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name); +int snd_unregister_device(int type, struct snd_card *card, int dev); #ifdef CONFIG_SND_OSSEMUL -int snd_register_oss_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name); -int snd_unregister_oss_device(int type, snd_card_t *card, int dev); +int snd_register_oss_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name); +int snd_unregister_oss_device(int type, struct snd_card *card, int dev); #endif int snd_minor_info_init(void); @@ -291,43 +256,43 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size /* init.c */ extern unsigned int snd_cards_lock; -extern snd_card_t *snd_cards[SNDRV_CARDS]; +extern struct snd_card *snd_cards[SNDRV_CARDS]; extern rwlock_t snd_card_rwlock; #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) #define SND_MIXER_OSS_NOTIFY_REGISTER 0 #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 #define SND_MIXER_OSS_NOTIFY_FREE 2 -extern int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int cmd); +extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd); #endif -snd_card_t *snd_card_new(int idx, const char *id, +struct snd_card *snd_card_new(int idx, const char *id, struct module *module, int extra_size); -int snd_card_disconnect(snd_card_t *card); -int snd_card_free(snd_card_t *card); -int snd_card_free_in_thread(snd_card_t *card); -int snd_card_register(snd_card_t *card); +int snd_card_disconnect(struct snd_card *card); +int snd_card_free(struct snd_card *card); +int snd_card_free_in_thread(struct snd_card *card); +int snd_card_register(struct snd_card *card); int snd_card_info_init(void); int snd_card_info_done(void); -int snd_component_add(snd_card_t *card, const char *component); -int snd_card_file_add(snd_card_t *card, struct file *file); -int snd_card_file_remove(snd_card_t *card, struct file *file); +int snd_component_add(struct snd_card *card, const char *component); +int snd_card_file_add(struct snd_card *card, struct file *file); +int snd_card_file_remove(struct snd_card *card, struct file *file); #ifndef snd_card_set_dev #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) #endif /* register a generic device (for ISA, etc) */ -int snd_card_set_generic_dev(snd_card_t *card); +int snd_card_set_generic_dev(struct snd_card *card); /* device.c */ -int snd_device_new(snd_card_t *card, snd_device_type_t type, - void *device_data, snd_device_ops_t *ops); -int snd_device_register(snd_card_t *card, void *device_data); -int snd_device_register_all(snd_card_t *card); -int snd_device_disconnect(snd_card_t *card, void *device_data); -int snd_device_disconnect_all(snd_card_t *card); -int snd_device_free(snd_card_t *card, void *device_data); -int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd); +int snd_device_new(struct snd_card *card, snd_device_type_t type, + void *device_data, struct snd_device_ops *ops); +int snd_device_register(struct snd_card *card, void *device_data); +int snd_device_register_all(struct snd_card *card); +int snd_device_disconnect(struct snd_card *card, void *device_data); +int snd_device_disconnect_all(struct snd_card *card); +int snd_device_free(struct snd_card *card, void *device_data); +int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd); /* isadma.c */ @@ -443,4 +408,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) #endif #endif +#include "typedefs.h" + #endif /* __SOUND_CORE_H */ diff --git a/sound/core/device.c b/sound/core/device.c index 1f509f56e60..afa8cc7fb05 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -41,10 +41,10 @@ * * Returns zero if successful, or a negative error code on failure. */ -int snd_device_new(snd_card_t *card, snd_device_type_t type, - void *device_data, snd_device_ops_t *ops) +int snd_device_new(struct snd_card *card, snd_device_type_t type, + void *device_data, struct snd_device_ops *ops) { - snd_device_t *dev; + struct snd_device *dev; snd_assert(card != NULL, return -ENXIO); snd_assert(device_data != NULL, return -ENXIO); @@ -73,10 +73,10 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type, * Returns zero if successful, or a negative error code on failure or if the * device not found. */ -int snd_device_free(snd_card_t *card, void *device_data) +int snd_device_free(struct snd_card *card, void *device_data) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; snd_assert(card != NULL, return -ENXIO); snd_assert(device_data != NULL, return -ENXIO); @@ -86,7 +86,8 @@ int snd_device_free(snd_card_t *card, void *device_data) continue; /* unlink */ list_del(&dev->list); - if ((dev->state == SNDRV_DEV_REGISTERED || dev->state == SNDRV_DEV_DISCONNECTED) && + if ((dev->state == SNDRV_DEV_REGISTERED || + dev->state == SNDRV_DEV_DISCONNECTED) && dev->ops->dev_unregister) { if (dev->ops->dev_unregister(dev)) snd_printk(KERN_ERR "device unregister failure\n"); @@ -99,7 +100,8 @@ int snd_device_free(snd_card_t *card, void *device_data) kfree(dev); return 0; } - snd_printd("device free %p (from %p), not found\n", device_data, __builtin_return_address(0)); + snd_printd("device free %p (from %p), not found\n", device_data, + __builtin_return_address(0)); return -ENXIO; } @@ -116,10 +118,10 @@ int snd_device_free(snd_card_t *card, void *device_data) * Returns zero if successful, or a negative error code on failure or if the * device not found. */ -int snd_device_disconnect(snd_card_t *card, void *device_data) +int snd_device_disconnect(struct snd_card *card, void *device_data) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; snd_assert(card != NULL, return -ENXIO); snd_assert(device_data != NULL, return -ENXIO); @@ -127,14 +129,16 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) dev = snd_device(list); if (dev->device_data != device_data) continue; - if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) { + if (dev->state == SNDRV_DEV_REGISTERED && + dev->ops->dev_disconnect) { if (dev->ops->dev_disconnect(dev)) snd_printk(KERN_ERR "device disconnect failure\n"); dev->state = SNDRV_DEV_DISCONNECTED; } return 0; } - snd_printd("device disconnect %p (from %p), not found\n", device_data, __builtin_return_address(0)); + snd_printd("device disconnect %p (from %p), not found\n", device_data, + __builtin_return_address(0)); return -ENXIO; } @@ -151,10 +155,10 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) * Returns zero if successful, or a negative error code on failure or if the * device not found. */ -int snd_device_register(snd_card_t *card, void *device_data) +int snd_device_register(struct snd_card *card, void *device_data) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; int err; snd_assert(card != NULL, return -ENXIO); @@ -179,10 +183,10 @@ int snd_device_register(snd_card_t *card, void *device_data) * register all the devices on the card. * called from init.c */ -int snd_device_register_all(snd_card_t *card) +int snd_device_register_all(struct snd_card *card) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; int err; snd_assert(card != NULL, return -ENXIO); @@ -201,9 +205,9 @@ int snd_device_register_all(snd_card_t *card) * disconnect all the devices on the card. * called from init.c */ -int snd_device_disconnect_all(snd_card_t *card) +int snd_device_disconnect_all(struct snd_card *card) { - snd_device_t *dev; + struct snd_device *dev; struct list_head *list; int err = 0; @@ -220,9 +224,9 @@ int snd_device_disconnect_all(snd_card_t *card) * release all the devices on the card. * called from init.c */ -int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd) +int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd) { - snd_device_t *dev; + struct snd_device *dev; struct list_head *list; int err; unsigned int range_low, range_high; diff --git a/sound/core/init.c b/sound/core/init.c index 33813f92ab5..dca64d199cb 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -40,14 +40,15 @@ struct snd_shutdown_f_ops { }; unsigned int snd_cards_lock = 0; /* locked for registering/using */ -snd_card_t *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL}; +struct snd_card *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL}; DEFINE_RWLOCK(snd_card_rwlock); #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) -int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int free_flag); +int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag); #endif -static void snd_card_id_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void snd_card_id_read(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { snd_iprintf(buffer, "%s\n", entry->card->id); } @@ -63,13 +64,13 @@ static void snd_card_free_thread(void * __card); * * Creates and initializes a soundcard structure. * - * Returns kmallocated snd_card_t structure. Creates the ALSA control interface + * Returns kmallocated snd_card structure. Creates the ALSA control interface * (which is blocked until snd_card_register function is called). */ -snd_card_t *snd_card_new(int idx, const char *xid, +struct snd_card *snd_card_new(int idx, const char *xid, struct module *module, int extra_size) { - snd_card_t *card; + struct snd_card *card; int err; if (extra_size < 0) @@ -132,7 +133,7 @@ snd_card_t *snd_card_new(int idx, const char *xid, goto __error_ctl; } if (extra_size > 0) - card->private_data = (char *)card + sizeof(snd_card_t); + card->private_data = (char *)card + sizeof(struct snd_card); return card; __error_ctl: @@ -158,7 +159,7 @@ static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait) * Note: The current implementation replaces all active file->f_op with special * dummy file operations (they do nothing except release). */ -int snd_card_disconnect(snd_card_t * card) +int snd_card_disconnect(struct snd_card *card) { struct snd_monitor_file *mfile; struct file *file; @@ -229,7 +230,7 @@ int snd_card_disconnect(snd_card_t * card) } #ifdef CONFIG_SND_GENERIC_DRIVER -static void snd_generic_device_unregister(snd_card_t *card); +static void snd_generic_device_unregister(struct snd_card *card); #else #define snd_generic_device_unregister(x) /*NOP*/ #endif @@ -245,7 +246,7 @@ static void snd_generic_device_unregister(snd_card_t *card); * Returns zero. Frees all associated devices and frees the control * interface associated to given soundcard. */ -int snd_card_free(snd_card_t * card) +int snd_card_free(struct snd_card *card) { struct snd_shutdown_f_ops *s_f_ops; @@ -300,7 +301,7 @@ int snd_card_free(snd_card_t * card) static void snd_card_free_thread(void * __card) { - snd_card_t *card = __card; + struct snd_card *card = __card; struct module * module = card->module; if (!try_module_get(module)) { @@ -327,7 +328,7 @@ static void snd_card_free_thread(void * __card) * * Returns - zero otherwise a negative error code if the start of thread failed. */ -int snd_card_free_in_thread(snd_card_t * card) +int snd_card_free_in_thread(struct snd_card *card) { if (card->files == NULL) { snd_card_free(card); @@ -343,7 +344,7 @@ int snd_card_free_in_thread(snd_card_t * card) return -EFAULT; } -static void choose_default_id(snd_card_t * card) +static void choose_default_id(struct snd_card *card) { int i, len, idx_flag = 0, loops = 8; char *id, *spos; @@ -415,10 +416,10 @@ static void choose_default_id(snd_card_t * card) * * Returns zero otherwise a negative error code if the registrain failed. */ -int snd_card_register(snd_card_t * card) +int snd_card_register(struct snd_card *card) { int err; - snd_info_entry_t *entry; + struct snd_info_entry *entry; snd_assert(card != NULL, return -EINVAL); if ((err = snd_device_register_all(card)) < 0) @@ -456,12 +457,12 @@ int snd_card_register(snd_card_t * card) return 0; } -static snd_info_entry_t *snd_card_info_entry = NULL; +static struct snd_info_entry *snd_card_info_entry = NULL; -static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void snd_card_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { int idx, count; - snd_card_t *card; + struct snd_card *card; for (idx = count = 0; idx < SNDRV_CARDS; idx++) { read_lock(&snd_card_rwlock); @@ -483,10 +484,10 @@ static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buff #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) -void snd_card_info_read_oss(snd_info_buffer_t * buffer) +void snd_card_info_read_oss(struct snd_info_buffer *buffer) { int idx, count; - snd_card_t *card; + struct snd_card *card; for (idx = count = 0; idx < SNDRV_CARDS; idx++) { read_lock(&snd_card_rwlock); @@ -504,11 +505,12 @@ void snd_card_info_read_oss(snd_info_buffer_t * buffer) #endif #ifdef MODULE -static snd_info_entry_t *snd_card_module_info_entry; -static void snd_card_module_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static struct snd_info_entry *snd_card_module_info_entry; +static void snd_card_module_info_read(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { int idx; - snd_card_t *card; + struct snd_card *card; for (idx = 0; idx < SNDRV_CARDS; idx++) { read_lock(&snd_card_rwlock); @@ -521,7 +523,7 @@ static void snd_card_module_info_read(snd_info_entry_t *entry, snd_info_buffer_t int __init snd_card_info_init(void) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL); if (! entry) @@ -571,7 +573,7 @@ int __exit snd_card_info_done(void) * Returns zero otherwise a negative error code. */ -int snd_component_add(snd_card_t *card, const char *component) +int snd_component_add(struct snd_card *card, const char *component) { char *ptr; int len = strlen(component); @@ -602,7 +604,7 @@ int snd_component_add(snd_card_t *card, const char *component) * * Returns zero or a negative error code. */ -int snd_card_file_add(snd_card_t *card, struct file *file) +int snd_card_file_add(struct snd_card *card, struct file *file) { struct snd_monitor_file *mfile; @@ -636,7 +638,7 @@ int snd_card_file_add(snd_card_t *card, struct file *file) * * Returns zero or a negative error code. */ -int snd_card_file_remove(snd_card_t *card, struct file *file) +int snd_card_file_remove(struct snd_card *card, struct file *file) { struct snd_monitor_file *mfile, *pfile = NULL; @@ -671,7 +673,7 @@ int snd_card_file_remove(snd_card_t *card, struct file *file) */ struct snd_generic_device { struct platform_device pdev; - snd_card_t *card; + struct snd_card *card; }; #define get_snd_generic_card(dev) container_of(dev, struct snd_generic_device, pdev)->card @@ -698,7 +700,7 @@ void snd_generic_device_release(struct device *dev) { } -static int snd_generic_device_register(snd_card_t *card) +static int snd_generic_device_register(struct snd_card *card) { struct snd_generic_device *dev; int err; @@ -724,7 +726,7 @@ static int snd_generic_device_register(snd_card_t *card) return 0; } -static void snd_generic_device_unregister(snd_card_t *card) +static void snd_generic_device_unregister(struct snd_card *card) { struct snd_generic_device *dev = card->generic_dev; if (dev) { @@ -744,7 +746,7 @@ static void snd_generic_device_unregister(snd_card_t *card) * * Returns zero if successful, or a negative error code. */ -int snd_card_set_generic_dev(snd_card_t *card) +int snd_card_set_generic_dev(struct snd_card *card) { int err; if ((err = snd_generic_device_register(card)) < 0) @@ -766,7 +768,7 @@ int snd_card_set_generic_dev(snd_card_t *card) * * Note: the power lock must be active before call. */ -int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file) +int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file) { wait_queue_t wait; int result = 0; @@ -809,9 +811,9 @@ int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file * These callbacks are called from ALSA's common PCI suspend/resume * handler and from the control API. */ -int snd_card_set_pm_callback(snd_card_t *card, - int (*suspend)(snd_card_t *, pm_message_t), - int (*resume)(snd_card_t *), +int snd_card_set_pm_callback(struct snd_card *card, + int (*suspend)(struct snd_card *, pm_message_t), + int (*resume)(struct snd_card *), void *private_data) { card->pm_suspend = suspend; @@ -824,7 +826,7 @@ int snd_card_set_pm_callback(snd_card_t *card, /* suspend/resume callbacks for snd_generic platform device */ static int snd_generic_suspend(struct platform_device *dev, pm_message_t state) { - snd_card_t *card; + struct snd_card *card; card = get_snd_generic_card(dev); if (card->power_state == SNDRV_CTL_POWER_D3hot) @@ -837,7 +839,7 @@ static int snd_generic_suspend(struct platform_device *dev, pm_message_t state) static int snd_generic_resume(struct platform_device *dev) { - snd_card_t *card; + struct snd_card *card; card = get_snd_generic_card(dev); if (card->power_state == SNDRV_CTL_POWER_D0) @@ -859,9 +861,9 @@ static int snd_generic_resume(struct platform_device *dev) * the given card. These callbacks are called from the ALSA's common * PM handler and from the control API. */ -int snd_card_set_generic_pm_callback(snd_card_t *card, - int (*suspend)(snd_card_t *, pm_message_t), - int (*resume)(snd_card_t *), +int snd_card_set_generic_pm_callback(struct snd_card *card, + int (*suspend)(struct snd_card *, pm_message_t), + int (*resume)(struct snd_card *), void *private_data) { int err; @@ -874,7 +876,7 @@ int snd_card_set_generic_pm_callback(snd_card_t *card, #ifdef CONFIG_PCI int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state) { - snd_card_t *card = pci_get_drvdata(dev); + struct snd_card *card = pci_get_drvdata(dev); int err; if (! card || ! card->pm_suspend) return 0; @@ -888,7 +890,7 @@ int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state) int snd_card_pci_resume(struct pci_dev *dev) { - snd_card_t *card = pci_get_drvdata(dev); + struct snd_card *card = pci_get_drvdata(dev); if (! card || ! card->pm_resume) return 0; if (card->power_state == SNDRV_CTL_POWER_D0) diff --git a/sound/core/sound.c b/sound/core/sound.c index 6e7cad1e947..04de0084e42 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -108,13 +108,13 @@ static void snd_request_other(int minor) #endif /* request_module support */ -static snd_minor_t *snd_minor_search(int minor) +static struct snd_minor *snd_minor_search(int minor) { struct list_head *list; - snd_minor_t *mptr; + struct snd_minor *mptr; list_for_each(list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]) { - mptr = list_entry(list, snd_minor_t, list); + mptr = list_entry(list, struct snd_minor, list); if (mptr->number == minor) return mptr; } @@ -126,7 +126,7 @@ static int snd_open(struct inode *inode, struct file *file) int minor = iminor(inode); int card = SNDRV_MINOR_CARD(minor); int dev = SNDRV_MINOR_DEVICE(minor); - snd_minor_t *mptr = NULL; + struct snd_minor *mptr = NULL; struct file_operations *old_fops; int err = 0; @@ -164,7 +164,7 @@ static struct file_operations snd_fops = .open = snd_open }; -static int snd_kernel_minor(int type, snd_card_t * card, int dev) +static int snd_kernel_minor(int type, struct snd_card *card, int dev) { int minor; @@ -196,7 +196,7 @@ static int snd_kernel_minor(int type, snd_card_t * card, int dev) * @type: the device type, SNDRV_DEVICE_TYPE_XXX * @card: the card instance * @dev: the device index - * @reg: the snd_minor_t record + * @reg: the struct snd_minor record * @name: the device file name * * Registers an ALSA device file for the given card. @@ -204,16 +204,16 @@ static int snd_kernel_minor(int type, snd_card_t * card, int dev) * * Retrurns zero if successful, or a negative error code on failure. */ -int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg, const char *name) +int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor * reg, const char *name) { int minor = snd_kernel_minor(type, card, dev); - snd_minor_t *preg; + struct snd_minor *preg; struct device *device = NULL; if (minor < 0) return minor; snd_assert(name, return -EINVAL); - preg = (snd_minor_t *)kmalloc(sizeof(snd_minor_t) + strlen(name) + 1, GFP_KERNEL); + preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL); if (preg == NULL) return -ENOMEM; *preg = *reg; @@ -248,10 +248,10 @@ int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg, * * Returns zero if sucecessful, or a negative error code on failure */ -int snd_unregister_device(int type, snd_card_t * card, int dev) +int snd_unregister_device(int type, struct snd_card *card, int dev) { int minor = snd_kernel_minor(type, card, dev); - snd_minor_t *mptr; + struct snd_minor *mptr; if (minor < 0) return minor; @@ -275,18 +275,18 @@ int snd_unregister_device(int type, snd_card_t * card, int dev) * INFO PART */ -static snd_info_entry_t *snd_minor_info_entry = NULL; +static struct snd_info_entry *snd_minor_info_entry = NULL; -static void snd_minor_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void snd_minor_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { int card, device; struct list_head *list; - snd_minor_t *mptr; + struct snd_minor *mptr; down(&sound_mutex); for (card = 0; card < SNDRV_CARDS; card++) { list_for_each(list, &snd_minors_hash[card]) { - mptr = list_entry(list, snd_minor_t, list); + mptr = list_entry(list, struct snd_minor, list); if (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_GLOBAL) { if ((device = mptr->device) >= 0) snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, mptr->comment); @@ -302,7 +302,7 @@ static void snd_minor_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buf int __init snd_minor_info_init(void) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL); if (entry) { -- cgit v1.2.3