From 5e15ccdf448bc9efa4b2c04466eab5b439a580fa Mon Sep 17 00:00:00 2001 From: Mayank Rana Date: Thu, 8 Apr 2021 16:47:51 -0700 Subject: [PATCH] llcc: Add declaration of APIs when CONFIG_QCOM_LLCC is not enabled This change declares set of APIs to fix linking errors seen with client driver compilation when CONFIG_QCOM_LLCC is not enabled. llcc manager's client driver doesn't use core llcc driver APIs. Hence it doesn't need to include llcc-qcom.h. This results into below warning while compiling client driver. warning: declaration of 'struct llcc_slice_config' will not be visible outside of this function [-Wvisibility] Hence include llcc-qcom.h within llcc-slice.h file. So llcc manager's client driver doesn't need to directly include llcc-qcom.h file as it doesn't use any of core driver APIs. Change-Id: If7232818856876be170af9d2fa7633ff3791d3f2 Signed-off-by: Mayank Rana --- drivers/soc/qcom/llcc-slice.c | 1 - include/linux/soc/qcom/llcc-tcm.h | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/llcc-slice.c b/drivers/soc/qcom/llcc-slice.c index eb09736b924e..bf5ec56a6395 100644 --- a/drivers/soc/qcom/llcc-slice.c +++ b/drivers/soc/qcom/llcc-slice.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #define ACTIVATE BIT(0) diff --git a/include/linux/soc/qcom/llcc-tcm.h b/include/linux/soc/qcom/llcc-tcm.h index 1ce35ef80d73..a689d49f72b8 100644 --- a/include/linux/soc/qcom/llcc-tcm.h +++ b/include/linux/soc/qcom/llcc-tcm.h @@ -6,6 +6,8 @@ #ifndef _TCM_QCOM_H_ #define _TCM_QCOM_H_ +#include + struct llcc_tcm_data { phys_addr_t phys_addr; void __iomem *virt_addr; @@ -16,6 +18,8 @@ int qcom_llcc_tcm_probe(struct platform_device *pdev, const struct llcc_slice_config *table, size_t size, struct device_node *node); +#if IS_ENABLED(CONFIG_QCOM_LLCC) + struct llcc_tcm_data *llcc_tcm_activate(void); phys_addr_t llcc_tcm_get_phys_addr(struct llcc_tcm_data *tcm_data); @@ -25,5 +29,21 @@ void __iomem *llcc_tcm_get_virt_addr(struct llcc_tcm_data *tcm_data); size_t llcc_tcm_get_slice_size(struct llcc_tcm_data *tcm_data); void llcc_tcm_deactivate(struct llcc_tcm_data *tcm_data); +#else +static struct llcc_tcm_data *llcc_tcm_activate(void) +{ return NULL; } + +static phys_addr_t llcc_tcm_get_phys_addr(struct llcc_tcm_data *tcm_data) +{ return 0; } + +static void __iomem *llcc_tcm_get_virt_addr(struct llcc_tcm_data *tcm_data) +{ return NULL; } + +static size_t llcc_tcm_get_slice_size(struct llcc_tcm_data *tcm_data) +{ return 0; } + +static void llcc_tcm_deactivate(struct llcc_tcm_data *tcm_data) +{ } +#endif #endif //_TCM_QCOM_H_