uapi: lsm_params: add support for ADSP multi stage VA

Enhance APIs to get instance id and stage info from userspace,
required for multi-stage Voice Activation in ADSP.

Change-Id: I82703c63214925173f3f978339188ccddff8ba91
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Tento commit je obsažen v:
Dhananjay Kumar
2018-06-19 06:01:46 +05:30
rodič 5bb5ccdee1
revize f7b5f39f74

Zobrazit soubor

@@ -7,7 +7,10 @@
#include <linux/types.h>
#include <sound/asound.h>
#define SNDRV_LSM_VERSION SNDRV_PROTOCOL_VERSION(0, 3, 0)
#define SNDRV_LSM_VERSION SNDRV_PROTOCOL_VERSION(0, 3, 1)
#define LSM_MAX_STAGES_PER_SESSION 2
#define LSM_STAGE_INDEX_FIRST 0
#define LSM_OUT_FORMAT_PCM (0)
#define LSM_OUT_FORMAT_ADPCM (1 << 0)
@@ -30,7 +33,8 @@
#define LSM_CUSTOM_PARAMS (6)
#define LSM_POLLING_ENABLE (7)
#define LSM_DET_EVENT_TYPE (8)
#define LSM_PARAMS_MAX (LSM_DET_EVENT_TYPE + 1)
#define LSM_LAB_CONTROL (9)
#define LSM_PARAMS_MAX (LSM_LAB_CONTROL + 1)
#define LSM_EVENT_NON_TIME_STAMP_MODE (0)
#define LSM_EVENT_TIME_STAMP_MODE (1)
@@ -126,6 +130,36 @@ struct snd_lsm_session_data {
enum lsm_app_id app_id;
};
/*
* Stage info for multi-stage session
* @app_type: acdb app_type to be used to map topology/cal for the stage
* @lpi_enable: low power island mode applicable for the stage
*/
struct snd_lsm_stage_info {
__u32 app_type;
__u32 lpi_enable;
};
/*
* Session info for multi-stage session
* @app_id: VoiceWakeup engine id, this is now used to just validate input arg
* @num_stages: number of detection stages to be used
* @stage_info: stage info for each of the stage being used, ordered by index
*/
struct snd_lsm_session_data_v2 {
enum lsm_app_id app_id;
__u32 num_stages;
struct snd_lsm_stage_info stage_info[LSM_MAX_STAGES_PER_SESSION];
};
/*
* Data for LSM_LAB_CONTROL param_type
* @enable: lab enable or disable
*/
struct snd_lsm_lab_control {
__u32 enable;
};
struct snd_lsm_event_status {
__u16 status;
__u16 payload_size;
@@ -162,6 +196,7 @@ struct snd_lsm_detection_params {
* For CONFIDENCE_LEVELS, this is array of confidence levels
* For REG_SND_MODEL, this is the sound model data
* For CUSTOM_PARAMS, this is the blob of custom data.
* @param_type: Parameter type as defined in values upto LSM_PARAMS_MAX
*/
struct lsm_params_info {
__u32 module_id;
@@ -171,6 +206,38 @@ struct lsm_params_info {
uint32_t param_type;
};
/*
* Param info(version 2) for each parameter type
*
* Existing member variables:
* @module_id: Module to which parameter is to be set
* @param_id: Parameter that is to be set
* @param_size: size (in number of bytes) for the data
* in param_data.
* For confidence levels, this is num_conf_levels
* For REG_SND_MODEL, this is size of sound model
* For CUSTOM_PARAMS, this is size of the entire blob of data
* @param_data: Data for the parameter.
* For some param_types this is a structure defined, ex: LSM_GAIN
* For CONFIDENCE_LEVELS, this is array of confidence levels
* For REG_SND_MODEL, this is the sound model data
* For CUSTOM_PARAMS, this is the blob of custom data.
* @param_type: Parameter type as defined in values upto LSM_PARAMS_MAX
*
* Member variables applicable only to V2:
* @instance_id: instance id of the param to which parameter is to be set
* @stage_idx: detection stage for which the param is applicable
*/
struct lsm_params_info_v2 {
__u32 module_id;
__u32 param_id;
__u32 param_size;
__u8 __user *param_data;
uint32_t param_type;
__u16 instance_id;
__u16 stage_idx;
};
/*
* Data passed to the SET_PARAM_V2 IOCTL
* @num_params: Number of params that are to be set
@@ -240,5 +307,9 @@ struct snd_lsm_input_hw_params {
#define SNDRV_LSM_GENERIC_DET_EVENT _IOW('U', 0x10, struct snd_lsm_event_status)
#define SNDRV_LSM_SET_INPUT_HW_PARAMS _IOW('U', 0x11, \
struct snd_lsm_input_hw_params)
#define SNDRV_LSM_SET_SESSION_DATA_V2 _IOW('U', 0x12, \
struct snd_lsm_session_data_v2)
#define SNDRV_LSM_SET_MODULE_PARAMS_V2 _IOW('U', 0x13, \
struct snd_lsm_module_params)
#endif