tegra: i2c: re-init i2c controller after reset
This serves as supplemental patch to CL:197732. After clearing bus, we should also redo controller init (because controller has been reset before bus clear). On the upper layer, upon receiving error return status, it should just retry instead of simply call cpu_reset(). BUG=chrome-os-partner:28323 BRANCH=nyan TEST=Built and tested on nyan and nyan_big. Change-Id: Ib526bc730cb73ffef8696fc2a6a2769d6e71eb9e Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com> Reviewed-on: https://chromium-review.googlesource.com/202784 Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
96a9ff8f63
commit
06f8917c70
1 changed files with 5 additions and 0 deletions
|
|
@ -112,12 +112,14 @@ static int tegra_i2c_send_recv(int bus, int read,
|
|||
"%s: The address was not acknowledged.\n",
|
||||
__func__);
|
||||
info->reset_func(info->reset_bit);
|
||||
i2c_init(bus);
|
||||
return -1;
|
||||
} else if (transfer_status & I2C_PKT_STATUS_NOACK_DATA) {
|
||||
printk(BIOS_ERR,
|
||||
"%s: The data was not acknowledged.\n",
|
||||
__func__);
|
||||
info->reset_func(info->reset_bit);
|
||||
i2c_init(bus);
|
||||
return -1;
|
||||
} else if (transfer_status & I2C_PKT_STATUS_ARB_LOST) {
|
||||
printk(BIOS_ERR,
|
||||
|
|
@ -128,6 +130,9 @@ static int tegra_i2c_send_recv(int bus, int read,
|
|||
/* Use Tegra bus clear registers to unlock SDA */
|
||||
do_bus_clear(bus);
|
||||
|
||||
/* re-init i2c controller */
|
||||
i2c_init(bus);
|
||||
|
||||
/* Return w/error, let caller decide what to do */
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue