blob: 8a26369ca851c7f0f73862404572f85530826f62 [file] [log] [blame]
Viswanadha Raju Thotakura426ec662017-03-15 17:00:29 -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_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 Pandey01b1b352017-06-25 20:38:54 +053025#include "cam_soc_util.h"
Jigarkumar Zalacbb5a382017-07-17 19:06:42 -070026#include "cam_debug_util.h"
Viswanadha Raju Thotakura426ec662017-03-15 17:00:29 -070027
28#define INVALID_VREG 100
29
Vivek Veenam2ad8de12017-04-04 18:56:22 +053030int cam_get_dt_power_setting_data(struct device_node *of_node,
31 struct cam_hw_soc_info *soc_info,
Viswanadha Raju Thotakura426ec662017-03-15 17:00:29 -070032 struct cam_sensor_power_ctrl_t *power_info);
33
Viswanadha Raju Thotakura426ec662017-03-15 17:00:29 -070034int msm_camera_pinctrl_init
35 (struct msm_pinctrl_info *sensor_pctrl, struct device *dev);
36
Viswanadha Raju Thotakura426ec662017-03-15 17:00:29 -070037int 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
40int32_t delete_request(struct i2c_settings_array *i2c_array);
Alok Pandey01b1b352017-06-25 20:38:54 +053041int cam_sensor_util_request_gpio_table(
42 struct cam_hw_soc_info *soc_info, int gpio_en);
43
44int 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);
47int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
48 struct cam_hw_soc_info *soc_info);
49
50int msm_camera_power_down(struct cam_sensor_power_ctrl_t *ctrl,
51 struct cam_hw_soc_info *soc_info);
52
53int 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 Veenam2ad8de12017-04-04 18:56:22 +053056
57int32_t cam_sensor_update_power_settings(void *cmd_buf,
58 int cmd_length, struct cam_sensor_power_ctrl_t *power_info);
Viswanadha Raju Thotakura426ec662017-03-15 17:00:29 -070059#endif /* _CAM_SENSOR_UTIL_H_ */