Fix the coding style and typo issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
anjiahao
2022-09-06 14:18:45 +08:00
committed by Masayuki Ishikawa
parent d07792a343
commit a4563b8744
148 changed files with 1747 additions and 1744 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ struct cxd56adc_dev_s
uint8_t fifomode; /* fifo mode */
struct scufifo_wm_s *wm; /* water mark */
struct math_filter_s *filter; /* math filter */
struct scuev_notify_s * notify; /* notify */
struct scuev_notify_s *notify; /* notify */
mutex_t lock; /* exclusive mutex */
int crefs; /* reference count */
};
+12 -5
View File
@@ -292,6 +292,10 @@ struct dma_channel_s
static struct dma_channel_s g_dmach[NCHANNELS];
static mutex_t g_dmalock = NXMUTEX_INITIALIZER;
/****************************************************************************
* Private Functions
****************************************************************************/
static int dma_init(int ch);
static int dma_uninit(int ch);
static int dma_open(int ch);
@@ -328,6 +332,7 @@ static struct dmac_register_map *get_device(int ch)
case 2: return (struct dmac_register_map *)DMAC2_REG_BASE;
case 3: return (struct dmac_register_map *)DMAC3_REG_BASE;
}
return NULL;
}
@@ -335,15 +340,17 @@ static struct dmac_ch_register_map *get_channel(int ch)
{
struct dmac_register_map *dev = get_device(ch);
if (dev == NULL)
return NULL;
{
return NULL;
}
if (is_dmac(2, dev))
{
return &dev->channel[ch - 7];
return &dev->channel[ch - 7];
}
else if (is_dmac(3, dev))
{
return &((struct dmac080_register_map *)dev)->channel[ch - 2];
return &((struct dmac080_register_map *)dev)->channel[ch - 2];
}
return &dev->channel[ch & 1];
@@ -397,12 +404,12 @@ static void _dmac_intc_handler(int ch)
if (is_dmac(2, dev))
{
mask = 1u << (ch - 7);
mask = 1u << (ch - 7);
}
else if (is_dmac(3, dev))
{
mask = 1u << (ch - 2);
mask = 1u << (ch - 2);
}
itc = dev->inttcstatus & mask;
+2 -4
View File
@@ -271,7 +271,7 @@ static struct emmc_dma_desc_s *emmc_setupdma(void *buf, unsigned int nbytes)
int i;
int ndescs;
struct emmc_dma_desc_s *descs;
struct emmc_dma_desc_s *d;
struct emmc_dma_desc_s *d;
uint32_t addr;
uint32_t size;
unsigned int remain;
@@ -935,13 +935,11 @@ static int cxd56_emmc_geometry(struct inode *inode,
int cxd56_emmcinitialize(void)
{
struct cxd56_emmc_state_s *priv;
struct cxd56_emmc_state_s *priv = &g_emmcdev;
uint8_t *buf;
struct emmc_dma_desc_s *descs;
int ret;
priv = &g_emmcdev;
ret = emmc_hwinitialize();
if (ret != OK)
{
+2 -2
View File
@@ -399,7 +399,7 @@ static int cxd56_geofence_get_all_status(unsigned long arg)
static int cxd56_geofence_set_mode(unsigned long arg)
{
int ret;
int ret;
struct cxd56_geofence_mode_s *mode;
if (!arg)
@@ -550,7 +550,7 @@ static int cxd56_geofence_poll(struct file *filep,
struct pollfd *fds,
bool setup)
{
struct inode * inode;
struct inode *inode;
struct cxd56_geofence_dev_s *priv;
int ret = OK;
int i;
+6 -6
View File
@@ -161,7 +161,7 @@ struct cxd56_gnss_dev_s
uint8_t num_open;
uint8_t notify_data;
struct file cepfp;
void * cepbuf;
void *cepbuf;
struct pollfd *fds[CONFIG_CXD56_GNSS_NPOLLWAITERS];
#if CONFIG_CXD56_GNSS_NSIGNALRECEIVERS != 0
struct cxd56_gnss_sig_s sigs[CONFIG_CXD56_GNSS_NSIGNALRECEIVERS];
@@ -1884,8 +1884,8 @@ static int cxd56_gnss_select_rtk_satellite(struct file *filep,
static int cxd56_gnss_get_rtk_satellite(struct file *filep,
unsigned long arg)
{
int ret;
uint32_t gnss = 0;
int ret;
uint32_t gnss = 0;
if (!arg)
{
@@ -2688,7 +2688,7 @@ static int cxd56_gnss_initialize(struct cxd56_gnss_dev_s *dev)
static int cxd56_gnss_open(struct file *filep)
{
struct inode * inode;
struct inode *inode;
struct cxd56_gnss_dev_s *priv;
int ret = OK;
int retry = 50;
@@ -2795,7 +2795,7 @@ success:
static int cxd56_gnss_close(struct file *filep)
{
struct inode * inode;
struct inode *inode;
struct cxd56_gnss_dev_s *priv;
int ret = OK;
@@ -2937,7 +2937,7 @@ static ssize_t cxd56_gnss_write(struct file *filep,
static int cxd56_gnss_ioctl(struct file *filep, int cmd,
unsigned long arg)
{
struct inode * inode;
struct inode *inode;
struct cxd56_gnss_dev_s *priv;
int ret;
+1 -3
View File
@@ -442,9 +442,7 @@ static int hif_initialize(struct hostif_buff_s *buffer)
cxd56_iccinit(CXD56_PROTO_HOSTIF);
ret = cxd56_iccregisterhandler(CXD56_PROTO_HOSTIF, hif_rxhandler, NULL);
return ret;
return cxd56_iccregisterhandler(CXD56_PROTO_HOSTIF, hif_rxhandler, NULL);
}
/****************************************************************************
+3 -3
View File
@@ -261,8 +261,8 @@ struct cxd56_sdiodev_s
bool usedma;
bool dmasend_prepare;
size_t receive_size;
uint8_t *aligned_buffer; /* Used to buffer alignment */
uint8_t *receive_buffer; /* Used to keep receive buffer address */
uint8_t *aligned_buffer; /* Used to buffer alignment */
uint8_t *receive_buffer; /* Used to keep receive buffer address */
uint32_t dma_cmd;
uint32_t dmasend_cmd;
uint32_t dmasend_regcmd;
@@ -2795,7 +2795,7 @@ static int cxd56_sdio_dmarecvsetup(struct sdio_dev_s *dev,
{
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
unsigned int blocksize;
int ret = OK;
int ret = OK;
DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
DEBUGASSERT(((uint32_t)buffer & 3) == 0);
+12 -12
View File
@@ -178,9 +178,9 @@ static const struct spi_ops_s g_spi4ops =
static struct cxd56_spidev_s g_spi4dev =
{
.spidev =
{
&g_spi4ops
},
{
.ops = &g_spi4ops,
},
.spibase = CXD56_IMG_SPI_BASE,
.spibasefreq = 0,
.port = 4,
@@ -225,9 +225,9 @@ static const struct spi_ops_s g_spi5ops =
static struct cxd56_spidev_s g_spi5dev =
{
.spidev =
{
&g_spi5ops
},
{
.ops = &g_spi5ops,
},
.spibase = CXD56_IMG_WSPI_BASE,
.spibasefreq = 0,
.port = 5,
@@ -271,9 +271,9 @@ static const struct spi_ops_s g_spi0ops =
static struct cxd56_spidev_s g_spi0dev =
{
.spidev =
{
&g_spi0ops
},
{
.ops = &g_spi0ops,
},
.spibase = CXD56_SPIM_BASE,
.spibasefreq = 0,
.port = 0,
@@ -317,9 +317,9 @@ static const struct spi_ops_s g_spi3ops =
static struct cxd56_spidev_s g_spi3dev =
{
.spidev =
{
&g_spi3ops
},
{
.ops = &g_spi3ops,
},
.spibase = CXD56_SCU_SPI_BASE,
.spibasefreq = 0,
.port = 3,
+1 -9
View File
@@ -231,15 +231,7 @@ static ssize_t uart0_write(struct file *filep,
int cxd56_uart0initialize(const char *devname)
{
int ret;
ret = register_driver(devname, &g_uart0fops, 0666, NULL);
if (ret != 0)
{
return ERROR;
}
return OK;
return register_driver(devname, &g_uart0fops, 0666, NULL);
}
/****************************************************************************
+1 -1
View File
@@ -742,7 +742,7 @@ static void efm32_i2c_setclock(struct efm32_i2c_priv_s *priv,
#elif defined(CONFIG_EFM32_I2C_CLHR_ASYMMETRIC)
# define n (6 + 3) /* Ratio is 6:3 */
#else /* CLHR STANDARD */
# define n ( 4 + 4) /* Ratio is 4:4 */
# define n (4 + 4) /* Ratio is 4:4 */
#endif
div = (BOARD_HFPERCLK_FREQUENCY - (4 * frequency)) / (n * frequency);
+3 -3
View File
@@ -494,8 +494,8 @@ static struct efm32_usbhost_s g_usbhost =
static struct usbhost_connection_s g_usbconn =
{
.wait = efm32_wait,
.enumerate = efm32_enumerate,
.wait = efm32_wait,
.enumerate = efm32_enumerate,
};
#ifdef HAVE_USBHOST_TRACE
@@ -5280,7 +5280,7 @@ static inline void efm32_sw_initialize(struct efm32_usbhost_s *priv)
struct efm32_chan_s *chan = &priv->chan[i];
chan->chidx = i;
nxsem_init(&chan->waitsem, 0, 0);
nxsem_init(&chan->waitsem, 0, 0);
}
}
+1 -1
View File
@@ -176,7 +176,7 @@ static struct gd32_dma_channel_s g_dmachan[DMA_NCHANNELS] =
.chan_num = GD32_DMA_CH6,
.irq = GD32_IRQ_DMA1_CHANNEL6,
.chsem = SEM_INITIALIZER(1),
.dmabase = GD32_DMA1,
.dmabase = GD32_DMA1,
},
{
.chan_num = GD32_DMA_CH7,
+9 -9
View File
@@ -293,9 +293,9 @@ static uint8_t g_spi0_rxbuf[SPI0_DMA_BUFSIZE_ADJ] SPI_DMA_BUFEER_ALIGN;
static struct gd32_spidev_s g_spi0dev =
{
.spidev =
{
&g_spi0ops
},
{
.ops = &g_spi0ops
},
.spibase = GD32_SPI0,
.spiclock = GD32_PCLK2_FREQUENCY,
.lock = NXMUTEX_INITIALIZER,
@@ -1451,12 +1451,12 @@ static void spi_exchange_nodma(struct spi_dev_s *dev,
struct gd32_spidev_s *priv = (struct gd32_spidev_s *)dev;
DEBUGASSERT(priv && priv->spibase);
uint8_t *brxptr = (uint8_t *)rxbuffer;
const uint8_t *btxptr = (uint8_t *)txbuffer;
uint16_t *wrxptr = (uint16_t *)rxbuffer;
const uint16_t *wtxptr = (const uint16_t *)txbuffer;
uint8_t byte;
uint16_t word;
uint8_t *brxptr = (uint8_t *)rxbuffer;
const uint8_t *btxptr = (uint8_t *)txbuffer;
uint16_t *wrxptr = (uint16_t *)rxbuffer;
const uint16_t *wtxptr = (const uint16_t *)txbuffer;
uint8_t byte;
uint16_t word;
spiinfo("txbuffer=%p rxbuffer=%p nwords=%d\n", txbuffer, rxbuffer, nwords);
+6 -6
View File
@@ -207,23 +207,23 @@ static struct imx_spidev_s g_spidev[] =
{
#ifdef CONFIG_IMX1_SPI1
{
.ops = &g_spiops,
.base = IMX_CSPI1_VBASE,
.ops = &g_spiops,
.base = IMX_CSPI1_VBASE,
.lock = NXMUTEX_INITIALIZER,
#ifndef CONFIG_SPI_POLLWAIT
.waitsem = SEM_INITIALIZER(0),
.irq = IMX_IRQ_CSPI1,
.irq = IMX_IRQ_CSPI1,
#endif
},
#endif
#ifdef CONFIG_IMX1_SPI2
{
.ops = &g_spiops,
.base = IMX_CSPI2_VBASE,
.ops = &g_spiops,
.base = IMX_CSPI2_VBASE,
.lock = NXMUTEX_INITIALIZER,
#ifndef CONFIG_SPI_POLLWAIT
.waitsem = SEM_INITIALIZER(0),
.irq = IMX_IRQ_CSPI2,
.irq = IMX_IRQ_CSPI2,
#endif
},
#endif
+9 -9
View File
@@ -592,7 +592,7 @@ static struct imxrt_qh_s g_asynchead aligned_data(32);
#ifndef CONFIG_USBHOST_INT_DISABLE
/* The head of the periodic queue */
static struct imxrt_qh_s g_intrhead aligned_data(32);
static struct imxrt_qh_s g_intrhead aligned_data(32);
/* The frame list */
@@ -4978,21 +4978,21 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
/* Sanity checks */
DEBUGASSERT(controller == 0);
DEBUGASSERT(((uintptr_t) & g_asynchead & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_asynchead & 0x1f) == 0);
DEBUGASSERT((sizeof(struct imxrt_qh_s) & 0x1f) == 0);
DEBUGASSERT((sizeof(struct imxrt_qtd_s) & 0x1f) == 0);
# ifdef CONFIG_IMXRT_EHCI_PREALLOCATE
DEBUGASSERT(((uintptr_t) & g_qhpool & 0x1f) == 0);
DEBUGASSERT(((uintptr_t) & g_qtdpool & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_qhpool & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_qtdpool & 0x1f) == 0);
# endif
# ifndef CONFIG_USBHOST_INT_DISABLE
DEBUGASSERT(((uintptr_t) & g_intrhead & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_intrhead & 0x1f) == 0);
# ifdef CONFIG_IMXRT_EHCI_PREALLOCATE
DEBUGASSERT(((uintptr_t) g_framelist & 0xfff) == 0);
DEBUGASSERT(((uintptr_t)g_framelist & 0xfff) == 0);
# endif
# endif /* CONFIG_USBHOST_INT_DISABLE */
# endif /* CONFIG_USBHOST_INT_DISABLE */
/* Software Configuration *************************************************/
@@ -5199,7 +5199,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
*/
memset(&g_asynchead, 0, sizeof(struct imxrt_qh_s));
physaddr = imxrt_physramaddr((uintptr_t) & g_asynchead);
physaddr = imxrt_physramaddr((uintptr_t)&g_asynchead);
g_asynchead.hw.hlp = imxrt_swap32(physaddr | QH_HLP_TYP_QH);
g_asynchead.hw.epchar = imxrt_swap32(QH_EPCHAR_H | QH_EPCHAR_EPS_FULL);
g_asynchead.hw.overlay.nqp = imxrt_swap32(QH_NQP_T);
@@ -5230,7 +5230,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
/* Attach the periodic QH to Period Frame List */
physaddr = imxrt_physramaddr((uintptr_t) & g_intrhead);
physaddr = imxrt_physramaddr((uintptr_t)&g_intrhead);
for (i = 0; i < FRAME_LIST_SIZE; i++)
{
g_framelist[i] = imxrt_swap32(physaddr) | PFL_TYP_QH;
+1 -1
View File
@@ -1201,7 +1201,7 @@ static int imxrt_ioctl(struct qe_lowerhalf_s *lower, int cmd,
int imxrt_qeinitialize(const char *devpath, int enc)
{
struct imxrt_enc_lowerhalf_s * priv = NULL;
struct imxrt_enc_lowerhalf_s *priv = NULL;
switch (enc)
{
+1 -1
View File
@@ -112,7 +112,7 @@ static struct imxrt_flexspidev_s g_flexspi0dev =
{
.ops = &g_flexspi0ops,
},
.base = (struct flexspi_type_s *) IMXRT_FLEXSPIC_BASE,
.base = (struct flexspi_type_s *)IMXRT_FLEXSPIC_BASE,
.lock = NXMUTEX_INITIALIZER,
};
+2 -2
View File
@@ -1070,7 +1070,7 @@ static void imxrt_lpi2c_setclock(struct imxrt_lpi2c_priv_s *priv,
CCM_CSCDR2_LPI2C_CLK_PODF_SHIFT;
lpi2c_clk_div = lpi2c_clk_div + 1;
src_freq = (BOARD_XTAL_FREQUENCY * pll3_div) /
(8 * lpi2c_clk_div) ;
(8 * lpi2c_clk_div);
}
/* LPI2C output frequency = (Source Clock (Hz)/ 2^prescale) /
@@ -1976,7 +1976,7 @@ static int imxrt_lpi2c_dma_transfer(struct imxrt_lpi2c_priv_s *priv)
LPI2C_MIER_NDIE | LPI2C_MIER_ALIE |
LPI2C_MIER_PLTIE | LPI2C_MIER_FEIE);
imxrt_dmach_start(priv->dma, imxrt_dma_callback, (void *)priv);
imxrt_dmach_start(priv->dma, imxrt_dma_callback, priv);
imxrt_lpi2c_modifyreg(priv, IMXRT_LPI2C_MDER_OFFSET, 0,
LPI2C_MDER_TDDE | LPI2C_MDER_RDDE);
+18 -18
View File
@@ -242,7 +242,7 @@ static struct imxrt_lpspidev_s g_lpspi1dev =
{
.spidev =
{
&g_spi1ops
.ops = &g_spi1ops,
},
.spibase = IMXRT_LPSPI1_BASE,
#ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS
@@ -291,7 +291,7 @@ static struct imxrt_lpspidev_s g_lpspi2dev =
{
.spidev =
{
&g_spi2ops
.ops = &g_spi2ops,
},
.spibase = IMXRT_LPSPI2_BASE,
#ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS
@@ -340,7 +340,7 @@ static struct imxrt_lpspidev_s g_lpspi3dev =
{
.spidev =
{
&g_spi3ops
.ops = &g_spi3ops,
},
.spibase = IMXRT_LPSPI3_BASE,
#ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS
@@ -389,7 +389,7 @@ static struct imxrt_lpspidev_s g_lpspi4dev =
{
.spidev =
{
&g_spi4ops
.ops = &g_spi4ops,
},
.spibase = IMXRT_LPSPI4_BASE,
#ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS
@@ -1310,8 +1310,8 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev,
{
/* 16-bit mode */
const uint16_t *src = (const uint16_t *)txbuffer;
uint16_t *dest = (uint16_t *) rxbuffer;
const uint16_t *src = txbuffer;
uint16_t *dest = rxbuffer;
uint16_t word;
while (nwords-- > 0)
@@ -1343,8 +1343,8 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev,
{
/* 8-bit mode */
const uint8_t *src = (const uint8_t *)txbuffer;
uint8_t *dest = (uint8_t *) rxbuffer;
const uint8_t *src = txbuffer;
uint8_t *dest = rxbuffer;
uint8_t word;
while (nwords-- > 0)
@@ -1362,7 +1362,7 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev,
/* Exchange one word */
word = (uint8_t) imxrt_lpspi_send(dev, (uint32_t) word);
word = (uint8_t)imxrt_lpspi_send(dev, word);
/* Is there a buffer to receive the return value? */
@@ -1396,16 +1396,16 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev,
****************************************************************************/
#ifdef CONFIG_IMXRT_LPSPI_DMA
static void imxrt_lpspi_exchange(struct spi_dev_s * dev,
const void * txbuffer,
void * rxbuffer, size_t nwords)
static void imxrt_lpspi_exchange(struct spi_dev_s *dev,
const void *txbuffer,
void *rxbuffer, size_t nwords)
{
int ret;
size_t adjust;
ssize_t nbytes;
static uint8_t rxdummy[4] aligned_data(4);
static const uint16_t txdummy = 0xffff;
uint32_t regval;
int ret;
size_t adjust;
ssize_t nbytes;
static uint8_t rxdummy[4] aligned_data(4);
static const uint16_t txdummy = 0xffff;
uint32_t regval;
struct imxrt_lpspidev_s *priv = (struct imxrt_lpspidev_s *)dev;
DEBUGASSERT(priv != NULL);
+5 -5
View File
@@ -1538,7 +1538,7 @@ static int imxrt_dma_setup(struct uart_dev_s *dev)
* worth of time to claim bytes before they are overwritten.
*/
imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, (void *)priv);
imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, priv);
}
#endif
@@ -1866,7 +1866,7 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
#ifdef CONFIG_SERIAL_TERMIOS
case TCGETS:
{
struct termios *termiosp = (struct termios *)arg;
struct termios *termiosp = (struct termios *)arg;
struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev;
if (!termiosp)
@@ -1928,7 +1928,7 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
case TCSETS:
{
struct termios *termiosp = (struct termios *)arg;
struct termios *termiosp = (struct termios *)arg;
struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev;
uint32_t baud;
uint32_t ie;
@@ -2398,7 +2398,7 @@ static void imxrt_dma_reenable(struct imxrt_uart_s *priv)
* worth of time to claim bytes before they are overwritten.
*/
imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, (void *)priv);
imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, priv);
/* Clear DMA suspended flag. */
@@ -2569,7 +2569,7 @@ static void imxrt_dma_send(struct uart_dev_s *dev)
/* Start transmission with the callback on DMA completion */
imxrt_dmach_start(priv->txdma, imxrt_dma_txcallback, (void *)priv);
imxrt_dmach_start(priv->txdma, imxrt_dma_txcallback, priv);
}
#endif
+6 -4
View File
@@ -950,7 +950,7 @@ static void imxrt_receive(struct imxrt_dev_s *priv)
{
/* Transfer any trailing fractional word */
uint8_t *ptr = (uint8_t *) priv->buffer;
uint8_t *ptr = (uint8_t *)priv->buffer;
int i;
for (i = 0; i < priv->remaining; i++)
@@ -2244,7 +2244,8 @@ static int imxrt_recvsetup(struct sdio_dev_s *dev, uint8_t *buffer,
* handler and DMA memory invalidation.
*/
priv->buffer = (uint32_t *) buffer; priv->remaining = nbytes;
priv->buffer = (uint32_t *)buffer;
priv->remaining = nbytes;
/* Then set up the SDIO data path */
@@ -2292,7 +2293,8 @@ static int imxrt_sendsetup(struct sdio_dev_s *dev,
/* Save the source buffer information for use by the interrupt handler */
priv->buffer = (uint32_t *) buffer; priv->remaining = nbytes;
priv->buffer = (uint32_t *)buffer;
priv->remaining = nbytes;
/* Then set up the SDIO data path */
@@ -3039,7 +3041,7 @@ static int imxrt_dmasendsetup(struct sdio_dev_s *dev,
# endif
#endif
priv->buffer = (uint32_t *) buffer;
priv->buffer = (uint32_t *)buffer;
priv->remaining = buflen;
/* Then set up the SDIO data path */
+10 -10
View File
@@ -221,13 +221,13 @@ static const struct spi_ops_s g_spi0ops =
static struct kinetis_spidev_s g_spi0dev =
{
.spidev =
.spidev =
{
&g_spi0ops
},
.spibase = KINETIS_SPI0_BASE,
.spibase = KINETIS_SPI0_BASE,
.lock = NXMUTEX_INITIALIZER,
.ctarsel = KINETIS_SPI_CTAR0_OFFSET,
.ctarsel = KINETIS_SPI_CTAR0_OFFSET,
#ifdef CONFIG_KINETIS_SPI_DMA
# ifdef CONFIG_KINETIS_SPI0_DMA
.rxch = KINETIS_DMA_REQUEST_SRC_SPI0_RX,
@@ -273,13 +273,13 @@ static const struct spi_ops_s g_spi1ops =
static struct kinetis_spidev_s g_spi1dev =
{
.spidev =
.spidev =
{
&g_spi1ops
},
.spibase = KINETIS_SPI1_BASE,
.spibase = KINETIS_SPI1_BASE,
.lock = NXMUTEX_INITIALIZER,
.ctarsel = KINETIS_SPI_CTAR0_OFFSET,
.ctarsel = KINETIS_SPI_CTAR0_OFFSET,
#ifdef CONFIG_KINETIS_SPI_DMA
# ifdef CONFIG_KINETIS_SPI1_DMA
.rxch = KINETIS_DMA_REQUEST_SRC_SPI1_RX,
@@ -325,13 +325,13 @@ static const struct spi_ops_s g_spi2ops =
static struct kinetis_spidev_s g_spi2dev =
{
.spidev =
.spidev =
{
&g_spi2ops
},
.spibase = KINETIS_SPI2_BASE,
.spibase = KINETIS_SPI2_BASE,
.lock = NXMUTEX_INITIALIZER,
.ctarsel = KINETIS_SPI_CTAR0_OFFSET,
.ctarsel = KINETIS_SPI_CTAR0_OFFSET,
#ifdef CONFIG_KINETIS_SPI_DMA
# ifdef CONFIG_KINETIS_SPI2_DMA
.rxch = KINETIS_DMA_REQUEST_SRC_FTM3_CH6__SPI2_RX,
@@ -1667,7 +1667,7 @@ struct spi_dev_s *kinetis_spibus_initialize(int port)
/* select mode 0 */
priv->mode = SPIDEV_MODE3;
priv->mode = SPIDEV_MODE3;
spi_setmode(&priv->spidev, SPIDEV_MODE0);
/* Select a default frequency of approx. 400KHz */
+7 -11
View File
@@ -4042,10 +4042,6 @@ static int kinetis_epalloc(struct usbhost_driver_s *drvr,
epinfo->xfrtype = epdesc->xfrtype;
epinfo->speed = hport->speed;
/* The iocsem semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
*/
nxsem_init(&epinfo->iocsem, 0, 0);
/* Success.. return an opaque reference to the endpoint information
@@ -5052,21 +5048,21 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
/* Sanity checks */
DEBUGASSERT(controller == 0);
DEBUGASSERT(((uintptr_t) & g_asynchead & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_asynchead & 0x1f) == 0);
DEBUGASSERT((sizeof(struct kinetis_qh_s) & 0x1f) == 0);
DEBUGASSERT((sizeof(struct kinetis_qtd_s) & 0x1f) == 0);
# ifdef CONFIG_KINETIS_EHCI_PREALLOCATE
DEBUGASSERT(((uintptr_t) & g_qhpool & 0x1f) == 0);
DEBUGASSERT(((uintptr_t) & g_qtdpool & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_qhpool & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_qtdpool & 0x1f) == 0);
# endif
# ifndef CONFIG_USBHOST_INT_DISABLE
DEBUGASSERT(((uintptr_t) & g_intrhead & 0x1f) == 0);
DEBUGASSERT(((uintptr_t)&g_intrhead & 0x1f) == 0);
# ifdef CONFIG_KINETIS_EHCI_PREALLOCATE
DEBUGASSERT(((uintptr_t) g_framelist & 0xfff) == 0);
DEBUGASSERT(((uintptr_t)g_framelist & 0xfff) == 0);
# endif
# endif /* CONFIG_USBHOST_INT_DISABLE */
# endif /* CONFIG_USBHOST_INT_DISABLE */
/* Software Configuration *************************************************/
@@ -5300,7 +5296,7 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
/* Attach the periodic QH to Period Frame List */
physaddr = kinetis_physramaddr((uintptr_t) & g_intrhead);
physaddr = kinetis_physramaddr((uintptr_t)&g_intrhead);
for (i = 0; i < FRAME_LIST_SIZE; i++)
{
g_framelist[i] = kinetis_swap32(physaddr) | PFL_TYP_QH;
+6 -6
View File
@@ -122,9 +122,9 @@ static const struct spi_ops_s g_spi0ops =
static struct kl_spidev_s g_spi0dev =
{
.spidev =
{
&g_spi0ops
},
{
.ops = &g_spi0ops
},
.spibase = KL_SPI0_BASE,
.lock = NXMUTEX_INITIALIZER,
};
@@ -155,9 +155,9 @@ static const struct spi_ops_s g_spi1ops =
static struct kl_spidev_s g_spi1dev =
{
.spidev =
{
&g_spi1ops
},
{
.ops = &g_spi1ops
},
.spibase = KL_SPI1_BASE,
.lock = NXMUTEX_INITIALIZER,
};
+1 -1
View File
@@ -306,7 +306,7 @@ static void dma_done(DMA_HANDLE handle, void *arg, int result)
test_done = 1;
}
void lc823450_dma_test()
void lc823450_dma_test(void)
{
int i;
for (i = 0; i < 256; i++)
-1
View File
@@ -815,7 +815,6 @@ int lc823450_mtd_uninitialize(uint32_t devno)
DEBUGASSERT(ret == OK);
nxmutex_destroy(&priv->lock);
kmm_free(g_mtdmaster[ch]);
g_mtdmaster[ch] = NULL;
+1 -1
View File
@@ -82,7 +82,7 @@
static mutex_t _sdc_lock[2] =
{
NXMUTEX_INITIALIZER,
NXMUTEX_INITIALIZER
NXMUTEX_INITIALIZER,
};
static struct sddrcfg_s _sdch0;
+1 -2
View File
@@ -168,7 +168,6 @@ struct up_dev_s
DMA_HANDLE hrxdma;
DMA_HANDLE htxdma;
sem_t rxdma_wait;
sem_t rxpkt_wait;
sem_t txdma_wait;
#endif /* CONFIG_HSUART */
spinlock_t lock;
@@ -1112,7 +1111,7 @@ static void uart_rxdma_callback(DMA_HANDLE hdma, void *arg, int result)
* Name: up_hs_dmasetup
****************************************************************************/
static void up_hs_dmasetup()
static void up_hs_dmasetup(void)
{
irqstate_t flags;
+4 -4
View File
@@ -73,7 +73,7 @@ struct lc823450_spidev_s
#endif
#ifdef CONFIG_LC823450_SPI_DMA
DMA_HANDLE hdma;
sem_t dma_wait;
sem_t dma_wait;
#endif /* CONFIG_LC823450_SPI_DMA */
};
@@ -127,9 +127,9 @@ static const struct spi_ops_s g_spiops =
static struct lc823450_spidev_s g_spidev =
{
.spidev =
{
&g_spiops
},
{
.ops = &g_spiops
},
#ifndef CONFIG_SPI_OWNBUS
.lock = NXMUTEX_INITIALIZER,
#endif
+3 -4
View File
@@ -560,7 +560,7 @@ static struct usbdev_req_s *lc823450_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct lc823450_ep_s *)ep)->epphy);
privreq = (struct lc823450_req_s *)
kmm_malloc(sizeof(struct lc823450_req_s));
kmm_zalloc(sizeof(struct lc823450_req_s));
if (!privreq)
{
@@ -568,7 +568,6 @@ static struct usbdev_req_s *lc823450_epallocreq(struct usbdev_ep_s *ep)
return NULL;
}
memset(privreq, 0, sizeof(struct lc823450_req_s));
return &privreq->req;
}
@@ -1710,7 +1709,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
* Name: usbdev_msc_read_enter
****************************************************************************/
void usbdev_msc_read_enter()
void usbdev_msc_read_enter(void)
{
struct lc823450_ep_s *privep;
# ifdef CONFIG_DVFS
@@ -1727,7 +1726,7 @@ void usbdev_msc_read_enter()
* Name: usbdev_msc_read_exit
****************************************************************************/
void usbdev_msc_read_exit()
void usbdev_msc_read_exit(void)
{
struct lc823450_ep_s *privep;
+4 -4
View File
@@ -139,7 +139,7 @@ static void lpc17_40_stopnext(struct lpc17_40_i2cdev_s *priv);
static int lpc17_40_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int lpc17_40_i2c_reset(struct i2c_master_s * dev);
static int lpc17_40_i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@@ -505,7 +505,7 @@ static int lpc17_40_i2c_interrupt(int irq, void *context, void *arg)
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int lpc17_40_i2c_reset(struct i2c_master_s * dev)
static int lpc17_40_i2c_reset(struct i2c_master_s *dev)
{
return OK;
}
@@ -651,9 +651,9 @@ struct i2c_master_s *lpc17_40_i2cbus_initialize(int port)
*
****************************************************************************/
int lpc17_40_i2cbus_uninitialize(struct i2c_master_s * dev)
int lpc17_40_i2cbus_uninitialize(struct i2c_master_s *dev)
{
struct lpc17_40_i2cdev_s *priv = (struct lpc17_40_i2cdev_s *) dev;
struct lpc17_40_i2cdev_s *priv = (struct lpc17_40_i2cdev_s *)dev;
/* Disable I2C */
+4 -4
View File
@@ -139,10 +139,10 @@ static const struct spi_ops_s g_spiops =
static struct lpc17_40_spidev_s g_spidev =
{
.spidev =
{
&g_spiops
},
.lock = NXMUTEX_INITIALIZER,
{
.ops = &g_spiops,
},
.lock = NXMUTEX_INITIALIZER,
};
/****************************************************************************
+9 -9
View File
@@ -177,9 +177,9 @@ static const struct spi_ops_s g_spi0ops =
static struct lpc17_40_sspdev_s g_ssp0dev =
{
.spidev =
{
&g_spi0ops
},
{
.ops = &g_spi0ops,
},
.sspbase = LPC17_40_SSP0_BASE,
#ifdef CONFIG_LPC17_40_SSP_INTERRUPTS
.sspirq = LPC17_40_IRQ_SSP0,
@@ -213,9 +213,9 @@ static const struct spi_ops_s g_spi1ops =
static struct lpc17_40_sspdev_s g_ssp1dev =
{
.spidev =
{
&g_spi1ops
},
{
.ops = &g_spi1ops,
},
.sspbase = LPC17_40_SSP1_BASE,
#ifdef CONFIG_LPC17_40_SSP_INTERRUPTS
.sspirq = LPC17_40_IRQ_SSP1,
@@ -249,9 +249,9 @@ static const struct spi_ops_s g_spi2ops =
static struct lpc17_40_sspdev_s g_ssp2dev =
{
.spidev =
{
&g_spi2ops
},
{
.ops = &g_spi2ops,
},
.sspbase = LPC17_40_SSP2_BASE,
#ifdef CONFIG_LPC17_40_SSP_INTERRUPTS
.sspirq = LPC17_40_IRQ_SSP2,
+4 -4
View File
@@ -421,8 +421,8 @@ static struct lpc17_40_usbhost_s g_usbhost =
static struct usbhost_connection_s g_usbconn =
{
.wait = lpc17_40_wait,
.enumerate = lpc17_40_enumerate,
.wait = lpc17_40_wait,
.enumerate = lpc17_40_enumerate,
};
/* This is a free list of EDs and TD buffers */
@@ -2665,7 +2665,7 @@ static int lpc17_40_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
struct lpc17_40_usbhost_s *priv = (struct lpc17_40_usbhost_s *)drvr;
struct lpc17_40_ed_s *ed = (struct lpc17_40_ed_s *)ep0;
uint16_t len;
int ret;
int ret;
DEBUGASSERT(priv != NULL && ed != NULL && req != NULL);
@@ -3634,7 +3634,7 @@ static inline void lpc17_40_ep0init(struct lpc17_40_usbhost_s *priv)
/* Initialize the common tail TD. */
memset(TDTAIL, 0, sizeof(struct lpc17_40_gtd_s));
TDTAIL->ed = EDCTRL;
TDTAIL->ed = EDCTRL;
/* Link the common tail TD to the ED's TD list */
+4 -4
View File
@@ -145,7 +145,7 @@ static void lpc2378_stopnext(struct lpc2378_i2cdev_s *priv);
static int lpc2378_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int lpc2378_i2c_reset(struct i2c_master_s * dev);
static int lpc2378_i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@@ -457,7 +457,7 @@ static int lpc2378_i2c_transfer(struct i2c_master_s *dev,
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int lpc2378_i2c_reset(struct i2c_master_s * dev)
static int lpc2378_i2c_reset(struct i2c_master_s *dev)
{
return OK;
}
@@ -614,9 +614,9 @@ struct i2c_master_s *lpc2378_i2cbus_initialize(int port)
*
****************************************************************************/
int lpc2378_i2cbus_uninitialize(struct i2c_master_s * dev)
int lpc2378_i2cbus_uninitialize(struct i2c_master_s *dev)
{
struct lpc2378_i2cdev_s *priv = (struct lpc2378_i2cdev_s *) dev;
struct lpc2378_i2cdev_s *priv = (struct lpc2378_i2cdev_s *)dev;
/* Disable I2C */
+4 -4
View File
@@ -158,10 +158,10 @@ static const struct spi_ops_s g_spiops =
static struct lpc23xx_spidev_s g_spidev =
{
.spidev =
{
&g_spiops
},
.lock = NXMUTEX_INITIALIZER,
{
.ops = &g_spiops,
},
.lock = NXMUTEX_INITIALIZER,
};
/****************************************************************************
+4 -4
View File
@@ -115,7 +115,7 @@ static void i2c_setfrequency(struct lpc31_i2cdev_s *priv,
static int i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int i2c_reset(struct i2c_master_s * dev);
static int i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@@ -418,7 +418,7 @@ out:
static void i2c_timeout(wdparm_t arg)
{
struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *) arg;
struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *)arg;
irqstate_t flags = enter_critical_section();
@@ -478,7 +478,7 @@ static void i2c_hwreset(struct lpc31_i2cdev_s *priv)
static int i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *) dev;
struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *)dev;
irqstate_t flags;
int ret;
@@ -539,7 +539,7 @@ static int i2c_transfer(struct i2c_master_s *dev,
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int i2c_reset(struct i2c_master_s * dev)
static int i2c_reset(struct i2c_master_s *dev)
{
return OK;
}
+5 -5
View File
@@ -154,10 +154,10 @@ static const struct spi_ops_s g_spiops =
static struct lpc31_spidev_s g_spidev =
{
.spidev =
{
&g_spiops
},
.lock = NXMUTEX_INITIALIZER,
{
.ops = &g_spiops,
},
.lock = NXMUTEX_INITIALIZER,
};
#ifdef CONFIG_LPC31_SPI_REGDEBUG
@@ -489,7 +489,7 @@ static int spi_lock(struct spi_dev_s *dev, bool lock)
static void spi_select(struct spi_dev_s *dev, uint32_t devid,
bool selected)
{
struct lpc31_spidev_s *priv = (struct lpc31_spidev_s *) dev;
struct lpc31_spidev_s *priv = (struct lpc31_spidev_s *)dev;
uint8_t slave = 0;
/* FIXME: map the devid to the SPI slave - this should really
+4 -4
View File
@@ -145,7 +145,7 @@ static void lpc43_i2c_setfrequency(struct lpc43_i2cdev_s *priv,
static int lpc43_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int lpc43_i2c_reset(struct i2c_master_s * dev);
static int lpc43_i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@@ -436,7 +436,7 @@ static int lpc43_i2c_transfer(struct i2c_master_s *dev,
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int lpc43_i2c_reset(struct i2c_master_s * dev)
static int lpc43_i2c_reset(struct i2c_master_s *dev)
{
return OK;
}
@@ -558,9 +558,9 @@ struct i2c_master_s *lpc43_i2cbus_initialize(int port)
*
****************************************************************************/
int lpc43_i2cbus_uninitialize(struct i2c_master_s * dev)
int lpc43_i2cbus_uninitialize(struct i2c_master_s *dev)
{
struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *) dev;
struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *)dev;
putreg32(I2C_CONCLRT_I2ENC, priv->base + LPC43_I2C_CONCLR_OFFSET);
up_disable_irq(priv->irqid);
+4 -4
View File
@@ -130,10 +130,10 @@ static const struct spi_ops_s g_spiops =
static struct lpc43_spidev_s g_spidev =
{
.spidev =
{
&g_spiops
},
.lock = NXMUTEX_INITIALIZER,
{
.ops = &g_spiops,
},
.lock = NXMUTEX_INITIALIZER,
};
/****************************************************************************
+6 -6
View File
@@ -144,9 +144,9 @@ static const struct spi_ops_s g_spi0ops =
static struct lpc43_sspdev_s g_ssp0dev =
{
.spidev =
{
&g_spi0ops
},
{
.ops = &g_spi0ops,
},
.sspbase = LPC43_SSP0_BASE,
.sspbasefreq = BOARD_SSP0_BASEFREQ,
#ifdef CONFIG_LPC43_SSP_INTERRUPTS
@@ -185,9 +185,9 @@ static const struct spi_ops_s g_spi1ops =
static struct lpc43_sspdev_s g_ssp1dev =
{
.spidev =
{
&g_spi1ops
},
{
.ops = &g_spi1ops,
},
.sspbase = LPC43_SSP1_BASE,
.sspbasefreq = BOARD_SSP1_BASEFREQ,
#ifdef CONFIG_LPC43_SSP_INTERRUPTS
+4 -4
View File
@@ -169,7 +169,7 @@ static int lpc54_i2c_poll(struct lpc54_i2cdev_s *priv);
static int lpc54_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int lpc54_i2c_reset(struct i2c_master_s * dev);
static int lpc54_i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@@ -878,7 +878,7 @@ static int lpc54_i2c_transfer(struct i2c_master_s *dev,
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int lpc54_i2c_reset(struct i2c_master_s * dev)
static int lpc54_i2c_reset(struct i2c_master_s *dev)
{
#warning Missing logic
return OK;
@@ -1302,9 +1302,9 @@ struct i2c_master_s *lpc54_i2cbus_initialize(int port)
*
****************************************************************************/
int lpc54_i2cbus_uninitialize(struct i2c_master_s * dev)
int lpc54_i2cbus_uninitialize(struct i2c_master_s *dev)
{
struct lpc54_i2cdev_s *priv = (struct lpc54_i2cdev_s *) dev;
struct lpc54_i2cdev_s *priv = (struct lpc54_i2cdev_s *)dev;
uint32_t regval;
/* Disable I2C interrupts */
+1 -1
View File
@@ -145,7 +145,7 @@ static const struct rtc_ops_s g_rtc_ops =
static struct lpc54_lowerhalf_s g_rtc_lowerhalf =
{
.ops = &g_rtc_ops,
.ops = &g_rtc_ops,
.devlock = NXMUTEX_INITIALIZER,
};
+5 -5
View File
@@ -510,8 +510,8 @@ static struct lpc54_usbhost_s g_usbhost =
static struct usbhost_connection_s g_usbconn =
{
.wait = lpc54_wait,
.enumerate = lpc54_enumerate,
.wait = lpc54_wait,
.enumerate = lpc54_enumerate,
};
/* Aligned static memory allocations */
@@ -2756,7 +2756,7 @@ static int lpc54_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
struct lpc54_usbhost_s *priv = (struct lpc54_usbhost_s *)drvr;
struct lpc54_ed_s *ed = (struct lpc54_ed_s *)ep0;
uint16_t len;
int ret;
int ret;
DEBUGASSERT(priv != NULL && ed != NULL && req != NULL);
@@ -2799,7 +2799,7 @@ static int lpc54_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
struct lpc54_usbhost_s *priv = (struct lpc54_usbhost_s *)drvr;
struct lpc54_ed_s *ed = (struct lpc54_ed_s *)ep0;
uint16_t len;
int ret;
int ret;
DEBUGASSERT(priv != NULL && ed != NULL && req != NULL);
@@ -3721,7 +3721,7 @@ static inline void lpc54_ep0init(struct lpc54_usbhost_s *priv)
/* Initialize the common tail TD. */
memset(TDTAIL, 0, sizeof(struct lpc54_gtd_s));
TDTAIL->ed = EDCTRL;
TDTAIL->ed = EDCTRL;
/* Link the common tail TD to the ED's TD list */
@@ -151,7 +151,7 @@ static const struct rtc_ops_s g_rtc_ops =
static struct max326_lowerhalf_s g_rtc_lowerhalf =
{
.ops = &g_rtc_ops,
.ops = &g_rtc_ops,
.devlock = NXMUTEX_INITIALIZER,
};
@@ -189,7 +189,7 @@ static void spi_recvblock(struct spi_dev_s *dev, void *rxbuffer,
/* Initialization */
static void spi_bus_initialize(struct max326_spidev_s *priv);
static void spi_bus_initialize(struct max326_spidev_s *priv);
/****************************************************************************
* Private Data
@@ -232,9 +232,9 @@ static const struct spi_ops_s g_sp0iops =
static struct max326_spidev_s g_spi0dev =
{
.dev =
{
&g_sp0iops
},
{
.ops = &g_sp0iops,
},
.base = MAX326_SPI0_BASE,
.lock = NXMUTEX_INITIALIZER,
#ifdef CONFIG_MAX326_SPI_INTERRUPTS
+2 -2
View File
@@ -145,7 +145,7 @@ static int nrf52_rng_initialize(void)
static int nrf52_rng_irqhandler(int irq, void *context, void *arg)
{
struct rng_dev_s *priv = (struct rng_dev_s *) &g_rngdev;
struct rng_dev_s *priv = (struct rng_dev_s *)&g_rngdev;
uint8_t *addr;
if (getreg32(NRF52_RNG_EVENTS_RDY) == RNG_INT_RDY)
@@ -200,7 +200,7 @@ static ssize_t nrf52_rng_read(struct file *filep, char *buffer,
return -EBUSY;
}
priv->rd_buf = (uint8_t *) buffer;
priv->rd_buf = (uint8_t *)buffer;
priv->buflen = buflen;
priv->rd_count = 0;
+4 -4
View File
@@ -198,7 +198,7 @@ static struct nrf52_spidev_s g_spi0dev =
{
.spidev =
{
&g_spi0ops
.ops = &g_spi0ops,
},
.base = NRF52_SPIM0_BASE,
@@ -251,7 +251,7 @@ static struct nrf52_spidev_s g_spi1dev =
{
.spidev =
{
&g_spi1ops
.ops = &g_spi1ops,
},
.base = NRF52_SPIM1_BASE,
@@ -304,7 +304,7 @@ static struct nrf52_spidev_s g_spi2dev =
{
.spidev =
{
&g_spi2ops
.ops = &g_spi2ops,
},
.base = NRF52_SPIM2_BASE,
@@ -357,7 +357,7 @@ static struct nrf52_spidev_s g_spi3dev =
{
.spidev =
{
&g_spi3ops
.ops = &g_spi3ops,
},
.base = NRF52_SPIM3_BASE,
+16 -16
View File
@@ -68,8 +68,8 @@
#define FLASH_BLOCK_ERASE_CMD 0x20
#define BOOT_2_SIZE 256
#define FLASH_START_OFFSET (rp2040_smart_flash_start - (uint8_t *) XIP_BASE)
#define FLASH_END_OFFSET (rp2040_smart_flash_end - (uint8_t *) XIP_BASE)
#define FLASH_START_OFFSET (rp2040_smart_flash_start - (uint8_t *)XIP_BASE)
#define FLASH_END_OFFSET (rp2040_smart_flash_end - (uint8_t *)XIP_BASE)
#define FLASH_START_READ (rp2040_smart_flash_start + 0x03000000)
/* Note: There is some ambiguity in terminology when it comes to flash.
@@ -155,16 +155,16 @@ extern const uint8_t rp2040_smart_flash_end[0];
static struct rp2040_flash_dev_s my_dev =
{
.mtd_dev =
{
rp2040_flash_erase,
rp2040_flash_block_read,
rp2040_flash_block_write,
rp2040_flash_byte_read,
{
rp2040_flash_erase,
rp2040_flash_block_read,
rp2040_flash_block_write,
rp2040_flash_byte_read,
#ifdef CONFIG_MTD_BYTE_WRITE
NULL,
NULL,
#endif
rp2040_flash_ioctl,
"rp_flash"
rp2040_flash_ioctl,
"rp_flash"
},
.lock = NXMUTEX_INITIALIZER,
};
@@ -247,7 +247,7 @@ static int rp2040_flash_erase(struct mtd_dev_s *dev,
off_t startblock,
size_t nblocks)
{
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev;
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev;
irqstate_t flags;
int ret = OK;
@@ -293,7 +293,7 @@ static ssize_t rp2040_flash_block_read(struct mtd_dev_s *dev,
size_t nblocks,
uint8_t *buffer)
{
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev;
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev;
int start;
int length;
int ret = OK;
@@ -336,7 +336,7 @@ static ssize_t rp2040_flash_block_write(struct mtd_dev_s *dev,
size_t nblocks,
const uint8_t *buffer)
{
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev;
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev;
irqstate_t flags;
int ret;
@@ -443,7 +443,7 @@ static int rp2040_flash_ioctl(struct mtd_dev_s *dev,
int cmd,
unsigned long arg)
{
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev;
rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev;
int ret = OK;
UNUSED(rp_dev);
@@ -452,7 +452,7 @@ static int rp2040_flash_ioctl(struct mtd_dev_s *dev,
{
case MTDIOC_GEOMETRY:
{
struct mtd_geometry_s *geo = (struct mtd_geometry_s *) arg;
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
if (geo != NULL)
{
@@ -525,7 +525,7 @@ struct mtd_dev_s *rp2040_flash_mtd_initialize(void)
* the rom until after this call completes.
*/
memcpy(my_dev.boot_2, (void *) XIP_BASE, BOOT_2_SIZE);
memcpy(my_dev.boot_2, (void *)XIP_BASE, BOOT_2_SIZE);
rom_functions.flash_enable_xip = (flash_enable_xip_f)my_dev.boot_2 + 1;
/* Do we need to initialize the flash? */
+3 -3
View File
@@ -964,7 +964,7 @@ static int rp2040_i2s_ioctl(struct i2s_dev_s *dev, int cmd,
unsigned long arg)
{
struct rp2040_i2s_s *priv = (struct rp2040_i2s_s *)dev;
struct audio_buf_desc_s *bufdesc;
struct audio_buf_desc_s *bufdesc;
int ret = -ENOTTY;
switch (cmd)
@@ -1095,7 +1095,7 @@ static int rp2040_i2s_ioctl(struct i2s_dev_s *dev, int cmd,
{
i2sinfo("AUDIOIOC_ALLOCBUFFER\n");
bufdesc = (struct audio_buf_desc_s *) arg;
bufdesc = (struct audio_buf_desc_s *)arg;
ret = apb_alloc(bufdesc);
}
break;
@@ -1109,7 +1109,7 @@ static int rp2040_i2s_ioctl(struct i2s_dev_s *dev, int cmd,
{
i2sinfo("AUDIOIOC_FREEBUFFER\n");
bufdesc = (struct audio_buf_desc_s *) arg;
bufdesc = (struct audio_buf_desc_s *)arg;
DEBUGASSERT(bufdesc->u.buffer != NULL);
apb_free(bufdesc->u.buffer);
ret = sizeof(struct audio_buf_desc_s);

Some files were not shown because too many files have changed in this diff Show More