diff options
author | Max Shi <meixuanshi@google.com> | 2019-06-28 17:19:07 -0700 |
---|---|---|
committer | Rios Kao <rioskao@google.com> | 2019-07-01 15:55:27 -0700 |
commit | c749946217cd28b1df144f69de8b5f7daa9979e6 (patch) | |
tree | 8277ef770383927e4af182c9a3a22424c44eea95 | |
parent | c0ba02a3897cf92f8dad36c4a972c08332f2d7d1 (diff) | |
download | android_hardware_knowles_athletico_sound_trigger_hal-c749946217cd28b1df144f69de8b5f7daa9979e6.tar.gz android_hardware_knowles_athletico_sound_trigger_hal-c749946217cd28b1df144f69de8b5f7daa9979e6.tar.bz2 android_hardware_knowles_athletico_sound_trigger_hal-c749946217cd28b1df144f69de8b5f7daa9979e6.zip |
sthal: subscribe to oslo data event
Bug: 136101324
Test: sanity check on oslo and chre
Change-Id: Id4210e9b49c72beb3e3f5ffda25a0110c6d66f56
-rw-r--r-- | cvq_ioctl.h | 1 | ||||
-rw-r--r-- | cvq_util.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/cvq_ioctl.h b/cvq_ioctl.h index 627fa67..0cafd61 100644 --- a/cvq_ioctl.h +++ b/cvq_ioctl.h @@ -54,6 +54,7 @@ #define SENSOR_PRESENCE_MODE 0 #define SENSOR_DETECTED_MODE 1 #define SENSOR_MAX_MODE 2 +#define OSLO_DATA_EVENT_ID 1 #define OSLO_CONFIGURED (0x201) #define OSLO_DESTROYED (0x202) #define OSLO_EP_DISCONNECT (0x205) @@ -493,6 +493,13 @@ int sensor_event_init_params(struct iaxxx_odsp_hw *odsp_hdl) goto exit; } + err = iaxxx_odsp_evt_subscribe(odsp_hdl, OSLO_EVT_SRC_ID, + OSLO_DATA_EVENT_ID, IAXXX_SYSID_HOST_1, 0); + if (err != 0) { + ALOGE("%s: ERROR: Sensor subscribe (oslo data event) failed %d(%s)", + __func__, errno, strerror(errno)); + goto exit; + } err = iaxxx_odsp_evt_subscribe(odsp_hdl, OSLO_EVT_SRC_ID, OSLO_CONFIGURED, IAXXX_SYSID_HOST_1, 0); @@ -565,6 +572,15 @@ static int sensor_event_deinit_params(struct iaxxx_odsp_hw *odsp_hdl) } err = iaxxx_odsp_evt_unsubscribe(odsp_hdl, OSLO_EVT_SRC_ID, + OSLO_DATA_EVENT_ID, IAXXX_SYSID_HOST_1); + if (err != 0) { + ALOGE("%s: Failed to unsubscribe sensor event (src id %d event id %d)" + " from host %d error %d(%s)", __func__, OSLO_EVT_SRC_ID, + OSLO_DATA_EVENT_ID, IAXXX_SYSID_HOST_1, errno, strerror(errno)); + goto exit; + } + + err = iaxxx_odsp_evt_unsubscribe(odsp_hdl, OSLO_EVT_SRC_ID, OSLO_CONFIGURED, IAXXX_SYSID_HOST_1); if (err != 0) { ALOGE("%s: Failed to unsubscribe sensor event (src id %d event id %d)" |