0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef __INCLUDE_SOUND_SOF_STREAM_H__
0010 #define __INCLUDE_SOUND_SOF_STREAM_H__
0011
0012 #include <sound/sof/header.h>
0013
0014
0015
0016
0017
0018 #define SOF_IPC_MAX_CHANNELS 8
0019
0020
0021 #define SOF_RATE_8000 (1 << 0)
0022 #define SOF_RATE_11025 (1 << 1)
0023 #define SOF_RATE_12000 (1 << 2)
0024 #define SOF_RATE_16000 (1 << 3)
0025 #define SOF_RATE_22050 (1 << 4)
0026 #define SOF_RATE_24000 (1 << 5)
0027 #define SOF_RATE_32000 (1 << 6)
0028 #define SOF_RATE_44100 (1 << 7)
0029 #define SOF_RATE_48000 (1 << 8)
0030 #define SOF_RATE_64000 (1 << 9)
0031 #define SOF_RATE_88200 (1 << 10)
0032 #define SOF_RATE_96000 (1 << 11)
0033 #define SOF_RATE_176400 (1 << 12)
0034 #define SOF_RATE_192000 (1 << 13)
0035
0036
0037 #define SOF_RATE_CONTINUOUS (1 << 30)
0038 #define SOF_RATE_KNOT (1 << 31)
0039
0040
0041 #define SOF_PCM_FLAG_XRUN_STOP (1 << 0)
0042
0043
0044 enum sof_ipc_frame {
0045 SOF_IPC_FRAME_S16_LE = 0,
0046 SOF_IPC_FRAME_S24_4LE,
0047 SOF_IPC_FRAME_S32_LE,
0048 SOF_IPC_FRAME_FLOAT,
0049
0050 };
0051
0052
0053 enum sof_ipc_buffer_format {
0054 SOF_IPC_BUFFER_INTERLEAVED,
0055 SOF_IPC_BUFFER_NONINTERLEAVED,
0056
0057 };
0058
0059
0060 enum sof_ipc_stream_direction {
0061 SOF_IPC_STREAM_PLAYBACK = 0,
0062 SOF_IPC_STREAM_CAPTURE,
0063 };
0064
0065
0066 struct sof_ipc_host_buffer {
0067 struct sof_ipc_hdr hdr;
0068 uint32_t phy_addr;
0069 uint32_t pages;
0070 uint32_t size;
0071 uint32_t reserved[3];
0072 } __packed;
0073
0074 struct sof_ipc_stream_params {
0075 struct sof_ipc_hdr hdr;
0076 struct sof_ipc_host_buffer buffer;
0077 uint32_t direction;
0078 uint32_t frame_fmt;
0079 uint32_t buffer_fmt;
0080 uint32_t rate;
0081 uint16_t stream_tag;
0082 uint16_t channels;
0083 uint16_t sample_valid_bytes;
0084 uint16_t sample_container_bytes;
0085
0086 uint32_t host_period_bytes;
0087 uint16_t no_stream_position;
0088 uint8_t cont_update_posn;
0089 uint8_t reserved0;
0090 int16_t ext_data_length;
0091 uint8_t reserved[2];
0092 uint16_t chmap[SOF_IPC_MAX_CHANNELS];
0093 uint8_t ext_data[];
0094 } __packed;
0095
0096
0097 struct sof_ipc_pcm_params {
0098 struct sof_ipc_cmd_hdr hdr;
0099 uint32_t comp_id;
0100 uint32_t flags;
0101 uint32_t reserved[2];
0102 struct sof_ipc_stream_params params;
0103 } __packed;
0104
0105
0106 struct sof_ipc_pcm_params_reply {
0107 struct sof_ipc_reply rhdr;
0108 uint32_t comp_id;
0109 uint32_t posn_offset;
0110 } __packed;
0111
0112
0113 struct sof_ipc_stream {
0114 struct sof_ipc_cmd_hdr hdr;
0115 uint32_t comp_id;
0116 } __packed;
0117
0118
0119 #define SOF_TIME_HOST_SYNC (1 << 0)
0120 #define SOF_TIME_DAI_SYNC (1 << 1)
0121 #define SOF_TIME_WALL_SYNC (1 << 2)
0122 #define SOF_TIME_STAMP_SYNC (1 << 3)
0123
0124
0125 #define SOF_TIME_HOST_VALID (1 << 8)
0126 #define SOF_TIME_DAI_VALID (1 << 9)
0127 #define SOF_TIME_WALL_VALID (1 << 10)
0128 #define SOF_TIME_STAMP_VALID (1 << 11)
0129
0130
0131 #define SOF_TIME_HOST_64 (1 << 16)
0132 #define SOF_TIME_DAI_64 (1 << 17)
0133 #define SOF_TIME_WALL_64 (1 << 18)
0134 #define SOF_TIME_STAMP_64 (1 << 19)
0135
0136 struct sof_ipc_stream_posn {
0137 struct sof_ipc_reply rhdr;
0138 uint32_t comp_id;
0139 uint32_t flags;
0140 uint32_t wallclock_hz;
0141 uint32_t timestamp_ns;
0142 uint64_t host_posn;
0143 uint64_t dai_posn;
0144 uint64_t comp_posn;
0145 uint64_t wallclock;
0146 uint64_t timestamp;
0147 uint32_t xrun_comp_id;
0148 int32_t xrun_size;
0149 } __packed;
0150
0151 #endif