mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
Very trivial changes from review of last PR
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user