From 923be76f78964845a60c81e688e024420a1e371b Mon Sep 17 00:00:00 2001 From: Vignesh Kulothungan Date: Thu, 2 Jan 2020 16:20:19 -0800 Subject: [PATCH] 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 --- dsp/Kbuild | 6 ++++-- dsp/q6_init.h | 16 +++++++++++++++- include/dsp/q6core.h | 9 ++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/dsp/Kbuild b/dsp/Kbuild index cd75541891..bafd111adb 100644 --- a/dsp/Kbuild +++ b/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 diff --git a/dsp/q6_init.h b/dsp/q6_init.h index 4df2e03270..57439d16a2 100644 --- a/dsp/q6_init.h +++ b/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); diff --git a/include/dsp/q6core.h b/include/dsp/q6core.h index 210471cd2d..45ecd4f79c 100644 --- a/include/dsp/q6core.h +++ b/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);