diff options
-rw-r--r-- | cvq_ioctl.h | 2 | ||||
-rw-r--r-- | cvq_util.c | 17 | ||||
-rw-r--r-- | iaxxx-odsp.h | 21 | ||||
-rw-r--r-- | iaxxx_odsp_hw.c | 39 | ||||
-rw-r--r-- | iaxxx_odsp_hw.h | 13 | ||||
-rw-r--r-- | sound_trigger_hw_iaxxx.c | 41 |
6 files changed, 6 insertions, 127 deletions
diff --git a/cvq_ioctl.h b/cvq_ioctl.h index a1b6c72..b21048d 100644 --- a/cvq_ioctl.h +++ b/cvq_ioctl.h @@ -179,6 +179,4 @@ int enable_downlink_audio_route(struct audio_route *route_hdl, bool enable); int flush_model(struct iaxxx_odsp_hw *odsp_hdl, int kw_type); int get_entity_param_blk(struct iaxxx_odsp_hw *odsp_hdl, void *payload, unsigned int payload_size); -int setup_mpll_clock_source(struct iaxxx_odsp_hw *odsp_hdl, - const int clk_source, const uint32_t clk_value); #endif /* _CVQ_IOCTL_H */ @@ -1315,20 +1315,3 @@ int get_entity_param_blk(struct iaxxx_odsp_hw *odsp_hdl, void *payload, } return err; } - -int setup_mpll_clock_source(struct iaxxx_odsp_hw *odsp_hdl, - const int clk_source, const uint32_t clk_value) -{ - int err; - ALOGD("+%s+ clk_src:%d", __func__, clk_source); - - err = iaxxx_odsp_set_mpll_src(odsp_hdl, - clk_source, clk_value); - if (err != 0) { - ALOGE("%s: ERROR Failed to set internal oscillator", - __func__); - return err; - } - ALOGD("-%s-", __func__); - return err; -} diff --git a/iaxxx-odsp.h b/iaxxx-odsp.h index 676fe09..daa8a2b 100644 --- a/iaxxx-odsp.h +++ b/iaxxx-odsp.h @@ -24,11 +24,6 @@ #define IAXXX_PLUGIN_VER_STR_SIZE_MAX (100) #define IAXXX_MAX_PLUGIN_ENDPOINTS (16) #define IAXXX_MAX_VER_STR_SIZE (20) -enum iaxxx_pll_source { - IAXXX_SRC_SYSCLK = 0, - IAXXX_INT_OSC = 9, - IAXXX_EXT_OSC = 11, -}; struct iaxxx_plugin_info { uint32_t plg_idx; @@ -91,10 +86,6 @@ struct iaxxx_get_event { uint16_t event_id; uint32_t data; }; -struct iaxxx_pll_clk_data { - uint32_t clk_src; - uint32_t clk_val; -}; struct iaxxx_pkg_mgmt_info { char pkg_name[NAME_MAX_SIZE]; uint32_t pkg_id; @@ -204,10 +195,10 @@ struct iaxxx_sys_versions { #define ODSP_PLG_GET_PACKAGE_VERSION _IO(IAXXX_IOCTL_MAGIC, 0x2A) #define ODSP_PLG_GET_PLUGIN_VERSION _IO(IAXXX_IOCTL_MAGIC, 0x2B) #define ODSP_SET_MPLL_SRC _IO(IAXXX_IOCTL_MAGIC, 0x2C) -#define ODSP_EVENT_RESET_READ_INDEX _IO(IAXXX_IOCTL_MAGIC, 0x2D) -#define ODSP_PLG_GET_ENDPOINT_TIMESTAMPS _IO(IAXXX_IOCTL_MAGIC, 0x2E) -#define ODSP_GET_PROC_EXECUTION_STATUS _IO(IAXXX_IOCTL_MAGIC, 0x2F) -#define ODSP_GET_SYS_VERSIONS _IO(IAXXX_IOCTL_MAGIC, 0x30) -#define ODSP_GET_SYS_DEVICE_ID _IO(IAXXX_IOCTL_MAGIC, 0x31) -#define ODSP_GET_SYS_MODE _IO(IAXXX_IOCTL_MAGIC, 0x32) +#define ODSP_EVENT_RESET_READ_INDEX _IO(IAXXX_IOCTL_MAGIC, 0x2C) +#define ODSP_PLG_GET_ENDPOINT_TIMESTAMPS _IO(IAXXX_IOCTL_MAGIC, 0x2D) +#define ODSP_GET_PROC_EXECUTION_STATUS _IO(IAXXX_IOCTL_MAGIC, 0x2E) +#define ODSP_GET_SYS_VERSIONS _IO(IAXXX_IOCTL_MAGIC, 0x2F) +#define ODSP_GET_SYS_DEVICE_ID _IO(IAXXX_IOCTL_MAGIC, 0x30) +#define ODSP_GET_SYS_MODE _IO(IAXXX_IOCTL_MAGIC, 0x31) #endif diff --git a/iaxxx_odsp_hw.c b/iaxxx_odsp_hw.c index aae0fef..27023a1 100644 --- a/iaxxx_odsp_hw.c +++ b/iaxxx_odsp_hw.c @@ -1530,45 +1530,6 @@ func_exit: } /** - * Set the MPLL clock source and value - * - * Input - odsp_hd_hdl - Handle to odsp hw structure - * clk_source - Clock source, internal or external - * clk_value - Clock value - * - * Output - 0 on success, on failure < 0 - */ -int iaxxx_odsp_set_mpll_src(struct iaxxx_odsp_hw *odsp_hw_hdl, - const enum iaxxx_pll_source clk_source, - const uint32_t clk_value) -{ - int err = 0; - struct iaxxx_pll_clk_data pll_clk_data; - - FUNCTION_ENTRY_LOG; - - if (odsp_hw_hdl == NULL) { - ALOGE("%s: ERROR: Invalid handle to iaxxx_odsp_hw", __func__); - err = -1; - goto func_exit; - } - - pll_clk_data.clk_src = clk_source; - pll_clk_data.clk_val = clk_value; - - err = ioctl(fileno(odsp_hw_hdl->dev_node), ODSP_SET_MPLL_SRC, - (unsigned long)&pll_clk_data); - if (err != 0) { - ALOGE("%s: ERROR: Failed to set the MPLL source with error %s", - __func__, strerror(errno)); - } -func_exit: - FUNCTION_EXIT_LOG; - return err; - -} - -/** * Returns the execution status of given processor * * Input - odsp_hw_hdl - Handle to odsp hw structure diff --git a/iaxxx_odsp_hw.h b/iaxxx_odsp_hw.h index 31840b3..afecff7 100644 --- a/iaxxx_odsp_hw.h +++ b/iaxxx_odsp_hw.h @@ -576,19 +576,6 @@ int iaxxx_odsp_plugin_get_endpoint_status( struct iaxxx_plugin_endpoint_status_data *plugin_ep_status_data); /** - * Set the MPLL clock source and value - * - * Input - odsp_hd_hdl - Handle to odsp hw structure - * clk_source - Clock source, internal or external - * clk_value - Clock value - * - * Output - 0 on success, on failure < 0 - */ -int iaxxx_odsp_set_mpll_src(struct iaxxx_odsp_hw *odsp_hw_hdl, - const enum iaxxx_pll_source clk_source, - const uint32_t clk_value); - -/** * Returns the execution status of given processor * * Input - odsp_hw_hdl - Handle to odsp hw structure diff --git a/sound_trigger_hw_iaxxx.c b/sound_trigger_hw_iaxxx.c index e30da16..7a95538 100644 --- a/sound_trigger_hw_iaxxx.c +++ b/sound_trigger_hw_iaxxx.c @@ -144,7 +144,6 @@ struct knowles_sound_trigger_device { bool is_mic_route_enabled; bool is_music_playing; bool is_bargein_route_enabled; - bool is_internal_osc_switched; bool is_buffer_package_loaded; bool is_st_hal_ready; @@ -415,22 +414,6 @@ static void stdev_close_term_sock(struct knowles_sound_trigger_device *stdev) } } -static int switch_internal_osc(struct knowles_sound_trigger_device *stdev) -{ - int err = 0; - if (stdev->is_internal_osc_switched == false) { - err = setup_mpll_clock_source(stdev->odsp_hdl, - IAXXX_INT_OSC, 0); - if (err != 0) { - ALOGE("%s: ERROR Failed to set internal oscillator", - __func__); - return err; - } - stdev->is_internal_osc_switched = true; - } - return err; -} - static int configure_buffer_plugin(struct knowles_sound_trigger_device *stdev, enum buffer_configuration req_config) { int err = 0; @@ -750,7 +733,6 @@ static int handle_input_source(struct knowles_sound_trigger_device *stdev, */ if (enable) { if (stdev->is_mic_route_enabled == false) { - switch_internal_osc(stdev); stdev->is_mic_route_enabled = true; err = enable_mic_route(stdev->route_hdl, true, ct); if (err != 0) { @@ -806,13 +788,6 @@ static int handle_input_source(struct knowles_sound_trigger_device *stdev, stdev->is_mic_route_enabled = true; goto exit; } - if (stdev->is_internal_osc_switched == true && - !(stdev->current_enable & OSLO_MASK) && - stdev->is_mic_route_enabled == false) { - // Mic disable, Sensor disable, internal osc = false - ALOGD("external osc switch happens in driver runtime pm"); - stdev->is_internal_osc_switched = false; - } } } } @@ -850,7 +825,6 @@ static int restart_recognition(struct knowles_sound_trigger_device *stdev) if (stdev->is_mic_route_enabled == true) { //TBD - switch_internal_osc(stdev); err = enable_mic_route(stdev->route_hdl, true, ct); if (err != 0) { ALOGE("failed to restart mic route"); @@ -877,7 +851,6 @@ static int restart_recognition(struct knowles_sound_trigger_device *stdev) if (check_uuid_equality(stdev->models[i].uuid, stdev->sensor_model_uuid)) { // setup the sensor route - switch_internal_osc(stdev); err = setup_sensor_package(stdev->odsp_hdl); if (err != 0) { ALOGE("%s: setup Sensor package failed", __func__); @@ -917,12 +890,6 @@ static int fw_crash_recovery(struct knowles_sound_trigger_device *stdev) { int err = 0; - err = iaxxx_odsp_set_mpll_src(stdev->odsp_hdl, IAXXX_INT_OSC, 0); - if (err != 0) { - ALOGE("%s: ERROR Failed to set internal oscillator", - __func__); - } - // Redownload the keyword model files and start recognition err = restart_recognition(stdev); if (err != 0) { @@ -1315,7 +1282,6 @@ static int stdev_load_sound_model(const struct sound_trigger_hw_device *dev, } else if (check_uuid_equality(stdev->models[i].uuid, stdev->sensor_model_uuid)) { // setup the sensor route - switch_internal_osc(stdev); stdev->current_enable = stdev->current_enable | OSLO_MASK; ret = setup_sensor_package(stdev->odsp_hdl); if (ret != 0) { @@ -1405,12 +1371,6 @@ static int stdev_unload_sound_model(const struct sound_trigger_hw_device *dev, ALOGE("%s: destroy Sensor package failed", __func__); } stdev->current_enable = stdev->current_enable & ~OSLO_MASK; - - if (stdev->is_internal_osc_switched == true && - stdev->is_mic_route_enabled == false) { - ALOGD("external osc switch happens in driver runtime pm"); - stdev->is_internal_osc_switched = false; - } } else if (check_uuid_equality(stdev->models[handle].uuid, stdev->chre_model_uuid)) { // Disable the CHRE route @@ -1950,7 +1910,6 @@ static int stdev_open(const hw_module_t *module, const char *name, stdev->is_mic_route_enabled = false; stdev->is_music_playing = false; stdev->is_bargein_route_enabled = false; - stdev->is_internal_osc_switched = false; stdev->is_buffer_package_loaded = false; stdev->current_enable = 0; stdev->bc = NOT_CONFIGURED; |