fix(esp32s3_i2c): i2c_clear_bus on for I2C_RESET

This function is only used now for I2C_RESET, so we wrap it with the
config macro.
This commit is contained in:
Marco Casaroli 2023-10-09 07:11:31 +00:00 committed by Petro Karashchenko
parent f25a382c1a
commit cba44cc9dc

View File

@ -257,9 +257,9 @@ static int i2c_sem_waitdone(struct esp32s3_i2c_priv_s *priv);
#ifdef CONFIG_I2C_POLLED
static int i2c_polling_waitdone(struct esp32s3_i2c_priv_s *priv);
#endif
static void i2c_clear_bus(struct esp32s3_i2c_priv_s *priv);
static void i2c_reset_fsmc(struct esp32s3_i2c_priv_s *priv);
#ifdef CONFIG_I2C_RESET
static void i2c_clear_bus(struct esp32s3_i2c_priv_s *priv);
static int i2c_reset(struct i2c_master_s *dev);
#endif
@ -1117,6 +1117,7 @@ static int i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs,
*
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static void i2c_clear_bus(struct esp32s3_i2c_priv_s *priv)
{
modifyreg32(I2C_SCL_SP_CONF_REG(priv->id),
@ -1142,7 +1143,6 @@ static void i2c_clear_bus(struct esp32s3_i2c_priv_s *priv)
*
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int i2c_reset(struct i2c_master_s *dev)
{
struct esp32s3_i2c_priv_s *priv = (struct esp32s3_i2c_priv_s *)dev;