From fa8a50289b7d645f0ed541b4ee7afa83efdd7b39 Mon Sep 17 00:00:00 2001 From: Vachounet Date: Wed, 3 Jan 2018 17:21:47 +0100 Subject: [PATCH] sanders: add ssr and sound trigger headers * Fix audio HAL --- BoardConfig.mk | 2 + include/sound_trigger_prop_intf.h | 66 +++++++++++++++++++++++++++++++ include/surround_rec_interface.h | 32 +++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 include/sound_trigger_prop_intf.h create mode 100644 include/surround_rec_interface.h diff --git a/BoardConfig.mk b/BoardConfig.mk index 7ccbe72..c13559d 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -18,6 +18,8 @@ DEVICE_PATH := device/motorola/sanders +TARGET_SPECIFIC_HEADER_PATH := $(DEVICE_PATH)/include + BOARD_VENDOR := motorola-qcom # AIDs and CAPS diff --git a/include/sound_trigger_prop_intf.h b/include/sound_trigger_prop_intf.h new file mode 100644 index 0000000..bde563f --- /dev/null +++ b/include/sound_trigger_prop_intf.h @@ -0,0 +1,66 @@ +/* + * Extrapolated / reversed header for Sound Trigger + */ + +#ifndef SOUND_TRIGGER_PROP_INTF_H +#define SOUND_TRIGGER_PROP_INTF_H + +struct sound_trigger_session_info { + int capture_handle; + void* p_ses; + struct pcm_config config; +}; + +enum audio_event_type { + AUDIO_EVENT_CAPTURE_DEVICE_INACTIVE, + AUDIO_EVENT_CAPTURE_DEVICE_ACTIVE, + AUDIO_EVENT_PLAYBACK_STREAM_INACTIVE, + AUDIO_EVENT_PLAYBACK_STREAM_ACTIVE, + AUDIO_EVENT_STOP_LAB, + AUDIO_EVENT_SSR, + AUDIO_EVENT_NUM_ST_SESSIONS, + AUDIO_EVENT_READ_SAMPLES, + AUDIO_EVENT_DEVICE_CONNECT, + AUDIO_EVENT_DEVICE_DISCONNECT, + AUDIO_EVENT_SVA_EXEC_MODE, + AUDIO_EVENT_SVA_EXEC_MODE_STATUS, +}; + +enum sound_trigger_event_type { + ST_EVENT_SESSION_REGISTER, + ST_EVENT_SESSION_DEREGISTER +}; +typedef enum sound_trigger_event_type sound_trigger_event_type_t; + +enum ssr_event_status { + SND_CARD_STATUS_OFFLINE, + SND_CARD_STATUS_ONLINE, + CPE_STATUS_OFFLINE, + CPE_STATUS_ONLINE +}; + +struct sound_trigger_event_info { + struct sound_trigger_session_info st_ses; +}; +typedef struct sound_trigger_event_info sound_trigger_event_info_t; + +struct audio_read_samples_info { + struct sound_trigger_session_info *ses_info; + void *buf; + size_t num_bytes; +}; + +struct audio_event_info { + union { + enum ssr_event_status status; + int value; + void *str_value; + struct sound_trigger_session_info ses_info; + struct audio_read_samples_info aud_info; + }u; +}; +typedef struct audio_event_info audio_event_info_t; + +typedef int (*sound_trigger_hw_call_back_t)(enum audio_event_type, + struct audio_event_info*); +#endif diff --git a/include/surround_rec_interface.h b/include/surround_rec_interface.h new file mode 100644 index 0000000..e1b7b52 --- /dev/null +++ b/include/surround_rec_interface.h @@ -0,0 +1,32 @@ +/* + * Extrapolated / reversed header for SSR + */ + +#ifndef _SURROUND_REC_INTERFACE_H_ +#define _SURROUND_REC_INTERFACE_H_ + +typedef char *get_param(void *arg); +typedef void set_param(void *arg, const char *arg1); + +typedef struct get_param_data { + const char *name; + get_param *get_param_fn; +} get_param_data_t; + +typedef struct set_param_data { + const char *name; + set_param *set_param_fn; +} set_param_data_t; + +const get_param_data_t* surround_rec_get_get_param_data(void); + +const set_param_data_t* surround_rec_get_set_param_data(void); + +int surround_rec_init(void **arg, int arg1, int arg2, int arg3, + int arg4, const char *arg5); + +void surround_rec_deinit(void *arg); + +void surround_rec_process(void *arg, const int16_t *arg1, int16_t *arg2); + +#endif /* #ifndef _SURROUND_REC_INTERFACE_H_ */