diff --git a/arch/arm/src/lc823450/lc823450_i2c.c b/arch/arm/src/lc823450/lc823450_i2c.c index 90030c65b8..5b49856ee4 100644 --- a/arch/arm/src/lc823450/lc823450_i2c.c +++ b/arch/arm/src/lc823450/lc823450_i2c.c @@ -765,12 +765,12 @@ static int lc823450_i2c_poll(FAR struct lc823450_i2c_priv_s *priv) i2cinfo("re-START condition\n"); +#ifdef CONFIG_I2C_RESET /* Reset I2C bus by softreset. There is not description of the reset, * but in order to recover I2C bus busy, it must be done. * Please refer to macaron's code. */ -#ifdef CONFIG_I2C_RESET lc823450_i2c_reset((FAR struct i2c_master_s *)priv); #endif @@ -778,6 +778,7 @@ static int lc823450_i2c_poll(FAR struct lc823450_i2c_priv_s *priv) /* We have to enable interrupt again, because all registers are reset by * lc823450_i2c_reset(). */ + lc823450_i2c_enableirq(priv); #endif diff --git a/arch/arm/src/lc823450/lc823450_i2s.c b/arch/arm/src/lc823450/lc823450_i2s.c index b467d6324e..b2cef037db 100644 --- a/arch/arm/src/lc823450/lc823450_i2s.c +++ b/arch/arm/src/lc823450/lc823450_i2s.c @@ -219,7 +219,6 @@ static void _setup_audio_pll(uint32_t freq) 0x0, 0x0200 /* AUDDIV=2 */ ); - } /**************************************************************************** @@ -255,7 +254,6 @@ static void _i2s_semtake(FAR sem_t *sem) while (ret == -EINTR); } - /**************************************************************************** * Name: lc823450_i2s_txsamplerate ****************************************************************************/ @@ -334,6 +332,7 @@ static int lc823450_i2s_send(struct i2s_dev_s *dev, struct ap_buffer_s *apb, /**************************************************************************** * Name: lc823450_i2s_beeptest ****************************************************************************/ + #ifdef BEEP_TEST static void lc823450_i2s_beeptest(void) { diff --git a/arch/arm/src/lc823450/lc823450_i2s.h b/arch/arm/src/lc823450/lc823450_i2s.h index 6a12f4ec9c..82e64be60d 100644 --- a/arch/arm/src/lc823450/lc823450_i2s.h +++ b/arch/arm/src/lc823450/lc823450_i2s.h @@ -36,7 +36,6 @@ #ifndef __ARCH_ARM_SRC_LC823450_LC823450_I2S_H #define __ARCH_ARM_SRC_LC823450_LC823450_I2S_H - /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/drivers/audio/wm8776.c b/drivers/audio/wm8776.c index 3157a6626d..72750372ed 100644 --- a/drivers/audio/wm8776.c +++ b/drivers/audio/wm8776.c @@ -186,6 +186,8 @@ static void wm8776_writereg(FAR struct wm8776_dev_s *priv, uint16_t regval) { struct i2c_config_s config; + uint8_t data[2]; + int ret; /* Setup up the I2C configuration */ @@ -193,16 +195,12 @@ static void wm8776_writereg(FAR struct wm8776_dev_s *priv, config.address = priv->lower->address; config.addrlen = 7; - uint8_t data[2]; - int ret; - /* Set up the data to write */ data[0] = (regaddr << 1) + ((regval >> 8) & 0x1); data[1] = (regval & 0xff); ret = i2c_write(priv->i2c, &config, data, sizeof(data)); - if (ret < 0) { auderr("ERROR: I2C_TRANSFER failed: %d\n", ret); @@ -639,7 +637,6 @@ static void wm8776_returnbuffers(FAR struct wm8776_dev_s *priv) leave_critical_section(flags); } - /**************************************************************************** * Name: wm8776_sendbuffer * diff --git a/drivers/audio/wm8776.h b/drivers/audio/wm8776.h index c82e03e23e..ec3ecaee64 100644 --- a/drivers/audio/wm8776.h +++ b/drivers/audio/wm8776.h @@ -75,7 +75,6 @@ #define WM8776_HPOUT_VOL_MASK (0x7f << WM8776_HPOUT_VOL_SHIFT) # define WM8776_HPOUT_VOL(n) ((uint16_t)(n) << WM8776_HPOUT_VOL_SHIFT) - /**************************************************************************** * Public Types ****************************************************************************/ @@ -123,6 +122,5 @@ struct wm8776_dev_s volatile int result; /* The result of the last transfer */ }; - #endif /* CONFIG_AUDIO */ #endif /* __DRIVERS_AUDIO_WM8776_H */