led: aw9523 reduce R/W time cost [1/1]

PD#SWPL-98173

Problem:
R/W operation cost time too long

Solution:
return immediately while success R/W operation

Verify:
sc2 ah212

Signed-off-by: junyi.zhao <junyi.zhao@amlogic.com>
Change-Id: Id929b146bea1b54b797a4dc64dc10ac5819e8ff5
This commit is contained in:
junyi.zhao
2022-10-19 17:52:20 +08:00
committed by Wanwei Jiang
parent 96be599f45
commit 44bcb7c42e
+6 -3
View File
@@ -348,10 +348,13 @@ static int aw9523_i2c_write(struct meson_aw9523 *aw9523,
while (cnt < AW_I2C_RETRIES) {
ret = i2c_smbus_write_byte_data(aw9523->i2c, reg_addr, reg_data);
if (ret < 0)
if (ret < 0) {
pr_err("%s: i2c_write cnt=%d error=%d\n", __func__, cnt, ret);
cnt++;
msleep(AW_I2C_RETRY_DELAY);
cnt++;
msleep(AW_I2C_RETRY_DELAY);
} else {
break;
}
}
return ret;