cam_compat.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0)
  13. #define VFL_TYPE_VIDEO VFL_TYPE_GRABBER
  14. #endif
  15. #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
  16. #include <linux/msm_ion.h>
  17. #include <linux/ion.h>
  18. #include <linux/qcom_scm.h>
  19. #else
  20. #include <linux/msm_ion.h>
  21. #include <linux/ion_kernel.h>
  22. #include <soc/qcom/scm.h>
  23. #endif
  24. struct cam_fw_alloc_info {
  25. struct device *fw_dev;
  26. void *fw_kva;
  27. uint64_t fw_hdl;
  28. };
  29. int cam_reserve_icp_fw(struct cam_fw_alloc_info *icp_fw, size_t fw_length);
  30. void cam_unreserve_icp_fw(struct cam_fw_alloc_info *icp_fw, size_t fw_length);
  31. void cam_cpastop_scm_write(struct cam_cpas_hw_errata_wa *errata_wa);
  32. int cam_ife_notify_safe_lut_scm(bool safe_trigger);
  33. int camera_component_match_add_drivers(struct device *master_dev,
  34. struct component_match **match_list);
  35. int cam_csiphy_notify_secure_mode(struct csiphy_device *csiphy_dev,
  36. bool protect, int32_t offset);
  37. void cam_free_clear(const void *);
  38. #endif /* _CAM_COMPAT_H_ */