camss-ispif.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * camss-ispif.h
  4. *
  5. * Qualcomm MSM Camera Subsystem - ISPIF (ISP Interface) Module
  6. *
  7. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
  8. * Copyright (C) 2015-2018 Linaro Ltd.
  9. */
  10. #ifndef QC_MSM_CAMSS_ISPIF_H
  11. #define QC_MSM_CAMSS_ISPIF_H
  12. #include <linux/clk.h>
  13. #include <media/media-entity.h>
  14. #include <media/v4l2-device.h>
  15. #include <media/v4l2-subdev.h>
  16. #define MSM_ISPIF_PAD_SINK 0
  17. #define MSM_ISPIF_PAD_SRC 1
  18. #define MSM_ISPIF_PADS_NUM 2
  19. #define MSM_ISPIF_VFE_NUM 2
  20. enum ispif_intf {
  21. PIX0,
  22. RDI0,
  23. PIX1,
  24. RDI1,
  25. RDI2
  26. };
  27. struct ispif_intf_cmd_reg {
  28. u32 cmd_0;
  29. u32 cmd_1;
  30. };
  31. struct ispif_line {
  32. struct ispif_device *ispif;
  33. u8 id;
  34. u8 csid_id;
  35. u8 vfe_id;
  36. enum ispif_intf interface;
  37. struct v4l2_subdev subdev;
  38. struct media_pad pads[MSM_ISPIF_PADS_NUM];
  39. struct v4l2_mbus_framefmt fmt[MSM_ISPIF_PADS_NUM];
  40. const u32 *formats;
  41. unsigned int nformats;
  42. };
  43. struct ispif_device {
  44. void __iomem *base;
  45. void __iomem *base_clk_mux;
  46. u32 irq;
  47. char irq_name[30];
  48. struct camss_clock *clock;
  49. int nclocks;
  50. struct camss_clock *clock_for_reset;
  51. int nclocks_for_reset;
  52. struct completion reset_complete;
  53. int power_count;
  54. struct mutex power_lock;
  55. struct ispif_intf_cmd_reg intf_cmd[MSM_ISPIF_VFE_NUM];
  56. struct mutex config_lock;
  57. unsigned int line_num;
  58. struct ispif_line *line;
  59. };
  60. struct resources_ispif;
  61. int msm_ispif_subdev_init(struct ispif_device *ispif,
  62. const struct resources_ispif *res);
  63. int msm_ispif_register_entities(struct ispif_device *ispif,
  64. struct v4l2_device *v4l2_dev);
  65. void msm_ispif_unregister_entities(struct ispif_device *ispif);
  66. #endif /* QC_MSM_CAMSS_ISPIF_H */