blob: 4a22293fab17aa336692bcbb3a36a31ae812c827 [file] [log] [blame]
Pavan Kumar Chilamkurthi5719f212017-07-20 15:02:21 -07001/* 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 */
25enum 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 */
38struct cam_fd_soc_private {
39 int32_t regbase_index[CAM_FD_REG_MAX];
40 uint32_t cpas_handle;
41};
42
43int cam_fd_soc_init_resources(struct cam_hw_soc_info *soc_info,
44 irq_handler_t irq_handler, void *private_data);
45int cam_fd_soc_deinit_resources(struct cam_hw_soc_info *soc_info);
46int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info);
47int cam_fd_soc_disable_resources(struct cam_hw_soc_info *soc_info);
48uint32_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);
50void 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_ */