1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd. */ 3 4 #ifndef _RKISPP_DEV_H 5 #define _RKISPP_DEV_H 6 7 #include "ispp.h" 8 #include "params.h" 9 #include "stream.h" 10 #include "stats.h" 11 #include "hw.h" 12 #include "procfs.h" 13 14 #define DRIVER_NAME "rkispp" 15 #define II_VDEV_NAME DRIVER_NAME "_input_image" 16 #define MB_VDEV_NAME DRIVER_NAME "_m_bypass" 17 #define S0_VDEV_NAME DRIVER_NAME "_scale0" 18 #define S1_VDEV_NAME DRIVER_NAME "_scale1" 19 #define S2_VDEV_NAME DRIVER_NAME "_scale2" 20 #define VIR_VDEV_NAME DRIVER_NAME "_iqtool" 21 22 enum rkispp_input { 23 INP_INVAL = 0, 24 INP_ISP, 25 INP_DDR, 26 }; 27 28 struct rkispp_device { 29 char name[128]; 30 struct device *dev; 31 void *sw_base_addr; 32 struct media_device media_dev; 33 struct v4l2_device v4l2_dev; 34 struct v4l2_ctrl_handler ctrl_handler; 35 36 struct rkispp_hw_dev *hw_dev; 37 struct rkispp_subdev ispp_sdev; 38 struct rkispp_stream_vdev stream_vdev; 39 struct rkispp_params_vdev params_vdev; 40 struct rkispp_stats_vdev stats_vdev; 41 struct proc_dir_entry *procfs; 42 43 struct work_struct irq_work; 44 enum rkispp_ver ispp_ver; 45 /* mutex to serialize the calls from user */ 46 struct mutex apilock; 47 /* mutex to serialize the calls of iq */ 48 struct mutex iqlock; 49 enum rkispp_input inp; 50 u32 dev_id; 51 u32 isp_mode; 52 u32 isr_cnt; 53 u32 isr_err_cnt; 54 u32 mis_val; 55 wait_queue_head_t sync_onoff; 56 bool stream_sync; 57 u8 stream_max; 58 void (*irq_hdl)(u32 mis, struct rkispp_device *dev); 59 }; 60 #endif 61