mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
Merge "i2c: i2c-msm-geni: Do i2c transfer if GENI IOS in proper state"
This commit is contained in:
commit
6f420e10da
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