diff options
author | PixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com> | 2020-08-21 14:26:02 -0700 |
---|---|---|
committer | SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> | 2020-08-21 14:26:03 -0700 |
commit | 9ebd1b334ed7a8f3f6e9ab5b056ef69113be36d9 (patch) | |
tree | 15183678ffd2f731cd2d13d75361edae66f7bb85 | |
parent | 76e5cc2342d4497536478426ece4e274c518dae3 (diff) | |
parent | 21437ea878416dad4e3364033a7886e899de5bf3 (diff) | |
download | camera-kernel-9ebd1b334ed7a8f3f6e9ab5b056ef69113be36d9.tar.gz |
Merge android-msm-pixel-4.19-rvc-qpr1 into android-msm-pixel-4.19
SBMerger: 325904710
Change-Id: I443aebee8ca0c28403e950fb4a25d00476dd86e6
Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r-- | drivers/cam_sensor_module/cam_sensor/cam_sensor_core.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/cam_sensor_module/cam_sensor/cam_sensor_core.c b/drivers/cam_sensor_module/cam_sensor/cam_sensor_core.c index 20db229..c0b7850 100644 --- a/drivers/cam_sensor_module/cam_sensor/cam_sensor_core.c +++ b/drivers/cam_sensor_module/cam_sensor/cam_sensor_core.c @@ -774,6 +774,7 @@ int32_t cam_sensor_driver_cmd(struct cam_sensor_ctrl_t *s_ctrl, void *arg) { int rc = 0, pkt_opcode = 0; + int8_t retries = 3; struct cam_control *cmd = (struct cam_control *)arg; struct cam_sensor_power_ctrl_t *power_info = &s_ctrl->sensordata->power_info; @@ -959,10 +960,26 @@ int32_t cam_sensor_driver_cmd(struct cam_sensor_ctrl_t *s_ctrl, goto release_mutex; } + s_ctrl->sensor_state = CAM_SENSOR_ACQUIRE; + s_ctrl->last_flush_req = 0; + CAM_INFO(CAM_SENSOR, + "CAM_ACQUIRE_DEV Success, sensor_id:0x%x,sensor_slave_addr:0x%x", + s_ctrl->sensordata->slave_info.sensor_id, + s_ctrl->sensordata->slave_info.sensor_slave_addr); + #if IS_ENABLED(CONFIG_CAMERA_GYRO) if (s_ctrl->sensordata->slave_info.sensor_id == 0x363 && s_ctrl->custom_gyro_support) { - rc = enable_cam_gyro(); + /* From vendor spec, we need to add at least 10 ms delay time + * to pacify the first writing of gyro settings after turning + * the camera power on. Use the retry mechanism to fulfill this purpose. + */ + while ((rc = enable_cam_gyro()) && (retries > 0)) { + CAM_ERR(CAM_SENSOR, "CAM_GYRO_ENABLE failure, wait and retry"); + retries--; + /* TBD: Delay 1 ms for each retry */ + usleep_range(1000, 3000); + } if (rc < 0) { CAM_ERR(CAM_SENSOR, "CAM_GYRO_ENABLE failure"); cam_sensor_power_down(s_ctrl); @@ -971,13 +988,6 @@ int32_t cam_sensor_driver_cmd(struct cam_sensor_ctrl_t *s_ctrl, CAM_INFO(CAM_SENSOR, "CAM_GYRO_ENABLE success"); } #endif - - s_ctrl->sensor_state = CAM_SENSOR_ACQUIRE; - s_ctrl->last_flush_req = 0; - CAM_INFO(CAM_SENSOR, - "CAM_ACQUIRE_DEV Success, sensor_id:0x%x,sensor_slave_addr:0x%x", - s_ctrl->sensordata->slave_info.sensor_id, - s_ctrl->sensordata->slave_info.sensor_slave_addr); } break; case CAM_RELEASE_DEV: { |