summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSebastien Guiriec <s-guiriec@ti.com>2010-11-05 14:46:22 +0100
committerSebastien Jan <s-jan@ti.com>2010-12-03 11:02:59 +0100
commit6ced80294efd58707eb4764db52ed540d14c7ec1 (patch)
treece213a985a6809c9af98d712be74fcf714f02fa3 /sound
parent547a59a1531829b79b654c24ce50415942074fc7 (diff)
ASoC: ABE HAL: Add API to check ABE activity
Introduce a new API in order to check if any ABE ports are running. Change-Id: I920548dfcbe95125fc30b871ff38ab9b550e8e7a Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/omap/abe/abe_api.h10
-rw-r--r--sound/soc/omap/abe/abe_lib.c24
2 files changed, 34 insertions, 0 deletions
diff --git a/sound/soc/omap/abe/abe_api.h b/sound/soc/omap/abe/abe_api.h
index c0e27c29ea1b..a6b814879e66 100644
--- a/sound/soc/omap/abe/abe_api.h
+++ b/sound/soc/omap/abe/abe_api.h
@@ -475,4 +475,14 @@ abehal_status abe_remote_debugger_interface(u32 n, u8 *p);
*
*/
abehal_status abe_enable_test_pattern(u32 smem_id, u32 on_off);
+/**
+ * abe_check_activity - Check if some ABE activity.
+ *
+ * Check if any ABE ports are running.
+ * return 1: still activity on ABE
+ * return 0: no more activity on ABE. Event generator can be stopped
+ *
+ */
+u32 abe_check_activity(void);
+
#endif/* _ABE_API_H_ */
diff --git a/sound/soc/omap/abe/abe_lib.c b/sound/soc/omap/abe/abe_lib.c
index b63d6f54d263..c9e0a8c1f2b2 100644
--- a/sound/soc/omap/abe/abe_lib.c
+++ b/sound/soc/omap/abe/abe_lib.c
@@ -522,3 +522,27 @@ void abe_decide_main_port(u32 id)
abe_select_main_port(id);
}
}
+/**
+ * abe_check_activity - Check if some ABE activity.
+ *
+ * Check if any ABE ports are running.
+ * return 1: still activity on ABE
+ * return 0: no more activity on ABE. Event generator can be stopped
+ *
+ */
+u32 abe_check_activity(void)
+{
+ u32 i;
+ u32 ret;
+
+ ret = 0;
+ for (i = 0; i < (LAST_PORT_ID - 1); i++) {
+ if (abe_port[abe_port_priority[i]].status ==
+ OMAP_ABE_PORT_ACTIVITY_RUNNING)
+ break;
+ }
+ if (i < (LAST_PORT_ID - 1))
+ ret = 1;
+
+ return ret;
+}