Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #ifndef __SST_MFLD_DSP_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #define __SST_MFLD_DSP_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  sst_mfld_dsp.h - Intel SST Driver for audio engine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Copyright (C) 2008-14 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *  Authors:	Vinod Koul <vinod.koul@linux.intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define SST_MAX_BIN_BYTES 1024
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define MAX_DBG_RW_BYTES 80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #define MAX_NUM_SCATTER_BUFFERS 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define MAX_LOOP_BACK_DWORDS 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) /* IPC base address and mailbox, timestamp offsets */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define SST_MAILBOX_SIZE 0x0400
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define SST_MAILBOX_SEND 0x0000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define SST_TIME_STAMP 0x1800
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #define SST_TIME_STAMP_MRFLD 0x800
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define SST_RESERVED_OFFSET 0x1A00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define SST_SCU_LPE_MAILBOX 0x1000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #define SST_LPE_SCU_MAILBOX 0x1400
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define SST_SCU_LPE_LOG_BUF (SST_SCU_LPE_MAILBOX+16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #define PROCESS_MSG 0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) /* Message ID's for IPC messages */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) /* Bits B7: SST or IA/SC ; B6-B4: Msg Category; B3-B0: Msg Type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) /* I2L Firmware/Codec Download msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #define IPC_IA_PREP_LIB_DNLD 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #define IPC_IA_LIB_DNLD_CMPLT 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #define IPC_IA_GET_FW_VERSION 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define IPC_IA_GET_FW_BUILD_INF 0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define IPC_IA_GET_FW_INFO 0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define IPC_IA_GET_FW_CTXT 0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define IPC_IA_SET_FW_CTXT 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #define IPC_IA_PREPARE_SHUTDOWN 0x31
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) /* I2L Codec Config/control msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #define IPC_PREP_D3 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #define IPC_IA_SET_CODEC_PARAMS 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define IPC_IA_GET_CODEC_PARAMS 0x11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define IPC_IA_SET_PPP_PARAMS 0x12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define IPC_IA_GET_PPP_PARAMS 0x13
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define IPC_SST_PERIOD_ELAPSED_MRFLD 0xA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #define IPC_IA_ALG_PARAMS 0x1A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #define IPC_IA_TUNING_PARAMS 0x1B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) #define IPC_IA_SET_RUNTIME_PARAMS 0x1C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define IPC_IA_SET_PARAMS 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) #define IPC_IA_GET_PARAMS 0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #define IPC_EFFECTS_CREATE 0xE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) #define IPC_EFFECTS_DESTROY 0xF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) /* I2L Stream config/control msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #define IPC_IA_ALLOC_STREAM_MRFLD 0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) #define IPC_IA_ALLOC_STREAM 0x20 /* Allocate a stream ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) #define IPC_IA_FREE_STREAM_MRFLD 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) #define IPC_IA_FREE_STREAM 0x21 /* Free the stream ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #define IPC_IA_SET_STREAM_PARAMS 0x22
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) #define IPC_IA_SET_STREAM_PARAMS_MRFLD 0x12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) #define IPC_IA_GET_STREAM_PARAMS 0x23
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) #define IPC_IA_PAUSE_STREAM 0x24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) #define IPC_IA_PAUSE_STREAM_MRFLD 0x4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #define IPC_IA_RESUME_STREAM 0x25
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) #define IPC_IA_RESUME_STREAM_MRFLD 0x5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) #define IPC_IA_DROP_STREAM 0x26
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #define IPC_IA_DROP_STREAM_MRFLD 0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #define IPC_IA_DRAIN_STREAM 0x27 /* Short msg with str_id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) #define IPC_IA_DRAIN_STREAM_MRFLD 0x8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) #define IPC_IA_CONTROL_ROUTING 0x29
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) #define IPC_IA_VTSV_UPDATE_MODULES 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) #define IPC_IA_VTSV_DETECTED 0x21
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) #define IPC_IA_START_STREAM_MRFLD 0X06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #define IPC_IA_START_STREAM 0x30 /* Short msg with str_id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #define IPC_IA_SET_GAIN_MRFLD 0x21
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) /* Debug msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #define IPC_IA_DBG_MEM_READ 0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) #define IPC_IA_DBG_MEM_WRITE 0x41
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) #define IPC_IA_DBG_LOOP_BACK 0x42
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) #define IPC_IA_DBG_LOG_ENABLE 0x45
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) #define IPC_IA_DBG_SET_PROBE_PARAMS 0x47
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) /* L2I Firmware/Codec Download msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) #define IPC_IA_FW_INIT_CMPLT 0x81
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) #define IPC_IA_FW_INIT_CMPLT_MRFLD 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) #define IPC_IA_FW_ASYNC_ERR_MRFLD 0x11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) /* L2I Codec Config/control msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) #define IPC_SST_FRAGMENT_ELPASED 0x90 /* Request IA more data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) #define IPC_SST_BUF_UNDER_RUN 0x92 /* PB Under run and stopped */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) #define IPC_SST_BUF_OVER_RUN 0x93 /* CAP Under run and stopped */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #define IPC_SST_DRAIN_END 0x94 /* PB Drain complete and stopped */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define IPC_SST_CHNGE_SSP_PARAMS 0x95 /* PB SSP parameters changed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define IPC_SST_STREAM_PROCESS_FATAL_ERR 0x96/* error in processing a stream */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define IPC_SST_PERIOD_ELAPSED 0x97 /* period elapsed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #define IPC_SST_ERROR_EVENT 0x99 /* Buffer over run occurred */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) /* L2S messages */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define IPC_SC_DDR_LINK_UP 0xC0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) #define IPC_SC_DDR_LINK_DOWN 0xC1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #define IPC_SC_SET_LPECLK_REQ 0xC2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define IPC_SC_SSP_BIT_BANG 0xC3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /* L2I Error reporting msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) #define IPC_IA_MEM_ALLOC_FAIL 0xE0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #define IPC_IA_PROC_ERR 0xE1 /* error in processing a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 					stream can be used by playback and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 					capture modules */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) /* L2I Debug msgs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #define IPC_IA_PRINT_STRING 0xF0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) /* Buffer under-run */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #define IPC_IA_BUF_UNDER_RUN_MRFLD 0x0B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /* Mrfld specific defines:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)  * For asynchronous messages(INIT_CMPLT, PERIOD_ELAPSED, ASYNC_ERROR)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)  * received from FW, the format is:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  *  - IPC High: pvt_id is set to zero. Always short message.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  *  - msg_id is in lower 16-bits of IPC low payload.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  *  - pipe_id is in higher 16-bits of IPC low payload for period_elapsed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  *  - error id is in higher 16-bits of IPC low payload for async errors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) #define SST_ASYNC_DRV_ID 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) /* Command Response or Acknowledge message to any IPC message will have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)  * same message ID and stream ID information which is sent.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  * There is no specific Ack message ID. The data field is used as response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)  * meaning.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) enum ackData {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	IPC_ACK_SUCCESS = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	IPC_ACK_FAILURE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) enum ipc_ia_msg_id {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	IPC_CMD = 1,		/*!< Task Control message ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	IPC_SET_PARAMS = 2,/*!< Task Set param message ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	IPC_GET_PARAMS = 3,	/*!< Task Get param message ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	IPC_INVALID = 0xFF,	/*!<Task Get param message ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) enum sst_codec_types {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	/*  AUDIO/MUSIC	CODEC Type Definitions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	SST_CODEC_TYPE_UNKNOWN = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	SST_CODEC_TYPE_PCM,	/* Pass through Audio codec */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	SST_CODEC_TYPE_MP3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	SST_CODEC_TYPE_MP24,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	SST_CODEC_TYPE_AAC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	SST_CODEC_TYPE_AACP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	SST_CODEC_TYPE_eAACP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) enum stream_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	SST_STREAM_TYPE_NONE = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	SST_STREAM_TYPE_MUSIC = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) enum sst_error_codes {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	/* Error code,response to msgId: Description */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	/* Common error codes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	SST_SUCCESS = 0,        /* Success */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	SST_ERR_INVALID_STREAM_ID = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	SST_ERR_INVALID_MSG_ID = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	SST_ERR_INVALID_STREAM_OP = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	SST_ERR_INVALID_PARAMS = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	SST_ERR_INVALID_CODEC = 5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	SST_ERR_INVALID_MEDIA_TYPE = 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	SST_ERR_STREAM_ERR = 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	SST_ERR_STREAM_IN_USE = 15,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) struct ipc_dsp_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	u16 mod_index_id:8;		/*!< DSP Command ID specific to tasks */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	u16 pipe_id:8;	/*!< instance of the module in the pipeline */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	u16 mod_id;		/*!< Pipe_id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	u16 cmd_id;		/*!< Module ID = lpe_algo_types_t */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	u16 length;		/*!< Length of the payload only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) union ipc_header_high {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		u32  msg_id:8;	    /* Message ID - Max 256 Message Types */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		u32  task_id:4;	    /* Task ID associated with this comand */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		u32  drv_id:4;    /* Identifier for the driver to track*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		u32  rsvd1:8;	    /* Reserved */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		u32  result:4;	    /* Reserved */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		u32  res_rqd:1;	    /* Response rqd */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		u32  large:1;	    /* Large Message if large = 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		u32  done:1;	    /* bit 30 - Done bit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		u32  busy:1;	    /* bit 31 - busy bit*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	} part;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	u32 full;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) /* IPC header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) union ipc_header_mrfld {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		u32 header_low_payload;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 		union ipc_header_high header_high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	} p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	u64 full;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) /* CAUTION NOTE: All IPC message body must be multiple of 32 bits.*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) /* IPC Header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) union ipc_header {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		u32  msg_id:8; /* Message ID - Max 256 Message Types */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		u32  str_id:5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		u32  large:1;	/* Large Message if large = 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 		u32  reserved:2;	/* Reserved for future use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		u32  data:14;	/* Ack/Info for msg, size of msg in Mailbox */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		u32  done:1; /* bit 30 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		u32  busy:1; /* bit 31 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	} part;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	u32 full;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) /* Firmware build info */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) struct sst_fw_build_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	unsigned char  date[16]; /* Firmware build date */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	unsigned char  time[16]; /* Firmware build time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) /* Firmware Version info */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) struct snd_sst_fw_version {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	u8 build;	/* build number*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	u8 minor;	/* minor number*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	u8 major;	/* major number*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	u8 type;	/* build type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) struct ipc_header_fw_init {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	struct snd_sst_fw_version fw_version;/* Firmware version details */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	struct sst_fw_build_info build_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	u16 result;	/* Fw init result */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	u8 module_id; /* Module ID in case of error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	u8 debug_info; /* Debug info from Module ID in case of fail */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) struct snd_sst_tstamp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	u64 ring_buffer_counter;	/* PB/CP: Bytes copied from/to DDR. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	u64 hardware_counter;	    /* PB/CP: Bytes DMAed to/from SSP. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	u64 frames_decoded;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	u64 bytes_decoded;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	u64 bytes_copied;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	u32 sampling_frequency;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	u32 channel_peak[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) /* Stream type params struture for Alloc stream */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) struct snd_sst_str_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	u8 codec_type;		/* Codec type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	u8 str_type;		/* 1 = voice 2 = music */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	u8 operation;		/* Playback or Capture */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	u8 protected_str;	/* 0=Non DRM, 1=DRM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	u8 time_slots;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	u8 reserved;		/* Reserved */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	u16 result;		/* Result used for acknowledgment */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) /* Library info structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) struct module_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	u32 lib_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	u32 lib_type;/*TBD- KLOCKWORK u8 lib_type;*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	u32 media_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	u8  lib_name[12];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	u32 lib_caps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 	unsigned char  b_date[16]; /* Lib build date */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	unsigned char  b_time[16]; /* Lib build time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) /* Library slot info */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) struct lib_slot_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	u8  slot_num; /* 1 or 2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	u8  reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	u16 reserved2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	u32 iram_size; /* slot size in IRAM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 	u32 dram_size; /* slot size in DRAM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	u32 iram_offset; /* starting offset of slot in IRAM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	u32 dram_offset; /* starting offset of slot in DRAM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) struct snd_ppp_mixer_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	__u32			type; /*Type of the parameter */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	__u32			size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 	__u32			input_stream_bitmap; /*Input stream Bit Map*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) struct snd_sst_lib_download {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	struct module_info lib_info; /* library info type, capabilities etc */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 	struct lib_slot_info slot_info; /* slot info to be downloaded */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	u32 mod_entry_pt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) struct snd_sst_lib_download_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	struct snd_sst_lib_download dload_lib;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	u16 result;	/* Result used for acknowledgment */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	u8 pvt_id; /* Private ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 	u8 reserved;  /* for alignment */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) struct snd_pcm_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 	u8 num_chan;	/* 1=Mono, 2=Stereo */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 	u8 pcm_wd_sz;	/* 16/24 - bit*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	u8 use_offload_path;	/* 0-PCM using period elpased & ALSA interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 				   1-PCM stream via compressed interface  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	u8 reserved2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	u32 sfreq;    /* Sampling rate in Hz */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	u8 channel_map[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) /* MP3 Music Parameters Message */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) struct snd_mp3_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	u8  num_chan;	/* 1=Mono, 2=Stereo	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	u8  pcm_wd_sz; /* 16/24 - bit*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 	u8  crc_check; /* crc_check - disable (0) or enable (1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	u8  reserved1; /* unused*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 	u16 reserved2;	/* Unused */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) #define AAC_BIT_STREAM_ADTS		0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) #define AAC_BIT_STREAM_ADIF		1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) #define AAC_BIT_STREAM_RAW		2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) /* AAC Music Parameters Message */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) struct snd_aac_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	u8 num_chan; /* 1=Mono, 2=Stereo*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	u8 pcm_wd_sz; /* 16/24 - bit*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	u8 bdownsample; /*SBR downsampling 0 - disable 1 -enabled AAC+ only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	u8 bs_format; /* input bit stream format adts=0, adif=1, raw=2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	u16  reser2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 	u32 externalsr; /*sampling rate of basic AAC raw bit stream*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	u8 sbr_signalling;/*disable/enable/set automode the SBR tool.AAC+*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	u8 reser1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	u16  reser3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) /* WMA Music Parameters Message */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) struct snd_wma_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	u8  num_chan;	/* 1=Mono, 2=Stereo */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 	u8  pcm_wd_sz;	/* 16/24 - bit*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	u16 reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 	u32 brate;	/* Use the hard coded value. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	u32 sfreq;	/* Sampling freq eg. 8000, 441000, 48000 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	u32 channel_mask;  /* Channel Mask */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	u16 format_tag;	/* Format Tag */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 	u16 block_align;	/* packet size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 	u16 wma_encode_opt;/* Encoder option */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 	u8 op_align;	/* op align 0- 16 bit, 1- MSB, 2 LSB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	u8 reserved;	/* reserved */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) /* Codec params struture */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) union  snd_sst_codec_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	struct snd_pcm_params pcm_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	struct snd_mp3_params mp3_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	struct snd_aac_params aac_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 	struct snd_wma_params wma_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) /* Address and size info of a frame buffer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) struct sst_address_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	u32 addr; /* Address at IA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 	u32 size; /* Size of the buffer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) struct snd_sst_alloc_params_ext {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 	__u16 sg_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 	__u16 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	__u32 frag_size;	/*Number of samples after which period elapsed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 				  message is sent valid only if path  = 0*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 	struct sst_address_info  ring_buf_info[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) struct snd_sst_stream_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	union snd_sst_codec_params uc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) struct snd_sst_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 	u32 result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	u32 stream_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 	u8 codec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	u8 ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 	u8 stream_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 	u8 device_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	u8 task;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	struct snd_sst_stream_params sparams;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 	struct snd_sst_alloc_params_ext aparams;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) struct snd_sst_alloc_mrfld {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	u16 codec_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	u8 operation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	u8 sg_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	struct sst_address_info ring_buf_info[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 	u32 frag_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 	u32 ts;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 	struct snd_sst_stream_params codec_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) /* Alloc stream params structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) struct snd_sst_alloc_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	struct snd_sst_str_type str_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	struct snd_sst_stream_params stream_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	struct snd_sst_alloc_params_ext alloc_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) /* Alloc stream response message */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) struct snd_sst_alloc_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	struct snd_sst_str_type str_type; /* Stream type for allocation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	struct snd_sst_lib_download lib_dnld; /* Valid only for codec dnld */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) /* Drop response */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) struct snd_sst_drop_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	u32 result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	u32 bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) struct snd_sst_async_msg {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	u32 msg_id; /* Async msg id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	u32 payload[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) struct snd_sst_async_err_msg {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 	u32 fw_resp; /* Firmware Result */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 	u32 lib_resp; /*Library result */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) struct snd_sst_vol {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 	u32	stream_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 	s32	volume;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 	u32	ramp_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 	u32	ramp_type;		/* Ramp type, default=0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) /* Gain library parameters for mrfld
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446)  * based on DSP command spec v0.82
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) struct snd_sst_gain_v2 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 	u16 gain_cell_num;  /* num of gain cells to modify*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 	u8 cell_nbr_idx; /* instance index*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 	u8 cell_path_idx; /* pipe-id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 	u16 module_id; /*module id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 	u16 left_cell_gain; /* left gain value in dB*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 	u16 right_cell_gain; /* right gain value in dB*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	u16 gain_time_const; /* gain time constant*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) struct snd_sst_mute {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 	u32	stream_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	u32	mute;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) struct snd_sst_runtime_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 	u8 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 	u8 str_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 	u8 size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 	u8 rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	void *addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) enum stream_param_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	SST_SET_TIME_SLOT = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 	SST_SET_CHANNEL_INFO = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 	OTHERS = 2, /*reserved for future params*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) /* CSV Voice call routing structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) struct snd_sst_control_routing {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 	u8 control; /* 0=start, 1=Stop */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 	u8 reserved[3];	/* Reserved- for 32 bit alignment */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) struct ipc_post {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 	struct list_head node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 	union ipc_header header; /* driver specific */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 	bool is_large;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 	bool is_process_reply;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 	union ipc_header_mrfld mrfld_header;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 	char *mailbox_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) struct snd_sst_ctxt_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 	u32 address; /* Physical Address in DDR where the context is stored */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 	u32 size; /* size of the context */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) struct snd_sst_lpe_log_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 	u8 dbg_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 	u8 module_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 	u8 log_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 	u8 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) enum snd_sst_bytes_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 	SND_SST_BYTES_SET = 0x1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 	SND_SST_BYTES_GET = 0x2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) struct snd_sst_bytes_v2 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 	u8 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 	u8 ipc_msg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 	u8 block;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 	u8 task_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 	u8 pipe_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 	u8 rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 	u16 len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 	char bytes[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) #define MAX_VTSV_FILES 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) struct snd_sst_vtsv_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) 	struct sst_address_info vfiles[MAX_VTSV_FILES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) #endif /* __SST_MFLD_DSP_H__ */