cam_compat.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _CAM_COMPAT_H_
  6. #define _CAM_COMPAT_H_
  7. #include <linux/version.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/component.h>
  10. #include <linux/iommu.h>
  11. #include <linux/qcom_scm.h>
  12. #include "cam_csiphy_dev.h"
  13. #include "cam_cpastop_hw.h"
  14. #include "cam_smmu_api.h"
  15. #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
  16. #include <linux/ion.h>
  17. #include <linux/msm_ion.h>
  18. #define VFL_TYPE_VIDEO VFL_TYPE_GRABBER
  19. #endif
  20. #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) && \
  21. LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
  22. #include <soc/qcom/of_common.h>
  23. #include <linux/qcom-dma-mapping.h>
  24. #endif
  25. struct cam_fw_alloc_info {
  26. struct device *fw_dev;
  27. void *fw_kva;
  28. uint64_t fw_hdl;
  29. };
  30. int cam_reserve_icp_fw(struct cam_fw_alloc_info *icp_fw, size_t fw_length);
  31. void cam_unreserve_icp_fw(struct cam_fw_alloc_info *icp_fw, size_t fw_length);
  32. void cam_cpastop_scm_write(struct cam_cpas_hw_errata_wa *errata_wa);
  33. int cam_ife_notify_safe_lut_scm(bool safe_trigger);
  34. int camera_component_match_add_drivers(struct device *master_dev,
  35. struct component_match **match_list);
  36. int cam_csiphy_notify_secure_mode(struct csiphy_device *csiphy_dev,
  37. bool protect, int32_t offset);
  38. void cam_free_clear(const void *);
  39. void cam_check_iommu_faults(struct iommu_domain *domain,
  40. struct cam_smmu_pf_info *pf_info);
  41. int cam_get_ddr_type(void);
  42. #endif /* _CAM_COMPAT_H_ */