From ba5572d0c7d9faeb8ddf4a44e831c84ac5d8897e Mon Sep 17 00:00:00 2001 From: wasikhan Date: Fri, 18 Feb 2022 10:11:55 -0800 Subject: [PATCH] msm: camera: common: Reinstate API to check memory types Add back in check for ddr memory type to distinguish between DDR4/5 memory types. CRs-fixed: 3136181 Change-Id: Ia152cde2786bf6e3da172d2b7046f9871d4f8e3c Signed-off-by: Karthik Jayakumar Signed-off-by: Wasim Khan --- drivers/cam_utils/cam_compat.c | 15 +-------------- drivers/cam_utils/cam_compat.h | 4 +++- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/cam_utils/cam_compat.c b/drivers/cam_utils/cam_compat.c index 2e3fe6c45f..0a00baf016 100644 --- a/drivers/cam_utils/cam_compat.c +++ b/drivers/cam_utils/cam_compat.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * copyright (c) 2022, Qulacomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -364,14 +364,6 @@ void cam_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr) dma_buf_vunmap(dmabuf, &mapping); } - -int cam_get_ddr_type(void) -{ - /* We assume all chipsets running kernel version 5.15+ - * to be using only DDR5 based memory. - */ - return DDR_TYPE_LPDDR5; -} #else void cam_smmu_util_iommu_custom(struct device *dev, dma_addr_t discard_start, size_t discard_length) @@ -410,9 +402,4 @@ void cam_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr) { dma_buf_vunmap(dmabuf, vaddr); } - -int cam_get_ddr_type(void) -{ - return of_fdt_get_ddrtype(); -} #endif diff --git a/drivers/cam_utils/cam_compat.h b/drivers/cam_utils/cam_compat.h index 4ff5e6daf8..c07f935531 100644 --- a/drivers/cam_utils/cam_compat.h +++ b/drivers/cam_utils/cam_compat.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _CAM_COMPAT_H_ @@ -13,6 +14,7 @@ #include #include #include +#include #include "cam_csiphy_dev.h" #include "cam_cpastop_hw.h" @@ -47,7 +49,7 @@ int cam_csiphy_notify_secure_mode(struct csiphy_device *csiphy_dev, void cam_free_clear(const void *); void cam_check_iommu_faults(struct iommu_domain *domain, struct cam_smmu_pf_info *pf_info); -int cam_get_ddr_type(void); +static inline int cam_get_ddr_type(void) { return of_fdt_get_ddrtype(); } int cam_compat_util_get_dmabuf_va(struct dma_buf *dmabuf, uintptr_t *vaddr); void cam_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr); void cam_smmu_util_iommu_custom(struct device *dev,