xref: /openbmc/linux/sound/xen/xen_snd_front.h (revision d0e22329)
1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 
3 /*
4  * Xen para-virtual sound device
5  *
6  * Copyright (C) 2016-2018 EPAM Systems Inc.
7  *
8  * Author: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
9  */
10 
11 #ifndef __XEN_SND_FRONT_H
12 #define __XEN_SND_FRONT_H
13 
14 #include "xen_snd_front_cfg.h"
15 
16 struct xen_snd_front_card_info;
17 struct xen_snd_front_evtchnl;
18 struct xen_snd_front_evtchnl_pair;
19 struct xen_front_pgdir_shbuf;
20 struct xensnd_query_hw_param;
21 
22 struct xen_snd_front_info {
23 	struct xenbus_device *xb_dev;
24 
25 	struct xen_snd_front_card_info *card_info;
26 
27 	int num_evt_pairs;
28 	struct xen_snd_front_evtchnl_pair *evt_pairs;
29 
30 	struct xen_front_cfg_card cfg;
31 };
32 
33 int xen_snd_front_stream_query_hw_param(struct xen_snd_front_evtchnl *evtchnl,
34 					struct xensnd_query_hw_param *hw_param_req,
35 					struct xensnd_query_hw_param *hw_param_resp);
36 
37 int xen_snd_front_stream_prepare(struct xen_snd_front_evtchnl *evtchnl,
38 				 struct xen_front_pgdir_shbuf *shbuf,
39 				 u8 format, unsigned int channels,
40 				 unsigned int rate, u32 buffer_sz,
41 				 u32 period_sz);
42 
43 int xen_snd_front_stream_close(struct xen_snd_front_evtchnl *evtchnl);
44 
45 int xen_snd_front_stream_write(struct xen_snd_front_evtchnl *evtchnl,
46 			       unsigned long pos, unsigned long count);
47 
48 int xen_snd_front_stream_read(struct xen_snd_front_evtchnl *evtchnl,
49 			      unsigned long pos, unsigned long count);
50 
51 int xen_snd_front_stream_trigger(struct xen_snd_front_evtchnl *evtchnl,
52 				 int type);
53 
54 #endif /* __XEN_SND_FRONT_H */
55