c89: get rid of designated initializers in common code

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko
2022-03-26 21:51:22 +01:00
committed by Xiang Xiao
parent c67272f9c8
commit 98ba65c422
37 changed files with 346 additions and 369 deletions
+2 -2
View File
@@ -132,9 +132,9 @@ static int ds_i2c_transfer(FAR struct i2c_master_s *i2cdev,
static const struct i2c_ops_s ds_i2c_ops = static const struct i2c_ops_s ds_i2c_ops =
{ {
.transfer = ds_i2c_transfer ds_i2c_transfer
#ifdef CONFIG_I2C_RESET #ifdef CONFIG_I2C_RESET
, .reset = ds_i2c_reset , ds_i2c_reset
#endif #endif
}; };
+15 -15
View File
@@ -69,12 +69,12 @@
#define AD5410_REG_CMD 0x55 #define AD5410_REG_CMD 0x55
#define AD5410_REG_RST 0x56 #define AD5410_REG_RST 0x56
#define AD5410_CMD_REXT (1<<13) #define AD5410_CMD_REXT (1 << 13)
#define AD5410_CMD_OUTEN (1<<12) #define AD5410_CMD_OUTEN (1 << 12)
#define AD5410_CMD_SRCLK(x) (x<<8) #define AD5410_CMD_SRCLK(x) ((x) << 8)
#define AD5410_CMD_SRSTEP(x) (x<<5) #define AD5410_CMD_SRSTEP(x) ((x) << 5)
#define AD5410_CMD_SREN (1<<4) #define AD5410_CMD_SREN (1 << 4)
#define AD5410_CMD_DCEN (1<<3) #define AD5410_CMD_DCEN (1 << 3)
#define AD5410_CMD_420MA 0x05 #define AD5410_CMD_420MA 0x05
#define AD5410_CMD_020MA 0x06 #define AD5410_CMD_020MA 0x06
#define AD5410_CMD_024MA 0x07 #define AD5410_CMD_024MA 0x07
@@ -111,20 +111,20 @@ static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg);
static const struct dac_ops_s g_dacops = static const struct dac_ops_s g_dacops =
{ {
.ao_reset = dac_reset, dac_reset, /* ao_reset */
.ao_setup = dac_setup, dac_setup, /* ao_setup */
.ao_shutdown = dac_shutdown, dac_shutdown, /* ao_shutdown */
.ao_txint = dac_txint, dac_txint, /* ao_txint */
.ao_send = dac_send, dac_send, /* ao_send */
.ao_ioctl = dac_ioctl, dac_ioctl /* ao_ioctl */
}; };
static struct up_dev_s g_dacpriv; static struct up_dev_s g_dacpriv;
static struct dac_dev_s g_dacdev = static struct dac_dev_s g_dacdev =
{ {
.ad_ops = &g_dacops, &g_dacops, /* ad_ops */
.ad_priv = &g_dacpriv, &g_dacpriv /* ad_priv */
}; };
/**************************************************************************** /****************************************************************************
@@ -185,7 +185,7 @@ static void dac_reset(FAR struct dac_dev_s *dev)
* *
****************************************************************************/ ****************************************************************************/
static int dac_setup(FAR struct dac_dev_s *dev) static int dac_setup(FAR struct dac_dev_s *dev)
{ {
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->ad_priv; FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->ad_priv;
FAR struct spi_dev_s *spi = priv->spi; FAR struct spi_dev_s *spi = priv->spi;
+20 -23
View File
@@ -116,16 +116,16 @@
struct ads1255_dev_s struct ads1255_dev_s
{ {
FAR const struct adc_callback_s *cb;
FAR struct spi_dev_s *spi; /* Cached SPI device reference */ FAR struct spi_dev_s *spi; /* Cached SPI device reference */
struct work_s work;
uint8_t channel;
uint32_t sps;
uint8_t pga;
uint8_t buf;
const uint8_t *mux;
int irq;
int devno; int devno;
const uint8_t *mux;
uint16_t sps;
uint8_t channel;
uint8_t pga;
int irq;
FAR const struct adc_callback_s *cb;
struct work_s work;
bool buf;
}; };
/**************************************************************************** /****************************************************************************
@@ -156,29 +156,27 @@ static int adc_interrupt(int irq, void *context, FAR void *arg);
static const struct adc_ops_s g_adcops = static const struct adc_ops_s g_adcops =
{ {
.ao_bind = adc_bind, /* ao_bind */ adc_bind, /* ao_bind */
.ao_reset = adc_reset, /* ao_reset */ adc_reset, /* ao_reset */
.ao_setup = adc_setup, /* ao_setup */ adc_setup, /* ao_setup */
.ao_shutdown = adc_shutdown, /* ao_shutdown */ adc_shutdown, /* ao_shutdown */
.ao_rxint = adc_rxint, /* ao_rxint */ adc_rxint, /* ao_rxint */
.ao_ioctl = adc_ioctl /* ao_read */ adc_ioctl /* ao_read */
}; };
static struct ads1255_dev_s g_adcpriv = static struct ads1255_dev_s g_adcpriv =
{ {
.mux = (const uint8_t []) NULL, 0, (const uint8_t [])
{ {
CONFIG_ADS1255_MUX, 0 CONFIG_ADS1255_MUX, 0
}, },
.sps = CONFIG_ADS1255_SPS, CONFIG_ADS1255_SPS, 0, 0, CONFIG_ADS1255_IRQ
.channel = 0,
.irq = CONFIG_ADS1255_IRQ,
}; };
static struct adc_dev_s g_adcdev = static struct adc_dev_s g_adcdev =
{ {
.ad_ops = &g_adcops, &g_adcops, /* ad_ops */
.ad_priv = &g_adcpriv, &g_adcpriv /* ad_priv */
}; };
/**************************************************************************** /****************************************************************************
@@ -187,13 +185,13 @@ static struct adc_dev_s g_adcdev =
static uint8_t getspsreg(uint16_t sps) static uint8_t getspsreg(uint16_t sps)
{ {
static const unsigned short sps_tab[] = static const uint16_t sps_tab[] =
{ {
3, 7, 12, 20, 27, 40, 55, 80, 3, 7, 12, 20, 27, 40, 55, 80,
300, 750, 1500, 3000, 5000, 10000, 20000, 65535, 300, 750, 1500, 3000, 5000, 10000, 20000, 65535,
}; };
static const unsigned char sps_reg[] = static const uint8_t sps_reg[] =
{ {
0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x72, 0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x72,
0x82, 0x92, 0xa1, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0x82, 0x92, 0xa1, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0,
@@ -522,7 +520,6 @@ FAR struct adc_dev_s *up_ads1255initialize(FAR struct spi_dev_s *spi,
/* Driver state data */ /* Driver state data */
priv->cb = NULL;
priv->spi = spi; priv->spi = spi;
priv->devno = devno; priv->devno = devno;
return &g_adcdev; return &g_adcdev;
+12 -13
View File
@@ -94,7 +94,7 @@ static int ads7828_readchannel(FAR struct ads7828_dev_s *priv,
/* ADC methods */ /* ADC methods */
static int ads7828_bind(FAR struct adc_dev_s *dev, static int ads7828_bind(FAR struct adc_dev_s *dev,
FAR const struct adc_callback_s *callback); FAR const struct adc_callback_s *callback);
static void ads7828_reset(FAR struct adc_dev_s *dev); static void ads7828_reset(FAR struct adc_dev_s *dev);
static int ads7828_setup(FAR struct adc_dev_s *dev); static int ads7828_setup(FAR struct adc_dev_s *dev);
static void ads7828_shutdown(FAR struct adc_dev_s *dev); static void ads7828_shutdown(FAR struct adc_dev_s *dev);
@@ -108,20 +108,20 @@ static int ads7828_ioctl(FAR struct adc_dev_s *dev, int cmd,
static const struct adc_ops_s g_adcops = static const struct adc_ops_s g_adcops =
{ {
.ao_bind = ads7828_bind, /* ao_bind */ ads7828_bind, /* ao_bind */
.ao_reset = ads7828_reset, /* ao_reset */ ads7828_reset, /* ao_reset */
.ao_setup = ads7828_setup, /* ao_setup */ ads7828_setup, /* ao_setup */
.ao_shutdown = ads7828_shutdown, /* ao_shutdown */ ads7828_shutdown, /* ao_shutdown */
.ao_rxint = ads7828_rxint, /* ao_rxint */ ads7828_rxint, /* ao_rxint */
.ao_ioctl = ads7828_ioctl /* ao_read */ ads7828_ioctl /* ao_read */
}; };
static struct ads7828_dev_s g_adcpriv; static struct ads7828_dev_s g_adcpriv;
static struct adc_dev_s g_adcdev = static struct adc_dev_s g_adcdev =
{ {
.ad_ops = &g_adcops, &g_adcops, /* ad_ops */
.ad_priv = &g_adcpriv, &g_adcpriv /* ad_priv */
}; };
/**************************************************************************** /****************************************************************************
@@ -280,11 +280,10 @@ static int ads7828_bind(FAR struct adc_dev_s *dev,
static void ads7828_reset(FAR struct adc_dev_s *dev) static void ads7828_reset(FAR struct adc_dev_s *dev)
{ {
FAR struct ads7828_dev_s *priv = FAR struct ads7828_dev_s *priv = (FAR struct ads7828_dev_s *)dev->ad_priv;
(FAR struct ads7828_dev_s *)dev->ad_priv;
priv->cmdbyte = 0; priv->cmdbyte = 0;
priv->chanstrobed = 0xffu; priv->chanstrobed = 0xffu;
} }
/**************************************************************************** /****************************************************************************
+9 -9
View File
@@ -76,9 +76,9 @@ static int dac7554_setup(FAR struct dac_dev_s *dev);
static void dac7554_shutdown(FAR struct dac_dev_s *dev); static void dac7554_shutdown(FAR struct dac_dev_s *dev);
static void dac7554_txint(FAR struct dac_dev_s *dev, bool enable); static void dac7554_txint(FAR struct dac_dev_s *dev, bool enable);
static int dac7554_send(FAR struct dac_dev_s *dev, static int dac7554_send(FAR struct dac_dev_s *dev,
FAR struct dac_msg_s *msg); FAR struct dac_msg_s *msg);
static int dac7554_ioctl(FAR struct dac_dev_s *dev, int cmd, static int dac7554_ioctl(FAR struct dac_dev_s *dev, int cmd,
unsigned long arg); unsigned long arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -86,12 +86,12 @@ static int dac7554_ioctl(FAR struct dac_dev_s *dev, int cmd,
static const struct dac_ops_s g_dacops = static const struct dac_ops_s g_dacops =
{ {
.ao_reset = dac7554_reset, dac7554_reset, /* ao_reset */
.ao_setup = dac7554_setup, dac7554_setup, /* ao_setup */
.ao_shutdown = dac7554_shutdown, dac7554_shutdown, /* ao_shutdown */
.ao_txint = dac7554_txint, dac7554_txint, /* ao_txint */
.ao_send = dac7554_send, dac7554_send, /* ao_send */
.ao_ioctl = dac7554_ioctl, dac7554_ioctl /* ao_ioctl */
}; };
/**************************************************************************** /****************************************************************************
@@ -138,7 +138,7 @@ static void dac7554_reset(FAR struct dac_dev_s *dev)
* *
****************************************************************************/ ****************************************************************************/
static int dac7554_setup(FAR struct dac_dev_s *dev) static int dac7554_setup(FAR struct dac_dev_s *dev)
{ {
return OK; return OK;
} }
+9 -9
View File
@@ -99,18 +99,18 @@ static struct dac7571_dev_s g_dacpriv;
static const struct dac_ops_s g_dacops = static const struct dac_ops_s g_dacops =
{ {
.ao_reset = dac7571_reset, dac7571_reset, /* ao_reset */
.ao_setup = dac7571_setup, dac7571_setup, /* ao_setup */
.ao_shutdown = dac7571_shutdown, dac7571_shutdown, /* ao_shutdown */
.ao_txint = dac7571_txint, dac7571_txint, /* ao_txint */
.ao_send = dac7571_send, dac7571_send, /* ao_send */
.ao_ioctl = dac7571_ioctl, dac7571_ioctl /* ao_ioctl */
}; };
static struct dac_dev_s g_dacdev = static struct dac_dev_s g_dacdev =
{ {
.ad_ops = &g_dacops, &g_dacops, /* ad_ops */
.ad_priv = &g_dacpriv, &g_dacpriv /* ad_priv */
}; };
/**************************************************************************** /****************************************************************************
@@ -141,7 +141,7 @@ static void dac7571_reset(FAR struct dac_dev_s *dev)
* *
****************************************************************************/ ****************************************************************************/
static int dac7571_setup(FAR struct dac_dev_s *dev) static int dac7571_setup(FAR struct dac_dev_s *dev)
{ {
return OK; return OK;
} }
+16 -16
View File
@@ -279,36 +279,36 @@ static struct lmp92001_dev_s g_devpriv;
#ifdef CONFIG_DAC #ifdef CONFIG_DAC
static const struct dac_ops_s g_dacops = static const struct dac_ops_s g_dacops =
{ {
.ao_reset = lmp92001_dac_reset, lmp92001_dac_reset, /* ao_reset */
.ao_setup = lmp92001_dac_setup, lmp92001_dac_setup, /* ao_setup */
.ao_shutdown = lmp92001_dac_shutdown, lmp92001_dac_shutdown, /* ao_shutdown */
.ao_txint = lmp92001_dac_txint, lmp92001_dac_txint, /* ao_txint */
.ao_send = lmp92001_dac_send, lmp92001_dac_send, /* ao_send */
.ao_ioctl = lmp92001_dac_ioctl, lmp92001_dac_ioctl /* ao_ioctl */
}; };
static struct dac_dev_s g_dacdev = static struct dac_dev_s g_dacdev =
{ {
.ad_ops = &g_dacops, &g_dacops, /* ad_ops */
.ad_priv = &g_devpriv, &g_devpriv /* ad_priv */
}; };
#endif #endif
#ifdef CONFIG_ADC #ifdef CONFIG_ADC
static const struct adc_ops_s g_adcops = static const struct adc_ops_s g_adcops =
{ {
.ao_bind = lmp92001_adc_bind, lmp92001_adc_bind, /* ao_bind */
.ao_reset = lmp92001_adc_reset, lmp92001_adc_reset, /* ao_reset */
.ao_setup = lmp92001_adc_setup, lmp92001_adc_setup, /* ao_setup */
.ao_shutdown = lmp92001_adc_shutdown, lmp92001_adc_shutdown, /* ao_shutdown */
.ao_rxint = lmp92001_adc_rxint, lmp92001_adc_rxint, /* ao_rxint */
.ao_ioctl = lmp92001_adc_ioctl lmp92001_adc_ioctl /* ao_ioctl */
}; };
static struct adc_dev_s g_adcdev = static struct adc_dev_s g_adcdev =
{ {
.ad_ops = &g_adcops, &g_adcops, /* ad_ops */
.ad_priv = &g_devpriv, &g_devpriv /* ad_priv */
}; };
#endif #endif
+6 -6
View File
@@ -87,12 +87,12 @@ static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg);
static const struct adc_ops_s g_adcops = static const struct adc_ops_s g_adcops =
{ {
.ao_bind = adc_bind, /* ao_bind */ adc_bind, /* ao_bind */
.ao_reset = adc_reset, /* ao_reset */ adc_reset, /* ao_reset */
.ao_setup = adc_setup, /* ao_setup */ adc_setup, /* ao_setup */
.ao_shutdown = adc_shutdown, /* ao_shutdown */ adc_shutdown, /* ao_shutdown */
.ao_rxint = adc_rxint, /* ao_rxint */ adc_rxint, /* ao_rxint */
.ao_ioctl = adc_ioctl /* ao_read */ adc_ioctl /* ao_read */
}; };
/**************************************************************************** /****************************************************************************
+8 -8
View File
@@ -144,20 +144,20 @@ static int max1161x_ioctl(FAR struct adc_dev_s *dev, int cmd,
static const struct adc_ops_s g_adcops = static const struct adc_ops_s g_adcops =
{ {
.ao_bind = max1161x_bind, /* ao_bind */ max1161x_bind, /* ao_bind */
.ao_reset = max1161x_reset, /* ao_reset */ max1161x_reset, /* ao_reset */
.ao_setup = max1161x_setup, /* ao_setup */ max1161x_setup, /* ao_setup */
.ao_shutdown = max1161x_shutdown, /* ao_shutdown */ max1161x_shutdown, /* ao_shutdown */
.ao_rxint = max1161x_rxint, /* ao_rxint */ max1161x_rxint, /* ao_rxint */
.ao_ioctl = max1161x_ioctl /* ao_read */ max1161x_ioctl /* ao_read */
}; };
static struct max1161x_dev_s g_adcpriv; static struct max1161x_dev_s g_adcpriv;
static struct adc_dev_s g_adcdev = static struct adc_dev_s g_adcdev =
{ {
.ad_ops = &g_adcops, &g_adcops, /* ad_ops */
.ad_priv = &g_adcpriv, &g_adcpriv /* ad_priv */
}; };
/**************************************************************************** /****************************************************************************
+8 -8
View File
@@ -110,18 +110,18 @@ static struct mcp48xx_dev_s g_devpriv;
static const struct dac_ops_s g_dacops = static const struct dac_ops_s g_dacops =
{ {
.ao_reset = mcp48xx_reset, mcp48xx_reset, /* ao_reset */
.ao_setup = mcp48xx_setup, mcp48xx_setup, /* ao_setup */
.ao_shutdown = mcp48xx_shutdown, mcp48xx_shutdown, /* ao_shutdown */
.ao_txint = mcp48xx_txint, mcp48xx_txint, /* ao_txint */
.ao_send = mcp48xx_send, mcp48xx_send, /* ao_send */
.ao_ioctl = mcp48xx_ioctl, mcp48xx_ioctl /* ao_ioctl */
}; };
static struct dac_dev_s g_dacdev = static struct dac_dev_s g_dacdev =
{ {
.ad_ops = &g_dacops, &g_dacops, /* ad_ops */
.ad_priv = &g_devpriv, &g_devpriv /* ad_priv */
}; };
/**************************************************************************** /****************************************************************************
+3 -4
View File
@@ -41,10 +41,9 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int opamp_open(FAR struct file *filep); static int opamp_open(FAR struct file *filep);
static int opamp_close(FAR struct file *filep); static int opamp_close(FAR struct file *filep);
static int opamp_ioctl(FAR struct file *filep, int cmd, static int opamp_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
unsigned long arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
+16 -13
View File
@@ -101,23 +101,26 @@ static void audio_i2s_callback(struct i2s_dev_s *dev,
static const struct audio_ops_s g_audio_i2s_ops = static const struct audio_ops_s g_audio_i2s_ops =
{ {
.getcaps = audio_i2s_getcaps, audio_i2s_getcaps, /* getcaps */
.configure = audio_i2s_configure, audio_i2s_configure, /* configure */
.shutdown = audio_i2s_shutdown, audio_i2s_shutdown, /* shutdown */
.start = audio_i2s_start, audio_i2s_start, /* start */
#ifndef CONFIG_AUDIO_EXCLUDE_STOP #ifndef CONFIG_AUDIO_EXCLUDE_STOP
.stop = audio_i2s_stop, audio_i2s_stop, /* stop */
#endif #endif
#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME #ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
.pause = audio_i2s_pause, audio_i2s_pause, /* pause */
.resume = audio_i2s_resume, audio_i2s_resume, /* resume */
#endif #endif
.allocbuffer = audio_i2s_allocbuffer, audio_i2s_allocbuffer, /* allocbuffer */
.freebuffer = audio_i2s_freebuffer, audio_i2s_freebuffer, /* freebuffer */
.enqueuebuffer = audio_i2s_enqueuebuffer, audio_i2s_enqueuebuffer, /* enqueue_buffer */
.ioctl = audio_i2s_ioctl, NULL, /* cancel_buffer */
.reserve = audio_i2s_reserve, audio_i2s_ioctl, /* ioctl */
.release = audio_i2s_release, NULL, /* read */
NULL, /* write */
audio_i2s_reserve, /* reserve */
audio_i2s_release /* release */
}; };
/**************************************************************************** /****************************************************************************
+40 -39
View File
@@ -68,62 +68,63 @@ struct null_dev_s
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int null_getcaps(FAR struct audio_lowerhalf_s *dev, int type, static int null_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
FAR struct audio_caps_s *caps); FAR struct audio_caps_s *caps);
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_configure(FAR struct audio_lowerhalf_s *dev, static int null_configure(FAR struct audio_lowerhalf_s *dev,
FAR void *session, FAR const struct audio_caps_s *caps); FAR void *session,
FAR const struct audio_caps_s *caps);
#else #else
static int null_configure(FAR struct audio_lowerhalf_s *dev, static int null_configure(FAR struct audio_lowerhalf_s *dev,
FAR const struct audio_caps_s *caps); FAR const struct audio_caps_s *caps);
#endif #endif
static int null_shutdown(FAR struct audio_lowerhalf_s *dev); static int null_shutdown(FAR struct audio_lowerhalf_s *dev);
static void *null_workerthread(pthread_addr_t pvarg); static void *null_workerthread(pthread_addr_t pvarg);
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_start(FAR struct audio_lowerhalf_s *dev, static int null_start(FAR struct audio_lowerhalf_s *dev,
FAR void *session); FAR void *session);
#else #else
static int null_start(FAR struct audio_lowerhalf_s *dev); static int null_start(FAR struct audio_lowerhalf_s *dev);
#endif #endif
#ifndef CONFIG_AUDIO_EXCLUDE_STOP #ifndef CONFIG_AUDIO_EXCLUDE_STOP
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_stop(FAR struct audio_lowerhalf_s *dev, static int null_stop(FAR struct audio_lowerhalf_s *dev,
FAR void *session); FAR void *session);
#else #else
static int null_stop(FAR struct audio_lowerhalf_s *dev); static int null_stop(FAR struct audio_lowerhalf_s *dev);
#endif #endif
#endif #endif
#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME #ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_pause(FAR struct audio_lowerhalf_s *dev, static int null_pause(FAR struct audio_lowerhalf_s *dev,
FAR void *session); FAR void *session);
static int null_resume(FAR struct audio_lowerhalf_s *dev, static int null_resume(FAR struct audio_lowerhalf_s *dev,
FAR void *session); FAR void *session);
#else #else
static int null_pause(FAR struct audio_lowerhalf_s *dev); static int null_pause(FAR struct audio_lowerhalf_s *dev);
static int null_resume(FAR struct audio_lowerhalf_s *dev); static int null_resume(FAR struct audio_lowerhalf_s *dev);
#endif #endif
#endif #endif
static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb); FAR struct ap_buffer_s *apb);
static int null_cancelbuffer(FAR struct audio_lowerhalf_s *dev, static int null_cancelbuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb); FAR struct ap_buffer_s *apb);
static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd, static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd,
unsigned long arg); unsigned long arg);
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_reserve(FAR struct audio_lowerhalf_s *dev, static int null_reserve(FAR struct audio_lowerhalf_s *dev,
FAR void **session); FAR void **session);
#else #else
static int null_reserve(FAR struct audio_lowerhalf_s *dev); static int null_reserve(FAR struct audio_lowerhalf_s *dev);
#endif #endif
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_release(FAR struct audio_lowerhalf_s *dev, static int null_release(FAR struct audio_lowerhalf_s *dev,
FAR void *session); FAR void *session);
#else #else
static int null_release(FAR struct audio_lowerhalf_s *dev); static int null_release(FAR struct audio_lowerhalf_s *dev);
#endif #endif
static int null_sleep(FAR struct audio_lowerhalf_s *dev, static int null_sleep(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb); FAR struct ap_buffer_s *apb);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -206,7 +207,7 @@ static int null_sleep(FAR struct audio_lowerhalf_s *dev,
****************************************************************************/ ****************************************************************************/
static int null_getcaps(FAR struct audio_lowerhalf_s *dev, int type, static int null_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
FAR struct audio_caps_s *caps) FAR struct audio_caps_s *caps)
{ {
audinfo("type=%d\n", type); audinfo("type=%d\n", type);
@@ -699,7 +700,7 @@ static int null_resume(FAR struct audio_lowerhalf_s *dev)
****************************************************************************/ ****************************************************************************/
static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, static int null_enqueuebuffer(FAR struct audio_lowerhalf_s *dev,
FAR struct ap_buffer_s *apb) FAR struct ap_buffer_s *apb)
{ {
FAR struct null_dev_s *priv = (FAR struct null_dev_s *)dev; FAR struct null_dev_s *priv = (FAR struct null_dev_s *)dev;
struct audio_msg_s msg; struct audio_msg_s msg;
@@ -747,7 +748,7 @@ static int null_cancelbuffer(FAR struct audio_lowerhalf_s *dev,
****************************************************************************/ ****************************************************************************/
static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd, static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd,
unsigned long arg) unsigned long arg)
{ {
int ret = OK; int ret = OK;
#ifdef CONFIG_AUDIO_DRIVER_SPECIFIC_BUFFERS #ifdef CONFIG_AUDIO_DRIVER_SPECIFIC_BUFFERS
@@ -801,7 +802,7 @@ static int null_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd,
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_reserve(FAR struct audio_lowerhalf_s *dev, static int null_reserve(FAR struct audio_lowerhalf_s *dev,
FAR void **session) FAR void **session)
#else #else
static int null_reserve(FAR struct audio_lowerhalf_s *dev) static int null_reserve(FAR struct audio_lowerhalf_s *dev)
#endif #endif
@@ -819,7 +820,7 @@ static int null_reserve(FAR struct audio_lowerhalf_s *dev)
#ifdef CONFIG_AUDIO_MULTI_SESSION #ifdef CONFIG_AUDIO_MULTI_SESSION
static int null_release(FAR struct audio_lowerhalf_s *dev, static int null_release(FAR struct audio_lowerhalf_s *dev,
FAR void *session) FAR void *session)
#else #else
static int null_release(FAR struct audio_lowerhalf_s *dev) static int null_release(FAR struct audio_lowerhalf_s *dev)
#endif #endif
+4 -1
View File
@@ -74,7 +74,10 @@ static void i2c_bitbang_send(FAR struct i2c_bitbang_dev_s *dev,
static const struct i2c_ops_s g_i2c_ops = static const struct i2c_ops_s g_i2c_ops =
{ {
.transfer = i2c_bitbang_transfer i2c_bitbang_transfer /* transfer */
#ifdef CONFIG_I2C_RESET
, NULL /* reset */
#endif
}; };
/**************************************************************************** /****************************************************************************
+4 -3
View File
@@ -60,9 +60,10 @@ static uint32_t g_btnnum;
static const struct btn_lowerhalf_s g_btnlower = static const struct btn_lowerhalf_s g_btnlower =
{ {
.bl_supported = btn_supported, btn_supported, /* bl_supported */
.bl_buttons = btn_buttons, btn_buttons, /* bl_buttons */
.bl_enable = btn_enable, btn_enable, /* bl_enable */
NULL /* bl_write */
}; };
/* Current interrupt handler and argument */ /* Current interrupt handler and argument */
+8 -20
View File
@@ -240,18 +240,12 @@ static int mbr3108_i2c_write(FAR struct mbr3108_dev_s *dev, uint8_t reg,
struct i2c_msg_s msgv[2] = struct i2c_msg_s msgv[2] =
{ {
{ {
.frequency = CONFIG_MBR3108_I2C_FREQUENCY, CONFIG_MBR3108_I2C_FREQUENCY,
.addr = dev->addr, dev->addr, 0, &reg, sizeof(reg)
.flags = 0,
.buffer = &reg,
.length = 1
}, },
{ {
.frequency = CONFIG_MBR3108_I2C_FREQUENCY, CONFIG_MBR3108_I2C_FREQUENCY,
.addr = dev->addr, dev->addr, I2C_M_NOSTART, buf, buflen
.flags = I2C_M_NOSTART,
.buffer = (void *)buf,
.length = buflen
} }
}; };
@@ -294,18 +288,12 @@ static int mbr3108_i2c_read(FAR struct mbr3108_dev_s *dev, uint8_t reg,
struct i2c_msg_s msgv[2] = struct i2c_msg_s msgv[2] =
{ {
{ {
.frequency = CONFIG_MBR3108_I2C_FREQUENCY, CONFIG_MBR3108_I2C_FREQUENCY,
.addr = dev->addr, dev->addr, 0, &reg, sizeof(reg)
.flags = 0,
.buffer = &reg,
.length = 1
}, },
{ {
.frequency = CONFIG_MBR3108_I2C_FREQUENCY, CONFIG_MBR3108_I2C_FREQUENCY,
.addr = dev->addr, dev->addr, I2C_M_READ, buf, buflen
.flags = I2C_M_READ,
.buffer = buf,
.length = buflen
} }
}; };
+4 -4
View File
@@ -59,11 +59,11 @@ static uint32_t g_lednum;
static const struct userled_lowerhalf_s g_userled_lower = static const struct userled_lowerhalf_s g_userled_lower =
{ {
.ll_supported = userled_supported, userled_supported, /* ll_supported */
.ll_setled = userled_setled, userled_setled, /* ll_setled */
.ll_setall = userled_setall, userled_setall /* ll_setall */
#ifdef CONFIG_USERLED_LOWER_READSTATE #ifdef CONFIG_USERLED_LOWER_READSTATE
.ll_getall = userled_getall, , userled_getall /* ll_getall */
#endif #endif
}; };
+1 -1
View File
@@ -126,7 +126,7 @@ struct lwl_entry_s
static struct lwl_entry_s g_d = static struct lwl_entry_s g_d =
{ {
.sig = LWL_ID_SIG LWL_ID_SIG
}; };
static const struct file_operations g_consoleops = static const struct file_operations g_consoleops =
+1 -1
View File
@@ -88,7 +88,7 @@ static const struct file_operations g_foc_fops =
static struct foc_callbacks_s g_foc_callbacks = static struct foc_callbacks_s g_foc_callbacks =
{ {
.notifier = foc_notifier, foc_notifier
}; };
/**************************************************************************** /****************************************************************************
+3 -3
View File
@@ -43,10 +43,10 @@
struct noteram_info_s struct noteram_info_s
{ {
unsigned int ni_overwrite;
volatile unsigned int ni_head; volatile unsigned int ni_head;
volatile unsigned int ni_tail; volatile unsigned int ni_tail;
volatile unsigned int ni_read; volatile unsigned int ni_read;
unsigned int ni_overwrite;
uint8_t ni_buffer[CONFIG_DRIVER_NOTERAM_BUFSIZE]; uint8_t ni_buffer[CONFIG_DRIVER_NOTERAM_BUFSIZE];
}; };
@@ -95,9 +95,9 @@ static const struct file_operations g_noteram_fops =
static struct noteram_info_s g_noteram_info = static struct noteram_info_s g_noteram_info =
{ {
#ifdef CONFIG_DRIVER_NOTERAM_DEFAULT_NOOVERWRITE #ifdef CONFIG_DRIVER_NOTERAM_DEFAULT_NOOVERWRITE
.ni_overwrite = NOTERAM_MODE_OVERWRITE_DISABLE NOTERAM_MODE_OVERWRITE_DISABLE
#else #else
.ni_overwrite = NOTERAM_MODE_OVERWRITE_ENABLE NOTERAM_MODE_OVERWRITE_ENABLE
#endif #endif
}; };
+7 -9
View File
@@ -150,19 +150,16 @@ static void governor_update(int domain, int16_t accum);
struct pm_activity_governor_s g_pm_activity_governor = struct pm_activity_governor_s g_pm_activity_governor =
{ {
.pmcount =
{ {
CONFIG_PM_GOVERNOR_IDLEENTER_COUNT, CONFIG_PM_GOVERNOR_IDLEENTER_COUNT,
CONFIG_PM_GOVERNOR_STANDBYENTER_COUNT, CONFIG_PM_GOVERNOR_STANDBYENTER_COUNT,
CONFIG_PM_GOVERNOR_SLEEPENTER_COUNT CONFIG_PM_GOVERNOR_SLEEPENTER_COUNT
}, },
.pmenterthresh =
{ {
CONFIG_PM_GOVERNOR_IDLEENTER_THRESH, CONFIG_PM_GOVERNOR_IDLEENTER_THRESH,
CONFIG_PM_GOVERNOR_STANDBYENTER_THRESH, CONFIG_PM_GOVERNOR_STANDBYENTER_THRESH,
CONFIG_PM_GOVERNOR_SLEEPENTER_THRESH CONFIG_PM_GOVERNOR_SLEEPENTER_THRESH
}, },
.pmexitthresh =
{ {
CONFIG_PM_GOVERNOR_IDLEEXIT_THRESH, CONFIG_PM_GOVERNOR_IDLEEXIT_THRESH,
CONFIG_PM_GOVERNOR_STANDBYEXIT_THRESH, CONFIG_PM_GOVERNOR_STANDBYEXIT_THRESH,
@@ -170,7 +167,6 @@ struct pm_activity_governor_s g_pm_activity_governor =
}, },
#if CONFIG_PM_GOVERNOR_MEMORY > 1 #if CONFIG_PM_GOVERNOR_MEMORY > 1
.pmcoeffs =
{ {
CONFIG_PM_GOVERNOR_COEF1 CONFIG_PM_GOVERNOR_COEF1
#if CONFIG_PM_GOVERNOR_MEMORY > 2 #if CONFIG_PM_GOVERNOR_MEMORY > 2
@@ -192,12 +188,14 @@ struct pm_activity_governor_s g_pm_activity_governor =
#endif #endif
}; };
struct pm_governor_s g_pmgovernor = static struct pm_governor_s g_pmgovernor =
{ {
.initialize = governor_initialize, governor_initialize, /* initialize */
.checkstate = governor_checkstate, NULL, /* deinitialize */
.statechanged = governor_statechanged, governor_statechanged, /* statechanged */
.activity = governor_activity governor_checkstate, /* checkstate */
governor_activity, /* activity */
NULL /* priv */
}; };
/**************************************************************************** /****************************************************************************
+10 -8
View File
@@ -53,10 +53,10 @@
/* PM governor methods */ /* PM governor methods */
static void greedy_governor_initialize(void); static void greedy_governor_initialize(void);
static void greedy_governor_statechanged(int domain, static void greedy_governor_statechanged(int domain,
enum pm_state_e newstate); enum pm_state_e newstate);
static enum pm_state_e greedy_governor_checkstate(int domain); static enum pm_state_e greedy_governor_checkstate(int domain);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -64,10 +64,12 @@ static enum pm_state_e greedy_governor_checkstate(int domain);
static struct pm_governor_s g_greedy_governor_ops = static struct pm_governor_s g_greedy_governor_ops =
{ {
.initialize = greedy_governor_initialize, /* initialize */ greedy_governor_initialize, /* initialize */
.statechanged = greedy_governor_statechanged, /* statechanged */ NULL, /* deinitialize */
.checkstate = greedy_governor_checkstate, /* checkstate */ greedy_governor_statechanged, /* statechanged */
.activity = NULL, /* activity */ greedy_governor_checkstate, /* checkstate */
NULL, /* activity */
NULL /* priv */
}; };
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -50,7 +50,7 @@
struct pm_global_s g_pmglobals = struct pm_global_s g_pmglobals =
{ {
.regsem = SEM_INITIALIZER(1) SEM_INITIALIZER(1)
}; };
/**************************************************************************** /****************************************************************************
+8 -3
View File
@@ -58,9 +58,14 @@ static int regulator_gpio_is_enabled(FAR struct regulator_dev_s *rdev);
static const struct regulator_ops_s g_regulator_gpio_ops = static const struct regulator_ops_s g_regulator_gpio_ops =
{ {
.enable = regulator_gpio_enable, NULL, /* list_voltage */
.disable = regulator_gpio_disable, NULL, /* set_voltage */
.is_enabled = regulator_gpio_is_enabled, NULL, /* set_voltage_sel */
NULL, /* get_voltage */
NULL, /* get_voltage_sel */
regulator_gpio_enable, /* enable */
regulator_gpio_is_enabled, /* is_enabled */
regulator_gpio_disable /* disable */
}; };
/**************************************************************************** /****************************************************************************
+12 -12
View File
@@ -86,18 +86,18 @@ struct dummy_dev_s
static const struct lirc_ops_s g_dummy_ops = static const struct lirc_ops_s g_dummy_ops =
{ {
.driver_type = LIRC_DRIVER_IR_RAW, LIRC_DRIVER_IR_RAW, /* driver_type */
.open = dummy_open, dummy_open, /* open */
.close = dummy_close, dummy_close, /* close */
.s_tx_mask = dummy_s_tx_mask, dummy_s_tx_mask, /* s_tx_mask */
.s_tx_carrier = dummy_s_tx_carrier, dummy_s_tx_carrier, /* s_tx_carrier */
.s_tx_duty_cycle = dummy_s_tx_duty_cycle, dummy_s_tx_duty_cycle, /* s_tx_duty_cycle */
.s_rx_carrier_range = dummy_s_rx_carrier_range, dummy_s_rx_carrier_range, /* s_rx_carrier_range */
.tx_ir = dummy_tx_ir, dummy_tx_ir, /* tx_ir */
.tx_scancode = dummy_tx_scancode, dummy_tx_scancode, /* tx_scancode */
.s_learning_mode = dummy_s_learning_mode, dummy_s_learning_mode, /* s_learning_mode */
.s_carrier_report = dummy_s_carrier_report, dummy_s_carrier_report, /* s_carrier_report */
.s_timeout = dummy_s_timeout, dummy_s_timeout /* s_timeout */
}; };
/**************************************************************************** /****************************************************************************
+8 -9
View File
@@ -196,19 +196,18 @@ static void qspi_flash_writeword(FAR struct qspi_flashdev_s *priv,
static const struct qspi_ops_s g_qspiops = static const struct qspi_ops_s g_qspiops =
{ {
.lock = qspi_flash_lock, qspi_flash_lock, /* lock */
.setfrequency = qspi_flash_setfrequency, qspi_flash_setfrequency, /* setfrequency */
.setmode = qspi_flash_setmode, qspi_flash_setmode, /* setmode */
.setbits = qspi_flash_setbits, qspi_flash_setbits, /* setbits */
.command = qspi_flash_command, qspi_flash_command, /* command */
.memory = qspi_flash_memory, qspi_flash_memory, /* memory */
.alloc = qspi_flash_alloc, qspi_flash_alloc, /* alloc */
.free = qspi_flash_free qspi_flash_free /* free */
}; };
struct qspi_flashdev_s g_qspidev = struct qspi_flashdev_s g_qspidev =
{ {
.spidev =
{ {
&g_qspiops &g_qspiops
} }
+47 -45
View File
@@ -151,15 +151,15 @@
struct spi_flash_dev_s struct spi_flash_dev_s
{ {
struct spi_dev_s spidev; /* Externally visible part of the SPI interface */ struct spi_dev_s spidev; /* Externally visible part of the SPI interface */
uint32_t selected; /* SPIn base address */ FAR const char * name; /* Name of the flash type (m25p, w25, etc.) */
FAR char * name; /* Name of the flash type (m25p, w25, etc.) */
int wren;
int state;
uint32_t read_data;
uint8_t last_cmd;
uint8_t capacity;
uint8_t manuf; uint8_t manuf;
uint8_t type; uint8_t type;
uint8_t capacity;
uint8_t last_cmd;
uint32_t selected; /* SPIn base address */
uint32_t read_data;
int wren;
int state;
unsigned long address; unsigned long address;
unsigned char data[CONFIG_SPI_FLASH_SIZE]; unsigned char data[CONFIG_SPI_FLASH_SIZE];
}; };
@@ -203,85 +203,87 @@ static uint32_t spi_flash_readword(FAR struct spi_flash_dev_s *priv);
static const struct spi_ops_s g_spiops = static const struct spi_ops_s g_spiops =
{ {
.lock = spi_flash_lock, spi_flash_lock, /* lock */
.select = spi_flash_select, spi_flash_select, /* select */
.setfrequency = spi_flash_setfrequency, spi_flash_setfrequency, /* setfrequency */
.setmode = spi_flash_setmode, #ifdef CONFIG_SPI_DELAY_CONTROL
.setbits = spi_flash_setbits, NULL, /* setdelay */
#endif
spi_flash_setmode, /* setmode */
spi_flash_setbits, /* setbits */
#ifdef CONFIG_SPI_HWFEATURES #ifdef CONFIG_SPI_HWFEATURES
.hwfeatures = 0, /* Not supported */ NULL, /* hwfeatures */
#endif #endif
.status = spi_flash_status, spi_flash_status, /* status */
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
.cmddata = spi_flash_cmddata, spi_flash_cmddata, /* cmddata */
#endif #endif
.send = spi_flash_send, spi_flash_send, /* send */
#ifdef CONFIG_SPI_EXCHANGE #ifdef CONFIG_SPI_EXCHANGE
.exchange = spi_flash_exchange, spi_flash_exchange, /* exchange */
#else #else
.sndblock = spi_flash_sndblock, spi_flash_sndblock, /* sndblock */
.recvblock = spi_flash_recvblock, spi_flash_recvblock, /* recvblock */
#endif #endif
.registercallback = 0, #ifdef CONFIG_SPI_TRIGGER
NULL, /* trigger */
#endif
NULL /* registercallback */
}; };
#ifdef CONFIG_SPI_FLASH_M25P #ifdef CONFIG_SPI_FLASH_M25P
struct spi_flash_dev_s g_spidev_m25p = struct spi_flash_dev_s g_spidev_m25p =
{ {
.spidev =
{ {
&g_spiops &g_spiops /* spidev */
}, },
.name = "m25p", "m25p", /* name */
.manuf = 0x20, 0x20, /* manuf */
.type = 0x20, 0x20, /* type */
.capacity = CONFIG_SPI_FLASH_CAPACITY CONFIG_SPI_FLASH_CAPACITY /* capacity */
}; };
#endif #endif
#ifdef CONFIG_SPI_FLASH_SST26 #ifdef CONFIG_SPI_FLASH_SST26
struct spi_flash_dev_s g_spidev_sst26 = struct spi_flash_dev_s g_spidev_sst26 =
{ {
.spidev =
{ {
&g_spiops &g_spiops /* spidev */
}, },
.name = "sst26", "sst26", /* name */
.manuf = 0xbf, 0xbf, /* manuf */
#ifdef CONFIG_SST26_MEMORY_TYPE #ifdef CONFIG_SST26_MEMORY_TYPE
.type = CONFIG_SST26_MEMORY_TYPE, CONFIG_SST26_MEMORY_TYPE, /* type */
#else #else
.type = 0x25, 0x25, /* type */
#endif #endif
.capacity = CONFIG_SPI_FLASH_CAPACITY_SST26 CONFIG_SPI_FLASH_CAPACITY_SST26 /* capacity */
}; };
#endif #endif
#ifdef CONFIG_SPI_FLASH_W25 #ifdef CONFIG_SPI_FLASH_W25
struct spi_flash_dev_s g_spidev_w25 = struct spi_flash_dev_s g_spidev_w25 =
{ {
.spidev =
{ {
&g_spiops &g_spiops /* spidev */
}, },
.name = "w25", "w25", /* name */
.manuf = 0xef, 0xef, /* manuf */
.type = 0x30, 0x30, /* type */
.capacity = CONFIG_SPI_FLASH_CAPACITY CONFIG_SPI_FLASH_CAPACITY /* capacity */
}; };
#endif #endif
#ifdef CONFIG_SPI_FLASH_CUSTOM #ifdef CONFIG_SPI_FLASH_CUSTOM
struct spi_flash_dev_s g_spidev_custom = struct spi_flash_dev_s g_spidev_custom =
{ {
.spidev =
{ {
&g_spiops &g_spiops /* spidev */
}, },
.name = "custom", "custom", /* name */
.manuf = CONFIG_SPI_FLASH_MANUFACTURER, CONFIG_SPI_FLASH_MANUFACTURER, /* manuf */
.type = CONFIG_SPI_FLASH_MEMORY_TYPE, CONFIG_SPI_FLASH_MEMORY_TYPE, /* type */
.capacity = CONFIG_SPI_FLASH_CAPACITY CONFIG_SPI_FLASH_CAPACITY /* capacity */
}; };
#endif #endif
+8 -8
View File
@@ -614,14 +614,14 @@ static uint8_t g_isx012_iso_regval[] =
static struct imgsensor_ops_s g_isx012_ops = static struct imgsensor_ops_s g_isx012_ops =
{ {
.init = isx012_init, isx012_init, /* init */
.uninit = isx012_uninit, isx012_uninit, /* uninit */
.validate_frame_setting = isx012_validate_frame_setting, isx012_validate_frame_setting, /* validate_frame_setting */
.start_capture = isx012_start_capture, isx012_start_capture, /* start_capture */
.stop_capture = isx012_stop_capture, isx012_stop_capture, /* stop_capture */
.get_supported_value = isx012_get_supported_value, isx012_get_supported_value, /* get_supported_value */
.get_value = isx012_get_value, isx012_get_value, /* get_value */
.set_value = isx012_set_value, isx012_set_value /* set_value */
}; };
/**************************************************************************** /****************************************************************************
+14 -14
View File
@@ -281,71 +281,71 @@ enum v4l2_scene_mode g_video_scene_mode = V4L2_SCENE_MODE_NONE;
video_scene_params_t g_video_scene_parameter[] = video_scene_params_t g_video_scene_parameter[] =
{ {
{ {
.mode = V4L2_SCENE_MODE_NONE, V4L2_SCENE_MODE_NONE
}, },
#ifdef CONFIG_VIDEO_SCENE_BACKLIGHT #ifdef CONFIG_VIDEO_SCENE_BACKLIGHT
{ {
.mode = V4L2_SCENE_MODE_BACKLIGHT, V4L2_SCENE_MODE_BACKLIGHT
}, },
#endif /* CONFIG_VIDEO_SCENE_BACKLIGHT */ #endif /* CONFIG_VIDEO_SCENE_BACKLIGHT */
#ifdef CONFIG_VIDEO_SCENE_BEACHSNOW #ifdef CONFIG_VIDEO_SCENE_BEACHSNOW
{ {
.mode = V4L2_SCENE_MODE_BEACH_SNOW, V4L2_SCENE_MODE_BEACH_SNOW
}, },
#endif /* CONFIG_VIDEO_SCENE_BEACHSNOW */ #endif /* CONFIG_VIDEO_SCENE_BEACHSNOW */
#ifdef CONFIG_VIDEO_SCENE_CANDLELIGHT #ifdef CONFIG_VIDEO_SCENE_CANDLELIGHT
{ {
.mode = V4L2_SCENE_MODE_CANDLE_LIGHT, V4L2_SCENE_MODE_CANDLE_LIGHT
}, },
#endif /* CONFIG_VIDEO_SCENE_CANDLELIGHT */ #endif /* CONFIG_VIDEO_SCENE_CANDLELIGHT */
#ifdef CONFIG_VIDEO_SCENE_DAWNDUSK #ifdef CONFIG_VIDEO_SCENE_DAWNDUSK
{ {
.mode = V4L2_SCENE_MODE_DAWN_DUSK, V4L2_SCENE_MODE_DAWN_DUSK
}, },
#endif /* CONFIG_VIDEO_SCENE_DAWNDUSK */ #endif /* CONFIG_VIDEO_SCENE_DAWNDUSK */
#ifdef CONFIG_VIDEO_SCENE_FALLCOLORS #ifdef CONFIG_VIDEO_SCENE_FALLCOLORS
{ {
.mode = V4L2_SCENE_MODE_FALL_COLORS, V4L2_SCENE_MODE_FALL_COLORS,
}, },
#endif /* CONFIG_VIDEO_SCENE_FALLCOLORS */ #endif /* CONFIG_VIDEO_SCENE_FALLCOLORS */
#ifdef CONFIG_VIDEO_SCENE_FIREWORKS #ifdef CONFIG_VIDEO_SCENE_FIREWORKS
{ {
.mode = V4L2_SCENE_MODE_FIREWORKS, V4L2_SCENE_MODE_FIREWORKS
}, },
#endif /* CONFIG_VIDEO_SCENE_FIREWORKS */ #endif /* CONFIG_VIDEO_SCENE_FIREWORKS */
#ifdef CONFIG_VIDEO_SCENE_LANDSCAPE #ifdef CONFIG_VIDEO_SCENE_LANDSCAPE
{ {
.mode = V4L2_SCENE_MODE_LANDSCAPE, V4L2_SCENE_MODE_LANDSCAPE
}, },
#endif /* CONFIG_VIDEO_SCENE_LANDSCAPE */ #endif /* CONFIG_VIDEO_SCENE_LANDSCAPE */
#ifdef CONFIG_VIDEO_SCENE_NIGHT #ifdef CONFIG_VIDEO_SCENE_NIGHT
{ {
.mode = V4L2_SCENE_MODE_NIGHT, V4L2_SCENE_MODE_NIGHT
}, },
#endif /* CONFIG_VIDEO_SCENE_NIGHT */ #endif /* CONFIG_VIDEO_SCENE_NIGHT */
#ifdef CONFIG_VIDEO_SCENE_PARTYINDOOR #ifdef CONFIG_VIDEO_SCENE_PARTYINDOOR
{ {
.mode = V4L2_SCENE_MODE_PARTY_INDOOR, V4L2_SCENE_MODE_PARTY_INDOOR
}, },
#endif /* CONFIG_VIDEO_SCENE_PARTYINDOOR */ #endif /* CONFIG_VIDEO_SCENE_PARTYINDOOR */
#ifdef CONFIG_VIDEO_SCENE_PORTRAIT #ifdef CONFIG_VIDEO_SCENE_PORTRAIT
{ {
.mode = V4L2_SCENE_MODE_PORTRAIT, V4L2_SCENE_MODE_PORTRAIT
}, },
#endif /* CONFIG_VIDEO_SCENE_PORTRAIT */ #endif /* CONFIG_VIDEO_SCENE_PORTRAIT */
#ifdef CONFIG_VIDEO_SCENE_SPORTS #ifdef CONFIG_VIDEO_SCENE_SPORTS
{ {
.mode = V4L2_SCENE_MODE_SPORTS, V4L2_SCENE_MODE_SPORTS
}, },
#endif /* CONFIG_VIDEO_SCENE_SPORTS */ #endif /* CONFIG_VIDEO_SCENE_SPORTS */
#ifdef CONFIG_VIDEO_SCENE_SUNSET #ifdef CONFIG_VIDEO_SCENE_SUNSET
{ {
.mode = V4L2_SCENE_MODE_SUNSET, V4L2_SCENE_MODE_SUNSET
}, },
#endif /* CONFIG_VIDEO_SCENE_SUNSET */ #endif /* CONFIG_VIDEO_SCENE_SUNSET */
#ifdef CONFIG_VIDEO_SCENE_TEXT #ifdef CONFIG_VIDEO_SCENE_TEXT
{ {
.mode = V4L2_SCENE_MODE_TEXT, V4L2_SCENE_MODE_TEXT
}, },
#endif /* CONFIG_VIDEO_SCENE_TEXT */ #endif /* CONFIG_VIDEO_SCENE_TEXT */
}; };
+8 -6
View File
@@ -72,12 +72,14 @@ static const struct file_operations g_sock_fileops =
static struct inode g_sock_inode = static struct inode g_sock_inode =
{ {
.i_crefs = 1, NULL, /* i_parent */
.i_flags = FSNODEFLAG_TYPE_SOCKET, NULL, /* i_peer */
.u = NULL, /* i_child */
{ 1, /* i_crefs */
.i_ops = &g_sock_fileops, FSNODEFLAG_TYPE_SOCKET, /* i_flags */
}, {
&g_sock_fileops /* u */
}
}; };
/**************************************************************************** /****************************************************************************
+8 -6
View File
@@ -85,12 +85,14 @@ static const struct file_operations g_epoll_ops =
static struct inode g_epoll_inode = static struct inode g_epoll_inode =
{ {
.i_crefs = 1, NULL, /* i_parent */
.i_flags = FSNODEFLAG_TYPE_DRIVER, NULL, /* i_peer */
.u = NULL, /* i_child */
{ 1, /* i_crefs */
.i_ops = &g_epoll_ops, FSNODEFLAG_TYPE_DRIVER, /* i_flags */
}, {
&g_epoll_ops /* u */
}
}; };
/**************************************************************************** /****************************************************************************
+5 -5
View File
@@ -178,6 +178,11 @@ struct adc_ops_s
struct adc_dev_s struct adc_dev_s
{ {
/* Fields provided by lower half ADC logic */
FAR const struct adc_ops_s *ad_ops; /* Arch-specific operations */
FAR void *ad_priv; /* Used by the arch-specific logic */
#ifdef CONFIG_ADC #ifdef CONFIG_ADC
/* Fields managed by common upper half ADC logic */ /* Fields managed by common upper half ADC logic */
@@ -195,11 +200,6 @@ struct adc_dev_s
struct pollfd *fds[CONFIG_ADC_NPOLLWAITERS]; struct pollfd *fds[CONFIG_ADC_NPOLLWAITERS];
#endif /* CONFIG_ADC */ #endif /* CONFIG_ADC */
/* Fields provided by lower half ADC logic */
FAR const struct adc_ops_s *ad_ops; /* Arch-specific operations */
FAR void *ad_priv; /* Used by the arch-specific logic */
}; };
/**************************************************************************** /****************************************************************************
+2 -2
View File
@@ -127,14 +127,14 @@ struct dac_ops_s
struct dac_dev_s struct dac_dev_s
{ {
const struct dac_ops_s *ad_ops; /* Arch-specific operations */
void *ad_priv; /* Used by the arch-specific logic */
uint8_t ad_ocount; /* The number of times the device has uint8_t ad_ocount; /* The number of times the device has
* been opened */ * been opened */
uint8_t ad_nchannel; /* Number of dac channel */ uint8_t ad_nchannel; /* Number of dac channel */
sem_t ad_closesem; /* Locks out new opens while close is sem_t ad_closesem; /* Locks out new opens while close is
* in progress */ * in progress */
struct dac_fifo_s ad_xmit; /* Describes receive FIFO */ struct dac_fifo_s ad_xmit; /* Describes receive FIFO */
const struct dac_ops_s *ad_ops; /* Arch-specific operations */
void *ad_priv; /* Used by the arch-specific logic */
}; };
/**************************************************************************** /****************************************************************************
+3 -24
View File
@@ -35,30 +35,9 @@
static struct lconv g_c_lconv = static struct lconv g_c_lconv =
{ {
.decimal_point = ".", ".", "", "", "", "", "", "", "", "", "", CHAR_MAX, CHAR_MAX,
.thousands_sep = "", CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX,
.grouping = "", CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX
.int_curr_symbol = "",
.currency_symbol = "",
.mon_decimal_point = "",
.mon_thousands_sep = "",
.mon_grouping = "",
.positive_sign = "",
.negative_sign = "",
.int_frac_digits = CHAR_MAX,
.frac_digits = CHAR_MAX,
.p_cs_precedes = CHAR_MAX,
.p_sep_by_space = CHAR_MAX,
.n_cs_precedes = CHAR_MAX,
.n_sep_by_space = CHAR_MAX,
.p_sign_posn = CHAR_MAX,
.n_sign_posn = CHAR_MAX,
.int_p_cs_precedes = CHAR_MAX,
.int_p_sep_by_space = CHAR_MAX,
.int_n_cs_precedes = CHAR_MAX,
.int_n_sep_by_space = CHAR_MAX,
.int_p_sign_posn = CHAR_MAX,
.int_n_sign_posn = CHAR_MAX,
}; };
/**************************************************************************** /****************************************************************************
+4 -5
View File
@@ -46,11 +46,10 @@
void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
unsigned int buflen) unsigned int buflen)
{ {
struct iovec buf = struct iovec buf;
{
.iov_base = (FAR char *)buffer, buf.iov_base = (FAR void *)buffer;
.iov_len = buflen, buf.iov_len = buflen;
};
lib_dumpvbuffer(msg, &buf, 1); lib_dumpvbuffer(msg, &buf, 1);
} }
+8 -9
View File
@@ -43,7 +43,7 @@
struct match_s struct match_s
{ {
FAR struct match_s *next; FAR struct match_s *next;
char name[]; char name[1];
}; };
/**************************************************************************** /****************************************************************************
@@ -71,8 +71,8 @@ static int sort(FAR const void *a, FAR const void *b);
static int append(FAR struct match_s **tail, FAR const char *name, static int append(FAR struct match_s **tail, FAR const char *name,
size_t len, int mark) size_t len, int mark)
{ {
FAR struct match_s *new = lib_malloc(sizeof(struct match_s) + len + 2); FAR struct match_s *new = lib_malloc(sizeof(struct match_s) + len + 1);
if (!new) if (new == NULL)
{ {
return -1; return -1;
} }
@@ -83,7 +83,7 @@ static int append(FAR struct match_s **tail, FAR const char *name,
if (mark && len && name[len - 1] != '/') if (mark && len && name[len - 1] != '/')
{ {
new->name[len] = '/'; new->name[len] = '/';
new->name[len + 1] = 0; new->name[len + 1] = '\0';
} }
*tail = new; *tail = new;
@@ -405,11 +405,7 @@ int glob(FAR const char *pat, int flags,
CODE int (*errfunc)(FAR const char *path, int err), CODE int (*errfunc)(FAR const char *path, int err),
FAR glob_t *g) FAR glob_t *g)
{ {
struct match_s head = struct match_s head;
{
.next = NULL
};
FAR struct match_s *tail = &head; FAR struct match_s *tail = &head;
size_t cnt; size_t cnt;
size_t i; size_t i;
@@ -417,6 +413,9 @@ int glob(FAR const char *pat, int flags,
int error = 0; int error = 0;
char buf[PATH_MAX]; char buf[PATH_MAX];
head.next = NULL;
head.name[0] = '\0';
if (!errfunc) if (!errfunc)
{ {
errfunc = ignore_err; errfunc = ignore_err;
+4 -5
View File
@@ -90,13 +90,12 @@ struct note_startalloc_s
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER #ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
static struct note_filter_s g_note_filter = static struct note_filter_s g_note_filter =
{ {
.mode = {
{ CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE
.flag = CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.cpuset = CONFIG_SCHED_INSTRUMENTATION_CPUSET, , CONFIG_SCHED_INSTRUMENTATION_CPUSET
#endif #endif
} }
}; };
#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER