Oleksandr Andrushchenko | cc3196ae1 | 2018-05-14 09:27:37 +0300 | [diff] [blame] | 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 | |
Oleksandr Andrushchenko | fd3b360 | 2018-05-14 09:27:38 +0300 | [diff] [blame] | 14 | #include "xen_snd_front_cfg.h" |
| 15 | |
Oleksandr Andrushchenko | 1cee559 | 2018-05-14 09:27:41 +0300 | [diff] [blame] | 16 | struct xen_snd_front_card_info; |
| 17 | struct xen_snd_front_evtchnl; |
Oleksandr Andrushchenko | 788ef64 | 2018-05-14 09:27:39 +0300 | [diff] [blame] | 18 | struct xen_snd_front_evtchnl_pair; |
Oleksandr Andrushchenko | 58f9d80 | 2018-11-30 09:42:05 +0200 | [diff] [blame] | 19 | struct xen_front_pgdir_shbuf; |
Oleksandr Andrushchenko | 1cee559 | 2018-05-14 09:27:41 +0300 | [diff] [blame] | 20 | struct xensnd_query_hw_param; |
Oleksandr Andrushchenko | 788ef64 | 2018-05-14 09:27:39 +0300 | [diff] [blame] | 21 | |
Oleksandr Andrushchenko | cc3196ae1 | 2018-05-14 09:27:37 +0300 | [diff] [blame] | 22 | struct xen_snd_front_info { |
| 23 | struct xenbus_device *xb_dev; |
Oleksandr Andrushchenko | fd3b360 | 2018-05-14 09:27:38 +0300 | [diff] [blame] | 24 | |
Oleksandr Andrushchenko | 1cee559 | 2018-05-14 09:27:41 +0300 | [diff] [blame] | 25 | struct xen_snd_front_card_info *card_info; |
| 26 | |
Oleksandr Andrushchenko | 788ef64 | 2018-05-14 09:27:39 +0300 | [diff] [blame] | 27 | int num_evt_pairs; |
| 28 | struct xen_snd_front_evtchnl_pair *evt_pairs; |
| 29 | |
Oleksandr Andrushchenko | fd3b360 | 2018-05-14 09:27:38 +0300 | [diff] [blame] | 30 | struct xen_front_cfg_card cfg; |
Oleksandr Andrushchenko | cc3196ae1 | 2018-05-14 09:27:37 +0300 | [diff] [blame] | 31 | }; |
| 32 | |
Oleksandr Andrushchenko | 1cee559 | 2018-05-14 09:27:41 +0300 | [diff] [blame] | 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, |
Oleksandr Andrushchenko | 58f9d80 | 2018-11-30 09:42:05 +0200 | [diff] [blame] | 38 | struct xen_front_pgdir_shbuf *shbuf, |
Oleksandr Andrushchenko | 1cee559 | 2018-05-14 09:27:41 +0300 | [diff] [blame] | 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 | |
Oleksandr Andrushchenko | cc3196ae1 | 2018-05-14 09:27:37 +0300 | [diff] [blame] | 54 | #endif /* __XEN_SND_FRONT_H */ |