ASoC: rmmod fixes for audio drivers

For remove module(rmmod), update drivers
to cleanup resources and allow insert module
again without any issue.

Change-Id: Iddc6e5e11d986359afd3100bf3c5eab70cb1c1eb
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
diff --git a/dsp/q6afe.c b/dsp/q6afe.c
index 391a7f7..27c3285 100644
--- a/dsp/q6afe.c
+++ b/dsp/q6afe.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -7639,6 +7639,12 @@
 
 void afe_exit(void)
 {
+	if (this_afe.apr) {
+		apr_reset(this_afe.apr);
+		atomic_set(&this_afe.state, 0);
+		this_afe.apr = NULL;
+		rtac_set_afe_handle(this_afe.apr);
+	}
 	afe_delete_cal_data();
 
 	config_debug_fs_exit();