xref: /OK3568_Linux_fs/kernel/sound/xen/xen_snd_front_cfg.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2*4882a593Smuzhiyun 
3*4882a593Smuzhiyun /*
4*4882a593Smuzhiyun  * Xen para-virtual sound device
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 2016-2018 EPAM Systems Inc.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Author: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #ifndef __XEN_SND_FRONT_CFG_H
12*4882a593Smuzhiyun #define __XEN_SND_FRONT_CFG_H
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #include <sound/core.h>
15*4882a593Smuzhiyun #include <sound/pcm.h>
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun struct xen_snd_front_info;
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun struct xen_front_cfg_stream {
20*4882a593Smuzhiyun 	int index;
21*4882a593Smuzhiyun 	char *xenstore_path;
22*4882a593Smuzhiyun 	struct snd_pcm_hardware pcm_hw;
23*4882a593Smuzhiyun };
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun struct xen_front_cfg_pcm_instance {
26*4882a593Smuzhiyun 	char name[80];
27*4882a593Smuzhiyun 	int device_id;
28*4882a593Smuzhiyun 	struct snd_pcm_hardware pcm_hw;
29*4882a593Smuzhiyun 	int  num_streams_pb;
30*4882a593Smuzhiyun 	struct xen_front_cfg_stream *streams_pb;
31*4882a593Smuzhiyun 	int  num_streams_cap;
32*4882a593Smuzhiyun 	struct xen_front_cfg_stream *streams_cap;
33*4882a593Smuzhiyun };
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun struct xen_front_cfg_card {
36*4882a593Smuzhiyun 	char name_short[32];
37*4882a593Smuzhiyun 	char name_long[80];
38*4882a593Smuzhiyun 	struct snd_pcm_hardware pcm_hw;
39*4882a593Smuzhiyun 	int num_pcm_instances;
40*4882a593Smuzhiyun 	struct xen_front_cfg_pcm_instance *pcm_instances;
41*4882a593Smuzhiyun };
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun int xen_snd_front_cfg_card(struct xen_snd_front_info *front_info,
44*4882a593Smuzhiyun 			   int *stream_cnt);
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun #endif /* __XEN_SND_FRONT_CFG_H */
47