Browse Source

dsp: compile avtimer based on avtimer config

Enable compilation of avtimer only if CONFIG_MSM_AVTIMER
is enabled.

Change-Id: I64cc8c65dbe22fafee527da80d3615fb5201665f
Signed-off-by: Vignesh Kulothungan <[email protected]>
Vignesh Kulothungan 5 years ago
parent
commit
923be76f78
3 changed files with 27 additions and 4 deletions
  1. 4 2
      dsp/Kbuild
  2. 15 1
      dsp/q6_init.h
  3. 8 1
      include/dsp/q6core.h

+ 4 - 2
dsp/Kbuild

@@ -121,7 +121,6 @@ ifdef CONFIG_SND_SOC_MSM_QDSP6V2_INTF
 	Q6_OBJS += q6lsm.o
 	Q6_OBJS += adsp_err.o
 	Q6_OBJS += msm_audio_ion.o
-	Q6_OBJS += avtimer.o
 	Q6_OBJS += q6_init.o
 endif
 
@@ -140,10 +139,13 @@ ifdef CONFIG_SND_SOC_MSM_QDSP6V2_VM
 	Q6_OBJS += q6lsm.o
 	Q6_OBJS += adsp_err.o
 	Q6_OBJS += msm_audio_ion_vm.o
-	Q6_OBJS += avtimer.o
 	Q6_OBJS += q6_init.o
 endif
 
+ifdef CONFIG_MSM_AVTIMER
+	Q6_OBJS += avtimer.o
+endif
+
 ifdef CONFIG_XT_LOGGING
 	Q6_OBJS += sp_params.o
 endif

+ 15 - 1
dsp/q6_init.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  */
 
 #ifndef __Q6_INIT_H__
@@ -15,7 +15,14 @@ int audio_cal_init(void);
 int core_init(void);
 int rtac_init(void);
 int msm_audio_ion_init(void);
+#if IS_ENABLED(CONFIG_MSM_AVTIMER)
 int avtimer_init(void);
+#else
+static inline int avtimer_init(void)
+{
+	return 0;
+}
+#endif
 #ifdef CONFIG_MSM_MDF
 int msm_mdf_init(void);
 void msm_mdf_exit(void);
@@ -43,7 +50,14 @@ static inline void spk_params_exit(void)
 }
 #endif
 
+#if IS_ENABLED(CONFIG_MSM_AVTIMER)
 void avtimer_exit(void);
+#else
+static inline void avtimer_exit(void)
+{
+	return;
+}
+#endif
 void msm_audio_ion_exit(void);
 void rtac_exit(void);
 void core_exit(void);

+ 8 - 1
include/dsp/q6core.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
  */
 
 #ifndef __Q6CORE_H__
@@ -17,7 +17,14 @@
 
 bool q6core_is_adsp_ready(void);
 
+#if IS_ENABLED(CONFIG_MSM_AVTIMER)
 int avcs_core_query_timer_offset(int64_t *av_offset, int32_t clock_id);
+#else
+static inline int avcs_core_query_timer_offset(int64_t *av_offset,
+                                                int32_t clock_id) {
+        return 0;
+}
+#endif
 int q6core_get_service_version(uint32_t service_id,
 			       struct avcs_fwk_ver_info *ver_info,
 			       size_t size);