Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
Harsh Shah | f713639 | 2017-08-29 12:42:52 -0700 | [diff] [blame] | 13 | #ifndef _CAM_CSID_HW_INTF_H_ |
| 14 | #define _CAM_CSID_HW_INTF_H_ |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 15 | |
| 16 | #include "cam_isp_hw.h" |
| 17 | #include "cam_hw_intf.h" |
| 18 | |
| 19 | /* MAX IFE CSID instance */ |
| 20 | #define CAM_IFE_CSID_HW_NUM_MAX 4 |
| 21 | |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 22 | /** |
| 23 | * enum cam_ife_pix_path_res_id - Specify the csid patch |
| 24 | */ |
| 25 | enum cam_ife_pix_path_res_id { |
| 26 | CAM_IFE_PIX_PATH_RES_RDI_0, |
| 27 | CAM_IFE_PIX_PATH_RES_RDI_1, |
| 28 | CAM_IFE_PIX_PATH_RES_RDI_2, |
| 29 | CAM_IFE_PIX_PATH_RES_RDI_3, |
| 30 | CAM_IFE_PIX_PATH_RES_IPP, |
| 31 | CAM_IFE_PIX_PATH_RES_MAX, |
| 32 | }; |
| 33 | |
| 34 | /** |
| 35 | * enum cam_ife_cid_res_id - Specify the csid cid |
| 36 | */ |
| 37 | enum cam_ife_cid_res_id { |
| 38 | CAM_IFE_CSID_CID_0, |
| 39 | CAM_IFE_CSID_CID_1, |
| 40 | CAM_IFE_CSID_CID_2, |
| 41 | CAM_IFE_CSID_CID_3, |
| 42 | CAM_IFE_CSID_CID_MAX, |
| 43 | }; |
| 44 | |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 45 | /** |
| 46 | * struct cam_ife_csid_hw_caps- get the CSID hw capability |
| 47 | * @no_rdis : number of rdis supported by CSID HW device |
| 48 | * @no_pix: number of pixel path supported by CSID HW device |
| 49 | * @major_version : major version |
| 50 | * @minor_version: minor version |
| 51 | * @version_incr: version increment |
| 52 | * |
| 53 | */ |
| 54 | struct cam_ife_csid_hw_caps { |
| 55 | uint32_t no_rdis; |
| 56 | uint32_t no_pix; |
| 57 | uint32_t major_version; |
| 58 | uint32_t minor_version; |
| 59 | uint32_t version_incr; |
| 60 | }; |
| 61 | |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 62 | /** |
| 63 | * struct cam_csid_hw_reserve_resource- hw reserve |
| 64 | * @res_type : reource type CID or PATH |
| 65 | * if type is CID, then res_id is not required, |
| 66 | * if type is path then res id need to be filled |
| 67 | * @res_id : res id to be reserved |
| 68 | * @in_port : input port resource info |
Ravikishore Pampana | ad6bc90 | 2017-07-12 19:37:06 +0530 | [diff] [blame] | 69 | * @out_port: output port resource info, used for RDI path only |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 70 | * @sync_mode : Sync mode |
| 71 | * Sync mode could be master, slave or none |
| 72 | * @master_idx: master device index to be configured in the slave path |
| 73 | * for master path, this value is not required. |
| 74 | * only slave need to configure the master index value |
| 75 | * @cid: cid (DT_ID) value for path, this is applicable for CSID path |
| 76 | * reserve |
| 77 | * @node_res : reserved resource structure pointer |
| 78 | * |
| 79 | */ |
| 80 | struct cam_csid_hw_reserve_resource_args { |
| 81 | enum cam_isp_resource_type res_type; |
| 82 | uint32_t res_id; |
| 83 | struct cam_isp_in_port_info *in_port; |
Ravikishore Pampana | ad6bc90 | 2017-07-12 19:37:06 +0530 | [diff] [blame] | 84 | struct cam_isp_out_port_info *out_port; |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 85 | enum cam_isp_hw_sync_mode sync_mode; |
| 86 | uint32_t master_idx; |
| 87 | uint32_t cid; |
| 88 | struct cam_isp_resource_node *node_res; |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 89 | }; |
| 90 | |
Jing Zhou | ff57d86 | 2017-03-21 00:54:25 -0700 | [diff] [blame] | 91 | /** |
| 92 | * enum cam_ife_csid_halt_cmd - Specify the halt command type |
| 93 | */ |
| 94 | enum cam_ife_csid_halt_cmd { |
| 95 | CAM_CSID_HALT_AT_FRAME_BOUNDARY, |
| 96 | CAM_CSID_RESUME_AT_FRAME_BOUNDARY, |
| 97 | CAM_CSID_HALT_IMMEDIATELY, |
| 98 | CAM_CSID_HALT_MAX, |
| 99 | }; |
| 100 | |
| 101 | /** |
| 102 | * struct cam_csid_hw_stop- stop all resources |
| 103 | * @stop_cmd : Applicable only for PATH resources |
| 104 | * if stop command set to Halt immediately,driver will stop |
| 105 | * path immediately, manager need to reset the path after HI |
| 106 | * if stop command set to halt at frame boundary, driver will set |
| 107 | * halt at frame boundary and wait for frame boundary |
| 108 | * @node_res : reource pointer array( ie cid or CSID) |
| 109 | * @num_res : number of resources to be stopped |
| 110 | * |
| 111 | */ |
| 112 | struct cam_csid_hw_stop_args { |
| 113 | enum cam_ife_csid_halt_cmd stop_cmd; |
| 114 | struct cam_isp_resource_node **node_res; |
| 115 | uint32_t num_res; |
| 116 | }; |
| 117 | |
| 118 | /** |
| 119 | * enum cam_ife_csid_reset_type - Specify the reset type |
| 120 | */ |
| 121 | enum cam_ife_csid_reset_type { |
| 122 | CAM_IFE_CSID_RESET_GLOBAL, |
| 123 | CAM_IFE_CSID_RESET_PATH, |
| 124 | CAM_IFE_CSID_RESET_MAX, |
| 125 | }; |
| 126 | |
| 127 | /** |
| 128 | * struct cam_ife_csid_reset_cfg- csid reset configuration |
| 129 | * @ reset_type : Global reset or path reset |
| 130 | * @res_node : resource need to be reset |
| 131 | * |
| 132 | */ |
| 133 | struct cam_csid_reset_cfg_args { |
| 134 | enum cam_ife_csid_reset_type reset_type; |
| 135 | struct cam_isp_resource_node *node_res; |
| 136 | }; |
| 137 | |
| 138 | /** |
| 139 | * struct cam_csid_get_time_stamp_args- time stamp capture arguments |
| 140 | * @res_node : resource to get the time stamp |
| 141 | * @ time_stamp_val : captured time stamp |
| 142 | * |
| 143 | */ |
| 144 | struct cam_csid_get_time_stamp_args { |
| 145 | struct cam_isp_resource_node *node_res; |
| 146 | uint64_t time_stamp_val; |
| 147 | }; |
| 148 | |
| 149 | /** |
| 150 | * enum cam_ife_csid_cmd_type - Specify the csid command |
| 151 | */ |
| 152 | enum cam_ife_csid_cmd_type { |
| 153 | CAM_IFE_CSID_CMD_GET_TIME_STAMP, |
| 154 | CAM_IFE_CSID_CMD_MAX, |
| 155 | }; |
| 156 | |
| 157 | /** |
| 158 | * cam_ife_csid_hw_init() |
| 159 | * |
| 160 | * @brief: Initialize function for the CSID hardware |
| 161 | * |
| 162 | * @ife_csid_hw: CSID hardware instance returned |
| 163 | * @hw_idex: CSID hardware instance id |
| 164 | */ |
| 165 | int cam_ife_csid_hw_init(struct cam_hw_intf **ife_csid_hw, |
| 166 | uint32_t hw_idx); |
| 167 | |
Harsh Shah | f713639 | 2017-08-29 12:42:52 -0700 | [diff] [blame] | 168 | #endif /* _CAM_CSID_HW_INTF_H_ */ |