Viswanadha Raju Thotakura | 426ec66 | 2017-03-15 17:00:29 -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_SENSOR_UTIL_H_ |
| 14 | #define _CAM_SENSOR_UTIL_H_ |
| 15 | |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/regulator/consumer.h> |
| 18 | #include <linux/gpio.h> |
| 19 | #include <linux/of_gpio.h> |
| 20 | #include <linux/of.h> |
| 21 | #include <cam_sensor_cmn_header.h> |
| 22 | #include <cam_req_mgr_util.h> |
| 23 | #include <cam_req_mgr_interface.h> |
| 24 | #include <cam_mem_mgr.h> |
Alok Pandey | 01b1b35 | 2017-06-25 20:38:54 +0530 | [diff] [blame] | 25 | #include "cam_soc_util.h" |
Jigarkumar Zala | cbb5a38 | 2017-07-17 19:06:42 -0700 | [diff] [blame] | 26 | #include "cam_debug_util.h" |
Viswanadha Raju Thotakura | 426ec66 | 2017-03-15 17:00:29 -0700 | [diff] [blame] | 27 | |
| 28 | #define INVALID_VREG 100 |
| 29 | |
Vivek Veenam | 2ad8de1 | 2017-04-04 18:56:22 +0530 | [diff] [blame] | 30 | int cam_get_dt_power_setting_data(struct device_node *of_node, |
| 31 | struct cam_hw_soc_info *soc_info, |
Viswanadha Raju Thotakura | 426ec66 | 2017-03-15 17:00:29 -0700 | [diff] [blame] | 32 | struct cam_sensor_power_ctrl_t *power_info); |
| 33 | |
Viswanadha Raju Thotakura | 426ec66 | 2017-03-15 17:00:29 -0700 | [diff] [blame] | 34 | int msm_camera_pinctrl_init |
| 35 | (struct msm_pinctrl_info *sensor_pctrl, struct device *dev); |
| 36 | |
Viswanadha Raju Thotakura | 426ec66 | 2017-03-15 17:00:29 -0700 | [diff] [blame] | 37 | int cam_sensor_i2c_pkt_parser(struct i2c_settings_array *i2c_reg_settings, |
| 38 | struct cam_cmd_buf_desc *cmd_desc, int32_t num_cmd_buffers); |
| 39 | |
| 40 | int32_t delete_request(struct i2c_settings_array *i2c_array); |
Alok Pandey | 01b1b35 | 2017-06-25 20:38:54 +0530 | [diff] [blame] | 41 | int cam_sensor_util_request_gpio_table( |
| 42 | struct cam_hw_soc_info *soc_info, int gpio_en); |
| 43 | |
| 44 | int cam_sensor_util_init_gpio_pin_tbl( |
| 45 | struct cam_hw_soc_info *soc_info, |
| 46 | struct msm_camera_gpio_num_info **pgpio_num_info); |
| 47 | int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl, |
| 48 | struct cam_hw_soc_info *soc_info); |
| 49 | |
| 50 | int msm_camera_power_down(struct cam_sensor_power_ctrl_t *ctrl, |
| 51 | struct cam_hw_soc_info *soc_info); |
| 52 | |
| 53 | int msm_camera_fill_vreg_params(struct cam_hw_soc_info *soc_info, |
| 54 | struct cam_sensor_power_setting *power_setting, |
| 55 | uint16_t power_setting_size); |
Vivek Veenam | 2ad8de1 | 2017-04-04 18:56:22 +0530 | [diff] [blame] | 56 | |
| 57 | int32_t cam_sensor_update_power_settings(void *cmd_buf, |
| 58 | int cmd_length, struct cam_sensor_power_ctrl_t *power_info); |
Viswanadha Raju Thotakura | 426ec66 | 2017-03-15 17:00:29 -0700 | [diff] [blame] | 59 | #endif /* _CAM_SENSOR_UTIL_H_ */ |