1/*
2 * This header was generated from the Linux kernel headers by update_headers.py,
3 * to provide necessary information from kernel to userspace, such as constants,
4 * structures, and macros, and thus, contains no copyrightable information.
5 */
6#ifndef __COMPRESS_OFFLOAD_H
7#define __COMPRESS_OFFLOAD_H
8#include <linux/types.h>
9#include <sound/asound.h>
10#include <sound/compress_params.h>
11#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2)
12struct snd_compressed_buffer {
13	__u32 fragment_size;
14	__u32 fragments;
15} __attribute__((packed, aligned(4)));
16struct snd_compr_params {
17	struct snd_compressed_buffer buffer;
18	struct snd_codec codec;
19	__u8 no_wake_mode;
20} __attribute__((packed, aligned(4)));
21struct snd_compr_tstamp {
22	__u32 byte_offset;
23	__u32 copied_total;
24	__u32 pcm_frames;
25	__u32 pcm_io_frames;
26	__u32 sampling_rate;
27} __attribute__((packed, aligned(4)));
28struct snd_compr_avail {
29	__u64 avail;
30	struct snd_compr_tstamp tstamp;
31} __attribute__((packed, aligned(4)));
32enum snd_compr_direction {
33	SND_COMPRESS_PLAYBACK = 0,
34	SND_COMPRESS_CAPTURE
35};
36struct snd_compr_caps {
37	__u32 num_codecs;
38	__u32 direction;
39	__u32 min_fragment_size;
40	__u32 max_fragment_size;
41	__u32 min_fragments;
42	__u32 max_fragments;
43	__u32 codecs[MAX_NUM_CODECS];
44	__u32 reserved[11];
45} __attribute__((packed, aligned(4)));
46struct snd_compr_codec_caps {
47	__u32 codec;
48	__u32 num_descriptors;
49	struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
50} __attribute__((packed, aligned(4)));
51enum sndrv_compress_encoder {
52	SNDRV_COMPRESS_ENCODER_PADDING = 1,
53	SNDRV_COMPRESS_ENCODER_DELAY = 2,
54};
55struct snd_compr_metadata {
56	 __u32 key;
57	 __u32 value[8];
58} __attribute__((packed, aligned(4)));
59#define SNDRV_COMPRESS_IOCTL_VERSION	_IOR('C', 0x00, int)
60#define SNDRV_COMPRESS_GET_CAPS		_IOWR('C', 0x10, struct snd_compr_caps)
61#define SNDRV_COMPRESS_GET_CODEC_CAPS	_IOWR('C', 0x11,\
62						struct snd_compr_codec_caps)
63#define SNDRV_COMPRESS_SET_PARAMS	_IOW('C', 0x12, struct snd_compr_params)
64#define SNDRV_COMPRESS_GET_PARAMS	_IOR('C', 0x13, struct snd_codec)
65#define SNDRV_COMPRESS_SET_METADATA	_IOW('C', 0x14,\
66						 struct snd_compr_metadata)
67#define SNDRV_COMPRESS_GET_METADATA	_IOWR('C', 0x15,\
68						 struct snd_compr_metadata)
69#define SNDRV_COMPRESS_TSTAMP		_IOR('C', 0x20, struct snd_compr_tstamp)
70#define SNDRV_COMPRESS_AVAIL		_IOR('C', 0x21, struct snd_compr_avail)
71#define SNDRV_COMPRESS_PAUSE		_IO('C', 0x30)
72#define SNDRV_COMPRESS_RESUME		_IO('C', 0x31)
73#define SNDRV_COMPRESS_START		_IO('C', 0x32)
74#define SNDRV_COMPRESS_STOP		_IO('C', 0x33)
75#define SNDRV_COMPRESS_DRAIN		_IO('C', 0x34)
76#define SNDRV_COMPRESS_NEXT_TRACK	_IO('C', 0x35)
77#define SNDRV_COMPRESS_PARTIAL_DRAIN	_IO('C', 0x36)
78#define SND_COMPR_TRIGGER_DRAIN 7
79#define SND_COMPR_TRIGGER_NEXT_TRACK 8
80#define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9
81#endif
82