Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef __COMPRESS_OFFLOAD_H |
| 20 | #define __COMPRESS_OFFLOAD_H |
| 21 | #include <linux/types.h> |
| 22 | #include <sound/asound.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #include <sound/compress_params.h> |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 24 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 2, 0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 25 | struct snd_compressed_buffer { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 26 | __u32 fragment_size; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | __u32 fragments; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 28 | } __attribute__((packed, aligned(4))); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | struct snd_compr_params { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 30 | struct snd_compressed_buffer buffer; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | struct snd_codec codec; |
| 32 | __u8 no_wake_mode; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 33 | } __attribute__((packed, aligned(4))); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | struct snd_compr_tstamp { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | __u32 byte_offset; |
| 36 | __u32 copied_total; |
| 37 | __u32 pcm_frames; |
| 38 | __u32 pcm_io_frames; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | __u32 sampling_rate; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 40 | } __attribute__((packed, aligned(4))); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | struct snd_compr_avail { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 42 | __u64 avail; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | struct snd_compr_tstamp tstamp; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 44 | } __attribute__((packed, aligned(4))); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | enum snd_compr_direction { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 | SND_COMPRESS_PLAYBACK = 0, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | SND_COMPRESS_CAPTURE |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | }; |
| 49 | struct snd_compr_caps { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 50 | __u32 num_codecs; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 51 | __u32 direction; |
| 52 | __u32 min_fragment_size; |
| 53 | __u32 max_fragment_size; |
| 54 | __u32 min_fragments; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | __u32 max_fragments; |
| 56 | __u32 codecs[MAX_NUM_CODECS]; |
| 57 | __u32 reserved[11]; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 58 | } __attribute__((packed, aligned(4))); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | struct snd_compr_codec_caps { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 60 | __u32 codec; |
| 61 | __u32 num_descriptors; |
| 62 | struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS]; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 63 | } __attribute__((packed, aligned(4))); |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 64 | enum sndrv_compress_encoder { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 65 | SNDRV_COMPRESS_ENCODER_PADDING = 1, |
| 66 | SNDRV_COMPRESS_ENCODER_DELAY = 2, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 67 | }; |
| 68 | struct snd_compr_metadata { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 69 | __u32 key; |
| 70 | __u32 value[8]; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 71 | } __attribute__((packed, aligned(4))); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | #define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int) |
| 73 | #define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 | #define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11, struct snd_compr_codec_caps) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params) |
| 76 | #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 77 | #define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14, struct snd_compr_metadata) |
| 78 | #define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15, struct snd_compr_metadata) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 79 | #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp) |
| 80 | #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail) |
| 81 | #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30) |
| 82 | #define SNDRV_COMPRESS_RESUME _IO('C', 0x31) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | #define SNDRV_COMPRESS_START _IO('C', 0x32) |
| 84 | #define SNDRV_COMPRESS_STOP _IO('C', 0x33) |
| 85 | #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34) |
| 86 | #define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | #define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36) |
| 88 | #define SND_COMPR_TRIGGER_DRAIN 7 |
| 89 | #define SND_COMPR_TRIGGER_NEXT_TRACK 8 |
| 90 | #define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 91 | #endif |