diff --git a/arch/arm/src/cxd56xx/cxd56_i2c.c b/arch/arm/src/cxd56xx/cxd56_i2c.c index 582a0643bddf5..f6b23dd2dbafe 100644 --- a/arch/arm/src/cxd56xx/cxd56_i2c.c +++ b/arch/arm/src/cxd56xx/cxd56_i2c.c @@ -723,6 +723,10 @@ static int cxd56_i2c_reset(struct i2c_master_s *dev) nxmutex_lock(&priv->lock); + /* Disable clock gating (clock enable) */ + + cxd56_i2c_clock_gate_disable(priv->port); + /* Use GPIO configuration to un-wedge the bus */ cxd56_i2c_pincontrol(priv->port, false); @@ -794,6 +798,11 @@ static int cxd56_i2c_reset(struct i2c_master_s *dev) up_udelay(10); } + /* Disable input of SCL and SDA pins */ + + cxd56_gpio_config(scl_gpio, false); + cxd56_gpio_config(sda_gpio, false); + /* Generate a start followed by a stop to reset slave * state machines. */ @@ -820,6 +829,10 @@ static int cxd56_i2c_reset(struct i2c_master_s *dev) cxd56_i2c_pincontrol(priv->port, true); + /* Enable clock gating (clock disable) */ + + cxd56_i2c_clock_gate_enable(priv->port); + /* Release the port for re-use by other clients */ nxmutex_unlock(&priv->lock);