mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
charging: disable I2C error workaround
disable I2C error workaround for miami. when unit suspend, plug out otg device, it can't disable otg vbus by i2c. Change-Id: I2a3fb1ba046be9d688d36ac1a7d587c55269aa6d Signed-off-by: Haijian Ma <mahj8@motorola.com> Reviewed-on: https://gerrit.mot.com/2330923 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
a2caade93d
commit
709e299c1e
2 changed files with 22 additions and 14 deletions
|
|
@ -86,14 +86,16 @@ int mmi_regmap_update_bits(struct sgm4154x_device *sgm, unsigned int reg,
|
|||
{
|
||||
int retry_count = 0;
|
||||
|
||||
while (sgm->sgm4154x_suspend_flag && retry_count < WAIT_I2C_COUNT) {
|
||||
retry_count ++;
|
||||
dev_err(sgm->dev, "wait system resume when I2C write, count %d\n", retry_count);
|
||||
msleep(WAIT_I2C_TIME);
|
||||
}
|
||||
if (!sgm->i2c_err_wa_dis) {
|
||||
while (sgm->sgm4154x_suspend_flag && retry_count < WAIT_I2C_COUNT) {
|
||||
retry_count ++;
|
||||
dev_err(sgm->dev, "wait system resume when I2C write, count %d\n", retry_count);
|
||||
msleep(WAIT_I2C_TIME);
|
||||
}
|
||||
|
||||
if (retry_count >= WAIT_I2C_COUNT)
|
||||
return -EBUSY;
|
||||
if (retry_count >= WAIT_I2C_COUNT)
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return regmap_update_bits(sgm->regmap, reg, mask, val);
|
||||
}
|
||||
|
|
@ -102,14 +104,16 @@ int mmi_regmap_read(struct sgm4154x_device *sgm, unsigned int reg, unsigned int
|
|||
{
|
||||
int retry_count = 0;
|
||||
|
||||
while (sgm->sgm4154x_suspend_flag && retry_count < WAIT_I2C_COUNT) {
|
||||
retry_count ++;
|
||||
dev_err(sgm->dev, "wait system resume when I2C read, count %d\n", retry_count);
|
||||
msleep(WAIT_I2C_TIME);
|
||||
}
|
||||
if (!sgm->i2c_err_wa_dis) {
|
||||
while (sgm->sgm4154x_suspend_flag && retry_count < WAIT_I2C_COUNT) {
|
||||
retry_count ++;
|
||||
dev_err(sgm->dev, "wait system resume when I2C read, count %d\n", retry_count);
|
||||
msleep(WAIT_I2C_TIME);
|
||||
}
|
||||
|
||||
if (retry_count >= WAIT_I2C_COUNT)
|
||||
return -EBUSY;
|
||||
if (retry_count >= WAIT_I2C_COUNT)
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return regmap_read(sgm->regmap, reg, val);
|
||||
}
|
||||
|
|
@ -2515,6 +2519,8 @@ static int sgm4154x_parse_dt(struct sgm4154x_device *sgm)
|
|||
|
||||
dev_info(sgm->dev, "mmi,wls-max-icl = %d\n",sgm->wls_max_icl);
|
||||
|
||||
sgm->i2c_err_wa_dis = of_property_read_bool(sgm->dev->of_node, "mmi,i2c-err-wa-dis");
|
||||
|
||||
#if 0
|
||||
ret = device_property_read_u32(sgm->dev, "watchdog-timer",
|
||||
&sgm->watchdog_timer);
|
||||
|
|
|
|||
|
|
@ -384,6 +384,8 @@ struct sgm4154x_device {
|
|||
/*wls output en/dis control*/
|
||||
int wls_en_gpio;
|
||||
int wls_max_icl;
|
||||
|
||||
bool i2c_err_wa_dis;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MMI_QC3P_WT6670_DETECTED
|
||||
|
|
|
|||
Loading…
Reference in a new issue