temp revert rk change
[firefly-linux-kernel-4.4.55.git] / include / linux / tegra_spdif.h
1 /* include/linux/tegra_spdif.h
2  *
3  * SPDIF audio driver for NVIDIA Tegra SoCs
4  *
5  * Copyright (c) 2008-2009, NVIDIA Corporation.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20  */
21
22 #ifndef _TEGRA_SPDIF_H
23 #define _TEGRA_SPDIF_H
24
25 #include <linux/ioctl.h>
26
27 #define TEGRA_SPDIF_MAGIC 's'
28
29
30
31 struct tegra_audio_buf_config {
32         unsigned size; /* order */
33         unsigned threshold; /* order */
34         unsigned chunk; /* order */
35 };
36
37
38
39 #define TEGRA_AUDIO_OUT_SET_BUF_CONFIG  _IOW(TEGRA_SPDIF_MAGIC, 0, \
40                         const struct tegra_audio_buf_config *)
41 #define TEGRA_AUDIO_OUT_GET_BUF_CONFIG  _IOR(TEGRA_SPDIF_MAGIC, 1, \
42                         struct tegra_audio_buf_config *)
43
44 #define TEGRA_AUDIO_OUT_GET_ERROR_COUNT _IOR(TEGRA_SPDIF_MAGIC, 2, \
45                         unsigned *)
46
47 struct tegra_audio_out_preload {
48         void *data;
49         size_t len;
50         size_t len_written;
51 };
52
53 #define TEGRA_AUDIO_OUT_PRELOAD_FIFO    _IOWR(TEGRA_SPDIF_MAGIC, 3, \
54                         struct tegra_audio_out_preload *)
55
56 #endif/*_TEGRA_SPDIF_H*/