1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * camss-video.h 4 * 5 * Qualcomm MSM Camera Subsystem - V4L2 device node 6 * 7 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. 8 * Copyright (C) 2015-2018 Linaro Ltd. 9 */ 10 #ifndef QC_MSM_CAMSS_VIDEO_H 11 #define QC_MSM_CAMSS_VIDEO_H 12 13 #include <linux/mutex.h> 14 #include <linux/videodev2.h> 15 #include <media/media-entity.h> 16 #include <media/v4l2-dev.h> 17 #include <media/v4l2-device.h> 18 #include <media/v4l2-fh.h> 19 #include <media/v4l2-mediabus.h> 20 #include <media/videobuf2-v4l2.h> 21 22 struct camss_buffer { 23 struct vb2_v4l2_buffer vb; 24 dma_addr_t addr[3]; 25 struct list_head queue; 26 }; 27 28 struct camss_video; 29 30 struct camss_video_ops { 31 int (*queue_buffer)(struct camss_video *vid, struct camss_buffer *buf); 32 int (*flush_buffers)(struct camss_video *vid, 33 enum vb2_buffer_state state); 34 }; 35 36 struct camss_video { 37 struct camss *camss; 38 struct vb2_queue vb2_q; 39 struct video_device vdev; 40 struct media_pad pad; 41 struct v4l2_format active_fmt; 42 enum v4l2_buf_type type; 43 struct media_pipeline pipe; 44 const struct camss_video_ops *ops; 45 struct mutex lock; 46 struct mutex q_lock; 47 unsigned int bpl_alignment; 48 unsigned int line_based; 49 const struct camss_format_info *formats; 50 unsigned int nformats; 51 }; 52 53 int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev, 54 const char *name); 55 56 void msm_video_unregister(struct camss_video *video); 57 58 #endif /* QC_MSM_CAMSS_VIDEO_H */ 59