mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
i2c: i2c-msm-geni: Do i2c transfer if GENI IOS in proper state
This change ensures the IOS lines are in protocol default state before starting the data transfer. This ensures the slave is properly powered up and also protocol lines are in IDLE High state. We can prevent any further try to send data which can be failed due to lines not in proper state. Change-Id: Ibd9a6109133dd776f86a841f8bde305d08d2c187 Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
This commit is contained in:
parent
b8bf0ad232
commit
5ad2f9de06
1 changed files with 12 additions and 0 deletions
|
|
@ -243,6 +243,8 @@ err_ret:
|
|||
|
||||
static int geni_i2c_prepare(struct geni_i2c_dev *gi2c)
|
||||
{
|
||||
u32 geni_ios = 0;
|
||||
|
||||
if (gi2c->se_mode == UNINITIALIZED) {
|
||||
int proto = get_se_proto(gi2c->base);
|
||||
u32 se_mode;
|
||||
|
|
@ -254,6 +256,16 @@ static int geni_i2c_prepare(struct geni_i2c_dev *gi2c)
|
|||
return -ENXIO;
|
||||
}
|
||||
|
||||
geni_ios = geni_read_reg_nolog(gi2c->base, SE_GENI_IOS);
|
||||
if ((geni_ios & 0x3) != 0x3) { //SCL:b'1, SDA:b'0
|
||||
GENI_SE_DBG(gi2c->ipcl, true, gi2c->dev,
|
||||
"IO lines not in good state, Check power to slave\n");
|
||||
|
||||
if (!gi2c->is_le_vm)
|
||||
se_geni_resources_off(&gi2c->i2c_rsc);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
se_mode = readl_relaxed(gi2c->base +
|
||||
GENI_IF_FIFO_DISABLE_RO);
|
||||
if (se_mode) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue