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 _LSM_PARAMS_H__ 20 #define _LSM_PARAMS_H__ 21 #define LSM_POLLING_ENABLE_SUPPORT 22 #define LSM_EVENT_TIMESTAMP_MODE_SUPPORT 23 #include <linux/types.h> 24 #include <sound/asound.h> 25 #define SNDRV_LSM_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0) 26 #define LSM_OUT_FORMAT_PCM (0) 27 #define LSM_OUT_FORMAT_ADPCM (1 << 0) 28 #define LSM_OUT_DATA_RAW (0) 29 #define LSM_OUT_DATA_PACKED (1) 30 #define LSM_OUT_DATA_EVENTS_DISABLED (0) 31 #define LSM_OUT_DATA_EVENTS_ENABLED (1) 32 #define LSM_OUT_TRANSFER_MODE_RT (0) 33 #define LSM_OUT_TRANSFER_MODE_FTRT (1) 34 #define LSM_ENDPOINT_DETECT_THRESHOLD (0) 35 #define LSM_OPERATION_MODE (1) 36 #define LSM_GAIN (2) 37 #define LSM_MIN_CONFIDENCE_LEVELS (3) 38 #define LSM_REG_SND_MODEL (4) 39 #define LSM_DEREG_SND_MODEL (5) 40 #define LSM_CUSTOM_PARAMS (6) 41 #define LSM_POLLING_ENABLE (7) 42 #define LSM_PARAMS_MAX (LSM_POLLING_ENABLE + 1) 43 #define LSM_EVENT_NON_TIME_STAMP_MODE (0) 44 #define LSM_EVENT_TIME_STAMP_MODE (1) 45 enum lsm_app_id { 46 LSM_VOICE_WAKEUP_APP_ID = 1, 47 LSM_VOICE_WAKEUP_APP_ID_V2 = 2, 48 }; 49 enum lsm_detection_mode { 50 LSM_MODE_KEYWORD_ONLY_DETECTION = 1, 51 LSM_MODE_USER_KEYWORD_DETECTION 52 }; 53 enum lsm_vw_status { 54 LSM_VOICE_WAKEUP_STATUS_RUNNING = 1, 55 LSM_VOICE_WAKEUP_STATUS_DETECTED, 56 LSM_VOICE_WAKEUP_STATUS_END_SPEECH, 57 LSM_VOICE_WAKEUP_STATUS_REJECTED 58 }; 59 struct snd_lsm_ep_det_thres { 60 __u32 epd_begin; 61 __u32 epd_end; 62 }; 63 struct snd_lsm_detect_mode { 64 enum lsm_detection_mode mode; 65 bool detect_failure; 66 }; 67 struct snd_lsm_gain { 68 __u16 gain; 69 }; 70 struct snd_lsm_poll_enable { 71 bool poll_en; 72 }; 73 struct snd_lsm_sound_model_v2 { 74 __u8 * data; 75 __u8 * confidence_level; 76 __u32 data_size; 77 enum lsm_detection_mode detection_mode; 78 __u8 num_confidence_levels; 79 bool detect_failure; 80 }; 81 struct snd_lsm_session_data { 82 enum lsm_app_id app_id; 83 }; 84 struct snd_lsm_event_status { 85 __u16 status; 86 __u16 payload_size; 87 __u8 payload[0]; 88 }; 89 struct snd_lsm_event_status_v3 { 90 __u32 timestamp_lsw; 91 __u32 timestamp_msw; 92 __u16 status; 93 __u16 payload_size; 94 __u8 payload[0]; 95 }; 96 struct snd_lsm_detection_params { 97 __u8 * conf_level; 98 enum lsm_detection_mode detect_mode; 99 __u8 num_confidence_levels; 100 bool detect_failure; 101 bool poll_enable; 102 }; 103 struct lsm_params_info { 104 __u32 module_id; 105 __u32 param_id; 106 __u32 param_size; 107 __u8 * param_data; 108 uint32_t param_type; 109 }; 110 struct snd_lsm_module_params { 111 __u8 * params; 112 __u32 num_params; 113 __u32 data_size; 114 }; 115 struct snd_lsm_output_format_cfg { 116 __u8 format; 117 __u8 packing; 118 __u8 events; 119 __u8 mode; 120 }; 121 #define SNDRV_LSM_DEREG_SND_MODEL _IOW('U', 0x01, int) 122 #define SNDRV_LSM_EVENT_STATUS _IOW('U', 0x02, struct snd_lsm_event_status) 123 #define SNDRV_LSM_ABORT_EVENT _IOW('U', 0x03, int) 124 #define SNDRV_LSM_START _IOW('U', 0x04, int) 125 #define SNDRV_LSM_STOP _IOW('U', 0x05, int) 126 #define SNDRV_LSM_SET_SESSION_DATA _IOW('U', 0x06, struct snd_lsm_session_data) 127 #define SNDRV_LSM_REG_SND_MODEL_V2 _IOW('U', 0x07, struct snd_lsm_sound_model_v2) 128 #define SNDRV_LSM_LAB_CONTROL _IOW('U', 0x08, uint32_t) 129 #define SNDRV_LSM_STOP_LAB _IO('U', 0x09) 130 #define SNDRV_LSM_SET_PARAMS _IOW('U', 0x0A, struct snd_lsm_detection_params) 131 #define SNDRV_LSM_SET_MODULE_PARAMS _IOW('U', 0x0B, struct snd_lsm_module_params) 132 #define SNDRV_LSM_OUT_FORMAT_CFG _IOW('U', 0x0C, struct snd_lsm_output_format_cfg) 133 #define SNDRV_LSM_SET_PORT _IO('U', 0x0D) 134 #define SNDRV_LSM_SET_FWK_MODE_CONFIG _IOW('U', 0x0E, uint32_t) 135 #define SNDRV_LSM_EVENT_STATUS_V3 _IOW('U', 0x0F, struct snd_lsm_event_status_v3) 136 #endif 137 138