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 <quic_kjayakum@quicinc.com>
Signed-off-by: Wasim Khan <quic_wasikhan@quicinc.com>
This commit is contained in:
wasikhan
2022-02-18 10:11:55 -08:00
committed by Wasim Khan
parent eb511bb3f5
commit ba5572d0c7
2 changed files with 4 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. * 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 <linux/dma-mapping.h> #include <linux/dma-mapping.h>
@@ -364,14 +364,6 @@ void cam_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr)
dma_buf_vunmap(dmabuf, &mapping); 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 #else
void cam_smmu_util_iommu_custom(struct device *dev, void cam_smmu_util_iommu_custom(struct device *dev,
dma_addr_t discard_start, size_t discard_length) 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); dma_buf_vunmap(dmabuf, vaddr);
} }
int cam_get_ddr_type(void)
{
return of_fdt_get_ddrtype();
}
#endif #endif

View File

@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#ifndef _CAM_COMPAT_H_ #ifndef _CAM_COMPAT_H_
@@ -13,6 +14,7 @@
#include <linux/qcom_scm.h> #include <linux/qcom_scm.h>
#include <linux/list_sort.h> #include <linux/list_sort.h>
#include <linux/dma-iommu.h> #include <linux/dma-iommu.h>
#include <soc/qcom/of_common.h>
#include "cam_csiphy_dev.h" #include "cam_csiphy_dev.h"
#include "cam_cpastop_hw.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_free_clear(const void *);
void cam_check_iommu_faults(struct iommu_domain *domain, void cam_check_iommu_faults(struct iommu_domain *domain,
struct cam_smmu_pf_info *pf_info); 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); 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_compat_util_put_dmabuf_va(struct dma_buf *dmabuf, void *vaddr);
void cam_smmu_util_iommu_custom(struct device *dev, void cam_smmu_util_iommu_custom(struct device *dev,