Skip to content

Commit

Permalink
camera: fix new version
Browse files Browse the repository at this point in the history
Signed-off-by: Qiwu Huang <[email protected]>
  • Loading branch information
Qiwu Huang authored and SreekanthPalakurthi committed Feb 16, 2020
1 parent dd8b3a9 commit aecfae1
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 14 deletions.
2 changes: 1 addition & 1 deletion drivers/media/platform/msm/camera_v2/isp/msm_isp47.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define VFE47_STATS_BURST_LEN 3
#define VFE47_UB_SIZE_VFE0 2048
#define VFE47_UB_SIZE_VFE1 1536
#define VFE47_UB_STATS_SIZE 144
#define VFE47_UB_STATS_SIZE 288
#define MSM_ISP47_TOTAL_IMAGE_UB_VFE0 (VFE47_UB_SIZE_VFE0 - VFE47_UB_STATS_SIZE)
#define MSM_ISP47_TOTAL_IMAGE_UB_VFE1 (VFE47_UB_SIZE_VFE1 - VFE47_UB_STATS_SIZE)
#define VFE47_WM_BASE(idx) (0xA0 + 0x2C * idx)
Expand Down
20 changes: 10 additions & 10 deletions drivers/media/platform/msm/camera_v2/isp/msm_isp48.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define MSM_VFE48_BUS_CLIENT_INIT 0xABAB
#define VFE48_STATS_BURST_LEN 3
#define VFE48_UB_SIZE_VFE 2048 /* 2048 * 256 bits = 64KB */
#define VFE48_UB_STATS_SIZE 144
#define VFE48_UB_STATS_SIZE 608
#define MSM_ISP48_TOTAL_IMAGE_UB_VFE (VFE48_UB_SIZE_VFE - VFE48_UB_STATS_SIZE)


Expand Down Expand Up @@ -319,15 +319,15 @@ void msm_vfe48_stats_cfg_ub(struct vfe_device *vfe_dev)
int i;
uint32_t ub_offset = 0, stats_burst_len;
uint32_t ub_size[VFE47_NUM_STATS_TYPE] = {
16, /* MSM_ISP_STATS_HDR_BE */
16, /* MSM_ISP_STATS_BG */
16, /* MSM_ISP_STATS_BF */
16, /* MSM_ISP_STATS_HDR_BHIST */
16, /* MSM_ISP_STATS_RS */
16, /* MSM_ISP_STATS_CS */
16, /* MSM_ISP_STATS_IHIST */
16, /* MSM_ISP_STATS_BHIST */
16, /* MSM_ISP_STATS_AEC_BG */
80, /* MSM_ISP_STATS_HDR_BE */
64, /* MSM_ISP_STATS_BG */
64, /* MSM_ISP_STATS_BF */
64, /* MSM_ISP_STATS_HDR_BHIST */
64, /* MSM_ISP_STATS_RS */
64, /* MSM_ISP_STATS_CS */
64, /* MSM_ISP_STATS_IHIST */
64, /* MSM_ISP_STATS_BHIST */
80, /* MSM_ISP_STATS_AEC_BG */
};

stats_burst_len = VFE48_STATS_BURST_LEN;
Expand Down
29 changes: 28 additions & 1 deletion drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ int msm_sensor_match_vendor_id(struct msm_sensor_ctrl_t *s_ctrl)
const char *sensor_name;
uint16_t temp_sid = 0;
uint16_t vcmid = 0;
uint16_t lensid = 0;
int have_vcmid = 0;
int have_lensid = 0;
enum cci_i2c_master_t temp_master = MASTER_0;


Expand Down Expand Up @@ -294,7 +296,17 @@ int msm_sensor_match_vendor_id(struct msm_sensor_ctrl_t *s_ctrl)
s_ctrl->sensordata->vcm_id_info->data_type);
have_vcmid = 1;
}


if (s_ctrl->sensordata->lens_id_info->lens_id_addr != 0)
{
msm_camera_cci_i2c_read(
sensor_i2c_client,
s_ctrl->sensordata->lens_id_info->lens_id_addr,
&lensid,
s_ctrl->sensordata->lens_id_info->data_type);
have_lensid = 1;
}

