aboutsummaryrefslogtreecommitdiffstats
path: root/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-09 17:59:18 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:52:51 +0200
commitbf9611f54cc183d6a7d61d0e4754de963c154d3a (patch)
treec457168b51d9827886cbf2d02196fc853c9c51f8 /4a-hal/4a-hal-utilities/4a-hal-utilities-data.c
parentfc6a9c748dab532faa2fbc2d27eeca169dd7e1ef (diff)
Add a function to search for hal using its dev-id
Add a function that allows to search for an already ready hal using its device id. This function will be useful at mixer attach of hal to check if the alsa device id is not already attach by another hal. Change-Id: I2f46dca19a98310064ed1af772425bd9186e0a75 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal/4a-hal-utilities/4a-hal-utilities-data.c')
-rw-r--r--4a-hal/4a-hal-utilities/4a-hal-utilities-data.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c
index d585f5d..b2c4b25 100644
--- a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c
+++ b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.c
@@ -187,6 +187,25 @@ struct SpecificHalData *HalUtlSearchHalDataByApiName(struct SpecificHalData **fi
return NULL;
}
+
+struct SpecificHalData *HalUtlSearchReadyHalDataByCarId(struct SpecificHalData **firstHalData, int cardId)
+{
+ struct SpecificHalData *currentApi;
+
+ if(! firstHalData)
+ return NULL;
+
+ currentApi = *firstHalData;
+ while(currentApi) {
+ if(currentApi->status == HAL_STATUS_READY && currentApi->sndCardId == cardId)
+ return currentApi;
+
+ currentApi = currentApi->next;
+ }
+
+ return NULL;
+}
+
/*******************************************************************************
* Hal Manager data handling functions *
******************************************************************************/