arch/renesas: remove FAR and apply formatting

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2022-12-15 00:53:03 +02:00 committed by Xiang Xiao
parent 5b4e12774c
commit e9fe00c573
25 changed files with 1845 additions and 1900 deletions

View File

@ -64,9 +64,9 @@
*
****************************************************************************/
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
void up_allocate_heap(void **heap_start, size_t *heap_size)
{
board_autoled_on(LED_HEAPALLOCATE);
*heap_start = (FAR void *)g_idle_topstack;
*heap_start = (void *)g_idle_topstack;
*heap_size = CONFIG_RAM_END - g_idle_topstack;
}

View File

@ -87,7 +87,7 @@
*
****************************************************************************/
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
{
#ifdef CONFIG_TLS_ALIGNED
/* The allocated stack size must not exceed the maximum possible for the

View File

@ -61,9 +61,9 @@
****************************************************************************/
#ifdef CONFIG_DUMP_ON_EXIT
static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
static void _up_dumponexit(struct tcb_s *tcb, void *arg)
{
FAR struct filelist *filelist;
struct filelist *filelist;
int i;
int j;

View File

@ -75,7 +75,7 @@
*
****************************************************************************/
void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype)
void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
{
/* Is there a stack allocated? */

View File

@ -68,9 +68,9 @@
*
****************************************************************************/
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
void *up_stack_frame(struct tcb_s *tcb, size_t frame_size)
{
FAR void *ret;
void *ret;
/* Align the frame_size */
@ -88,7 +88,7 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
/* Save the adjusted stack values in the struct tcb_s */
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
tcb->stack_base_ptr = (uint8_t *)tcb->stack_base_ptr + frame_size;
tcb->adj_stack_size -= frame_size;
/* And return a pointer to allocated memory */

View File

@ -125,7 +125,7 @@ static inline void m16c_registerdump(void)
void renesas_dumpstate(void)
{
FAR struct tcb_s *rtcb = running_task();
struct tcb_s *rtcb = running_task();
uint16_t sp = up_getsp();
uint16_t ustackbase;
uint16_t ustacksize;

View File

@ -49,11 +49,11 @@
*
****************************************************************************/
void up_initial_state(FAR struct tcb_s *tcb)
void up_initial_state(struct tcb_s *tcb)
{
FAR struct xcptcontext *xcp = &tcb->xcp;
FAR uint8_t *regs = xcp->regs;
uintptr_t sp;
struct xcptcontext *xcp = &tcb->xcp;
uint8_t *regs = xcp->regs;
uintptr_t sp;
/* Initialize the idle thread stack */

View File

@ -42,7 +42,7 @@
* DTC channel.
*/
typedef FAR void *DTC_HANDLE;
typedef void *DTC_HANDLE;
/* Configurable options for DTC Transfer mode */

View File

@ -135,7 +135,7 @@ static inline void rx65n_registerdump(void)
void renesas_dumpstate(void)
{
FAR struct tcb_s *rtcb = running_task();
struct tcb_s *rtcb = running_task();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;

View File

@ -195,7 +195,7 @@
* header
*/
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((struct eth_hdr_s *)&priv->dev.d_buf[0])
/* PHY return definitions */
@ -450,62 +450,62 @@ static void rx65n_checksetup(void);
/* Free buffer management */
static void rx65n_initbuffer(FAR struct rx65n_ethmac_s *priv);
static inline uint8_t *rx65n_allocbuffer(FAR struct rx65n_ethmac_s *priv);
static inline void rx65n_freebuffer(FAR struct rx65n_ethmac_s *priv,
uint8_t *buffer);
static inline bool rx65n_isfreebuffer(FAR struct rx65n_ethmac_s *priv);
static void rx65n_initbuffer(struct rx65n_ethmac_s *priv);
static inline uint8_t *rx65n_allocbuffer(struct rx65n_ethmac_s *priv);
static inline void rx65n_freebuffer(struct rx65n_ethmac_s *priv,
uint8_t *buffer);
static inline bool rx65n_isfreebuffer(struct rx65n_ethmac_s *priv);
/* Common TX logic */
static int rx65n_transmit(FAR struct rx65n_ethmac_s *priv);
static int rx65n_transmit(struct rx65n_ethmac_s *priv);
static int rx65n_txpoll(struct net_driver_s *dev);
static void rx65n_dopoll(FAR struct rx65n_ethmac_s *priv);
static void rx65n_dopoll(struct rx65n_ethmac_s *priv);
/* Interrupt handling */
static void rx65n_enableint(FAR struct rx65n_ethmac_s *priv,
uint32_t ierbit);
static void rx65n_disableint(FAR struct rx65n_ethmac_s *priv,
uint32_t ierbit);
static void rx65n_enableint(struct rx65n_ethmac_s *priv,
uint32_t ierbit);
static void rx65n_disableint(struct rx65n_ethmac_s *priv,
uint32_t ierbit);
static void rx65n_freesegment(FAR struct rx65n_ethmac_s *priv,
FAR struct eth_rxdesc_s *rxfirst, int segments);
static int rx65n_recvframe(FAR struct rx65n_ethmac_s *priv);
static void rx65n_receive(FAR struct rx65n_ethmac_s *priv);
static void rx65n_freeframe(FAR struct rx65n_ethmac_s *priv);
static void rx65n_txdone(FAR struct rx65n_ethmac_s *priv);
static void rx65n_freesegment(struct rx65n_ethmac_s *priv,
struct eth_rxdesc_s *rxfirst, int segments);
static int rx65n_recvframe(struct rx65n_ethmac_s *priv);
static void rx65n_receive(struct rx65n_ethmac_s *priv);
static void rx65n_freeframe(struct rx65n_ethmac_s *priv);
static void rx65n_txdone(struct rx65n_ethmac_s *priv);
static void rx65n_interrupt_work(FAR void *arg);
static int rx65n_interrupt(int irq, FAR void *context, FAR void *arg);
static void rx65n_interrupt_work(void *arg);
static int rx65n_interrupt(int irq, void *context, void *arg);
/* Timer expirations */
static void rx65n_txtimeout_work(FAR void *arg);
static void rx65n_txtimeout_work(void *arg);
/* NuttX callback functions */
static int rx65n_ifup(struct net_driver_s *dev);
static int rx65n_ifdown(struct net_driver_s *dev);
static void rx65n_txavail_work(FAR void *arg);
static void rx65n_txavail_work(void *arg);
static int rx65n_txavail(struct net_driver_s *dev);
#if defined(CONFIG_NET_MCASTGROUP) || defined(CONFIG_NET_ICMPv6)
static int rx65n_addmac(struct net_driver_s *dev, FAR const uint8_t *mac);
static int rx65n_addmac(struct net_driver_s *dev, const uint8_t *mac);
#endif
#ifdef CONFIG_NET_MCASTGROUP
static int rx65n_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
static int rx65n_rmmac(struct net_driver_s *dev, const uint8_t *mac);
#endif
#ifdef CONFIG_NETDEV_IOCTL
static int rx65n_ioctl(struct net_driver_s *dev, int cmd,
unsigned long arg);
unsigned long arg);
#endif
/* Descriptor Initialization */
static void rx65n_txdescinit(FAR struct rx65n_ethmac_s *priv);
static void rx65n_rxdescinit(FAR struct rx65n_ethmac_s *priv);
static void rx65n_txdescinit(struct rx65n_ethmac_s *priv);
static void rx65n_rxdescinit(struct rx65n_ethmac_s *priv);
/* PHY Initialization */
@ -513,36 +513,36 @@ static void rx65n_rxdescinit(FAR struct rx65n_ethmac_s *priv);
static void rx65n_phyintenable(bool enable);
#endif
#if defined(CONFIG_ARCH_PHY_INTERRUPT)
int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
int arch_phy_irq(const char *intf, xcpt_t handler, void *arg,
phy_enable_t *enable);
#endif
static int rx65n_phyinit(FAR struct rx65n_ethmac_s *priv);
static int rx65n_phyinit(struct rx65n_ethmac_s *priv);
/* MAC/DMA Initialization */
static int rx65n_ethreset(FAR struct rx65n_ethmac_s *priv);
static int rx65n_macconfig(FAR struct rx65n_ethmac_s *priv);
static void rx65n_macaddress(FAR struct rx65n_ethmac_s *priv);
static int rx65n_ethconfig(FAR struct rx65n_ethmac_s *priv);
static int rx65n_ethreset(struct rx65n_ethmac_s *priv);
static int rx65n_macconfig(struct rx65n_ethmac_s *priv);
static void rx65n_macaddress(struct rx65n_ethmac_s *priv);
static int rx65n_ethconfig(struct rx65n_ethmac_s *priv);
static void rx65n_phy_preamble (void);
static void rx65n_phy_trans_zto0 (void);
static void rx65n_phy_trans_1to0 (void);
static void rx65n_phy_preamble(void);
static void rx65n_phy_trans_zto0(void);
static void rx65n_phy_trans_1to0(void);
static void rx65n_phy_reg_set(uint8_t phydevaddr, uint16_t reg_addr,
int32_t option);
static void rx65n_phy_reg_write (uint16_t data);
static void rx65n_phy_mii_write1 (void);
static void rx65n_phy_mii_write0 (void);
static void rx65n_phy_reg_write(uint16_t data);
static void rx65n_phy_mii_write1(void);
static void rx65n_phy_mii_write0(void);
void rx65n_ether_enable_icu(void);
void rx65n_power_on_control (void);
void rx65n_power_on_control(void);
void rx65n_ether_set_phy_mode(uint8_t mode);
void rx65n_ether_interrupt_init(void);
static int rx65n_phywrite (uint8_t phydevaddr, uint16_t reg_addr,
uint16_t data);
static uint16_t rx65n_phyread (uint8_t phydevaddr, uint16_t reg_addr,
uint16_t *value);
static int rx65n_phywrite(uint8_t phydevaddr, uint16_t reg_addr,
uint16_t data);
static uint16_t rx65n_phyread(uint8_t phydevaddr, uint16_t reg_addr,
uint16_t *value);
void up_enable_irq(int irq);
void up_disable_irq(int irq);
@ -550,9 +550,9 @@ void up_disable_irq(int irq);
#if defined(CONFIG_ARCH_PHY_INTERRUPT)
struct phylinknotification_t
{
xcpt_t phandler;
void *penable;
struct phy_notify_s *pclient;
xcpt_t phandler;
void *penable;
struct phy_notify_s *pclient;
};
struct phylinknotification_t phylinknotification =
@ -704,7 +704,7 @@ static void rx65n_checksetup(void)
*
****************************************************************************/
static void rx65n_initbuffer(FAR struct rx65n_ethmac_s *priv)
static void rx65n_initbuffer(struct rx65n_ethmac_s *priv)
{
uint8_t *buffer;
int i;
@ -719,7 +719,7 @@ static void rx65n_initbuffer(FAR struct rx65n_ethmac_s *priv)
i < RX65N_ETH_NFREEBUFFERS;
i++, buffer += CONFIG_RX65N_ETH_BUFSIZE)
{
sq_addlast((FAR sq_entry_t *)buffer, &priv->freeb);
sq_addlast((sq_entry_t *)buffer, &priv->freeb);
}
}
@ -742,7 +742,7 @@ static void rx65n_initbuffer(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static inline uint8_t *rx65n_allocbuffer(FAR struct rx65n_ethmac_s *priv)
static inline uint8_t *rx65n_allocbuffer(struct rx65n_ethmac_s *priv)
{
/* Allocate a buffer by returning the head of the free buffer list */
@ -769,12 +769,12 @@ static inline uint8_t *rx65n_allocbuffer(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static inline void rx65n_freebuffer(FAR struct rx65n_ethmac_s *priv,
static inline void rx65n_freebuffer(struct rx65n_ethmac_s *priv,
uint8_t *buffer)
{
/* Free the buffer by adding it to the end of the free buffer list */
sq_addlast((FAR sq_entry_t *)buffer, &priv->freeb);
sq_addlast((sq_entry_t *)buffer, &priv->freeb);
}
/****************************************************************************
@ -795,7 +795,7 @@ static inline void rx65n_freebuffer(FAR struct rx65n_ethmac_s *priv,
*
****************************************************************************/
static inline bool rx65n_isfreebuffer(FAR struct rx65n_ethmac_s *priv)
static inline bool rx65n_isfreebuffer(struct rx65n_ethmac_s *priv)
{
/* Return TRUE if the free buffer list is not empty */
@ -822,7 +822,7 @@ static inline bool rx65n_isfreebuffer(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static int rx65n_transmit(FAR struct rx65n_ethmac_s *priv)
static int rx65n_transmit(struct rx65n_ethmac_s *priv)
{
struct eth_txdesc_s *txdesc;
struct eth_txdesc_s *txfirst;
@ -1042,8 +1042,7 @@ static int rx65n_transmit(FAR struct rx65n_ethmac_s *priv)
static int rx65n_txpoll(struct net_driver_s *dev)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)dev->
d_private;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)dev->d_private;
DEBUGASSERT(priv->dev.d_buf != NULL);
@ -1117,9 +1116,9 @@ static int rx65n_txpoll(struct net_driver_s *dev)
*
****************************************************************************/
static void rx65n_dopoll(FAR struct rx65n_ethmac_s *priv)
static void rx65n_dopoll(struct rx65n_ethmac_s *priv)
{
FAR struct net_driver_s *dev = &priv->dev;
struct net_driver_s *dev = &priv->dev;
/* Check if the next TX descriptor is owned by the Ethernet DMA or
* CPU. We cannot perform the TX poll if we are unable to accept
@ -1174,7 +1173,7 @@ static void rx65n_dopoll(FAR struct rx65n_ethmac_s *priv)
* None
****************************************************************************/
static void rx65n_enableint(FAR struct rx65n_ethmac_s *priv, uint32_t ierbit)
static void rx65n_enableint(struct rx65n_ethmac_s *priv, uint32_t ierbit)
{
uint32_t regval;
@ -1199,7 +1198,7 @@ static void rx65n_enableint(FAR struct rx65n_ethmac_s *priv, uint32_t ierbit)
* None
****************************************************************************/
static void rx65n_disableint(FAR struct rx65n_ethmac_s *priv,
static void rx65n_disableint(struct rx65n_ethmac_s *priv,
uint32_t ierbit)
{
uint32_t regval;
@ -1230,8 +1229,8 @@ static void rx65n_disableint(FAR struct rx65n_ethmac_s *priv,
*
****************************************************************************/
static void rx65n_freesegment(FAR struct rx65n_ethmac_s *priv,
FAR struct eth_rxdesc_s *rxfirst, int segments)
static void rx65n_freesegment(struct rx65n_ethmac_s *priv,
struct eth_rxdesc_s *rxfirst, int segments)
{
struct eth_rxdesc_s *rxdesc;
int i;
@ -1294,7 +1293,7 @@ static void rx65n_freesegment(FAR struct rx65n_ethmac_s *priv,
*
****************************************************************************/
static int rx65n_recvframe(FAR struct rx65n_ethmac_s *priv)
static int rx65n_recvframe(struct rx65n_ethmac_s *priv)
{
struct eth_rxdesc_s *rxdesc;
struct eth_rxdesc_s *rxcurr;
@ -1430,7 +1429,7 @@ static int rx65n_recvframe(FAR struct rx65n_ethmac_s *priv)
*/
nerr("ERROR: Dropped, RX descriptor errors: %08" PRIx32 "\n",
rxdesc->rdes0);
rxdesc->rdes0);
rx65n_freesegment(priv, rxcurr, priv->segments);
}
}
@ -1470,7 +1469,7 @@ static int rx65n_recvframe(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static void rx65n_receive(FAR struct rx65n_ethmac_s *priv)
static void rx65n_receive(struct rx65n_ethmac_s *priv)
{
struct net_driver_s *dev = &priv->dev;
@ -1594,7 +1593,7 @@ static void rx65n_receive(FAR struct rx65n_ethmac_s *priv)
{
nerr("ERROR: Dropped, Unknown type: %04x\n", BUF->type);
#if defined(CONFIG_NETDEV_STATISTICS)
(priv->dev.d_statistics.rx_dropped)++;
(priv->dev.d_statistics.rx_dropped)++;
#endif
}
@ -1632,7 +1631,7 @@ static void rx65n_receive(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static void rx65n_freeframe(FAR struct rx65n_ethmac_s *priv)
static void rx65n_freeframe(struct rx65n_ethmac_s *priv)
{
struct eth_txdesc_s *txdesc;
int i;
@ -1735,7 +1734,7 @@ static void rx65n_freeframe(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static void rx65n_txdone(FAR struct rx65n_ethmac_s *priv)
static void rx65n_txdone(struct rx65n_ethmac_s *priv)
{
DEBUGASSERT(priv->txtail != NULL);
@ -1749,7 +1748,7 @@ static void rx65n_txdone(FAR struct rx65n_ethmac_s *priv)
{
/* Cancel the TX timeout */
rx65n_cmtw0_stop(rx65n_cmtw0_timeout);
rx65n_cmtw0_stop(rx65n_cmtw0_timeout);
/* And disable further TX interrupts. */
@ -1778,9 +1777,9 @@ static void rx65n_txdone(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static void rx65n_interrupt_work(FAR void *arg)
static void rx65n_interrupt_work(void *arg)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)arg;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)arg;
uint32_t edmasr;
uint32_t regval;
@ -1902,9 +1901,9 @@ static void rx65n_interrupt_work(FAR void *arg)
*
****************************************************************************/
static int rx65n_interrupt(int irq, FAR void *context, FAR void *arg)
static int rx65n_interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_ethmac_s *priv = &g_rx65nethmac[0];
struct rx65n_ethmac_s *priv = &g_rx65nethmac[0];
uint32_t edmasr;
/* Get the interrupt status bits (ETHERC/EDMAC interrupt status check ) */
@ -1956,9 +1955,9 @@ static int rx65n_interrupt(int irq, FAR void *context, FAR void *arg)
*
****************************************************************************/
static void rx65n_txtimeout_work(FAR void *arg)
static void rx65n_txtimeout_work(void *arg)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)arg;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)arg;
/* Reset the hardware.Just take the interface down, then back up again. */
@ -2000,7 +1999,7 @@ static void rx65n_txtimeout_work(FAR void *arg)
void rx65n_txtimeout_expiry(wdparm_t arg)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)arg;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)arg;
nerr("ERROR: Timeout!\n");
/* Disable further Ethernet interrupts. This will prevent some race
@ -2039,8 +2038,7 @@ void rx65n_txtimeout_expiry(wdparm_t arg)
static int rx65n_ifup(struct net_driver_s *dev)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)dev->
d_private;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)dev->d_private;
int ret;
#ifdef CONFIG_NET_IPv4
@ -2095,8 +2093,7 @@ static int rx65n_ifup(struct net_driver_s *dev)
static int rx65n_ifdown(struct net_driver_s *dev)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)dev->
d_private;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)dev->d_private;
irqstate_t flags;
int ret = OK;
ninfo("Taking the network down\n");
@ -2149,9 +2146,9 @@ static int rx65n_ifdown(struct net_driver_s *dev)
*
****************************************************************************/
static void rx65n_txavail_work(FAR void *arg)
static void rx65n_txavail_work(void *arg)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)arg;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)arg;
ninfo("ifup: %d\n", priv->ifup);
@ -2189,8 +2186,7 @@ static void rx65n_txavail_work(FAR void *arg)
static int rx65n_txavail(struct net_driver_s *dev)
{
FAR struct rx65n_ethmac_s *priv = (FAR struct rx65n_ethmac_s *)dev->
d_private;
struct rx65n_ethmac_s *priv = (struct rx65n_ethmac_s *)dev->d_private;
/* Is our single work structure available?
* It may not be if there are
@ -2227,7 +2223,7 @@ static int rx65n_txavail(struct net_driver_s *dev)
****************************************************************************/
#if defined(CONFIG_NET_MCASTGROUP) || defined(CONFIG_NET_ICMPv6)
static int rx65n_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
static int rx65n_addmac(struct net_driver_s *dev, const uint8_t *mac)
{
ninfo("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
@ -2260,7 +2256,7 @@ static int rx65n_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
****************************************************************************/
#ifdef CONFIG_NET_MCASTGROUP
static int rx65n_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
static int rx65n_rmmac(struct net_driver_s *dev, const uint8_t *mac)
{
ninfo("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
@ -2290,7 +2286,7 @@ static int rx65n_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
*
****************************************************************************/
static void rx65n_txdescinit(FAR struct rx65n_ethmac_s *priv)
static void rx65n_txdescinit(struct rx65n_ethmac_s *priv)
{
struct eth_txdesc_s *txdesc;
int i;
@ -2372,7 +2368,7 @@ static void rx65n_txdescinit(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static void rx65n_rxdescinit(FAR struct rx65n_ethmac_s *priv)
static void rx65n_rxdescinit(struct rx65n_ethmac_s *priv)
{
struct eth_rxdesc_s *rxdesc;
int i;
@ -2626,7 +2622,7 @@ static void rx65n_phyintenable(bool enable)
****************************************************************************/
#if defined(CONFIG_ARCH_PHY_INTERRUPT)
int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
int arch_phy_irq(const char *intf, xcpt_t handler, void *arg,
phy_enable_t *enable)
{
/* Using ET0_LINKSTA for PHY interrupt line which is connected to ETHERC.
@ -2694,7 +2690,7 @@ int arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
* Return Value : none
****************************************************************************/
void phy_start_autonegotiate (uint8_t pause)
void phy_start_autonegotiate(uint8_t pause)
{
volatile uint16_t regval = 0;
@ -2829,7 +2825,7 @@ void rx65n_ether_set_phy_mode(uint8_t mode)
* Return Value : none
****************************************************************************/
static void phy_reg_read (uint16_t *pdata)
static void phy_reg_read(uint16_t *pdata)
{
int32_t databitcnt = 0;
int32_t j;
@ -2895,8 +2891,8 @@ static void phy_reg_read (uint16_t *pdata)
* Return Value : read value
****************************************************************************/
static uint16_t rx65n_phyread (uint8_t phydevaddr, uint16_t reg_addr,
uint16_t *value)
static uint16_t rx65n_phyread(uint8_t phydevaddr, uint16_t reg_addr,
uint16_t *value)
{
uint16_t data;
@ -2961,7 +2957,7 @@ void rx65n_ether_enable_icu(void)
* Return Value : none
****************************************************************************/
static void rx65n_phy_trans_zto0 ()
static void rx65n_phy_trans_zto0(void)
{
int32_t j;
@ -3004,7 +3000,7 @@ static void rx65n_phy_trans_zto0 ()
* Return Value : none
****************************************************************************/
static void rx65n_phy_trans_1to0 ()
static void rx65n_phy_trans_1to0(void)
{
/* The processing of TA (turnaround) about writing of the frame format
* of MII Management Interface which is
@ -3027,8 +3023,8 @@ static void rx65n_phy_trans_1to0 ()
* Return Value : none
****************************************************************************/
static void rx65n_phy_reg_set (uint8_t phydevaddr, uint16_t reg_addr,
int32_t option)
static void rx65n_phy_reg_set(uint8_t phydevaddr, uint16_t reg_addr,
int32_t option)
{
int32_t bitcnt = 0;
uint16_t data;
@ -3079,7 +3075,7 @@ static void rx65n_phy_reg_set (uint8_t phydevaddr, uint16_t reg_addr,
* Return Value : none
****************************************************************************/
static void rx65n_phy_reg_write (uint16_t data)
static void rx65n_phy_reg_write(uint16_t data)
{
int32_t databitcnt = 0;
@ -3113,7 +3109,7 @@ static void rx65n_phy_reg_write (uint16_t data)
* Return Value : none
****************************************************************************/
static void rx65n_phy_mii_write1 ()
static void rx65n_phy_mii_write1(void)
{
int32_t j;
@ -3310,7 +3306,7 @@ void rx65n_ether_interrupt_init(void)
*
****************************************************************************/
static int rx65n_phyinit(FAR struct rx65n_ethmac_s *priv)
static int rx65n_phyinit(struct rx65n_ethmac_s *priv)
{
uint32_t count;
uint16_t reg;
@ -3418,7 +3414,7 @@ static int rx65n_phyinit(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static int rx65n_ethreset(FAR struct rx65n_ethmac_s *priv)
static int rx65n_ethreset(struct rx65n_ethmac_s *priv)
{
uint32_t regval;
uint32_t retries;
@ -3498,7 +3494,7 @@ static int rx65n_ethreset(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static int rx65n_macconfig(FAR struct rx65n_ethmac_s *priv)
static int rx65n_macconfig(struct rx65n_ethmac_s *priv)
{
uint32_t regval;
uint32_t retries;
@ -3552,9 +3548,9 @@ static int rx65n_macconfig(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static void rx65n_macaddress(FAR struct rx65n_ethmac_s *priv)
static void rx65n_macaddress(struct rx65n_ethmac_s *priv)
{
FAR struct net_driver_s *dev = &priv->dev;
struct net_driver_s *dev = &priv->dev;
uint32_t regval;
regval = 0;
@ -3599,7 +3595,7 @@ static void rx65n_macaddress(FAR struct rx65n_ethmac_s *priv)
*
****************************************************************************/
static int rx65n_ethconfig(FAR struct rx65n_ethmac_s *priv)
static int rx65n_ethconfig(struct rx65n_ethmac_s *priv)
{
int ret;
uint32_t regval;

View File

@ -129,76 +129,64 @@ struct rx65n_i2c_priv_s
* Private Function Prototypes
****************************************************************************/
static int rx65n_riic_iicrst(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_setclock(FAR struct rx65n_i2c_priv_s *priv,
uint32_t frequency);
static void rx65n_riic_init(FAR struct rx65n_i2c_priv_s *priv);
static int rx65n_riic_startcond(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_restartcond(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_send_slv_addr(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_after_send_slvadr(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_master_transmit(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_master_receive(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_stopcond(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_advance(FAR struct rx65n_i2c_priv_s *priv);
static uint8_t rx65n_riic_read_data(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_wait_set(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_pre_end_set(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_end_set(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_nack(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_set_sending_data(FAR struct rx65n_i2c_priv_s *priv, \
uint8_t data);
static int rx65n_riic_after_stop(FAR struct rx65n_i2c_priv_s *priv);
static bool rx65n_riic_check_bus_busy(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_set_icier(FAR struct rx65n_i2c_priv_s *priv, \
uint8_t value);
static void rx65n_riic_timeout(FAR struct rx65n_i2c_priv_s *priv);
static int rx65n_riic_iicrst(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_setclock(struct rx65n_i2c_priv_s *priv,
uint32_t frequency);
static void rx65n_riic_init(struct rx65n_i2c_priv_s *priv);
static int rx65n_riic_startcond(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_restartcond(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_send_slv_addr(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_after_send_slvadr(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_master_transmit(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_master_receive(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_stopcond(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_advance(struct rx65n_i2c_priv_s *priv);
static uint8_t rx65n_riic_read_data(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_wait_set(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_pre_end_set(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_end_set(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_nack(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_set_sending_data(struct rx65n_i2c_priv_s *priv,
uint8_t data);
static int rx65n_riic_after_stop(struct rx65n_i2c_priv_s *priv);
static bool rx65n_riic_check_bus_busy(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_set_icier(struct rx65n_i2c_priv_s *priv,
uint8_t value);
static void rx65n_riic_timeout(struct rx65n_i2c_priv_s *priv);
/* RIIC Interrupt Handling */
static void rx65n_riic_int_disable(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_int_enable(FAR struct rx65n_i2c_priv_s *priv);
static int rx65n_riic_irq_init(FAR struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_int_disable(struct rx65n_i2c_priv_s *priv);
static void rx65n_riic_int_enable(struct rx65n_i2c_priv_s *priv);
static int rx65n_riic_irq_init(struct rx65n_i2c_priv_s *priv);
/* RIIC0 Channel Interrupt Handling */
static int rx65n_riic_rxi0interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_txi0interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_eei0interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_tei0interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_rxi0interrupt(int irq, void *context, void *arg);
static int rx65n_riic_txi0interrupt(int irq, oid *context, void *arg);
static int rx65n_riic_eei0interrupt(int irq, void *context, void *arg);
static int rx65n_riic_tei0interrupt(int irq, void *context, void *arg);
/* RIIC1 Channel Interrupt Handling */
static int rx65n_riic_rxi1interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_txi1interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_eei1interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_tei1interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_rxi1interrupt(int irq, void *context, void *arg);
static int rx65n_riic_txi1interrupt(int irq, void *context, void *arg);
static int rx65n_riic_eei1interrupt(int irq, void *context, void *arg);
static int rx65n_riic_tei1interrupt(int irq, void *context, void *arg);
/* RIIC2 Channel Interrupt Handling */
static int rx65n_riic_rxi2interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_txi2interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_eei2interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_tei2interrupt(int irq,
FAR void *context, FAR void *arg);
static int rx65n_riic_rxi2interrupt(int irq, void *context, void *arg);
static int rx65n_riic_txi2interrupt(int irq, void *context, void *arg);
static int rx65n_riic_eei2interrupt(int irq, void *context, void *arg);
static int rx65n_riic_tei2interrupt(int irq, void *context, void *arg);
/* I2C operations */
static int rx65n_i2c_transfer(FAR struct i2c_master_s *dev, \
FAR struct i2c_msg_s *msgs, int count);
static int rx65n_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count);
#ifdef CONFIG_I2C_RESET
static int rx65n_i2c_reset(FAR struct i2c_master_s *dev);
static int rx65n_i2c_reset(struct i2c_master_s *dev);
#endif
/****************************************************************************
@ -378,7 +366,7 @@ static void riic_mpc_disable(void)
* Disable writing to registers
****************************************************************************/
static int rx65n_riic_iicrst(FAR struct rx65n_i2c_priv_s *priv)
static int rx65n_riic_iicrst(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
@ -432,8 +420,8 @@ static int rx65n_riic_iicrst(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_set_icier(FAR struct rx65n_i2c_priv_s *priv, \
uint8_t value)
static void rx65n_riic_set_icier(struct rx65n_i2c_priv_s *priv,
uint8_t value)
{
uint8_t regval;
regval = (value | RX65N_RIIC_ICIER_TMO);
@ -465,8 +453,8 @@ static void rx65n_riic_set_icier(FAR struct rx65n_i2c_priv_s *priv, \
*
****************************************************************************/
static void rx65n_riic_setclock(FAR struct rx65n_i2c_priv_s *priv,
uint32_t frequency)
static void rx65n_riic_setclock(struct rx65n_i2c_priv_s *priv,
uint32_t frequency)
{
/* Divider array of RIIC clock */
@ -498,7 +486,7 @@ static void rx65n_riic_setclock(FAR struct rx65n_i2c_priv_s *priv,
*/
l_time = 0.5E-6;
h_time = (((1.0 / frequency) - l_time) - SCL_RISE_TIME_FASTPLUS) \
h_time = (((1.0 / frequency) - l_time) - SCL_RISE_TIME_FASTPLUS)
- SCL_FALL_TIME_FASTPLUS;
}
@ -521,7 +509,7 @@ static void rx65n_riic_setclock(FAR struct rx65n_i2c_priv_s *priv,
*/
l_time = 1.3E-6;
h_time = (((1.0 / frequency) - l_time) - SCL_RISE_TIME_FAST) \
h_time = (((1.0 / frequency) - l_time) - SCL_RISE_TIME_FAST)
- SCL_FALL_TIME_FAST;
}
@ -660,7 +648,7 @@ static void rx65n_riic_setclock(FAR struct rx65n_i2c_priv_s *priv,
*
****************************************************************************/
static void rx65n_riic_int_enable(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_int_enable(struct rx65n_i2c_priv_s *priv)
{
up_enable_irq(priv->dev->txi_irq);
up_enable_irq(priv->dev->rxi_irq);
@ -676,7 +664,7 @@ static void rx65n_riic_int_enable(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_int_disable(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_int_disable(struct rx65n_i2c_priv_s *priv)
{
up_disable_irq(priv->dev->txi_irq);
up_disable_irq(priv->dev->rxi_irq);
@ -692,7 +680,7 @@ static void rx65n_riic_int_disable(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static int rx65n_riic_irq_init(FAR struct rx65n_i2c_priv_s *priv)
static int rx65n_riic_irq_init(struct rx65n_i2c_priv_s *priv)
{
int ret;
@ -756,7 +744,7 @@ static int rx65n_riic_irq_init(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_init(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_init(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
@ -814,19 +802,19 @@ static void rx65n_riic_init(FAR struct rx65n_i2c_priv_s *priv)
switch (CONFIG_RX65N_RIIC0_NF_STAGE)
{
case 1:
regval |= RX65N_RIIC_ICMR3_NF1;
break;
regval |= RX65N_RIIC_ICMR3_NF1;
break;
case 2:
regval |= RX65N_RIIC_ICMR3_NF2;
break;
regval |= RX65N_RIIC_ICMR3_NF2;
break;
case 3:
regval |= RX65N_RIIC_ICMR3_NF3;
break;
regval |= RX65N_RIIC_ICMR3_NF3;
break;
case 4:
regval |= RX65N_RIIC_ICMR3_NF4;
regval |= RX65N_RIIC_ICMR3_NF4;
break;
}
@ -935,19 +923,19 @@ static void rx65n_riic_init(FAR struct rx65n_i2c_priv_s *priv)
switch (CONFIG_RX65N_RIIC1_NF_STAGE)
{
case 1:
regval |= RX65N_RIIC_ICMR3_NF1;
break;
regval |= RX65N_RIIC_ICMR3_NF1;
break;
case 2:
regval |= RX65N_RIIC_ICMR3_NF2;
break;
regval |= RX65N_RIIC_ICMR3_NF2;
break;
case 3:
regval |= RX65N_RIIC_ICMR3_NF3;
break;
regval |= RX65N_RIIC_ICMR3_NF3;
break;
case 4:
regval |= RX65N_RIIC_ICMR3_NF4;
regval |= RX65N_RIIC_ICMR3_NF4;
break;
}
@ -1056,21 +1044,21 @@ static void rx65n_riic_init(FAR struct rx65n_i2c_priv_s *priv)
switch (CONFIG_RX65N_RIIC2_NF_STAGE)
{
case 1:
regval |= RX65N_RIIC_ICMR3_NF1;
break;
regval |= RX65N_RIIC_ICMR3_NF1;
break;
case 2:
regval |= RX65N_RIIC_ICMR3_NF2;
break;
regval |= RX65N_RIIC_ICMR3_NF2;
break;
case 3:
regval |= RX65N_RIIC_ICMR3_NF3;
break;
regval |= RX65N_RIIC_ICMR3_NF3;
break;
case 4:
regval |= RX65N_RIIC_ICMR3_NF4;
break;
}
regval |= RX65N_RIIC_ICMR3_NF4;
break;
}
rx65n_putreg(regval, RX65N_RIIC2_ICMR3);
#endif
@ -1143,8 +1131,8 @@ static void rx65n_riic_init(FAR struct rx65n_i2c_priv_s *priv)
* Return Value : None
****************************************************************************/
static void rx65n_riic_set_sending_data (FAR struct rx65n_i2c_priv_s *priv, \
uint8_t data)
static void rx65n_riic_set_sending_data(struct rx65n_i2c_priv_s *priv,
uint8_t data)
{
if (0 == priv->bus)
{
@ -1191,7 +1179,7 @@ static void rx65n_riic_set_sending_data (FAR struct rx65n_i2c_priv_s *priv, \
*
****************************************************************************/
static void rx65n_riic_advance(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_advance(struct rx65n_i2c_priv_s *priv)
{
int ret;
@ -1257,7 +1245,7 @@ static void rx65n_riic_advance(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_nack(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_nack(struct rx65n_i2c_priv_s *priv)
{
rx65n_riic_set_icier(priv, RX65N_RIIC_ICIER_SP_AL);
@ -1278,7 +1266,7 @@ static void rx65n_riic_nack(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_timeout(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_timeout(struct rx65n_i2c_priv_s *priv)
{
priv->mode = RIIC_FINISH;
}
@ -1291,7 +1279,7 @@ static void rx65n_riic_timeout(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static int rx65n_riic_after_stop(FAR struct rx65n_i2c_priv_s *priv)
static int rx65n_riic_after_stop(struct rx65n_i2c_priv_s *priv)
{
int ret;
bool bus;
@ -1327,7 +1315,7 @@ static int rx65n_riic_after_stop(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static bool rx65n_riic_check_bus_busy(FAR struct rx65n_i2c_priv_s *priv)
static bool rx65n_riic_check_bus_busy(struct rx65n_i2c_priv_s *priv)
{
int i;
bool bus_state = RIIC_BUS_BUSY;
@ -1382,7 +1370,7 @@ static bool rx65n_riic_check_bus_busy(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static int rx65n_riic_startcond(FAR struct rx65n_i2c_priv_s *priv)
static int rx65n_riic_startcond(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
int ret = RIIC_SUCCESS;
@ -1401,7 +1389,7 @@ static int rx65n_riic_startcond(FAR struct rx65n_i2c_priv_s *priv)
rx65n_putreg(regval, RX65N_RIIC0_ICSR2);
regval = rx65n_getreg(RX65N_RIIC0_ICSR2);
while (0x00 != ((regval & RX65N_RIIC_ICSR2_START_SET) || \
while (0x00 != ((regval & RX65N_RIIC_ICSR2_START_SET) ||
(regval & RX65N_RIIC_ICSR2_STOP_SET)))
{
regval = rx65n_getreg(RX65N_RIIC0_ICSR2);
@ -1462,7 +1450,7 @@ static int rx65n_riic_startcond(FAR struct rx65n_i2c_priv_s *priv)
rx65n_putreg(regval, RX65N_RIIC1_ICSR2);
regval = rx65n_getreg(RX65N_RIIC1_ICSR2);
while (0x00 != ((regval & RX65N_RIIC_ICSR2_START_SET) || \
while (0x00 != ((regval & RX65N_RIIC_ICSR2_START_SET) ||
(regval & RX65N_RIIC_ICSR2_STOP_SET)))
{
regval = rx65n_getreg(RX65N_RIIC1_ICSR2);
@ -1512,7 +1500,7 @@ static int rx65n_riic_startcond(FAR struct rx65n_i2c_priv_s *priv)
rx65n_putreg(regval, RX65N_RIIC2_ICSR2);
regval = rx65n_getreg(RX65N_RIIC2_ICSR2);
while (0x00 != ((regval & RX65N_RIIC_ICSR2_START_SET) || \
while (0x00 != ((regval & RX65N_RIIC_ICSR2_START_SET) ||
(regval & RX65N_RIIC_ICSR2_STOP_SET)))
{
regval = rx65n_getreg(RX65N_RIIC2_ICSR2);
@ -1562,7 +1550,7 @@ static int rx65n_riic_startcond(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_restartcond(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_restartcond(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
@ -1629,7 +1617,7 @@ static void rx65n_riic_restartcond(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_send_slv_addr(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_send_slv_addr(struct rx65n_i2c_priv_s *priv)
{
uint16_t bit_addr;
uint8_t regval;
@ -1696,7 +1684,7 @@ static void rx65n_riic_send_slv_addr(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_after_send_slvadr(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_after_send_slvadr(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
uint8_t *data;
@ -1801,7 +1789,7 @@ static void rx65n_riic_after_send_slvadr(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_stopcond(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_stopcond(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
@ -1869,7 +1857,7 @@ static void rx65n_riic_stopcond(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_master_transmit(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_master_transmit(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
uint8_t *data;
@ -1935,7 +1923,7 @@ static void rx65n_riic_master_transmit(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static uint8_t rx65n_riic_read_data(FAR struct rx65n_i2c_priv_s *priv)
static uint8_t rx65n_riic_read_data(struct rx65n_i2c_priv_s *priv)
{
volatile uint8_t * regval;
@ -1966,7 +1954,7 @@ static uint8_t rx65n_riic_read_data(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_wait_set(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_wait_set(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
@ -2010,7 +1998,7 @@ static void rx65n_riic_wait_set(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_pre_end_set(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_pre_end_set(struct rx65n_i2c_priv_s *priv)
{
if (0 == priv->bus)
{
@ -2058,7 +2046,7 @@ static void rx65n_riic_pre_end_set(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_end_set(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_end_set(struct rx65n_i2c_priv_s *priv)
{
if (0 == priv->bus)
{
@ -2105,7 +2093,7 @@ static void rx65n_riic_end_set(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static void rx65n_riic_master_receive(FAR struct rx65n_i2c_priv_s *priv)
static void rx65n_riic_master_receive(struct rx65n_i2c_priv_s *priv)
{
uint8_t regval;
priv->dev_sts = RIIC_STS_RECEIVE_DATA_WAIT;
@ -2171,10 +2159,9 @@ static void rx65n_riic_master_receive(FAR struct rx65n_i2c_priv_s *priv)
*
****************************************************************************/
static int rx65n_riic_rxi0interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_rxi0interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
priv->event = RIIC_EV_INT_RECEIVE;
@ -2195,10 +2182,9 @@ static int rx65n_riic_rxi0interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_rxi1interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_rxi1interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
priv->event = RIIC_EV_INT_RECEIVE;
@ -2219,10 +2205,9 @@ static int rx65n_riic_rxi1interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_rxi2interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_rxi2interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
priv->event = RIIC_EV_INT_RECEIVE;
rx65n_riic_advance(priv);
@ -2240,10 +2225,9 @@ static int rx65n_riic_rxi2interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_txi0interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_txi0interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
/* Ideally, should never get here as this interrupt only occurs during
* Multi-master mode of operation and
@ -2267,10 +2251,9 @@ static int rx65n_riic_txi0interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_txi1interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_txi1interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
/* Ideally, should never get here as this interrupt only occurs during
* Multi-master mode of operation and
@ -2294,10 +2277,9 @@ static int rx65n_riic_txi1interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_txi2interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_txi2interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
/* Ideally, should never get here as this interrupt only occurs during
* Multi-master mode of operation and
@ -2321,10 +2303,9 @@ static int rx65n_riic_txi2interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_tei0interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_tei0interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
RIIC0.ICSR2.BIT.TEND = 0U;
while (0U != RIIC0.ICSR2.BIT.TEND)
@ -2362,10 +2343,9 @@ static int rx65n_riic_tei0interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_tei1interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_tei1interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
RIIC1.ICSR2.BIT.TEND = 0U;
while (0U != RIIC1.ICSR2.BIT.TEND)
@ -2399,10 +2379,9 @@ static int rx65n_riic_tei1interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_tei2interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_tei2interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
RIIC2.ICSR2.BIT.TEND = 0U;
while (0U != RIIC2.ICSR2.BIT.TEND)
@ -2441,10 +2420,9 @@ static int rx65n_riic_tei2interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_eei0interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_eei0interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
/* Check Timeout Condition */
@ -2483,7 +2461,7 @@ static int rx65n_riic_eei0interrupt(int irq, FAR void *context, \
RIIC0.ICMR3.BIT.ACKBT = 0U;
RIIC0.ICMR3.BIT.ACKWP = 0U;
while ((0U != RIIC0.ICMR3.BIT.RDRFS) || \
while ((0U != RIIC0.ICMR3.BIT.RDRFS) ||
(0U != RIIC0.ICMR3.BIT.ACKBT))
{
/* Do Nothing */
@ -2515,7 +2493,7 @@ static int rx65n_riic_eei0interrupt(int irq, FAR void *context, \
RIIC0.ICIER.BIT.TIE = 0U;
RIIC0.ICIER.BIT.RIE = 0U;
while (((0U != RIIC0.ICIER.BIT.TEIE) || \
while (((0U != RIIC0.ICIER.BIT.TEIE) ||
(0U != RIIC0.ICIER.BIT.TIE)) || (0U != RIIC0.ICIER.BIT.RIE))
{
/* Do Nothing */
@ -2535,7 +2513,7 @@ static int rx65n_riic_eei0interrupt(int irq, FAR void *context, \
{
RIIC0.ICIER.BIT.STIE = 0U;
RIIC0.ICSR2.BIT.START = 0U;
while ((0U != RIIC0.ICSR2.BIT.START) || \
while ((0U != RIIC0.ICSR2.BIT.START) ||
(0U != RIIC0.ICIER.BIT.STIE))
{
/* Wait till reset is completed */
@ -2566,10 +2544,9 @@ static int rx65n_riic_eei0interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_eei1interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_eei1interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
/* Check Timeout Condition */
@ -2607,7 +2584,7 @@ static int rx65n_riic_eei1interrupt(int irq, FAR void *context, \
RIIC1.ICMR3.BIT.ACKBT = 0U;
RIIC1.ICMR3.BIT.ACKWP = 0U;
while ((0U != RIIC1.ICMR3.BIT.RDRFS) || \
while ((0U != RIIC1.ICMR3.BIT.RDRFS) ||
(0U != RIIC1.ICMR3.BIT.ACKBT))
{
/* Do Nothing */
@ -2639,7 +2616,7 @@ static int rx65n_riic_eei1interrupt(int irq, FAR void *context, \
RIIC1.ICIER.BIT.TIE = 0U;
RIIC1.ICIER.BIT.RIE = 0U;
while (((0U != RIIC1.ICIER.BIT.TEIE) || \
while (((0U != RIIC1.ICIER.BIT.TEIE) ||
(0U != RIIC1.ICIER.BIT.TIE)) || (0U != RIIC1.ICIER.BIT.RIE))
{
/* Do Nothing */
@ -2687,10 +2664,9 @@ static int rx65n_riic_eei1interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_riic_eei2interrupt(int irq, FAR void *context, \
FAR void *arg)
static int rx65n_riic_eei2interrupt(int irq, void *context, void *arg)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)arg;
/* Check Timeout Condition */
@ -2729,7 +2705,7 @@ static int rx65n_riic_eei2interrupt(int irq, FAR void *context, \
RIIC2.ICMR3.BIT.ACKBT = 0U;
RIIC2.ICMR3.BIT.ACKWP = 0U;
while ((0U != RIIC2.ICMR3.BIT.RDRFS) || \
while ((0U != RIIC2.ICMR3.BIT.RDRFS) ||
(0U != RIIC2.ICMR3.BIT.ACKBT))
{
/* Do Nothing */
@ -2761,7 +2737,7 @@ static int rx65n_riic_eei2interrupt(int irq, FAR void *context, \
RIIC2.ICIER.BIT.TIE = 0U;
RIIC2.ICIER.BIT.RIE = 0U;
while (((0U != RIIC2.ICIER.BIT.TEIE) || \
while (((0U != RIIC2.ICIER.BIT.TEIE) ||
(0U != RIIC2.ICIER.BIT.TIE)) || (0U != RIIC2.ICIER.BIT.RIE))
{
/* Do Nothing */
@ -2781,7 +2757,7 @@ static int rx65n_riic_eei2interrupt(int irq, FAR void *context, \
{
RIIC2.ICIER.BIT.STIE = 0U;
RIIC2.ICSR2.BIT.START = 0U;
while ((0U != RIIC2.ICSR2.BIT.START) || \
while ((0U != RIIC2.ICSR2.BIT.START) ||
(0U != RIIC2.ICIER.BIT.STIE))
{
/* Wait till reset is completed */
@ -2802,10 +2778,10 @@ static int rx65n_riic_eei2interrupt(int irq, FAR void *context, \
*
****************************************************************************/
static int rx65n_i2c_transfer(FAR struct i2c_master_s *dev, \
FAR struct i2c_msg_s *msgs, int count)
static int rx65n_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)dev;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)dev;
int ret = 0;
DEBUGASSERT(dev != NULL && msgs != NULL && count > 0);
@ -2973,9 +2949,9 @@ static int rx65n_i2c_transfer(FAR struct i2c_master_s *dev, \
****************************************************************************/
#ifdef CONFIG_I2C_RESET
static int rx65n_i2c_reset(FAR struct i2c_master_s *dev)
static int rx65n_i2c_reset(struct i2c_master_s *dev)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)dev;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)dev;
uint8_t regval;
DEBUGASSERT(dev);
@ -3032,7 +3008,7 @@ static int rx65n_i2c_reset(FAR struct i2c_master_s *dev)
*
****************************************************************************/
FAR struct i2c_master_s *rx65n_i2cbus_initialize(int channel)
struct i2c_master_s *rx65n_i2cbus_initialize(int channel)
{
struct rx65n_i2c_priv_s *priv = NULL;
@ -3096,9 +3072,9 @@ FAR struct i2c_master_s *rx65n_i2cbus_initialize(int channel)
*
****************************************************************************/
int rx65n_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
int rx65n_i2cbus_uninitialize(struct i2c_master_s *dev)
{
FAR struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)dev;
struct rx65n_i2c_priv_s *priv = (struct rx65n_i2c_priv_s *)dev;
DEBUGASSERT(dev);

View File

@ -73,7 +73,7 @@
*
****************************************************************************/
FAR struct i2c_master_s *rx65n_i2cbus_initialize(int channel);
struct i2c_master_s *rx65n_i2cbus_initialize(int channel);
/****************************************************************************
* Name: rx65n_i2cbus_uninitialize
@ -90,6 +90,6 @@ FAR struct i2c_master_s *rx65n_i2cbus_initialize(int channel);
*
****************************************************************************/
int rx65n_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
int rx65n_i2cbus_uninitialize(struct i2c_master_s *dev);
#endif /* __ARCH_RENESAS_SRC_RX65N_RX65N_RIIC_H */

View File

@ -184,17 +184,17 @@ struct rx65n_rspidev_s
/* Helpers */
static inline uint32_t rspi_getreg32(FAR struct rx65n_rspidev_s *priv,
static inline uint32_t rspi_getreg32(struct rx65n_rspidev_s *priv,
uint8_t offset);
static inline uint16_t rspi_getreg16(FAR struct rx65n_rspidev_s *priv,
static inline uint16_t rspi_getreg16(struct rx65n_rspidev_s *priv,
uint8_t offset);
static inline uint8_t rspi_getreg8(FAR struct rx65n_rspidev_s *priv,
static inline uint8_t rspi_getreg8(struct rx65n_rspidev_s *priv,
uint8_t offset);
static inline void rspi_putreg32(FAR struct rx65n_rspidev_s *priv,
static inline void rspi_putreg32(struct rx65n_rspidev_s *priv,
uint8_t offset, uint32_t value);
static inline void rspi_putreg16(FAR struct rx65n_rspidev_s *priv,
static inline void rspi_putreg16(struct rx65n_rspidev_s *priv,
uint8_t offset, uint16_t value);
static inline void rspi_putreg8(FAR struct rx65n_rspidev_s *priv,
static inline void rspi_putreg8(struct rx65n_rspidev_s *priv,
uint8_t offset, uint8_t value);
/* SPI data transfer */
@ -218,41 +218,39 @@ static int rspi_transfer(struct rx65n_rspidev_s *priv, const void *txbuffer,
#ifndef CONFIG_SPI_POLLWAIT
static inline struct rx65n_rspidev_s *rspi_mapirq(int irq);
static int rspi_idlinterrupt(int irq, void *context, FAR void *arg);
static int rspi_erinterrupt(int irq, void *context, FAR void *arg);
static int rspi_txinterrupt(int irq, void *context, FAR void *arg);
static int rspi_rxinterrupt(int irq, void *context, FAR void *arg);
static int rspi_idlinterrupt(int irq, void *context, void *arg);
static int rspi_erinterrupt(int irq, void *context, void *arg);
static int rspi_txinterrupt(int irq, void *context, void *arg);
static int rspi_rxinterrupt(int irq, void *context, void *arg);
#endif
/* SPI methods */
static int rspi_lock(FAR struct spi_dev_s *dev, bool lock);
static uint32_t rspi_setfrequency(FAR struct spi_dev_s *dev,
static int rspi_lock(struct spi_dev_s *dev, bool lock);
static uint32_t rspi_setfrequency(struct spi_dev_s *dev,
uint32_t frequency);
static void rspi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
static void rspi_setbits(FAR struct spi_dev_s *dev, int nbits);
static void rspi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode);
static void rspi_setbits(struct spi_dev_s *dev, int nbits);
#ifdef CONFIG_SPI_HWFEATURES
static int rspi_hwfeatures(FAR struct spi_dev_s *dev,
static int rspi_hwfeatures(struct spi_dev_s *dev,
spi_hwfeatures_t features);
#endif
static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd);
static void rspi_exchange(FAR struct spi_dev_s *dev,
FAR const void *txbuffer,
FAR void *rxbuffer, size_t nwords);
static uint32_t rspi_send(struct spi_dev_s *dev, uint32_t wd);
static void rspi_exchange(struct spi_dev_s *dev, const void *txbuffer,
void *rxbuffer, size_t nwords);
#ifdef CONFIG_SPI_TRIGGER
static int rspi_trigger(FAR struct spi_dev_s *dev);
static int rspi_trigger(struct spi_dev_s *dev);
#endif
#ifndef CONFIG_SPI_EXCHANGE
static void rspi_sndblock(FAR struct spi_dev_s *dev,
FAR const void *txbuffer,
static void rspi_sndblock(struct spi_dev_s *dev, const void *txbuffer,
size_t nwords);
static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer,
static void rspi_recvblock(struct spi_dev_s *dev, void *rxbuffer,
size_t nwords);
#endif
/* Initialization */
static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv);
static void rspi_bus_initialize(struct rx65n_rspidev_s *priv);
/****************************************************************************
* Private Data
@ -548,57 +546,57 @@ dtc_static_transfer_data_cfg_t rx_cfg =
*
****************************************************************************/
#ifdef CONFIG_RX65N_RSPI0
void rx65n_rspi0select(FAR struct spi_dev_s *dev, uint32_t devid,
void rx65n_rspi0select(struct spi_dev_s *dev, uint32_t devid,
bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" :
"de-assert");
}
uint8_t rx65n_rspi0status(FAR struct spi_dev_s *dev, uint32_t devid)
uint8_t rx65n_rspi0status(struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
int rx65n_rspi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
int rx65n_rspi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{
return -ENODEV;
}
#endif
#ifdef CONFIG_RX65N_RSPI1
void rx65n_rspi1select(FAR struct spi_dev_s *dev, uint32_t devid,
void rx65n_rspi1select(struct spi_dev_s *dev, uint32_t devid,
bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" :
"de-assert");
}
uint8_t rx65n_rspi1status(FAR struct spi_dev_s *dev, uint32_t devid)
uint8_t rx65n_rspi1status(struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
int rx65n_rspi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
int rx65n_rspi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{
return -ENODEV;
}
#endif
#ifdef CONFIG_RX65N_RSPI2
void rx65n_rspi2select(FAR struct spi_dev_s *dev, uint32_t devid,
void rx65n_rspi2select(struct spi_dev_s *dev, uint32_t devid,
bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" :
"de-assert");
}
uint8_t rx65n_rspi2status(FAR struct spi_dev_s *dev, uint32_t devid)
uint8_t rx65n_rspi2status(struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
int rx65n_rspi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
int rx65n_rspi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{
return -ENODEV;
}
@ -625,9 +623,8 @@ int rx65n_rspi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
****************************************************************************/
#ifdef CONFIG_SPI_CALLBACK
#ifdef CONFIG_RX65N_RSPI0
int rx65n_rspi0register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg)
int rx65n_rspi0register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg)
{
spiinfo("INFO: Registering rspi0 device\n");
return OK;
@ -635,9 +632,8 @@ int rx65n_rspi0register(FAR struct spi_dev_s *dev,
#endif
#ifdef CONFIG_RX65N_RSPI1
int rx65n_rspi1register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg)
int rx65n_rspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg)
{
spiinfo("INFO: Registering rspi1 device\n");
return OK;
@ -645,9 +641,8 @@ int rx65n_rspi1register(FAR struct spi_dev_s *dev,
#endif
#ifdef CONFIG_RX65N_RSPI2
int rx65n_rspi2register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg)
int rx65n_rspi2register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg)
{
spiinfo("INFO: Registering rspi2 device\n");
return OK;
@ -1017,9 +1012,9 @@ static void rspi_startxfr(struct rx65n_rspidev_s *priv)
****************************************************************************/
#ifdef CONFIG_RX65N_RSPI_DTC_DT_MODE
static dtc_err_t rspi_dtctxsetup(FAR struct rx65n_rspidev_s *priv,
FAR const void *txbuffer,
FAR const void *txdummy, size_t nwords)
static dtc_err_t rspi_dtctxsetup(struct rx65n_rspidev_s *priv,
const void *txbuffer,
const void *txdummy, size_t nwords)
{
dtc_err_t ret = DTC_SUCCESS;
dtc_dynamic_transfer_data_cfg_t dcfg;
@ -1093,8 +1088,8 @@ static dtc_err_t rspi_dtctxsetup(FAR struct rx65n_rspidev_s *priv,
*
****************************************************************************/
static dtc_err_t rspi_dtcrxsetup(FAR struct rx65n_rspidev_s *priv,
FAR void *rxbuffer, FAR void *rxdummy,
static dtc_err_t rspi_dtcrxsetup(struct rx65n_rspidev_s *priv,
void *rxbuffer, void *rxdummy,
size_t nwords)
{
dtc_err_t ret = DTC_SUCCESS;
@ -1508,7 +1503,7 @@ static void rspi_errhandle(struct rx65n_rspidev_s *priv, uint8_t bus)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_idlinterrupt(int irq, void *context, FAR void *arg)
static int rspi_idlinterrupt(int irq, void *context, void *arg)
{
uint8_t regval8;
@ -1551,7 +1546,7 @@ static int rspi_idlinterrupt(int irq, void *context, FAR void *arg)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_erinterrupt(int irq, void *context, FAR void *arg)
static int rspi_erinterrupt(int irq, void *context, void *arg)
{
struct rx65n_rspidev_s *priv = rspi_mapirq(irq);
@ -1594,7 +1589,7 @@ static int rspi_erinterrupt(int irq, void *context, FAR void *arg)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_rxinterrupt(int irq, void *context, FAR void *arg)
static int rspi_rxinterrupt(int irq, void *context, void *arg)
{
#ifdef CONFIG_RX65N_RSPI_DTC_DT_MODE
uint8_t regval8;
@ -1647,7 +1642,7 @@ static int rspi_rxinterrupt(int irq, void *context, FAR void *arg)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_txinterrupt(int irq, void *context, FAR void *arg)
static int rspi_txinterrupt(int irq, void *context, void *arg)
{
struct rx65n_rspidev_s *priv = rspi_mapirq(irq);
@ -1705,7 +1700,7 @@ static int rspi_txinterrupt(int irq, void *context, FAR void *arg)
*
****************************************************************************/
static int rspi_lock(FAR struct spi_dev_s *dev, bool lock)
static int rspi_lock(struct spi_dev_s *dev, bool lock)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
int ret;
@ -1737,7 +1732,7 @@ static int rspi_lock(FAR struct spi_dev_s *dev, bool lock)
*
****************************************************************************/
static uint32_t rspi_setfrequency(FAR struct spi_dev_s *dev,
static uint32_t rspi_setfrequency(struct spi_dev_s *dev,
uint32_t frequency)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
@ -1837,7 +1832,7 @@ static uint32_t rspi_setfrequency(FAR struct spi_dev_s *dev,
*
****************************************************************************/
static void rspi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
static void rspi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
@ -1900,7 +1895,7 @@ static void rspi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
*
****************************************************************************/
static void rspi_setbits(FAR struct spi_dev_s *dev, int nbits)
static void rspi_setbits(struct spi_dev_s *dev, int nbits)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
uint8_t regval8;
@ -1955,7 +1950,7 @@ static void rspi_setbits(FAR struct spi_dev_s *dev, int nbits)
*
****************************************************************************/
static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd)
static uint32_t rspi_send(struct spi_dev_s *dev, uint32_t wd)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
uint32_t response = 0;
@ -1986,9 +1981,8 @@ static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd)
****************************************************************************/
#ifdef CONFIG_SPI_EXCHANGE
static void rspi_exchange(FAR struct spi_dev_s *dev,
FAR const void *txbuffer,
FAR void *rxbuffer, size_t nwords)
static void rspi_exchange(struct spi_dev_s *dev, const void *txbuffer,
void *rxbuffer, size_t nwords)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
rspi_transfer(priv, txbuffer, rxbuffer, nwords);
@ -2016,7 +2010,7 @@ static void rspi_exchange(FAR struct spi_dev_s *dev,
****************************************************************************/
#ifndef CONFIG_SPI_EXCHANGE
static void rspi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
static void rspi_sndblock(struct spi_dev_s *dev, const void *buffer,
size_t nwords)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
@ -2045,7 +2039,7 @@ static void rspi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
****************************************************************************/
#ifndef CONFIG_SPI_EXCHANGE
static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
static void rspi_recvblock(struct spi_dev_s *dev, void *buffer,
size_t nwords)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
@ -2060,7 +2054,7 @@ static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
* Return Value : none
****************************************************************************/
void rspi_interrupt_init(FAR struct rx65n_rspidev_s *priv, uint8_t bus)
void rspi_interrupt_init(struct rx65n_rspidev_s *priv, uint8_t bus)
{
/* Enable error interrupt source bit */
@ -2214,7 +2208,7 @@ static void rspi_reg_protect(uint8_t enable)
*
****************************************************************************/
static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv)
static void rspi_bus_initialize(struct rx65n_rspidev_s *priv)
{
uint8_t regval8;
uint16_t regval16;
@ -2278,7 +2272,7 @@ static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv)
/* Select a default frequency of approx. 400KHz */
rspi_setfrequency((FAR struct spi_dev_s *)priv, 400000);
rspi_setfrequency((struct spi_dev_s *)priv, 400000);
/* Configure data control register SPDCR
* Four frames can be transmitted or received in one round of transmission
@ -2424,9 +2418,9 @@ static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv)
*
****************************************************************************/
FAR struct spi_dev_s *rx65n_rspibus_initialize(int bus)
struct spi_dev_s *rx65n_rspibus_initialize(int bus)
{
FAR struct rx65n_rspidev_s *priv = NULL;
struct rx65n_rspidev_s *priv = NULL;
irqstate_t flags = enter_critical_section();
#ifdef CONFIG_RX65N_RSPI0
@ -2534,7 +2528,7 @@ FAR struct spi_dev_s *rx65n_rspibus_initialize(int bus)
}
leave_critical_section(flags);
return (FAR struct spi_dev_s *)priv;
return (struct spi_dev_s *)priv;
}
#endif /* CONFIG_RX65N_RSPI0 || CONFIG_RX65N_RSPI1 || CONFIG_RX65N_RSPI2 */

View File

@ -64,7 +64,7 @@ struct spi_dev_s;
*
****************************************************************************/
FAR struct spi_dev_s *rx65n_rspibus_initialize(int bus);
struct spi_dev_s *rx65n_rspibus_initialize(int bus);
/****************************************************************************
* Name: rx65n_rspi0/1/2 select and rx65n_rspi0/1/2 status
@ -98,24 +98,24 @@ FAR struct spi_dev_s *rx65n_rspibus_initialize(int bus);
*
****************************************************************************/
#ifdef CONFIG_RX65N_RSPI0
void rx65n_rspi0select(FAR struct spi_dev_s *dev, uint32_t devid,
bool selected);
uint8_t rx65n_rspi0status(FAR struct spi_dev_s *dev, uint32_t devid);
int rx65n_rspi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
void rx65n_rspi0select(struct spi_dev_s *dev, uint32_t devid,
bool selected);
uint8_t rx65n_rspi0status(struct spi_dev_s *dev, uint32_t devid);
int rx65n_rspi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
#endif
#ifdef CONFIG_RX65N_RSPI1
void rx65n_rspi1select(FAR struct spi_dev_s *dev, uint32_t devid,
bool selected);
uint8_t rx65n_rspi1status(FAR struct spi_dev_s *dev, uint32_t devid);
int rx65n_rspi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
void rx65n_rspi1select(struct spi_dev_s *dev, uint32_t devid,
bool selected);
uint8_t rx65n_rspi1status(struct spi_dev_s *dev, uint32_t devid);
int rx65n_rspi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
#endif
#ifdef CONFIG_RX65N_RSPI2
void rx65n_rspi2select(FAR struct spi_dev_s *dev, uint32_t devid,
bool selected);
uint8_t rx65n_rspi2status(FAR struct spi_dev_s *dev, uint32_t devid);
int rx65n_rspi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
void rx65n_rspi2select(struct spi_dev_s *dev, uint32_t devid,
bool selected);
uint8_t rx65n_rspi2status(struct spi_dev_s *dev, uint32_t devid);
int rx65n_rspi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
#endif
/****************************************************************************
@ -140,21 +140,18 @@ int rx65n_rspi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
#ifdef CONFIG_SPI_CALLBACK
#ifdef CONFIG_RX65N_RSPI0
int rx65n_rspi0register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg);
int rx65n_rspi0register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg);
#endif
#ifdef CONFIG_RX65N_RSPI1
int rx65n_rspi1register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg);
int rx65n_rspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg);
#endif
#ifdef CONFIG_RX65N_RSPI2
int rx65n_rspi2register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg);
int rx65n_rspi2register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg);
#endif
#endif

View File

@ -173,17 +173,17 @@ struct rx65n_rspidev_s
/* Helpers */
static inline uint32_t rspi_getreg32(FAR struct rx65n_rspidev_s *priv,
static inline uint32_t rspi_getreg32(struct rx65n_rspidev_s *priv,
uint8_t offset);
static inline uint16_t rspi_getreg16(FAR struct rx65n_rspidev_s *priv,
static inline uint16_t rspi_getreg16(struct rx65n_rspidev_s *priv,
uint8_t offset);
static inline uint8_t rspi_getreg8(FAR struct rx65n_rspidev_s *priv,
static inline uint8_t rspi_getreg8(struct rx65n_rspidev_s *priv,
uint8_t offset);
static inline void rspi_putreg32(FAR struct rx65n_rspidev_s *priv,
static inline void rspi_putreg32(struct rx65n_rspidev_s *priv,
uint8_t offset, uint32_t value);
static inline void rspi_putreg16(FAR struct rx65n_rspidev_s *priv,
static inline void rspi_putreg16(struct rx65n_rspidev_s *priv,
uint8_t offset, uint16_t value);
static inline void rspi_putreg8(FAR struct rx65n_rspidev_s *priv,
static inline void rspi_putreg8(struct rx65n_rspidev_s *priv,
uint8_t offset, uint8_t value);
/* SPI data transfer */
@ -199,47 +199,45 @@ static void rspi_rxuint8(struct rx65n_rspidev_s *priv);
static void rspi_performtx(struct rx65n_rspidev_s *priv);
static inline void rspi_performrx(struct rx65n_rspidev_s *priv);
static int rspi_transfer(struct rx65n_rspidev_s *priv, const void *txbuffer,
void *rxbuffer, unsigned int nwords);
void *rxbuffer, unsigned int nwords);
/* Interrupt handling */
#ifndef CONFIG_SPI_POLLWAIT
static inline struct rx65n_rspidev_s *rspi_mapirq(int irq);
static int rspi_idlinterrupt(int irq, void *context, FAR void *arg);
static int rspi_erinterrupt(int irq, void *context, FAR void *arg);
static int rspi_txinterrupt(int irq, void *context, FAR void *arg);
static int rspi_rxinterrupt(int irq, void *context, FAR void *arg);
static int rspi_idlinterrupt(int irq, void *context, void *arg);
static int rspi_erinterrupt(int irq, void *context, void *arg);
static int rspi_txinterrupt(int irq, void *context, void *arg);
static int rspi_rxinterrupt(int irq, void *context, void *arg);
#endif
/* SPI methods */
static int rspi_lock(FAR struct spi_dev_s *dev, bool lock);
static uint32_t rspi_setfrequency(FAR struct spi_dev_s *dev,
static int rspi_lock(struct spi_dev_s *dev, bool lock);
static uint32_t rspi_setfrequency(struct spi_dev_s *dev,
uint32_t frequency);
static void rspi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
static void rspi_setbits(FAR struct spi_dev_s *dev, int nbits);
static void rspi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode);
static void rspi_setbits(struct spi_dev_s *dev, int nbits);
#ifdef CONFIG_SPI_HWFEATURES
static int rspi_hwfeatures(FAR struct spi_dev_s *dev,
spi_hwfeatures_t features);
static int rspi_hwfeatures(struct spi_dev_s *dev,
spi_hwfeatures_t features);
#endif
static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd);
static void rspi_exchange(FAR struct spi_dev_s *dev,
FAR const void *txbuffer,
FAR void *rxbuffer, size_t nwords);
static uint32_t rspi_send(struct spi_dev_s *dev, uint32_t wd);
static void rspi_exchange(struct spi_dev_s *dev, const void *txbuffer,
void *rxbuffer, size_t nwords);
#ifdef CONFIG_SPI_TRIGGER
static int rspi_trigger(FAR struct spi_dev_s *dev);
static int rspi_trigger(struct spi_dev_s *dev);
#endif
#ifndef CONFIG_SPI_EXCHANGE
static void rspi_sndblock(FAR struct spi_dev_s *dev,
FAR const void *txbuffer,
size_t nwords);
static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer,
size_t nwords);
static void rspi_sndblock(struct spi_dev_s *dev, const void *txbuffer,
size_t nwords);
static void rspi_recvblock(struct spi_dev_s *dev, void *rxbuffer,
size_t nwords);
#endif
/* Initialization */
static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv);
static void rspi_bus_initialize(struct rx65n_rspidev_s *priv);
/****************************************************************************
* Private Data
@ -439,57 +437,57 @@ static struct rx65n_rspidev_s g_rspi2dev =
*
****************************************************************************/
#ifdef CONFIG_RX65N_RSPI0
void rx65n_rspi0select(FAR struct spi_dev_s *dev, uint32_t devid,
void rx65n_rspi0select(struct spi_dev_s *dev, uint32_t devid,
bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" :
"de-assert");
}
uint8_t rx65n_rspi0status(FAR struct spi_dev_s *dev, uint32_t devid)
uint8_t rx65n_rspi0status(struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
int rx65n_rspi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
int rx65n_rspi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{
return -ENODEV;
}
#endif
#ifdef CONFIG_RX65N_RSPI1
void rx65n_rspi1select(FAR struct spi_dev_s *dev, uint32_t devid,
void rx65n_rspi1select(struct spi_dev_s *dev, uint32_t devid,
bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" :
"de-assert");
}
uint8_t rx65n_rspi1status(FAR struct spi_dev_s *dev, uint32_t devid)
uint8_t rx65n_rspi1status(struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
int rx65n_rspi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
int rx65n_rspi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{
return -ENODEV;
}
#endif
#ifdef CONFIG_RX65N_RSPI2
void rx65n_rspi2select(FAR struct spi_dev_s *dev, uint32_t devid,
void rx65n_rspi2select(struct spi_dev_s *dev, uint32_t devid,
bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" :
"de-assert");
}
uint8_t rx65n_rspi2status(FAR struct spi_dev_s *dev, uint32_t devid)
uint8_t rx65n_rspi2status(struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
int rx65n_rspi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
int rx65n_rspi2cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{
return -ENODEV;
}
@ -516,9 +514,8 @@ int rx65n_rspi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
****************************************************************************/
#ifdef CONFIG_SPI_CALLBACK
#ifdef CONFIG_RX65N_RSPI0
int rx65n_rspi0register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg)
int rx65n_rspi0register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg)
{
spiinfo("INFO: Registering rspi0 device\n");
return OK;
@ -526,9 +523,8 @@ int rx65n_rspi0register(FAR struct spi_dev_s *dev,
#endif
#ifdef CONFIG_RX65N_RSPI1
int rx65n_rspi1register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg)
int rx65n_rspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg)
{
spiinfo("INFO: Registering rspi1 device\n");
return OK;
@ -536,9 +532,8 @@ int rx65n_rspi1register(FAR struct spi_dev_s *dev,
#endif
#ifdef CONFIG_RX65N_RSPI2
int rx65n_rspi2register(FAR struct spi_dev_s *dev,
spi_mediachange_t callback,
FAR void *arg)
int rx65n_rspi2register(struct spi_dev_s *dev, spi_mediachange_t callback,
void *arg)
{
spiinfo("INFO: Registering rspi2 device\n");
return OK;
@ -630,7 +625,7 @@ static inline uint8_t rspi_getreg8(struct rx65n_rspidev_s *priv,
****************************************************************************/
static inline void rspi_putreg32(struct rx65n_rspidev_s *priv,
uint8_t offset, uint32_t value)
uint8_t offset, uint32_t value)
{
putreg32(value, priv->rspibase + offset);
}
@ -652,7 +647,7 @@ static inline void rspi_putreg32(struct rx65n_rspidev_s *priv,
****************************************************************************/
static inline void rspi_putreg16(struct rx65n_rspidev_s *priv,
uint8_t offset, uint16_t value)
uint8_t offset, uint16_t value)
{
putreg16(value, priv->rspibase + offset);
}
@ -674,7 +669,7 @@ static inline void rspi_putreg16(struct rx65n_rspidev_s *priv,
****************************************************************************/
static inline void rspi_putreg8(struct rx65n_rspidev_s *priv,
uint8_t offset, uint8_t value)
uint8_t offset, uint8_t value)
{
putreg8(value, priv->rspibase + offset);
}
@ -912,7 +907,7 @@ static void rspi_startxfr(struct rx65n_rspidev_s *priv)
****************************************************************************/
static int rspi_transfer(struct rx65n_rspidev_s *priv, const void *txbuffer,
void *rxbuffer, unsigned int nwords)
void *rxbuffer, unsigned int nwords)
{
uint8_t regval8;
#ifndef CONFIG_SPI_POLLWAIT
@ -1178,7 +1173,7 @@ static void rspi_errhandle(struct rx65n_rspidev_s *priv, uint8_t bus)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_idlinterrupt(int irq, void *context, FAR void *arg)
static int rspi_idlinterrupt(int irq, void *context, void *arg)
{
uint8_t regval8;
@ -1221,7 +1216,7 @@ static int rspi_idlinterrupt(int irq, void *context, FAR void *arg)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_erinterrupt(int irq, void *context, FAR void *arg)
static int rspi_erinterrupt(int irq, void *context, void *arg)
{
struct rx65n_rspidev_s *priv = rspi_mapirq(irq);
@ -1264,7 +1259,7 @@ static int rspi_erinterrupt(int irq, void *context, FAR void *arg)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_rxinterrupt(int irq, void *context, FAR void *arg)
static int rspi_rxinterrupt(int irq, void *context, void *arg)
{
struct rx65n_rspidev_s *priv = rspi_mapirq(irq);
@ -1299,7 +1294,7 @@ static int rspi_rxinterrupt(int irq, void *context, FAR void *arg)
****************************************************************************/
#ifndef CONFIG_SPI_POLLWAIT
static int rspi_txinterrupt(int irq, void *context, FAR void *arg)
static int rspi_txinterrupt(int irq, void *context, void *arg)
{
struct rx65n_rspidev_s *priv = rspi_mapirq(irq);
@ -1334,7 +1329,7 @@ static int rspi_txinterrupt(int irq, void *context, FAR void *arg)
*
****************************************************************************/
static int rspi_lock(FAR struct spi_dev_s *dev, bool lock)
static int rspi_lock(struct spi_dev_s *dev, bool lock)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
int ret;
@ -1366,8 +1361,8 @@ static int rspi_lock(FAR struct spi_dev_s *dev, bool lock)
*
****************************************************************************/
static uint32_t rspi_setfrequency(FAR struct spi_dev_s *dev,
uint32_t frequency)
static uint32_t rspi_setfrequency(struct spi_dev_s *dev,
uint32_t frequency)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
uint32_t actual;
@ -1466,7 +1461,7 @@ static uint32_t rspi_setfrequency(FAR struct spi_dev_s *dev,
*
****************************************************************************/
static void rspi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
static void rspi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
@ -1529,7 +1524,7 @@ static void rspi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
*
****************************************************************************/
static void rspi_setbits(FAR struct spi_dev_s *dev, int nbits)
static void rspi_setbits(struct spi_dev_s *dev, int nbits)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
@ -1585,7 +1580,7 @@ static void rspi_setbits(FAR struct spi_dev_s *dev, int nbits)
*
****************************************************************************/
static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd)
static uint32_t rspi_send(struct spi_dev_s *dev, uint32_t wd)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
uint32_t response = 0;
@ -1616,9 +1611,8 @@ static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd)
****************************************************************************/
#ifdef CONFIG_SPI_EXCHANGE
static void rspi_exchange(FAR struct spi_dev_s *dev,
FAR const void *txbuffer,
FAR void *rxbuffer, size_t nwords)
static void rspi_exchange(struct spi_dev_s *dev, const void *txbuffer,
void *rxbuffer, size_t nwords)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
rspi_transfer(priv, txbuffer, rxbuffer, nwords);
@ -1646,8 +1640,8 @@ static void rspi_exchange(FAR struct spi_dev_s *dev,
****************************************************************************/
#ifndef CONFIG_SPI_EXCHANGE
static void rspi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
size_t nwords)
static void rspi_sndblock(struct spi_dev_s *dev, const void *buffer,
size_t nwords)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
rspi_transfer(priv, buffer, NULL, nwords);
@ -1675,8 +1669,8 @@ static void rspi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
****************************************************************************/
#ifndef CONFIG_SPI_EXCHANGE
static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
size_t nwords)
static void rspi_recvblock(struct spi_dev_s *dev, void *buffer,
size_t nwords)
{
struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev;
rspi_transfer(priv, NULL, buffer, nwords);
@ -1690,7 +1684,7 @@ static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
* Return Value : none
****************************************************************************/
void rspi_interrupt_init(FAR struct rx65n_rspidev_s *priv, uint8_t bus)
void rspi_interrupt_init(struct rx65n_rspidev_s *priv, uint8_t bus)
{
/* Enable error interrupt source bit */
@ -1844,7 +1838,7 @@ static void rspi_reg_protect(uint8_t enable)
*
****************************************************************************/
static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv)
static void rspi_bus_initialize(struct rx65n_rspidev_s *priv)
{
uint8_t regval8;
uint16_t regval16;
@ -1882,7 +1876,7 @@ static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv)
/* Select a default frequency of approx. 400KHz */
rspi_setfrequency((FAR struct spi_dev_s *)priv, 400000);
rspi_setfrequency((struct spi_dev_s *)priv, 400000);
/* Configure data control register SPDCR
* Four frames can be transmitted or received in one round of transmission
@ -2028,9 +2022,9 @@ static void rspi_bus_initialize(FAR struct rx65n_rspidev_s *priv)
*
****************************************************************************/
FAR struct spi_dev_s *rx65n_rspibus_initialize(int bus)
struct spi_dev_s *rx65n_rspibus_initialize(int bus)
{
FAR struct rx65n_rspidev_s *priv = NULL;
struct rx65n_rspidev_s *priv = NULL;
irqstate_t flags = enter_critical_section();
@ -2139,7 +2133,7 @@ FAR struct spi_dev_s *rx65n_rspibus_initialize(int bus)
}
leave_critical_section(flags);
return (FAR struct spi_dev_s *)priv;
return (struct spi_dev_s *)priv;
}
#endif /* CONFIG_RX65N_RSPI0 || CONFIG_RX65N_RSPI1 || CONFIG_RX65N_RSPI2 */

View File

@ -83,7 +83,7 @@ static int rtc_bcd2dec(uint32_t value);
struct alm_cbinfo_s
{
volatile alm_callback_t ac_cb; /* Client callback function */
volatile FAR void *ac_arg; /* Argument to pass with the callback function */
volatile void *ac_arg; /* Argument to pass with the callback function */
};
#endif
@ -93,7 +93,7 @@ struct alm_cbinfo_s
struct prd_cbinfo_s
{
volatile periodiccb_t prd_cb; /* Client callback function */
volatile FAR void *prd_arg; /* Argument to pass with the callback function */
volatile void *prd_arg; /* Argument to pass with the callback function */
};
#endif
@ -148,7 +148,7 @@ volatile bool g_rtc_enabled = false;
****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO
static void rtc_dumpregs(FAR const char *msg)
static void rtc_dumpregs(const char *msg)
{
rtcinfo("%s:\n", msg);
rtcinfo(" 64-Hz Counter: %08x\n", getreg8(RX65N_RTC_R64CNT));
@ -191,7 +191,7 @@ static void rtc_dumpregs(FAR const char *msg)
****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO
static void rtc_dumptime(FAR struct tm *tp, FAR const char *msg)
static void rtc_dumptime(struct tm *tp, const char *msg)
{
rtcinfo("%s:\n", msg);
rtcinfo(" tm_sec: %08x\n", tp->tm_sec);
@ -261,9 +261,9 @@ static int rtc_bcd2dec(uint32_t value)
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rtc_alm_interrupt(int irq, void *context, FAR void *arg)
static int rtc_alm_interrupt(int irq, void *context, void *arg)
{
FAR struct alm_cbinfo_s *cbinfo;
struct alm_cbinfo_s *cbinfo;
alm_callback_t cb;
uint8_t source = rx65n_getreg(RX65N_RTC_RCR1);
if ((source & RTC_ALARM_INT_ENABLE) != 0)
@ -272,7 +272,7 @@ static int rtc_alm_interrupt(int irq, void *context, FAR void *arg)
cbinfo = &g_alarmcb;
cb = cbinfo->ac_cb;
arg = (FAR void *)cbinfo->ac_arg;
arg = (void *)cbinfo->ac_arg;
cbinfo->ac_cb = NULL;
cbinfo->ac_arg = NULL;
cb(arg, 0);
@ -284,9 +284,9 @@ static int rtc_alm_interrupt(int irq, void *context, FAR void *arg)
#endif
#ifdef CONFIG_RTC_PERIODIC
static int rtc_periodic_interrupt(int irq, void *context, FAR void *arg)
static int rtc_periodic_interrupt(int irq, void *context, void *arg)
{
FAR struct prd_cbinfo_s *cbinfo;
struct prd_cbinfo_s *cbinfo;
periodiccb_t cb;
uint8_t source = rx65n_getreg(RX65N_RTC_RCR1);
if ((source & RTC_PERIOD_INT_ENABLE) != 0)
@ -295,7 +295,7 @@ static int rtc_periodic_interrupt(int irq, void *context, FAR void *arg)
cbinfo = &g_periodiccb;
cb = cbinfo->prd_cb;
arg = (FAR void *)cbinfo->prd_arg;
arg = (void *)cbinfo->prd_arg;
cb(arg, 0);
}
@ -304,7 +304,7 @@ static int rtc_periodic_interrupt(int irq, void *context, FAR void *arg)
#endif
#ifdef CONFIG_RX65N_CARRY
static int rtc_carry_interrupt(int irq, void *context, FAR void *arg)
static int rtc_carry_interrupt(int irq, void *context, void *arg)
{
uint8_t source = rx65n_getreg(RX65N_RTC_RCR1);
if ((source & RTC_CARRY_INT_ENABLE) != 0)
@ -457,7 +457,7 @@ int up_rtc_initialize(void)
****************************************************************************/
#if defined(CONFIG_RTC_HIRES)
int up_rtc_gettime(FAR struct timespec *tp)
int up_rtc_gettime(struct timespec *tp)
{
uint8_t weekcnt;
uint8_t daycnt;
@ -543,7 +543,7 @@ int up_rtc_gettime(FAR struct timespec *tp)
}
#endif
int rx65n_rtc_setdatetime(FAR const struct tm *tp)
int rx65n_rtc_setdatetime(const struct tm *tp)
{
int i;
volatile uint8_t dummy_byte;
@ -695,9 +695,9 @@ int rx65n_rtc_setdatetime(FAR const struct tm *tp)
*
****************************************************************************/
int up_rtc_settime(FAR const struct timespec *tp)
int up_rtc_settime(const struct timespec *tp)
{
FAR struct tm newtime;
struct tm newtime;
int i;
volatile uint8_t dummy_byte;
volatile uint16_t dummy_word;
@ -845,7 +845,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_rtc_getalarmdatetime(FAR struct tm *tp)
static int rx65n_rtc_getalarmdatetime(struct tm *tp)
{
uint8_t bcd_years;
DEBUGASSERT(tp != NULL);
@ -880,7 +880,7 @@ static int rx65n_rtc_getalarmdatetime(FAR struct tm *tp)
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
int rx65n_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo)
int rx65n_rtc_rdalarm(struct alm_rdalarm_s *alminfo)
{
int ret = -EINVAL;
DEBUGASSERT(alminfo != NULL);
@ -905,7 +905,7 @@ int rx65n_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo)
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
int rx65n_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
int rx65n_rtc_setalarm(struct alm_setalarm_s *alminfo)
{
irqstate_t flags;
uint8_t dummy_byte;
@ -1074,7 +1074,7 @@ int rx65n_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
#endif
#ifdef CONFIG_RTC_PERIODIC
int rx65n_rtc_setperiodic(FAR const struct timespec *period,
int rx65n_rtc_setperiodic(const struct timespec *period,
periodiccb_t callback)
{
irqstate_t flags;
@ -1249,7 +1249,7 @@ int rx65n_rtc_cancelcarry(void)
****************************************************************************/
#ifdef CONFIG_RTC_DATETIME
int up_rtc_getdatetime(FAR struct tm *tp)
int up_rtc_getdatetime(struct tm *tp)
{
uint8_t weekcnt;
uint8_t daycnt;

View File

@ -44,7 +44,7 @@
/* The form of an alarm callback */
typedef CODE void (*alm_callback_t)(FAR void *arg, unsigned int alarmid);
typedef void (*alm_callback_t)(void *arg, unsigned int alarmid);
/* Structure used to pass parameters to set an alarm */
@ -53,7 +53,7 @@ struct alm_setalarm_s
int as_id; /* enum alm_id_e */
struct tm as_time; /* Alarm expiration time */
alm_callback_t as_cb; /* Callback (if non-NULL) */
FAR void *as_arg; /* Argument for callback */
void *as_arg; /* Argument for callback */
};
/* Structure used to pass parameters to query an alarm */
@ -61,17 +61,17 @@ struct alm_setalarm_s
struct alm_rdalarm_s
{
int ar_id; /* enum alm_id_e */
FAR struct rtc_time *ar_time; /* Argument for storing ALARM RTC time */
struct rtc_time *ar_time; /* Argument for storing ALARM RTC time */
};
#endif /* CONFIG_RTC_ALARM */
#ifdef CONFIG_RTC_PERIODIC
typedef CODE int (*periodiccb_t)(FAR void *arg, unsigned int alarmid);
typedef int (*periodiccb_t)(void *arg, unsigned int alarmid);
#endif
#ifdef CONFIG_RX65N_CARRY
typedef void (*carrycb_t)(void);
typedef void (*carrycb_t)(void);
#endif
/****************************************************************************
@ -109,7 +109,7 @@ extern "C"
#ifdef CONFIG_RTC_DATETIME
struct tm;
int rx65n_rtc_setdatetime(FAR const struct tm *tp);
int rx65n_rtc_setdatetime(const struct tm *tp);
#endif
/****************************************************************************
@ -140,7 +140,7 @@ bool rx65n_rtc_havesettime(void);
*
****************************************************************************/
int rx65n_rtc_setalarm(FAR struct alm_setalarm_s *alminfo);
int rx65n_rtc_setalarm(struct alm_setalarm_s *alminfo);
/****************************************************************************
* Name: rx65n_rtc_rdalarm
@ -156,7 +156,7 @@ int rx65n_rtc_setalarm(FAR struct alm_setalarm_s *alminfo);
*
****************************************************************************/
int rx65n_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo);
int rx65n_rtc_rdalarm(struct alm_rdalarm_s *alminfo);
/****************************************************************************
* Name: rx65n_rtc_cancelalarm
@ -192,7 +192,7 @@ int rx65n_rtc_cancelalarm(void);
*
****************************************************************************/
int rx65n_rtc_setperiodic(FAR const struct timespec *period,
int rx65n_rtc_setperiodic(const struct timespec *period,
periodiccb_t callback);
/****************************************************************************
@ -235,7 +235,7 @@ int rx65n_rtc_cancelperiodic(void);
#ifdef CONFIG_RTC_DRIVER
struct rtc_lowerhalf_s;
FAR struct rtc_lowerhalf_s *rx65n_rtc_lowerhalf(void);
struct rtc_lowerhalf_s *rx65n_rtc_lowerhalf(void);
#endif
#undef EXTERN

View File

@ -59,7 +59,7 @@
struct rx65n_cbinfo_s
{
volatile rtc_alarm_callback_t cb; /* Callback when the alarm expires */
volatile FAR void *priv; /* Private argument to accompany callback */
volatile void *priv; /* Private argument to accompany callback */
uint8_t id; /* Identifies the alarm */
};
#endif
@ -74,7 +74,7 @@ struct rx65n_lowerhalf_s
* operations vtable (which may lie in FLASH or ROM)
*/
FAR const struct rtc_ops_s *ops;
const struct rtc_ops_s *ops;
/* Data following is private to this driver and not visible outside of
* this file.
@ -101,29 +101,27 @@ struct rx65n_lowerhalf_s
/* Prototypes for static methods in struct rtc_ops_s */
static int rx65n_rdtime(FAR struct rtc_lowerhalf_s *lower,
FAR struct rtc_time *rtctime);
static int rx65n_settime(FAR struct rtc_lowerhalf_s *lower,
FAR const struct rtc_time *rtctime);
static bool rx65n_havesettime(FAR struct rtc_lowerhalf_s *lower);
static int rx65n_rdtime(struct rtc_lowerhalf_s *lower,
struct rtc_time *rtctime);
static int rx65n_settime(struct rtc_lowerhalf_s *lower,
const struct rtc_time *rtctime);
static bool rx65n_havesettime(struct rtc_lowerhalf_s *lower);
#ifdef CONFIG_RTC_ALARM
static int rx65n_setalarm(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setalarm_s *alarminfo);
static int rx65n_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s
*alarminfo);
static int rx65n_cancelalarm(FAR struct rtc_lowerhalf_s *lower,
int alarmid);
static int rx65n_rdalarm(FAR struct rtc_lowerhalf_s *lower,
FAR struct lower_rdalarm_s *alarminfo);
static int rx65n_setalarm(struct rtc_lowerhalf_s *lower,
const struct lower_setalarm_s *alarminfo);
static int rx65n_setrelative(struct rtc_lowerhalf_s *lower,
const struct lower_setrelative_s *alarminfo);
static int rx65n_cancelalarm(struct rtc_lowerhalf_s *lower,
int alarmid);
static int rx65n_rdalarm(struct rtc_lowerhalf_s *lower,
struct lower_rdalarm_s *alarminfo);
#endif
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_setperiodic(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setperiodic_s
*alarminfo);
static int rx65n_cancelperiodic(FAR struct rtc_lowerhalf_s *lower, int id);
static int rx65n_setperiodic(struct rtc_lowerhalf_s *lower,
const struct lower_setperiodic_s *alarminfo);
static int rx65n_cancelperiodic(struct rtc_lowerhalf_s *lower, int id);
#endif
/****************************************************************************
@ -183,12 +181,12 @@ static struct rx65n_lowerhalf_s g_rtc_lowerhalf =
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static void rx65n_alarm_callback(FAR void *arg, unsigned int alarmid)
static void rx65n_alarm_callback(void *arg, unsigned int alarmid)
{
FAR struct rx65n_lowerhalf_s *lower;
FAR struct rx65n_cbinfo_s *cbinfo;
struct rx65n_lowerhalf_s *lower;
struct rx65n_cbinfo_s *cbinfo;
rtc_alarm_callback_t cb;
FAR void *priv;
void *priv;
DEBUGASSERT(arg != NULL);
@ -200,7 +198,7 @@ static void rx65n_alarm_callback(FAR void *arg, unsigned int alarmid)
*/
cb = (rtc_alarm_callback_t)cbinfo->cb;
priv = (FAR void *)cbinfo->priv;
priv = (void *)cbinfo->priv;
cbinfo->cb = NULL;
cbinfo->priv = NULL;
@ -230,8 +228,8 @@ static void rx65n_alarm_callback(FAR void *arg, unsigned int alarmid)
*
****************************************************************************/
static int rx65n_rdtime(FAR struct rtc_lowerhalf_s *lower,
FAR struct rtc_time *rtctime)
static int rx65n_rdtime(struct rtc_lowerhalf_s *lower,
struct rtc_time *rtctime)
{
#if defined(CONFIG_RTC_DATETIME)
/* This operation depends on the fact that struct rtc_time is cast
@ -239,10 +237,10 @@ static int rx65n_rdtime(FAR struct rtc_lowerhalf_s *lower,
*/
int ret;
return up_rtc_getdatetime((FAR struct tm *)rtctime);
return up_rtc_getdatetime((struct tm *)rtctime);
#elif defined(CONFIG_RTC_HIRES)
FAR struct timespec ts;
struct timespec ts;
int ret;
/* Get the higher resolution time */
@ -258,7 +256,7 @@ static int rx65n_rdtime(FAR struct rtc_lowerhalf_s *lower,
* compatible.
*/
if (!gmtime_r(&ts.tv_sec, (FAR struct tm *)rtctime))
if (!gmtime_r(&ts.tv_sec, (struct tm *)rtctime))
{
ret = -get_errno();
goto errout;
@ -288,15 +286,15 @@ errout:
*
****************************************************************************/
static int rx65n_settime(FAR struct rtc_lowerhalf_s *lower,
FAR const struct rtc_time *rtctime)
static int rx65n_settime(struct rtc_lowerhalf_s *lower,
const struct rtc_time *rtctime)
{
#ifdef CONFIG_RTC_DATETIME
/* This operation depends on the fact that struct rtc_time is cast
* compatible with struct tm.
*/
return rx65n_rtc_setdatetime((FAR const struct tm *)rtctime);
return rx65n_rtc_setdatetime((const struct tm *)rtctime);
#else
struct timespec ts;
@ -305,7 +303,7 @@ static int rx65n_settime(FAR struct rtc_lowerhalf_s *lower,
* rtc_time is cast compatible with struct tm.
*/
ts.tv_sec = timegm((FAR struct tm *)rtctime);
ts.tv_sec = timegm((struct tm *)rtctime);
ts.tv_nsec = 0;
/* Now set the time (to one second accuracy) */
@ -328,7 +326,7 @@ static int rx65n_settime(FAR struct rtc_lowerhalf_s *lower,
*
****************************************************************************/
static bool rx65n_havesettime(FAR struct rtc_lowerhalf_s *lower)
static bool rx65n_havesettime(struct rtc_lowerhalf_s *lower)
{
return true ;
}
@ -351,16 +349,16 @@ static bool rx65n_havesettime(FAR struct rtc_lowerhalf_s *lower)
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_setalarm(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setalarm_s *alarminfo)
static int rx65n_setalarm(struct rtc_lowerhalf_s *lower,
const struct lower_setalarm_s *alarminfo)
{
FAR struct rx65n_lowerhalf_s *priv;
FAR struct rx65n_cbinfo_s *cbinfo;
struct rx65n_lowerhalf_s *priv;
struct rx65n_cbinfo_s *cbinfo;
struct alm_setalarm_s lowerinfo;
int ret;
DEBUGASSERT(lower != NULL && alarminfo != NULL && alarminfo->id == 0);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
priv = (struct rx65n_lowerhalf_s *)lower;
ret = nxmutex_lock(&priv->devlock);
if (ret < 0)
@ -416,9 +414,8 @@ static int rx65n_setalarm(FAR struct rtc_lowerhalf_s *lower,
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s
*alarminfo)
static int rx65n_setrelative(struct rtc_lowerhalf_s *lower,
const struct lower_setrelative_s *alarminfo)
{
struct lower_setalarm_s setalarm;
struct tm time;
@ -468,7 +465,7 @@ static int rx65n_setrelative(FAR struct rtc_lowerhalf_s *lower,
/* And convert the time back to broken out format */
gmtime_r(&seconds, (FAR struct tm *)&setalarm.time);
gmtime_r(&seconds, (struct tm *)&setalarm.time);
/* The set the alarm using this absolute time */
@ -512,14 +509,14 @@ static int rx65n_setrelative(FAR struct rtc_lowerhalf_s *lower,
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
static int rx65n_cancelalarm(struct rtc_lowerhalf_s *lower, int alarmid)
{
FAR struct rx65n_lowerhalf_s *priv;
FAR struct rx65n_cbinfo_s *cbinfo;
struct rx65n_lowerhalf_s *priv;
struct rx65n_cbinfo_s *cbinfo;
DEBUGASSERT(lower != NULL);
DEBUGASSERT(alarmid == 0);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
priv = (struct rx65n_lowerhalf_s *)lower;
/* Nullify callback information to reduce window for race conditions */
@ -550,8 +547,8 @@ static int rx65n_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_rdalarm(FAR struct rtc_lowerhalf_s *lower,
FAR struct lower_rdalarm_s *alarminfo)
static int rx65n_rdalarm(struct rtc_lowerhalf_s *lower,
struct lower_rdalarm_s *alarminfo)
{
struct alm_rdalarm_s lowerinfo;
int ret = -EINVAL;
@ -596,16 +593,16 @@ static int rx65n_rdalarm(FAR struct rtc_lowerhalf_s *lower,
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_periodic_callback(void)
{
FAR struct rx65n_lowerhalf_s *lower;
struct rx65n_lowerhalf_s *lower;
struct lower_setperiodic_s *cbinfo;
periodiccb_t cb;
FAR void *priv;
void *priv;
lower = (FAR struct rx65n_lowerhalf_s *)&g_rtc_lowerhalf;
lower = (struct rx65n_lowerhalf_s *)&g_rtc_lowerhalf;
cbinfo = &lower->periodic;
cb = (periodiccb_t)cbinfo->cb;
priv = (FAR void *)cbinfo->priv;
priv = (void *)cbinfo->priv;
/* Perform the callback */
@ -637,15 +634,14 @@ static int rx65n_periodic_callback(void)
****************************************************************************/
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_setperiodic(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setperiodic_s
*alarminfo)
static int rx65n_setperiodic(struct rtc_lowerhalf_s *lower,
const struct lower_setperiodic_s *alarminfo)
{
FAR struct rx65n_lowerhalf_s *priv;
struct rx65n_lowerhalf_s *priv;
int ret;
DEBUGASSERT(lower != NULL && alarminfo != NULL);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
priv = (struct rx65n_lowerhalf_s *)lower;
ret = nxmutex_lock(&priv->devlock);
if (ret < 0)
@ -679,13 +675,13 @@ static int rx65n_setperiodic(FAR struct rtc_lowerhalf_s *lower,
****************************************************************************/
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_cancelperiodic(FAR struct rtc_lowerhalf_s *lower, int id)
static int rx65n_cancelperiodic(struct rtc_lowerhalf_s *lower, int id)
{
FAR struct rx65n_lowerhalf_s *priv;
struct rx65n_lowerhalf_s *priv;
int ret;
DEBUGASSERT(lower != NULL);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
priv = (struct rx65n_lowerhalf_s *)lower;
DEBUGASSERT(id == 0);
@ -728,9 +724,9 @@ static int rx65n_cancelperiodic(FAR struct rtc_lowerhalf_s *lower, int id)
*
****************************************************************************/
FAR struct rtc_lowerhalf_s *rx65n_rtc_lowerhalf(void)
struct rtc_lowerhalf_s *rx65n_rtc_lowerhalf(void)
{
return (FAR struct rtc_lowerhalf_s *)&g_rtc_lowerhalf;
return (struct rtc_lowerhalf_s *)&g_rtc_lowerhalf;
}
#endif /* CONFIG_RTC_DRIVER */

View File

@ -93,28 +93,26 @@ struct rx65n_sbram_s
{
mutex_t lock; /* For atomic accesses to this structure */
uint8_t refs; /* Number of references */
FAR struct sbramfh_s *bbf; /* File in bbram */
struct sbramfh_s *bbf; /* File in bbram */
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static int rx65n_sbram_open(FAR struct file *filep);
static int rx65n_sbram_close(FAR struct file *filep);
static off_t rx65n_sbram_seek(FAR struct file *filep, off_t offset,
int whence);
static ssize_t rx65n_sbram_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static ssize_t rx65n_sbram_write(FAR struct file *filep,
FAR const char *buffer, size_t len);
static int rx65n_sbram_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int rx65n_sbram_poll(FAR struct file *filep,
FAR struct pollfd *fds,
bool setup);
static int rx65n_sbram_open(struct file *filep);
static int rx65n_sbram_close(struct file *filep);
static off_t rx65n_sbram_seek(struct file *filep, off_t offset,
int whence);
static ssize_t rx65n_sbram_read(struct file *filep, char *buffer,
size_t len);
static ssize_t rx65n_sbram_write(struct file *filep, const char *buffer,
size_t len);
static int rx65n_sbram_ioctl(struct file *filep, int cmd, unsigned long arg);
static int rx65n_sbram_poll(struct file *filep, struct pollfd *fds,
bool setup);
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int rx65n_sbram_unlink(FAR struct inode *inode);
static int rx65n_sbram_unlink(struct inode *inode);
#endif
/****************************************************************************
@ -161,7 +159,7 @@ static void rx65n_sbram_rd(void)
****************************************************************************/
#if defined(CONFIG_SBRAM_DEBUG)
static void rx65n_sbram_dump(FAR struct sbramfh_s *bbf, char *op)
static void rx65n_sbram_dump(struct sbramfh_s *bbf, char *op)
{
SBRAM_DEBUG_READ();
_info("%s:\n", op);
@ -190,7 +188,7 @@ static void rx65n_sbram_dump(FAR struct sbramfh_s *bbf, char *op)
*
****************************************************************************/
static uint32_t rx65n_sbram_crc(FAR struct sbramfh_s *pf)
static uint32_t rx65n_sbram_crc(struct sbramfh_s *pf)
{
return crc32((uint8_t *)pf + SBRAM_CRCED_OFFSET,
SBRAM_CRCED_SIZE(pf->len));
@ -203,13 +201,13 @@ static uint32_t rx65n_sbram_crc(FAR struct sbramfh_s *pf)
*
****************************************************************************/
static int rx65n_sbram_open(FAR struct file *filep)
static int rx65n_sbram_open(struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
FAR struct rx65n_sbram_s *bbr;
struct inode *inode = filep->f_inode;
struct rx65n_sbram_s *bbr;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct rx65n_sbram_s *)inode->i_private;
bbr = (struct rx65n_sbram_s *)inode->i_private;
/* Increment the reference count */
@ -236,7 +234,7 @@ static int rx65n_sbram_open(FAR struct file *filep)
*
****************************************************************************/
static int rx65n_sbram_internal_close(FAR struct sbramfh_s *bbf)
static int rx65n_sbram_internal_close(struct sbramfh_s *bbf)
{
bbf->dirty = 0;
clock_gettime(CLOCK_REALTIME, &bbf->lastwrite);
@ -253,14 +251,14 @@ static int rx65n_sbram_internal_close(FAR struct sbramfh_s *bbf)
*
****************************************************************************/
static int rx65n_sbram_close(FAR struct file *filep)
static int rx65n_sbram_close(struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
FAR struct rx65n_sbram_s *bbr;
struct inode *inode = filep->f_inode;
struct rx65n_sbram_s *bbr;
int ret = OK;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct rx65n_sbram_s *)inode->i_private;
bbr = (struct rx65n_sbram_s *)inode->i_private;
nxmutex_lock(&bbr->lock);
@ -293,16 +291,16 @@ static int rx65n_sbram_close(FAR struct file *filep)
* Name: rx65n_sbram_seek
****************************************************************************/
static off_t rx65n_sbram_seek(FAR struct file *filep, off_t offset,
int whence)
static off_t rx65n_sbram_seek(struct file *filep, off_t offset,
int whence)
{
FAR struct inode *inode = filep->f_inode;
FAR struct rx65n_sbram_s *bbr;
struct inode *inode = filep->f_inode;
struct rx65n_sbram_s *bbr;
off_t newpos;
int ret;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct rx65n_sbram_s *)inode->i_private;
bbr = (struct rx65n_sbram_s *)inode->i_private;
nxmutex_lock(&bbr->lock);
@ -364,14 +362,14 @@ static off_t rx65n_sbram_seek(FAR struct file *filep, off_t offset,
* Name: rx65n_sbram_read
****************************************************************************/
static ssize_t rx65n_sbram_read(FAR struct file *filep, FAR char *buffer,
size_t len)
static ssize_t rx65n_sbram_read(struct file *filep, char *buffer,
size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct rx65n_sbram_s *bbr;
struct inode *inode = filep->f_inode;
struct rx65n_sbram_s *bbr;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct rx65n_sbram_s *)inode->i_private;
bbr = (struct rx65n_sbram_s *)inode->i_private;
nxmutex_lock(&bbr->lock);
@ -392,9 +390,9 @@ static ssize_t rx65n_sbram_read(FAR struct file *filep, FAR char *buffer,
* Name: rx65n_sbram_internal_write
****************************************************************************/
static ssize_t rx65n_sbram_internal_write(FAR struct sbramfh_s *bbf,
FAR const char *buffer,
off_t offset, size_t len)
static ssize_t rx65n_sbram_internal_write(struct sbramfh_s *bbf,
const char *buffer,
off_t offset, size_t len)
{
bbf->dirty = 1;
memcpy(&bbf->data[offset], buffer, len);
@ -405,16 +403,15 @@ static ssize_t rx65n_sbram_internal_write(FAR struct sbramfh_s *bbf,
* Name: rx65n_sbram_write
****************************************************************************/
static ssize_t rx65n_sbram_write(FAR struct file *filep,
FAR const char *buffer,
size_t len)
static ssize_t rx65n_sbram_write(struct file *filep, const char *buffer,
size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct rx65n_sbram_s *bbr;
struct inode *inode = filep->f_inode;
struct rx65n_sbram_s *bbr;
int ret = -EFBIG;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct rx65n_sbram_s *)inode->i_private;
bbr = (struct rx65n_sbram_s *)inode->i_private;
/* Forbid writes past the end of the device */
@ -445,8 +442,8 @@ static ssize_t rx65n_sbram_write(FAR struct file *filep,
* Name: rx65n_sbram_poll
****************************************************************************/
static int rx65n_sbram_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
static int rx65n_sbram_poll(struct file *filep, struct pollfd *fds,
bool setup)
{
if (setup)
{
@ -463,19 +460,18 @@ static int rx65n_sbram_poll(FAR struct file *filep, FAR struct pollfd *fds,
*
****************************************************************************/
static int rx65n_sbram_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
static int rx65n_sbram_ioctl(struct file *filep, int cmd, unsigned long arg)
{
FAR struct inode *inode = filep->f_inode;
FAR struct rx65n_sbram_s *bbr;
struct inode *inode = filep->f_inode;
struct rx65n_sbram_s *bbr;
int ret = -ENOTTY;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct rx65n_sbram_s *)inode->i_private;
bbr = (struct rx65n_sbram_s *)inode->i_private;
if (cmd == RX65N_SBRAM_GETDESC_IOCTL)
{
FAR struct sbramd_s *bbrr = (FAR struct sbramd_s *)((uintptr_t)arg);
struct sbramd_s *bbrr = (struct sbramd_s *)((uintptr_t)arg);
nxmutex_lock(&bbr->lock);
if (!bbrr)
@ -513,12 +509,12 @@ static int rx65n_sbram_ioctl(FAR struct file *filep, int cmd,
****************************************************************************/
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int rx65n_sbram_unlink(FAR struct inode *inode)
static int rx65n_sbram_unlink(struct inode *inode)
{
FAR struct rx65n_sbram_s *bbr;
struct rx65n_sbram_s *bbr;
DEBUGASSERT(inode && inode->i_private);
bbr = (FAR struct rx65n_sbram_s *)inode->i_private;
bbr = (struct rx65n_sbram_s *)inode->i_private;
nxmutex_lock(&bbr->lock);
memset(bbr->bbf->data, 0, bbr->bbf->len);
@ -691,7 +687,7 @@ int rx65n_sbraminitialize(char *devpath, int *sizes)
#if defined(CONFIG_RX65N_SAVE_CRASHDUMP)
int rx65n_sbram_savepanic(int fileno, uint8_t *context, int length)
{
FAR struct sbramfh_s *bbf;
struct sbramfh_s *bbf;
int fill;
int ret = -ENOSPC;
@ -737,7 +733,7 @@ int rx65n_sbram_savepanic(int fileno, uint8_t *context, int length)
/* Fill with 0 if data is less then file size */
fill = (int) bbf->len - length;
fill = (int)bbf->len - length;
if (fill > 0)
{

View File

@ -281,10 +281,10 @@ static void up_shutdown(struct uart_dev_s *dev);
static int up_attach(struct uart_dev_s *dev);
static void up_detach(struct uart_dev_s *dev);
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
static int up_xmtinterrupt(int irq, void *context, FAR void *arg);
static int up_rcvinterrupt(int irq, void *context, FAR void *arg);
static int up_eriinterrupt(int irq, void *context, FAR void *arg);
static int up_teiinterrupt(int irq, void *context, FAR void *arg);
static int up_xmtinterrupt(int irq, void *context, void *arg);
static int up_rcvinterrupt(int irq, void *context, void *arg);
static int up_eriinterrupt(int irq, void *context, void *arg);
static int up_teiinterrupt(int irq, void *context, void *arg);
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
static void up_rxint(struct uart_dev_s *dev, bool enable);
static bool up_rxavailable(struct uart_dev_s *dev);
@ -1268,7 +1268,7 @@ static int up_rcvinterrupt(int irq, void *context, void *arg)
*
****************************************************************************/
static int up_xmtinterrupt(int irq, void *context, FAR void *arg)
static int up_xmtinterrupt(int irq, void *context, void *arg)
{
struct uart_dev_s *dev;
dev = (struct uart_dev_s *)arg;

File diff suppressed because it is too large Load Diff

View File

@ -301,7 +301,7 @@ static inline uint16_t rx65n_usbhost_getle16(const uint8_t *val);
/* OHCI memory pool helper functions ****************************************/
static inline void rx65n_usbhost_edfree(struct rx65n_usbhost_ed_s *ed);
static struct rx65n_usbhost_gtd_s *rx65n_usbhost_tdalloc(uint8_t epnum);
static struct rx65n_usbhost_gtd_s *rx65n_usbhost_tdalloc(uint8_t epnum);
static void rx65n_usbhost_tdfree(struct rx65n_usbhost_gtd_s *buffer);
static uint8_t *rx65n_usbhost_tballoc(void);
static void rx65n_usbhost_tbfree(uint8_t *buffer);
@ -316,9 +316,9 @@ static void rx65n_usbhost_free_xfrinfo
/* ED list helper functions *************************************************/
static inline int rx65n_usbhost_addctrled(struct rx65n_usbhost_s *priv,
struct rx65n_usbhost_ed_s *ed);
struct rx65n_usbhost_ed_s *ed);
static inline int rx65n_usbhost_remctrled(struct rx65n_usbhost_s *priv,
struct rx65n_usbhost_ed_s *ed);
struct rx65n_usbhost_ed_s *ed);
static inline int rx65n_usbhost_addbulked(struct rx65n_usbhost_s *priv,
const struct usbhost_epdesc_s
@ -326,12 +326,12 @@ static inline int rx65n_usbhost_addbulked(struct rx65n_usbhost_s *priv,
*ed);
static inline int rx65n_usbhost_rembulked(struct rx65n_usbhost_s *priv,
struct rx65n_usbhost_ed_s *ed);
struct rx65n_usbhost_ed_s *ed);
#if !defined(CONFIG_USBHOST_INT_DISABLE) || !defined(CONFIG_USBHOST_ISOC_DISABLE)
static unsigned int rx65n_usbhost_getinterval(uint8_t interval);
static void rx65n_usbhost_setinttab(uint32_t value, unsigned int interval,
unsigned int offset);
unsigned int offset);
#endif
static inline int rx65n_usbhost_addinted(struct rx65n_usbhost_s *priv,
@ -358,71 +358,74 @@ static int rx65n_usbhost_ctrltd(struct rx65n_usbhost_s *priv,
/* Interrupt handling *******************************************************/
static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg);
static int rx65n_usbhost_usbinterrupt(int irq, void *context, void *arg);
/* USB host controller operations *******************************************/
static int rx65n_usbhost_wait(struct usbhost_connection_s *conn,
struct usbhost_hubport_s **hport);
struct usbhost_hubport_s **hport);
static int rx65n_usbhost_rh_enumerate(struct usbhost_connection_s *conn,
struct usbhost_hubport_s *hport);
struct usbhost_hubport_s *hport);
static int rx65n_usbhost_enumerate(struct usbhost_connection_s *conn,
struct usbhost_hubport_s *hport);
struct usbhost_hubport_s *hport);
static int rx65n_usbhost_ep0configure(struct usbhost_driver_s *drvr,
usbhost_ep_t ep0, uint8_t funcaddr, uint8_t speed,
uint16_t maxpacketsize);
usbhost_ep_t ep0, uint8_t funcaddr,
uint8_t speed, uint16_t maxpacketsize);
static int rx65n_usbhost_epalloc(struct usbhost_driver_s *drvr,
const struct usbhost_epdesc_s *epdesc,
usbhost_ep_t *ep);
const struct usbhost_epdesc_s *epdesc,
usbhost_ep_t *ep);
static int rx65n_usbhost_epfree(struct usbhost_driver_s *drvr,
usbhost_ep_t ep);
usbhost_ep_t ep);
static int rx65n_usbhost_alloc(struct usbhost_driver_s *drvr,
uint8_t **buffer, size_t *maxlen);
uint8_t **buffer, size_t *maxlen);
static int rx65n_usbhost_free(struct usbhost_driver_s *drvr,
uint8_t *buffer);
uint8_t *buffer);
static int rx65n_usbhost_ioalloc(struct usbhost_driver_s *drvr,
uint8_t **buffer, size_t buflen);
uint8_t **buffer, size_t buflen);
static int rx65n_usbhost_iofree(struct usbhost_driver_s *drvr,
uint8_t *buffer);
uint8_t *buffer);
static int rx65n_usbhost_ctrlin(struct usbhost_driver_s *drvr,
usbhost_ep_t ep0,
const struct usb_ctrlreq_s *req,
uint8_t *buffer);
usbhost_ep_t ep0,
const struct usb_ctrlreq_s *req,
uint8_t *buffer);
static int rx65n_usbhost_ctrlout(struct usbhost_driver_s *drvr,
usbhost_ep_t ep0,
const struct usb_ctrlreq_s *req,
const uint8_t *buffer);
usbhost_ep_t ep0,
const struct usb_ctrlreq_s *req,
const uint8_t *buffer);
static int rx65n_usbhost_transfer_common(struct rx65n_usbhost_s *priv,
struct rx65n_usbhost_ed_s *ed, uint8_t *buffer,
size_t buflen);
struct rx65n_usbhost_ed_s *ed,
uint8_t *buffer, size_t buflen);
#if RX65N_USBHOST_IOBUFFERS > 0
static int rx65n_usbhost_dma_alloc(struct rx65n_usbhost_s *priv,
struct rx65n_usbhost_ed_s *ed, uint8_t *userbuffer,
size_t buflen, uint8_t **alloc);
struct rx65n_usbhost_ed_s *ed,
uint8_t *userbuffer,
size_t buflen, uint8_t **alloc);
static void rx65n_usbhost_dma_free(struct rx65n_usbhost_s *priv,
struct rx65n_usbhost_ed_s *ed, uint8_t *userbuffer,
size_t buflen, uint8_t *alloc);
struct rx65n_usbhost_ed_s *ed,
uint8_t *userbuffer,
size_t buflen, uint8_t *alloc);
#endif
static ssize_t rx65n_usbhost_transfer(struct usbhost_driver_s *drvr,
usbhost_ep_t ep,
uint8_t *buffer, size_t buflen);
usbhost_ep_t ep,
uint8_t *buffer, size_t buflen);
#ifdef CONFIG_USBHOST_ASYNCH
static void rx65n_usbhost_asynch_completion(struct rx65n_usbhost_s *priv,
struct rx65n_usbhost_ed_s *ed);
static int rx65n_usbhost_asynch(FAR struct usbhost_driver_s *drvr,
usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen,
usbhost_asynch_t callback, FAR void *arg);
struct rx65n_usbhost_ed_s *ed);
static int rx65n_usbhost_asynch(struct usbhost_driver_s *drvr,
usbhost_ep_t ep, uint8_t *buffer,
size_t buflen, usbhost_asynch_t callback,
void *arg);
#endif
static int rx65n_usbhost_cancel(FAR struct usbhost_driver_s *drvr,
usbhost_ep_t ep);
static int rx65n_usbhost_cancel(struct usbhost_driver_s *drvr,
usbhost_ep_t ep);
#ifdef CONFIG_USBHOST_HUB
static int rx65n_usbhost_connect(FAR struct usbhost_driver_s *drvr,
FAR struct usbhost_hubport_s *hport,
bool connected);
static int rx65n_usbhost_connect(struct usbhost_driver_s *drvr,
struct usbhost_hubport_s *hport,
bool connected);
#endif
static void rx65n_usbhost_disconnect(struct usbhost_driver_s *drvr,
struct usbhost_hubport_s *hport);
struct usbhost_hubport_s *hport);
/* Initialization ***********************************************************/
@ -5937,7 +5940,7 @@ errout_with_xfrinfo:
*
****************************************************************************/
static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg)
static int rx65n_usbhost_usbinterrupt(int irq, void *context, void *arg)
{
uint16_t intenb0;
uint16_t intenb1;
@ -6476,8 +6479,8 @@ static int rx65n_usbhost_rh_enumerate(struct usbhost_connection_s *conn,
*
****************************************************************************/
static int rx65n_usbhost_enumerate(FAR struct usbhost_connection_s *conn,
FAR struct usbhost_hubport_s *hport)
static int rx65n_usbhost_enumerate(struct usbhost_connection_s *conn,
struct usbhost_hubport_s *hport)
{
int ret;
@ -6969,13 +6972,13 @@ static int rx65n_usbhost_free(struct usbhost_driver_s *drvr, uint8_t *buffer)
static int rx65n_usbhost_ioalloc(struct usbhost_driver_s *drvr,
uint8_t **buffer, size_t buflen)
{
FAR uint8_t *alloc;
uint8_t *alloc;
DEBUGASSERT(drvr && buffer && buflen > 0);
/* There is no special memory requirement */
alloc = (FAR uint8_t *)kmm_malloc(buflen);
alloc = (uint8_t *)kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;
@ -7854,7 +7857,7 @@ errout_with_lock:
*
****************************************************************************/
static int rx65n_usbhost_cancel(FAR struct usbhost_driver_s *drvr,
static int rx65n_usbhost_cancel(struct usbhost_driver_s *drvr,
usbhost_ep_t ep)
{
#ifdef CONFIG_USBHOST_ASYNCH
@ -7975,8 +7978,8 @@ static int rx65n_usbhost_cancel(FAR struct usbhost_driver_s *drvr,
****************************************************************************/
#ifdef CONFIG_USBHOST_HUB
static int rx65n_usbhost_connect(FAR struct usbhost_driver_s *drvr,
FAR struct usbhost_hubport_s *hport,
static int rx65n_usbhost_connect(struct usbhost_driver_s *drvr,
struct usbhost_hubport_s *hport,
bool connected)
{
struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr;

View File

@ -235,7 +235,7 @@ extern "C"
#ifdef CONFIG_USBHOST
struct usbhost_connection_s;
FAR struct usbhost_connection_s *rx65n_usbhost_initialize(int controller);
struct usbhost_connection_s *rx65n_usbhost_initialize(int controller);
#endif
#undef EXTERN

View File

@ -112,7 +112,7 @@ static inline void sh1_registerdump(void)
void renesas_dumpstate(void)
{
FAR struct tcb_s *rtcb = running_task();
struct tcb_s *rtcb = running_task();
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;

View File

@ -141,7 +141,7 @@ static int up_setup(struct uart_dev_s *dev);
static void up_shutdown(struct uart_dev_s *dev);
static int up_attach(struct uart_dev_s *dev);
static void up_detach(struct uart_dev_s *dev);
static int up_interrupt(int irq, void *context, FAR void *arg);
static int up_interrupt(int irq, void *context, void *arg);
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
static void up_rxint(struct uart_dev_s *dev, bool enable);
static bool up_rxavailable(struct uart_dev_s *dev);
@ -556,7 +556,7 @@ static void up_detach(struct uart_dev_s *dev)
*
****************************************************************************/
static int up_interrupt(int irq, void *context, FAR void *arg)
static int up_interrupt(int irq, void *context, void *arg)
{
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
struct up_dev_s *priv;