Very trivial changes from review of last PR
This commit is contained in:
parent
51b19d5f38
commit
349b513978
@ -765,12 +765,12 @@ static int lc823450_i2c_poll(FAR struct lc823450_i2c_priv_s *priv)
|
|||||||
|
|
||||||
i2cinfo("re-START condition\n");
|
i2cinfo("re-START condition\n");
|
||||||
|
|
||||||
|
#ifdef CONFIG_I2C_RESET
|
||||||
/* Reset I2C bus by softreset. There is not description of the 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.
|
* but in order to recover I2C bus busy, it must be done.
|
||||||
* Please refer to macaron's code.
|
* Please refer to macaron's code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_I2C_RESET
|
|
||||||
lc823450_i2c_reset((FAR struct i2c_master_s *)priv);
|
lc823450_i2c_reset((FAR struct i2c_master_s *)priv);
|
||||||
#endif
|
#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
|
/* We have to enable interrupt again, because all registers are reset by
|
||||||
* lc823450_i2c_reset().
|
* lc823450_i2c_reset().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
lc823450_i2c_enableirq(priv);
|
lc823450_i2c_enableirq(priv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -219,7 +219,6 @@ static void _setup_audio_pll(uint32_t freq)
|
|||||||
0x0,
|
0x0,
|
||||||
0x0200 /* AUDDIV=2 */
|
0x0200 /* AUDDIV=2 */
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -255,7 +254,6 @@ static void _i2s_semtake(FAR sem_t *sem)
|
|||||||
while (ret == -EINTR);
|
while (ret == -EINTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: lc823450_i2s_txsamplerate
|
* 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
|
* Name: lc823450_i2s_beeptest
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef BEEP_TEST
|
#ifdef BEEP_TEST
|
||||||
static void lc823450_i2s_beeptest(void)
|
static void lc823450_i2s_beeptest(void)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#ifndef __ARCH_ARM_SRC_LC823450_LC823450_I2S_H
|
#ifndef __ARCH_ARM_SRC_LC823450_LC823450_I2S_H
|
||||||
#define __ARCH_ARM_SRC_LC823450_LC823450_I2S_H
|
#define __ARCH_ARM_SRC_LC823450_LC823450_I2S_H
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -186,6 +186,8 @@ static void wm8776_writereg(FAR struct wm8776_dev_s *priv,
|
|||||||
uint16_t regval)
|
uint16_t regval)
|
||||||
{
|
{
|
||||||
struct i2c_config_s config;
|
struct i2c_config_s config;
|
||||||
|
uint8_t data[2];
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Setup up the I2C configuration */
|
/* 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.address = priv->lower->address;
|
||||||
config.addrlen = 7;
|
config.addrlen = 7;
|
||||||
|
|
||||||
uint8_t data[2];
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Set up the data to write */
|
/* Set up the data to write */
|
||||||
|
|
||||||
data[0] = (regaddr << 1) + ((regval >> 8) & 0x1);
|
data[0] = (regaddr << 1) + ((regval >> 8) & 0x1);
|
||||||
data[1] = (regval & 0xff);
|
data[1] = (regval & 0xff);
|
||||||
|
|
||||||
ret = i2c_write(priv->i2c, &config, data, sizeof(data));
|
ret = i2c_write(priv->i2c, &config, data, sizeof(data));
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
auderr("ERROR: I2C_TRANSFER failed: %d\n", ret);
|
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);
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: wm8776_sendbuffer
|
* Name: wm8776_sendbuffer
|
||||||
*
|
*
|
||||||
|
@ -75,7 +75,6 @@
|
|||||||
#define WM8776_HPOUT_VOL_MASK (0x7f << WM8776_HPOUT_VOL_SHIFT)
|
#define WM8776_HPOUT_VOL_MASK (0x7f << WM8776_HPOUT_VOL_SHIFT)
|
||||||
# define WM8776_HPOUT_VOL(n) ((uint16_t)(n) << WM8776_HPOUT_VOL_SHIFT)
|
# define WM8776_HPOUT_VOL(n) ((uint16_t)(n) << WM8776_HPOUT_VOL_SHIFT)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -123,6 +122,5 @@ struct wm8776_dev_s
|
|||||||
volatile int result; /* The result of the last transfer */
|
volatile int result; /* The result of the last transfer */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_AUDIO */
|
#endif /* CONFIG_AUDIO */
|
||||||
#endif /* __DRIVERS_AUDIO_WM8776_H */
|
#endif /* __DRIVERS_AUDIO_WM8776_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user