blob: a2ea2463bcc5612b32e64a789c6ea53ee98ba420 [file] [log] [blame]
Oleksandr Andrushchenkocc3196a2018-05-14 09:27:37 +03001/* 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
Oleksandr Andrushchenkofd3b3602018-05-14 09:27:38 +030014#include "xen_snd_front_cfg.h"
15
Oleksandr Andrushchenko1cee5592018-05-14 09:27:41 +030016struct xen_snd_front_card_info;
17struct xen_snd_front_evtchnl;
Oleksandr Andrushchenko788ef642018-05-14 09:27:39 +030018struct xen_snd_front_evtchnl_pair;
Oleksandr Andrushchenko1cee5592018-05-14 09:27:41 +030019struct xen_snd_front_shbuf;
20struct xensnd_query_hw_param;
Oleksandr Andrushchenko788ef642018-05-14 09:27:39 +030021
Oleksandr Andrushchenkocc3196a2018-05-14 09:27:37 +030022struct xen_snd_front_info {
23 struct xenbus_device *xb_dev;
Oleksandr Andrushchenkofd3b3602018-05-14 09:27:38 +030024
Oleksandr Andrushchenko1cee5592018-05-14 09:27:41 +030025 struct xen_snd_front_card_info *card_info;
26
Oleksandr Andrushchenko788ef642018-05-14 09:27:39 +030027 int num_evt_pairs;
28 struct xen_snd_front_evtchnl_pair *evt_pairs;
29
Oleksandr Andrushchenkofd3b3602018-05-14 09:27:38 +030030 struct xen_front_cfg_card cfg;
Oleksandr Andrushchenkocc3196a2018-05-14 09:27:37 +030031};
32
Oleksandr Andrushchenko1cee5592018-05-14 09:27:41 +030033int 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
37int 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,
41 u32 period_sz);
42
43int xen_snd_front_stream_close(struct xen_snd_front_evtchnl *evtchnl);
44
45int xen_snd_front_stream_write(struct xen_snd_front_evtchnl *evtchnl,
46 unsigned long pos, unsigned long count);
47
48int xen_snd_front_stream_read(struct xen_snd_front_evtchnl *evtchnl,
49 unsigned long pos, unsigned long count);
50
51int xen_snd_front_stream_trigger(struct xen_snd_front_evtchnl *evtchnl,
52 int type);
53
Oleksandr Andrushchenkocc3196a2018-05-14 09:27:37 +030054#endif /* __XEN_SND_FRONT_H */