1d5ac70f0Sopenharmony_ci/**
2d5ac70f0Sopenharmony_ci * \file include/hwdep.h
3d5ac70f0Sopenharmony_ci * \brief Application interface library for the ALSA driver
4d5ac70f0Sopenharmony_ci * \author Jaroslav Kysela <perex@perex.cz>
5d5ac70f0Sopenharmony_ci * \author Abramo Bagnara <abramo@alsa-project.org>
6d5ac70f0Sopenharmony_ci * \author Takashi Iwai <tiwai@suse.de>
7d5ac70f0Sopenharmony_ci * \date 1998-2001
8d5ac70f0Sopenharmony_ci *
9d5ac70f0Sopenharmony_ci * Application interface library for the ALSA driver
10d5ac70f0Sopenharmony_ci */
11d5ac70f0Sopenharmony_ci/*
12d5ac70f0Sopenharmony_ci *   This library is free software; you can redistribute it and/or modify
13d5ac70f0Sopenharmony_ci *   it under the terms of the GNU Lesser General Public License as
14d5ac70f0Sopenharmony_ci *   published by the Free Software Foundation; either version 2.1 of
15d5ac70f0Sopenharmony_ci *   the License, or (at your option) any later version.
16d5ac70f0Sopenharmony_ci *
17d5ac70f0Sopenharmony_ci *   This program is distributed in the hope that it will be useful,
18d5ac70f0Sopenharmony_ci *   but WITHOUT ANY WARRANTY; without even the implied warranty of
19d5ac70f0Sopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20d5ac70f0Sopenharmony_ci *   GNU Lesser General Public License for more details.
21d5ac70f0Sopenharmony_ci *
22d5ac70f0Sopenharmony_ci *   You should have received a copy of the GNU Lesser General Public
23d5ac70f0Sopenharmony_ci *   License along with this library; if not, write to the Free Software
24d5ac70f0Sopenharmony_ci *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
25d5ac70f0Sopenharmony_ci *
26d5ac70f0Sopenharmony_ci */
27d5ac70f0Sopenharmony_ci
28d5ac70f0Sopenharmony_ci#ifndef __ALSA_HWDEP_H
29d5ac70f0Sopenharmony_ci#define __ALSA_HWDEP_H
30d5ac70f0Sopenharmony_ci
31d5ac70f0Sopenharmony_ci#ifdef __cplusplus
32d5ac70f0Sopenharmony_ciextern "C" {
33d5ac70f0Sopenharmony_ci#endif
34d5ac70f0Sopenharmony_ci
35d5ac70f0Sopenharmony_ci/**
36d5ac70f0Sopenharmony_ci *  \defgroup HwDep Hardware Dependant Interface
37d5ac70f0Sopenharmony_ci *  The Hardware Dependant Interface.
38d5ac70f0Sopenharmony_ci *  \{
39d5ac70f0Sopenharmony_ci */
40d5ac70f0Sopenharmony_ci
41d5ac70f0Sopenharmony_ci/** dlsym version for interface entry callback */
42d5ac70f0Sopenharmony_ci#define SND_HWDEP_DLSYM_VERSION		_dlsym_hwdep_001
43d5ac70f0Sopenharmony_ci
44d5ac70f0Sopenharmony_ci/** HwDep information container */
45d5ac70f0Sopenharmony_citypedef struct _snd_hwdep_info snd_hwdep_info_t;
46d5ac70f0Sopenharmony_ci
47d5ac70f0Sopenharmony_ci/** HwDep DSP status container */
48d5ac70f0Sopenharmony_citypedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t;
49d5ac70f0Sopenharmony_ci
50d5ac70f0Sopenharmony_ci/** HwDep DSP image container */
51d5ac70f0Sopenharmony_citypedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t;
52d5ac70f0Sopenharmony_ci
53d5ac70f0Sopenharmony_ci/** HwDep interface */
54d5ac70f0Sopenharmony_citypedef enum _snd_hwdep_iface {
55d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_OPL2 = 0,	/**< OPL2 raw driver */
56d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_OPL3,		/**< OPL3 raw driver */
57d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_OPL4,		/**< OPL4 raw driver */
58d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_SB16CSP,	/**< SB16CSP driver */
59d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_EMU10K1,	/**< EMU10K1 driver */
60d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_YSS225,		/**< YSS225 driver */
61d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_ICS2115,	/**< ICS2115 driver */
62d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_SSCAPE,		/**< Ensoniq SoundScape ISA card (MC68EC000) */
63d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_VX,		/**< Digigram VX cards */
64d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_MIXART,		/**< Digigram miXart cards */
65d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_USX2Y,		/**< Tascam US122, US224 & US428 usb */
66d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_EMUX_WAVETABLE,	/**< EmuX wavetable */
67d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_BLUETOOTH,	/**< Bluetooth audio */
68d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_USX2Y_PCM,	/**< Tascam US122, US224 & US428 raw USB PCM */
69d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_PCXHR,		/**< Digigram PCXHR */
70d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_SB_RC,		/**< SB Extigy/Audigy2NX remote control */
71d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_HDA,		/**< HD-audio */
72d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_USB_STREAM,	/**< direct access to usb stream */
73d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_DICE,	/**< TC DICE FireWire device */
74d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_FIREWORKS,	/**< Echo Audio Fireworks based device */
75d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_BEBOB,	/**< BridgeCo BeBoB based device */
76d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_OXFW,	/**< Oxford OXFW970/971 based device */
77d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_DIGI00X,	/* Digidesign Digi 002/003 family */
78d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_TASCAM,	/* TASCAM FireWire series */
79d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_LINE6,		/* Line6 USB processors */
80d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_MOTU,	/* MOTU FireWire series */
81d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_FW_FIREFACE,	/* RME Fireface series */
82d5ac70f0Sopenharmony_ci
83d5ac70f0Sopenharmony_ci	SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_FIREFACE,	/**< last known hwdep interface */
84d5ac70f0Sopenharmony_ci} snd_hwdep_iface_t;
85d5ac70f0Sopenharmony_ci
86d5ac70f0Sopenharmony_ci/** open for reading */
87d5ac70f0Sopenharmony_ci#define SND_HWDEP_OPEN_READ		(O_RDONLY)
88d5ac70f0Sopenharmony_ci/** open for writing */
89d5ac70f0Sopenharmony_ci#define SND_HWDEP_OPEN_WRITE		(O_WRONLY)
90d5ac70f0Sopenharmony_ci/** open for reading and writing */
91d5ac70f0Sopenharmony_ci#define SND_HWDEP_OPEN_DUPLEX		(O_RDWR)
92d5ac70f0Sopenharmony_ci/** open mode flag: open in nonblock mode */
93d5ac70f0Sopenharmony_ci#define SND_HWDEP_OPEN_NONBLOCK		(O_NONBLOCK)
94d5ac70f0Sopenharmony_ci
95d5ac70f0Sopenharmony_ci/** HwDep handle type */
96d5ac70f0Sopenharmony_citypedef enum _snd_hwdep_type {
97d5ac70f0Sopenharmony_ci	/** Kernel level HwDep */
98d5ac70f0Sopenharmony_ci	SND_HWDEP_TYPE_HW,
99d5ac70f0Sopenharmony_ci	/** Shared memory client HwDep (not yet implemented) */
100d5ac70f0Sopenharmony_ci	SND_HWDEP_TYPE_SHM,
101d5ac70f0Sopenharmony_ci	/** INET client HwDep (not yet implemented) */
102d5ac70f0Sopenharmony_ci	SND_HWDEP_TYPE_INET
103d5ac70f0Sopenharmony_ci} snd_hwdep_type_t;
104d5ac70f0Sopenharmony_ci
105d5ac70f0Sopenharmony_ci/** HwDep handle */
106d5ac70f0Sopenharmony_citypedef struct _snd_hwdep snd_hwdep_t;
107d5ac70f0Sopenharmony_ci
108d5ac70f0Sopenharmony_ciint snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);
109d5ac70f0Sopenharmony_ciint snd_hwdep_close(snd_hwdep_t *hwdep);
110d5ac70f0Sopenharmony_ciint snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);
111d5ac70f0Sopenharmony_ciint snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep);
112d5ac70f0Sopenharmony_ciint snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
113d5ac70f0Sopenharmony_ciint snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
114d5ac70f0Sopenharmony_ciint snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
115d5ac70f0Sopenharmony_ciint snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status);
116d5ac70f0Sopenharmony_ciint snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block);
117d5ac70f0Sopenharmony_ciint snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);
118d5ac70f0Sopenharmony_cissize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size);
119d5ac70f0Sopenharmony_cissize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size);
120d5ac70f0Sopenharmony_ci
121d5ac70f0Sopenharmony_cisize_t snd_hwdep_info_sizeof(void);
122d5ac70f0Sopenharmony_ci/** allocate #snd_hwdep_info_t container on stack */
123d5ac70f0Sopenharmony_ci#define snd_hwdep_info_alloca(ptr) __snd_alloca(ptr, snd_hwdep_info)
124d5ac70f0Sopenharmony_ciint snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);
125d5ac70f0Sopenharmony_civoid snd_hwdep_info_free(snd_hwdep_info_t *obj);
126d5ac70f0Sopenharmony_civoid snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src);
127d5ac70f0Sopenharmony_ci
128d5ac70f0Sopenharmony_ciunsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj);
129d5ac70f0Sopenharmony_ciint snd_hwdep_info_get_card(const snd_hwdep_info_t *obj);
130d5ac70f0Sopenharmony_ciconst char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj);
131d5ac70f0Sopenharmony_ciconst char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj);
132d5ac70f0Sopenharmony_cisnd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj);
133d5ac70f0Sopenharmony_civoid snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val);
134d5ac70f0Sopenharmony_ci
135d5ac70f0Sopenharmony_cisize_t snd_hwdep_dsp_status_sizeof(void);
136d5ac70f0Sopenharmony_ci/** allocate #snd_hwdep_dsp_status_t container on stack */
137d5ac70f0Sopenharmony_ci#define snd_hwdep_dsp_status_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_status)
138d5ac70f0Sopenharmony_ciint snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr);
139d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj);
140d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src);
141d5ac70f0Sopenharmony_ci
142d5ac70f0Sopenharmony_ciunsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj);
143d5ac70f0Sopenharmony_ciconst char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj);
144d5ac70f0Sopenharmony_ciunsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj);
145d5ac70f0Sopenharmony_ciunsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj);
146d5ac70f0Sopenharmony_ciunsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj);
147d5ac70f0Sopenharmony_ci
148d5ac70f0Sopenharmony_cisize_t snd_hwdep_dsp_image_sizeof(void);
149d5ac70f0Sopenharmony_ci/** allocate #snd_hwdep_dsp_image_t container on stack */
150d5ac70f0Sopenharmony_ci#define snd_hwdep_dsp_image_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_image)
151d5ac70f0Sopenharmony_ciint snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr);
152d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj);
153d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src);
154d5ac70f0Sopenharmony_ci
155d5ac70f0Sopenharmony_ciunsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj);
156d5ac70f0Sopenharmony_ciconst char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj);
157d5ac70f0Sopenharmony_ciconst void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj);
158d5ac70f0Sopenharmony_cisize_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj);
159d5ac70f0Sopenharmony_ci
160d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int _index);
161d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name);
162d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer);
163d5ac70f0Sopenharmony_civoid snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length);
164d5ac70f0Sopenharmony_ci
165d5ac70f0Sopenharmony_ci/** \} */
166d5ac70f0Sopenharmony_ci
167d5ac70f0Sopenharmony_ci#ifdef __cplusplus
168d5ac70f0Sopenharmony_ci}
169d5ac70f0Sopenharmony_ci#endif
170d5ac70f0Sopenharmony_ci
171d5ac70f0Sopenharmony_ci#endif /* __ALSA_HWDEP_H */
172d5ac70f0Sopenharmony_ci
173