cam_compat.h 1.5 KB

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