vsp1_video.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * vsp1_video.h -- R-Car VSP1 Video Node
  4. *
  5. * Copyright (C) 2013-2015 Renesas Electronics Corporation
  6. *
  7. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  8. */
  9. #ifndef __VSP1_VIDEO_H__
  10. #define __VSP1_VIDEO_H__
  11. #include <linux/list.h>
  12. #include <linux/spinlock.h>
  13. #include <media/videobuf2-v4l2.h>
  14. #include "vsp1_rwpf.h"
  15. struct vsp1_vb2_buffer {
  16. struct vb2_v4l2_buffer buf;
  17. struct list_head queue;
  18. struct vsp1_rwpf_memory mem;
  19. };
  20. static inline struct vsp1_vb2_buffer *
  21. to_vsp1_vb2_buffer(struct vb2_v4l2_buffer *vbuf)
  22. {
  23. return container_of(vbuf, struct vsp1_vb2_buffer, buf);
  24. }
  25. struct vsp1_video {
  26. struct list_head list;
  27. struct vsp1_device *vsp1;
  28. struct vsp1_rwpf *rwpf;
  29. struct video_device video;
  30. enum v4l2_buf_type type;
  31. struct media_pad pad;
  32. struct mutex lock;
  33. unsigned int pipe_index;
  34. struct vb2_queue queue;
  35. spinlock_t irqlock;
  36. struct list_head irqqueue;
  37. };
  38. static inline struct vsp1_video *to_vsp1_video(struct video_device *vdev)
  39. {
  40. return container_of(vdev, struct vsp1_video, video);
  41. }
  42. void vsp1_video_suspend(struct vsp1_device *vsp1);
  43. void vsp1_video_resume(struct vsp1_device *vsp1);
  44. struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
  45. struct vsp1_rwpf *rwpf);
  46. void vsp1_video_cleanup(struct vsp1_video *video);
  47. #endif /* __VSP1_VIDEO_H__ */