cam_custom_dev.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0-only
  2. *
  3. * Copyright (c) 2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _CAM_CUSTOM_DEV_H_
  6. #define _CAM_CUSTOM_DEV_H_
  7. #include "cam_subdev.h"
  8. #include "cam_hw_mgr_intf.h"
  9. #include "cam_custom_hw_mgr.h"
  10. #include "cam_context.h"
  11. #include "cam_custom_context.h"
  12. #define CAM_CUSTOM_HW_MAX_INSTANCES 3
  13. /**
  14. * struct cam_custom_dev - Camera Custom V4l2 device node
  15. *
  16. * @sd: Common camera subdevice node
  17. * @ctx: Custom base context storage
  18. * @ctx_custom: Custom private context storage
  19. * @custom_dev_mutex: Custom dev mutex
  20. * @open_cnt: Open device count
  21. */
  22. struct cam_custom_dev {
  23. struct cam_subdev sd;
  24. struct cam_context ctx[CAM_CUSTOM_HW_MAX_INSTANCES];
  25. struct cam_custom_context ctx_custom[CAM_CUSTOM_HW_MAX_INSTANCES];
  26. struct mutex custom_dev_mutex;
  27. int32_t open_cnt;
  28. };
  29. /**
  30. * @brief : API to register Custom hw to platform framework.
  31. * @return struct platform_device pointer on on success, or ERR_PTR() on error.
  32. */
  33. int cam_custom_dev_init_module(void);
  34. /**
  35. * @brief : API to remove Custom hw interface from platform framework.
  36. */
  37. void cam_custom_dev_exit_module(void);
  38. #endif /* _CAM_CUSTOM_DEV_H_ */