xref: /aosp_15_r20/external/tinyalsa_new/src/mixer_io.h (revision 02e95f1a335b55495d41ca67eaf42361f13704fa)
1*02e95f1aSMarcin Radomski /* mixer_io.h
2*02e95f1aSMarcin Radomski ** Copyright (c) 2019, The Linux Foundation.
3*02e95f1aSMarcin Radomski **
4*02e95f1aSMarcin Radomski ** Redistribution and use in source and binary forms, with or without
5*02e95f1aSMarcin Radomski ** modification, are permitted provided that the following conditions are
6*02e95f1aSMarcin Radomski ** met:
7*02e95f1aSMarcin Radomski **   * Redistributions of source code must retain the above copyright
8*02e95f1aSMarcin Radomski **     notice, this list of conditions and the following disclaimer.
9*02e95f1aSMarcin Radomski **   * Redistributions in binary form must reproduce the above
10*02e95f1aSMarcin Radomski **     copyright notice, this list of conditions and the following
11*02e95f1aSMarcin Radomski **     disclaimer in the documentation and/or other materials provided
12*02e95f1aSMarcin Radomski **     with the distribution.
13*02e95f1aSMarcin Radomski **   * Neither the name of The Linux Foundation nor the names of its
14*02e95f1aSMarcin Radomski **     contributors may be used to endorse or promote products derived
15*02e95f1aSMarcin Radomski **     from this software without specific prior written permission.
16*02e95f1aSMarcin Radomski **
17*02e95f1aSMarcin Radomski ** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18*02e95f1aSMarcin Radomski ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19*02e95f1aSMarcin Radomski ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20*02e95f1aSMarcin Radomski ** ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21*02e95f1aSMarcin Radomski ** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22*02e95f1aSMarcin Radomski ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23*02e95f1aSMarcin Radomski ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24*02e95f1aSMarcin Radomski ** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25*02e95f1aSMarcin Radomski ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26*02e95f1aSMarcin Radomski ** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27*02e95f1aSMarcin Radomski ** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*02e95f1aSMarcin Radomski **/
29*02e95f1aSMarcin Radomski 
30*02e95f1aSMarcin Radomski #ifndef TINYALSA_SRC_MIXER_H
31*02e95f1aSMarcin Radomski #define TINYALSA_SRC_MIXER_H
32*02e95f1aSMarcin Radomski 
33*02e95f1aSMarcin Radomski #include <stdio.h>
34*02e95f1aSMarcin Radomski #include <stdlib.h>
35*02e95f1aSMarcin Radomski #include <sound/asound.h>
36*02e95f1aSMarcin Radomski 
37*02e95f1aSMarcin Radomski struct mixer_ops;
38*02e95f1aSMarcin Radomski 
39*02e95f1aSMarcin Radomski int mixer_hw_open(unsigned int card, void **data,
40*02e95f1aSMarcin Radomski                   const struct mixer_ops **ops);
41*02e95f1aSMarcin Radomski int mixer_plugin_open(unsigned int card, void **data,
42*02e95f1aSMarcin Radomski                       const struct mixer_ops **ops);
43*02e95f1aSMarcin Radomski 
44*02e95f1aSMarcin Radomski struct mixer_ops {
45*02e95f1aSMarcin Radomski     void (*close) (void *data);
46*02e95f1aSMarcin Radomski     int (*get_poll_fd) (void *data, struct pollfd *pfd, int count);
47*02e95f1aSMarcin Radomski     ssize_t (*read_event) (void *data, struct snd_ctl_event *ev, size_t size);
48*02e95f1aSMarcin Radomski     int (*ioctl) (void *data, unsigned int cmd, ...);
49*02e95f1aSMarcin Radomski };
50*02e95f1aSMarcin Radomski 
51*02e95f1aSMarcin Radomski #endif /* TINYALSA_SRC_MIXER_H */
52