Shuzhen Wang | b4f4c92 | 2013-01-08 14:32:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, 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 | |
| 14 | #ifndef __CAMERA2_H__ |
| 15 | #define __CAMERA2_H__ |
| 16 | |
| 17 | #include <media/msm_cam_sensor.h> |
| 18 | #include <mach/board.h> |
| 19 | |
Sreesudhan Ramakrish Ramkumar | 6acf625 | 2013-01-26 21:26:13 -0800 | [diff] [blame] | 20 | enum msm_camera_device_type_t { |
| 21 | MSM_CAMERA_I2C_DEVICE, |
| 22 | MSM_CAMERA_PLATFORM_DEVICE, |
Jeyaprakash Soundrapandian | 651d64e | 2013-03-11 12:04:55 -0700 | [diff] [blame] | 23 | MSM_CAMERA_SPI_DEVICE, |
Shuzhen Wang | b4f4c92 | 2013-01-08 14:32:08 -0800 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | enum msm_bus_perf_setting { |
| 27 | S_INIT, |
| 28 | S_PREVIEW, |
| 29 | S_VIDEO, |
| 30 | S_CAPTURE, |
| 31 | S_ZSL, |
| 32 | S_STEREO_VIDEO, |
| 33 | S_STEREO_CAPTURE, |
| 34 | S_DEFAULT, |
| 35 | S_LIVESHOT, |
| 36 | S_DUAL, |
| 37 | S_EXIT |
| 38 | }; |
| 39 | |
Sreesudhan Ramakrish Ramkumar | 9f3aa30 | 2013-01-23 14:50:58 -0800 | [diff] [blame] | 40 | enum cci_i2c_master_t { |
| 41 | MASTER_0, |
| 42 | MASTER_1, |
Vasko Kalanoski | 18ba0d4 | 2013-04-15 21:18:54 -0700 | [diff] [blame] | 43 | MASTER_MAX, |
Sreesudhan Ramakrish Ramkumar | 9f3aa30 | 2013-01-23 14:50:58 -0800 | [diff] [blame] | 44 | }; |
| 45 | |
Shuzhen Wang | b4f4c92 | 2013-01-08 14:32:08 -0800 | [diff] [blame] | 46 | struct msm_camera_slave_info { |
| 47 | uint16_t sensor_slave_addr; |
| 48 | uint16_t sensor_id_reg_addr; |
| 49 | uint16_t sensor_id; |
| 50 | }; |
| 51 | |
| 52 | struct msm_cam_clk_info { |
| 53 | const char *clk_name; |
| 54 | long clk_rate; |
| 55 | uint32_t delay; |
| 56 | }; |
| 57 | |
| 58 | struct msm_cam_clk_setting { |
| 59 | struct msm_cam_clk_info *clk_info; |
| 60 | uint16_t num_clk_info; |
| 61 | uint8_t enable; |
| 62 | }; |
| 63 | |
| 64 | struct v4l2_subdev_info { |
| 65 | enum v4l2_mbus_pixelcode code; |
| 66 | enum v4l2_colorspace colorspace; |
| 67 | uint16_t fmt; |
| 68 | uint16_t order; |
| 69 | }; |
| 70 | |
| 71 | struct msm_camera_sensor_board_info { |
| 72 | const char *sensor_name; |
| 73 | struct msm_camera_slave_info *slave_info; |
| 74 | struct msm_camera_csi_lane_params *csi_lane_params; |
| 75 | struct camera_vreg_t *cam_vreg; |
| 76 | int num_vreg; |
| 77 | struct msm_camera_sensor_strobe_flash_data *strobe_flash_data; |
| 78 | struct msm_camera_gpio_conf *gpio_conf; |
| 79 | struct msm_actuator_info *actuator_info; |
| 80 | struct msm_camera_i2c_conf *i2c_conf; |
| 81 | struct msm_sensor_info_t *sensor_info; |
| 82 | struct msm_sensor_init_params *sensor_init_params; |
Hody Hung | a86d97a | 2013-05-09 17:03:19 -0700 | [diff] [blame] | 83 | const char *misc_regulator; |
Shuzhen Wang | b4f4c92 | 2013-01-08 14:32:08 -0800 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | enum msm_camera_i2c_cmd_type { |
| 87 | MSM_CAMERA_I2C_CMD_WRITE, |
| 88 | MSM_CAMERA_I2C_CMD_POLL, |
| 89 | }; |
| 90 | |
| 91 | struct msm_camera_i2c_reg_conf { |
| 92 | uint16_t reg_addr; |
| 93 | uint16_t reg_data; |
| 94 | enum msm_camera_i2c_data_type dt; |
| 95 | enum msm_camera_i2c_cmd_type cmd_type; |
| 96 | int16_t mask; |
| 97 | }; |
| 98 | |
Rajakumar Govindaram | 6ad7287 | 2013-01-29 18:36:13 -0800 | [diff] [blame] | 99 | struct msm_camera_i2c_conf_array { |
| 100 | struct msm_camera_i2c_reg_conf *conf; |
| 101 | uint16_t size; |
| 102 | uint16_t delay; |
| 103 | enum msm_camera_i2c_data_type data_type; |
| 104 | }; |
| 105 | |
Jeyaprakash Soundrapandian | 651d64e | 2013-03-11 12:04:55 -0700 | [diff] [blame] | 106 | struct eeprom_map_t { |
| 107 | uint32_t valid_size; |
| 108 | uint32_t addr; |
| 109 | uint32_t addr_t; |
| 110 | uint32_t data; |
| 111 | uint32_t data_t; |
| 112 | uint32_t delay; |
| 113 | }; |
| 114 | |
| 115 | struct eeprom_memory_map_t { |
| 116 | struct eeprom_map_t page; |
| 117 | struct eeprom_map_t poll; |
| 118 | struct eeprom_map_t mem; |
| 119 | }; |
| 120 | |
| 121 | struct msm_camera_power_ctrl_t { |
| 122 | struct device *dev; |
| 123 | struct msm_sensor_power_setting *power_setting; |
| 124 | uint16_t power_setting_size; |
| 125 | struct msm_camera_gpio_conf *gpio_conf; |
| 126 | struct camera_vreg_t *cam_vreg; |
| 127 | int num_vreg; |
| 128 | struct msm_camera_i2c_conf *i2c_conf; |
| 129 | struct msm_cam_clk_info *clk_info; |
| 130 | uint16_t clk_info_size; |
| 131 | }; |
| 132 | |
| 133 | struct msm_eeprom_board_info { |
| 134 | const char *eeprom_name; |
| 135 | uint16_t i2c_slaveaddr; |
| 136 | uint32_t num_blocks; |
| 137 | struct eeprom_memory_map_t *eeprom_map; |
| 138 | struct msm_camera_power_ctrl_t power_info; |
| 139 | }; |
| 140 | |
Shuzhen Wang | b4f4c92 | 2013-01-08 14:32:08 -0800 | [diff] [blame] | 141 | #endif |