1*d0c94b83SXin Li /* pcm.h 2*d0c94b83SXin Li ** 3*d0c94b83SXin Li ** Copyright (c) 2019, The Linux Foundation. All rights reserved. 4*d0c94b83SXin Li ** 5*d0c94b83SXin Li ** Redistribution and use in source and binary forms, with or without 6*d0c94b83SXin Li ** modification, are permitted provided that the following conditions are 7*d0c94b83SXin Li ** met: 8*d0c94b83SXin Li ** * Redistributions of source code must retain the above copyright 9*d0c94b83SXin Li ** notice, this list of conditions and the following disclaimer. 10*d0c94b83SXin Li ** * Redistributions in binary form must reproduce the above 11*d0c94b83SXin Li ** copyright notice, this list of conditions and the following 12*d0c94b83SXin Li ** disclaimer in the documentation and/or other materials provided 13*d0c94b83SXin Li ** with the distribution. 14*d0c94b83SXin Li ** * Neither the name of The Linux Foundation nor the names of its 15*d0c94b83SXin Li ** contributors may be used to endorse or promote products derived 16*d0c94b83SXin Li ** from this software without specific prior written permission. 17*d0c94b83SXin Li ** 18*d0c94b83SXin Li ** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 19*d0c94b83SXin Li ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20*d0c94b83SXin Li ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 21*d0c94b83SXin Li ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22*d0c94b83SXin Li ** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23*d0c94b83SXin Li ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24*d0c94b83SXin Li ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25*d0c94b83SXin Li ** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26*d0c94b83SXin Li ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27*d0c94b83SXin Li ** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 28*d0c94b83SXin Li ** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29*d0c94b83SXin Li **/ 30*d0c94b83SXin Li 31*d0c94b83SXin Li #ifndef __PCM_H__ 32*d0c94b83SXin Li #define __PCM_H__ 33*d0c94b83SXin Li 34*d0c94b83SXin Li #include <poll.h> 35*d0c94b83SXin Li 36*d0c94b83SXin Li struct pcm_ops { 37*d0c94b83SXin Li int (*open) (unsigned int card, unsigned int device, 38*d0c94b83SXin Li unsigned int flags, void **data, void *node); 39*d0c94b83SXin Li void (*close) (void *data); 40*d0c94b83SXin Li int (*ioctl) (void *data, unsigned int cmd, ...); 41*d0c94b83SXin Li void* (*mmap) (void *data, void *addr, size_t length, int prot, int flags, 42*d0c94b83SXin Li off_t offset); 43*d0c94b83SXin Li int (*munmap) (void *data, void *addr, size_t length); 44*d0c94b83SXin Li int (*poll) (void *data, struct pollfd *pfd, nfds_t nfds, int timeout); 45*d0c94b83SXin Li }; 46*d0c94b83SXin Li 47*d0c94b83SXin Li #endif /* end of __PCM_H__ */ 48