Pavan Kumar Chilamkurthi | 5719f21 | 2017-07-20 15:02:21 -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 | |
| 13 | #ifndef _CAM_FD_HW_SOC_H_ |
| 14 | #define _CAM_FD_HW_SOC_H_ |
| 15 | |
| 16 | #include "cam_soc_util.h" |
| 17 | |
| 18 | /** |
| 19 | * enum cam_fd_reg_base - Enum for FD register sets |
| 20 | * |
| 21 | * @CAM_FD_REG_CORE : Indicates FD Core register space |
| 22 | * @CAM_FD_REG_WRAPPER : Indicates FD Wrapper register space |
| 23 | * @CAM_FD_REG_MAX : Max number of register sets supported |
| 24 | */ |
| 25 | enum cam_fd_reg_base { |
| 26 | CAM_FD_REG_CORE, |
| 27 | CAM_FD_REG_WRAPPER, |
| 28 | CAM_FD_REG_MAX |
| 29 | }; |
| 30 | |
| 31 | /** |
| 32 | * struct cam_fd_soc_private : FD private SOC information |
| 33 | * |
| 34 | * @regbase_index : Mapping between Register base enum to register index in SOC |
| 35 | * @cpas_handle : CPAS handle |
| 36 | * |
| 37 | */ |
| 38 | struct cam_fd_soc_private { |
| 39 | int32_t regbase_index[CAM_FD_REG_MAX]; |
| 40 | uint32_t cpas_handle; |
| 41 | }; |
| 42 | |
| 43 | int cam_fd_soc_init_resources(struct cam_hw_soc_info *soc_info, |
| 44 | irq_handler_t irq_handler, void *private_data); |
| 45 | int cam_fd_soc_deinit_resources(struct cam_hw_soc_info *soc_info); |
| 46 | int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info); |
| 47 | int cam_fd_soc_disable_resources(struct cam_hw_soc_info *soc_info); |
| 48 | uint32_t cam_fd_soc_register_read(struct cam_hw_soc_info *soc_info, |
| 49 | enum cam_fd_reg_base reg_base, uint32_t reg_offset); |
| 50 | void cam_fd_soc_register_write(struct cam_hw_soc_info *soc_info, |
| 51 | enum cam_fd_reg_base reg_base, uint32_t reg_offset, uint32_t reg_value); |
| 52 | |
| 53 | #endif /* _CAM_FD_HW_SOC_H_ */ |