1 /* 2 * linux-5.4/drivers/media/platform/sunxi-vin/vin-csi/sunxi_csi.h 3 * 4 * Copyright (c) 2007-2017 Allwinnertech Co., Ltd. 5 * 6 * This software is licensed under the terms of the GNU General Public 7 * License version 2, as published by the Free Software Foundation, and 8 * may be copied, distributed, and modified under those terms. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 */ 16 17 #ifndef _SUNXI_CSI_H_ 18 #define _SUNXI_CSI_H_ 19 20 #include "../platform/platform_cfg.h" 21 #include "parser_reg.h" 22 23 enum csi_pad { 24 CSI_PAD_SINK, 25 CSI_PAD_SOURCE, 26 CSI_PAD_NUM, 27 }; 28 29 struct csi_format { 30 u32 code; 31 enum input_seq seq; 32 enum prs_input_fmt infmt; 33 unsigned int data_width; 34 }; 35 36 struct csi_dev { 37 u8 id; 38 u8 capture_mode; 39 int irq; 40 void __iomem *base; 41 struct v4l2_subdev subdev; 42 struct media_pad csi_pads[CSI_PAD_NUM]; 43 struct platform_device *pdev; 44 struct mutex subdev_lock; 45 struct bus_info bus_info; 46 struct frame_info frame_info; 47 struct frame_arrange arrange; 48 struct pinctrl *pctrl; 49 struct v4l2_mbus_framefmt mf; 50 struct prs_output_size out_size; 51 struct csi_format *csi_fmt; 52 struct prs_ncsi_if_cfg ncsi_if; 53 struct mutex reset_lock; 54 struct prs_fps_ds prs_fps_ds; 55 unsigned int reset_time; 56 }; 57 58 int sunxi_csi_subdev_s_parm(struct v4l2_subdev *sd, 59 struct v4l2_streamparm *param); 60 struct v4l2_subdev *sunxi_csi_get_subdev(int id); 61 int sunxi_csi_platform_register(void); 62 void sunxi_csi_platform_unregister(void); 63 64 #endif /*_SUNXI_CSI_H_*/ 65