1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
4 * Xen para-virtual sound device
6 * Copyright (C) 2016-2018 EPAM Systems Inc.
8 * Author: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
11 #ifndef __XEN_SND_FRONT_H
12 #define __XEN_SND_FRONT_H
14 #include "xen_snd_front_cfg.h"
16 struct xen_snd_front_card_info;
17 struct xen_snd_front_evtchnl;
18 struct xen_snd_front_evtchnl_pair;
19 struct xen_snd_front_shbuf;
20 struct xensnd_query_hw_param;
22 struct xen_snd_front_info {
23 struct xenbus_device *xb_dev;
25 struct xen_snd_front_card_info *card_info;
28 struct xen_snd_front_evtchnl_pair *evt_pairs;
30 struct xen_front_cfg_card cfg;
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);
37 int xen_snd_front_stream_prepare(struct xen_snd_front_evtchnl *evtchnl,
38 struct xen_snd_front_shbuf *sh_buf,
39 u8 format, unsigned int channels,
40 unsigned int rate, u32 buffer_sz,
43 int xen_snd_front_stream_close(struct xen_snd_front_evtchnl *evtchnl);
45 int xen_snd_front_stream_write(struct xen_snd_front_evtchnl *evtchnl,
46 unsigned long pos, unsigned long count);
48 int xen_snd_front_stream_read(struct xen_snd_front_evtchnl *evtchnl,
49 unsigned long pos, unsigned long count);
51 int xen_snd_front_stream_trigger(struct xen_snd_front_evtchnl *evtchnl,
54 #endif /* __XEN_SND_FRONT_H */