mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
camera: actuator: add retry when actuator apply setting failed
[detail] Retry 5 times if actuator apply setting failed. Change-Id: I31a7583d8c2b0bd506a85e6f6cb4a81f82c36232 Signed-off-by: liuwang2 <liuwang2@lenovo.com> Reviewed-on: https://gerrit.mot.com/2285973 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhichao Chen <chenzc2@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
4cd14f3235
commit
61ebef6832
1 changed files with 11 additions and 2 deletions
|
|
@ -163,8 +163,17 @@ static int32_t cam_actuator_i2c_modes_util(
|
|||
uint32_t i, size;
|
||||
|
||||
if (i2c_list->op_code == CAM_SENSOR_I2C_WRITE_RANDOM) {
|
||||
rc = camera_io_dev_write(io_master_info,
|
||||
&(i2c_list->i2c_settings));
|
||||
// if meet cci fail, retry 5 times, each time dealy 1.5ms.
|
||||
for (i = 0; i < 5; i++) {
|
||||
rc = camera_io_dev_write(io_master_info,
|
||||
&(i2c_list->i2c_settings));
|
||||
|
||||
if (rc >= 0)
|
||||
break;
|
||||
|
||||
usleep_range(1000, 1500);
|
||||
}
|
||||
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_ACTUATOR,
|
||||
"Failed to random write I2C settings: %d",
|
||||
|
|
|
|||
Loading…
Reference in a new issue