Kernel Functions for Drivers audio_dev_alloc(9F)
NAME
audio_dev_alloc, audio_dev_free - allocate or free an audio
deviceSYNOPSIS
#include
audio_dev_t *audio_dev_alloc(dev_info_t *dip, int devno);
void audio_dev_free(audio_dev_t *adev);
PARAMETERS
dip the device instance structure for the device devno an integer representing the "logical device" number of the device. If 0 is supplied, the instancenumber returned from ddi_get_instance(9F) is used
instead. adev pointer to an audio device allocated withaudio_dev_alloc()
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI)DESCRIPTION
The audio_dev_alloc() function allocates a structure
representing a logical audio device. Normally, there is onesuch audio device per dev_info_t. Some devices, however, may
support the notion of multiple logical devices, where dif-
ferent audio devices with completely independent configura-
tions can be supported. These devices will usually have com-
pletely independent physical ports as well. In such cases,the driver may supply a non-zero value for the devno.
If devno is used, it is the responsibility of the driver toensure that all values of devno are unique for that particu-
lar driver, and a devno must be supplied for all hardware instances in the system to avoid collisions with device instance numbers.An audio device (audio_dev_t) may have multiple DMA or PIO
engines "streams", but generally all of these engines are subject to the same set of controllable parameters (such as gain, port selection, etc.)SunOS 5.11 Last change: 21 Apr 2010 1
Kernel Functions for Drivers audio_dev_alloc(9F)
The audio_dev_free() function frees a previously allocated
audio device handle and releases any resources associated with it.RETURN VALUES
The audio_dev_alloc() function returns an opaque handle for
the audio device. It always succeeds.CONTEXT
The audio_dev_alloc() and audio_dev_free() functions may be
called from user or kernel context only.ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
SEE ALSO
attributes(5), audio(7D), audio_dev_add_control(9F),
audio_dev_add_engine(9F), audio_dev_register(9F),
audio_dev_set_description(9F), audio_dev_suspend(9F)
Writing Device DriversSunOS 5.11 Last change: 21 Apr 2010 2