sensor_i2c_client->cci_client->sid = temp_sid;
sensor_i2c_client->cci_client->cci_i2c_master = temp_master;
if (rc < 0) {
Expand Down Expand Up @@ -326,6 +338,21 @@ int msm_sensor_match_vendor_id(struct msm_sensor_ctrl_t *s_ctrl)
__func__, vcmid, s_ctrl->sensordata->vcm_id_info->vcm_id);
}
}
if(have_lensid == 1)
{
if (s_ctrl->sensordata->lens_id_info->lens_id != lensid)
{
pr_err("%s:match lensid if failed read lens id: 0x%x expected id 0x%x:\n",
__func__, lensid, s_ctrl->sensordata->lens_id_info->lens_id);
rc = -1;
return rc;
}
else
{
pr_err("%s: read lensid id: 0x%x expected id 0x%x:\n",
__func__, lensid, s_ctrl->sensordata->lens_id_info->lens_id);
}
}
}
pr_err("%s: read vendor id: 0x%x expected id 0x%x:\n",
__func__, vendorid, s_ctrl->sensordata->vendor_id_info->vendor_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ int32_t msm_sensor_driver_probe(void *setting,
slave_info->sensor_id_info = slave_info32->sensor_id_info;
slave_info->vendor_id_info = slave_info32->vendor_id_info;
slave_info->vcm_id_info = slave_info32->vcm_id_info;
slave_info->lens_id_info = slave_info32->lens_id_info;

slave_info->slave_addr = slave_info32->slave_addr;
slave_info->power_setting_array.size =
Expand Down Expand Up @@ -1044,6 +1045,8 @@ int32_t msm_sensor_driver_probe(void *setting,
s_ctrl->sensordata->flash_name = slave_info->flash_name;
s_ctrl->sensordata->vendor_id_info = &(slave_info->vendor_id_info);
s_ctrl->sensordata->vcm_id_info = &(slave_info->vcm_id_info);
s_ctrl->sensordata->lens_id_info = &(slave_info->lens_id_info);

/*
* Update eeporm subdevice Id by input eeprom name
*/
Expand Down
1 change: 1 addition & 0 deletions include/media/msm_cam_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct msm_camera_sensor_slave_info32 {
struct msm_sensor_id_info_t sensor_id_info;
struct msm_vendor_id_info_t vendor_id_info;
struct msm_vcm_id_info_t vcm_id_info;
struct msm_lens_id_info_t lens_id_info;
struct msm_sensor_power_setting_array32 power_setting_array;
uint8_t is_init_params_valid;
struct msm_sensor_init_params sensor_init_params;
Expand Down
1 change: 1 addition & 0 deletions include/soc/qcom/camera2.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ struct msm_camera_sensor_board_info {
struct msm_camera_slave_info *slave_info;
struct msm_vendor_id_info_t *vendor_id_info;
struct msm_vcm_id_info_t *vcm_id_info;
struct msm_lens_id_info_t *lens_id_info;
struct msm_camera_csi_lane_params *csi_lane_params;
struct msm_camera_sensor_strobe_flash_data *strobe_flash_data;
struct msm_actuator_info *actuator_info;
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/media/msm_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ struct msm_mctl_post_proc_cmd {
#define MSM_CAMERA_STROBE_FLASH_NONE 0
#define MSM_CAMERA_STROBE_FLASH_XENON 1

#define MSM_MAX_CAMERA_SENSORS 6
#define MSM_MAX_CAMERA_SENSORS 7
#define MAX_SENSOR_NAME 32
#define MAX_CAM_NAME_SIZE 32
#define MAX_ACT_MOD_NAME_SIZE 32
Expand Down
10 changes: 10 additions & 0 deletions include/uapi/media/msm_camsensor_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,15 @@ struct msm_vcm_id_info_t {
enum msm_cci_i2c_master_t cci_i2c_master;
};

struct msm_lens_id_info_t {
unsigned short eeprom_slave_addr;
unsigned short lens_id_addr;
enum msm_camera_i2c_reg_addr_type addr_type;
unsigned short lens_id;
enum msm_camera_i2c_data_type data_type;
enum msm_cci_i2c_master_t cci_i2c_master;
};

struct msm_camera_sensor_slave_info {
char sensor_name[32];
char eeprom_name[32];
Expand All @@ -338,6 +347,7 @@ struct msm_camera_sensor_slave_info {
struct msm_sensor_id_info_t sensor_id_info;
struct msm_vendor_id_info_t vendor_id_info;
struct msm_vcm_id_info_t vcm_id_info;
struct msm_lens_id_info_t lens_id_info;
struct msm_sensor_power_setting_array power_setting_array;
unsigned char is_init_params_valid;
struct msm_sensor_init_params sensor_init_params;
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/media/msmb_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define MSM_CAMERA_SUBDEV_EXT 19
#define MSM_CAMERA_SUBDEV_TOF 20
#define MSM_CAMERA_SUBDEV_LASER_LED 21
#define MSM_MAX_CAMERA_SENSORS 6
#define MSM_MAX_CAMERA_SENSORS 7

/* The below macro is defined to put an upper limit on maximum
* number of buffer requested per stream. In case of extremely
Expand Down

0 comments on commit aecfae1

Please sign in to comment.