arch/arm: Remove FAR and CODE from board folder(2)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-04-17 14:01:48 +08:00
committed by Petro Karashchenko
parent cd001725b7
commit a3c9b413d8
292 changed files with 1471 additions and 1471 deletions
+8 -8
View File
@@ -99,11 +99,11 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static void spi_select(FAR struct spi_bitbang_s *priv, uint32_t devid, static void spi_select(struct spi_bitbang_s *priv, uint32_t devid,
bool selected); bool selected);
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, uint32_t devid); static uint8_t spi_status(struct spi_bitbang_s *priv, uint32_t devid);
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid, static int spi_cmddata(struct spi_bitbang_s *priv, uint32_t devid,
bool cmd); bool cmd);
#endif #endif
@@ -127,7 +127,7 @@ static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid,
* *
****************************************************************************/ ****************************************************************************/
static void spi_select(FAR struct spi_bitbang_s *priv, uint32_t devid, static void spi_select(struct spi_bitbang_s *priv, uint32_t devid,
bool selected) bool selected)
{ {
if (devid == SPIDEV_MMCSD(0)) if (devid == SPIDEV_MMCSD(0))
@@ -158,7 +158,7 @@ static void spi_select(FAR struct spi_bitbang_s *priv, uint32_t devid,
* *
****************************************************************************/ ****************************************************************************/
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, uint32_t devid) static uint8_t spi_status(struct spi_bitbang_s *priv, uint32_t devid)
{ {
if (devid == SPIDEV_MMCSD(0)) if (devid == SPIDEV_MMCSD(0))
{ {
@@ -185,7 +185,7 @@ static uint8_t spi_status(FAR struct spi_bitbang_s *priv, uint32_t devid)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid, static int spi_cmddata(struct spi_bitbang_s *priv, uint32_t devid,
bool cmd) bool cmd)
{ {
return OK; return OK;
@@ -206,7 +206,7 @@ static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid,
* *
****************************************************************************/ ****************************************************************************/
static FAR struct spi_dev_s *sam_mmcsd_spiinitialize(void) static struct spi_dev_s *sam_mmcsd_spiinitialize(void)
{ {
/* Initialize GPIOs */ /* Initialize GPIOs */
@@ -234,7 +234,7 @@ static FAR struct spi_dev_s *sam_mmcsd_spiinitialize(void)
int sam_sdinitialize(int minor) int sam_sdinitialize(int minor)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
int ret; int ret;
/* Get the SPI driver instance for the SD chip select */ /* Get the SPI driver instance for the SD chip select */
@@ -112,11 +112,11 @@
/* Lower-half SPI */ /* Lower-half SPI */
static void spi_select(FAR struct spi_bitbang_s *priv, uint32_t devid, static void spi_select(struct spi_bitbang_s *priv, uint32_t devid,
bool selected); bool selected);
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, uint32_t devid); static uint8_t spi_status(struct spi_bitbang_s *priv, uint32_t devid);
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid, static int spi_cmddata(struct spi_bitbang_s *priv, uint32_t devid,
bool cmd); bool cmd);
#endif #endif
@@ -132,11 +132,11 @@ static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid,
* pendown - Return the state of the pen down GPIO input * pendown - Return the state of the pen down GPIO input
*/ */
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr); static int tsc_attach(struct ads7843e_config_s *state, xcpt_t isr);
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable); static void tsc_enable(struct ads7843e_config_s *state, bool enable);
static void tsc_clear(FAR struct ads7843e_config_s *state); static void tsc_clear(struct ads7843e_config_s *state);
static bool tsc_busy(FAR struct ads7843e_config_s *state); static bool tsc_busy(struct ads7843e_config_s *state);
static bool tsc_pendown(FAR struct ads7843e_config_s *state); static bool tsc_pendown(struct ads7843e_config_s *state);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -183,7 +183,7 @@ static struct ads7843e_config_s g_tscinfo =
* *
****************************************************************************/ ****************************************************************************/
static void spi_select(FAR struct spi_bitbang_s *priv, uint32_t devid, static void spi_select(struct spi_bitbang_s *priv, uint32_t devid,
bool selected) bool selected)
{ {
/* The touchscreen controller is always selected */ /* The touchscreen controller is always selected */
@@ -204,7 +204,7 @@ static void spi_select(FAR struct spi_bitbang_s *priv, uint32_t devid,
* *
****************************************************************************/ ****************************************************************************/
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, uint32_t devid) static uint8_t spi_status(struct spi_bitbang_s *priv, uint32_t devid)
{ {
return 0; return 0;
} }
@@ -226,7 +226,7 @@ static uint8_t spi_status(FAR struct spi_bitbang_s *priv, uint32_t devid)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid, static int spi_cmddata(struct spi_bitbang_s *priv, uint32_t devid,
bool cmd) bool cmd)
{ {
return OK; return OK;
@@ -247,7 +247,7 @@ static int spi_cmddata(FAR struct spi_bitbang_s *priv, uint32_t devid,
* *
****************************************************************************/ ****************************************************************************/
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr) static int tsc_attach(struct ads7843e_config_s *state, xcpt_t isr)
{ {
/* Attach the XPT2046 interrupt */ /* Attach the XPT2046 interrupt */
@@ -255,7 +255,7 @@ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr)
return irq_attach(SAM_TSC_IRQ, isr, NULL); return irq_attach(SAM_TSC_IRQ, isr, NULL);
} }
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) static void tsc_enable(struct ads7843e_config_s *state, bool enable)
{ {
/* Attach and enable, or detach and disable */ /* Attach and enable, or detach and disable */
@@ -270,17 +270,17 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
} }
} }
static void tsc_clear(FAR struct ads7843e_config_s *state) static void tsc_clear(struct ads7843e_config_s *state)
{ {
/* Does nothing */ /* Does nothing */
} }
static bool tsc_busy(FAR struct ads7843e_config_s *state) static bool tsc_busy(struct ads7843e_config_s *state)
{ {
return false; /* The BUSY signal is not connected */ return false; /* The BUSY signal is not connected */
} }
static bool tsc_pendown(FAR struct ads7843e_config_s *state) static bool tsc_pendown(struct ads7843e_config_s *state)
{ {
/* The /PENIRQ value is active low */ /* The /PENIRQ value is active low */
@@ -303,7 +303,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
* *
****************************************************************************/ ****************************************************************************/
static FAR struct spi_dev_s *sam_tsc_spiinitialize(void) static struct spi_dev_s *sam_tsc_spiinitialize(void)
{ {
/* Configure the SPI bit-bang pins */ /* Configure the SPI bit-bang pins */
@@ -339,7 +339,7 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
int sam_tsc_setup(int minor) int sam_tsc_setup(int minor)
{ {
FAR struct spi_dev_s *dev; struct spi_dev_s *dev;
int ret; int ret;
iinfo("minor %d\n", minor); iinfo("minor %d\n", minor);
@@ -258,7 +258,7 @@ int sam_bringup(void);
#ifdef HAVE_SSD1306 #ifdef HAVE_SSD1306
struct lcd_dev_s; /* Forward reference */ struct lcd_dev_s; /* Forward reference */
FAR struct lcd_dev_s *sam_graphics_setup(unsigned int devno); struct lcd_dev_s *sam_graphics_setup(unsigned int devno);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
@@ -154,7 +154,7 @@ void sam_spi0select(uint32_t devid, bool selected)
* *
****************************************************************************/ ****************************************************************************/
uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi0status(struct spi_dev_s *dev, uint32_t devid)
{ {
spiinfo("Returning nothing\n"); spiinfo("Returning nothing\n");
return 0; return 0;
@@ -185,7 +185,7 @@ uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
int sam_spi0cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) int sam_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{ {
spiinfo("devid: %08x %s\n", (unsigned int)devid, cmd ? "cmd" : "data"); spiinfo("devid: %08x %s\n", (unsigned int)devid, cmd ? "cmd" : "data");
@@ -84,10 +84,10 @@
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *sam_graphics_setup(unsigned int devno) struct lcd_dev_s *sam_graphics_setup(unsigned int devno)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
FAR struct lcd_dev_s *dev; struct lcd_dev_s *dev;
/* Configure the OLED GPIOs. This initial configuration is RESET low, /* Configure the OLED GPIOs. This initial configuration is RESET low,
* putting the OLED into reset state. * putting the OLED into reset state.
@@ -151,7 +151,7 @@ FAR struct lcd_dev_s *sam_graphics_setup(unsigned int devno)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NXSTART_EXTERNINIT #ifdef CONFIG_NXSTART_EXTERNINIT
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) struct lcd_dev_s *board_graphics_setup(unsigned int devno)
{ {
return sam_graphics_setup(devno); return sam_graphics_setup(devno);
} }
+1 -1
View File
@@ -116,7 +116,7 @@ int board_app_initialize(uintptr_t arg)
int ret; int ret;
#ifdef NSH_HAVE_MMCSD #ifdef NSH_HAVE_MMCSD
FAR struct sdio_dev_s *sdio; struct sdio_dev_s *sdio;
/* Mount the SDIO-based MMC/SD block driver */ /* Mount the SDIO-based MMC/SD block driver */
+1 -1
View File
@@ -148,7 +148,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
if (id == BUTTON1) if (id == BUTTON1)
{ {
+13 -13
View File
@@ -314,18 +314,18 @@ static void sam_dumpreg(uint8_t startreg, uint8_t endreg);
/* LCD Data Transfer Methods */ /* LCD Data Transfer Methods */
static int sam_putrun(fb_coord_t row, fb_coord_t col, static int sam_putrun(fb_coord_t row, fb_coord_t col,
FAR const uint8_t *buffer, const uint8_t *buffer,
size_t npixels); size_t npixels);
static int sam_getrun(fb_coord_t row, fb_coord_t col, static int sam_getrun(fb_coord_t row, fb_coord_t col,
FAR uint8_t *buffer, uint8_t *buffer,
size_t npixels); size_t npixels);
/* LCD Configuration */ /* LCD Configuration */
static int sam_getvideoinfo(FAR struct lcd_dev_s *dev, static int sam_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo); struct fb_videoinfo_s *vinfo);
static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int sam_getplaneinfo(struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo); struct lcd_planeinfo_s *pinfo);
/* LCD RGB Mapping */ /* LCD RGB Mapping */
@@ -592,7 +592,7 @@ static void sam_dumpreg(uint8_t startreg, uint8_t endreg)
****************************************************************************/ ****************************************************************************/
static int sam_putrun(fb_coord_t row, fb_coord_t col, static int sam_putrun(fb_coord_t row, fb_coord_t col,
FAR const uint8_t *buffer, const uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
uint16_t *run = (uint16_t *)buffer; uint16_t *run = (uint16_t *)buffer;
@@ -662,7 +662,7 @@ static int sam_putrun(fb_coord_t row, fb_coord_t col,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, static int sam_getrun(fb_coord_t row, fb_coord_t col, uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
uint16_t *run = (uint16_t *)buffer; uint16_t *run = (uint16_t *)buffer;
@@ -721,8 +721,8 @@ static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getvideoinfo(FAR struct lcd_dev_s *dev, static int sam_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo) struct fb_videoinfo_s *vinfo)
{ {
DEBUGASSERT(dev && vinfo); DEBUGASSERT(dev && vinfo);
lcdinfo("fmt: %d xres: %d yres: %d nplanes: %d\n", lcdinfo("fmt: %d xres: %d yres: %d nplanes: %d\n",
@@ -740,8 +740,8 @@ static int sam_getvideoinfo(FAR struct lcd_dev_s *dev,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int sam_getplaneinfo(struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo) struct lcd_planeinfo_s *pinfo)
{ {
DEBUGASSERT(dev && pinfo && planeno == 0); DEBUGASSERT(dev && pinfo && planeno == 0);
lcdinfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp); lcdinfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp);
@@ -1060,7 +1060,7 @@ int board_lcd_initialize(void)
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) struct lcd_dev_s *board_lcd_getdev(int lcddev)
{ {
lcdinfo("lcddev: %d\n", lcddev); lcdinfo("lcddev: %d\n", lcddev);
return lcddev == 0 ? &g_lcddev_s.dev : NULL; return lcddev == 0 ? &g_lcddev_s.dev : NULL;
+1 -1
View File
@@ -156,7 +156,7 @@ void sam_spi0select(uint32_t devid, bool selected)
* *
****************************************************************************/ ****************************************************************************/
uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi0status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
+11 -11
View File
@@ -91,11 +91,11 @@
* pendown - Return the state of the pen down GPIO input * pendown - Return the state of the pen down GPIO input
*/ */
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr); static int tsc_attach(struct ads7843e_config_s *state, xcpt_t isr);
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable); static void tsc_enable(struct ads7843e_config_s *state, bool enable);
static void tsc_clear(FAR struct ads7843e_config_s *state); static void tsc_clear(struct ads7843e_config_s *state);
static bool tsc_busy(FAR struct ads7843e_config_s *state); static bool tsc_busy(struct ads7843e_config_s *state);
static bool tsc_pendown(FAR struct ads7843e_config_s *state); static bool tsc_pendown(struct ads7843e_config_s *state);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -138,7 +138,7 @@ static struct ads7843e_config_s g_tscinfo =
* pendown - Return the state of the pen down GPIO input * pendown - Return the state of the pen down GPIO input
*/ */
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr) static int tsc_attach(struct ads7843e_config_s *state, xcpt_t isr)
{ {
/* Attach the ADS7843E interrupt */ /* Attach the ADS7843E interrupt */
@@ -146,7 +146,7 @@ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr)
return irq_attach(SAM_TCS_IRQ, isr, NULL); return irq_attach(SAM_TCS_IRQ, isr, NULL);
} }
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) static void tsc_enable(struct ads7843e_config_s *state, bool enable)
{ {
/* Attach and enable, or detach and disable */ /* Attach and enable, or detach and disable */
@@ -161,12 +161,12 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
} }
} }
static void tsc_clear(FAR struct ads7843e_config_s *state) static void tsc_clear(struct ads7843e_config_s *state)
{ {
/* Does nothing */ /* Does nothing */
} }
static bool tsc_busy(FAR struct ads7843e_config_s *state) static bool tsc_busy(struct ads7843e_config_s *state)
{ {
#if defined(CONFIG_DEBUG_INPUT) && defined(CONFIG_DEBUG_INFO) #if defined(CONFIG_DEBUG_INPUT) && defined(CONFIG_DEBUG_INFO)
static bool last = (bool)-1; static bool last = (bool)-1;
@@ -188,7 +188,7 @@ static bool tsc_busy(FAR struct ads7843e_config_s *state)
return busy; return busy;
} }
static bool tsc_pendown(FAR struct ads7843e_config_s *state) static bool tsc_pendown(struct ads7843e_config_s *state)
{ {
/* The /PENIRQ value is active low */ /* The /PENIRQ value is active low */
@@ -220,7 +220,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
int sam_tsc_setup(int minor) int sam_tsc_setup(int minor)
{ {
FAR struct spi_dev_s *dev; struct spi_dev_s *dev;
int ret; int ret;
iinfo("minor %d\n", minor); iinfo("minor %d\n", minor);
+1 -1
View File
@@ -59,7 +59,7 @@
* *
****************************************************************************/ ****************************************************************************/
void sam_usbsuspend(FAR struct usbdev_s *dev, bool resume) void sam_usbsuspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
+1 -1
View File
@@ -66,7 +66,7 @@
int board_usbmsc_initialize(int port) int board_usbmsc_initialize(int port)
{ {
FAR struct sdio_dev_s *sdio; struct sdio_dev_s *sdio;
int ret; int ret;
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
+11 -11
View File
@@ -88,11 +88,11 @@
* pendown - Return the state of the pen down GPIO input * pendown - Return the state of the pen down GPIO input
*/ */
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr); static int tsc_attach(struct ads7843e_config_s *state, xcpt_t isr);
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable); static void tsc_enable(struct ads7843e_config_s *state, bool enable);
static void tsc_clear(FAR struct ads7843e_config_s *state); static void tsc_clear(struct ads7843e_config_s *state);
static bool tsc_busy(FAR struct ads7843e_config_s *state); static bool tsc_busy(struct ads7843e_config_s *state);
static bool tsc_pendown(FAR struct ads7843e_config_s *state); static bool tsc_pendown(struct ads7843e_config_s *state);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -135,7 +135,7 @@ static struct ads7843e_config_s g_tscinfo =
* pendown - Return the state of the pen down GPIO input * pendown - Return the state of the pen down GPIO input
*/ */
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr) static int tsc_attach(struct ads7843e_config_s *state, xcpt_t isr)
{ {
/* Attach the ADS7843E interrupt */ /* Attach the ADS7843E interrupt */
@@ -143,7 +143,7 @@ static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr)
return irq_attach(SAM_TCS_IRQ, isr, NULL); return irq_attach(SAM_TCS_IRQ, isr, NULL);
} }
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) static void tsc_enable(struct ads7843e_config_s *state, bool enable)
{ {
/* Attach and enable, or detach and disable */ /* Attach and enable, or detach and disable */
@@ -158,12 +158,12 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
} }
} }
static void tsc_clear(FAR struct ads7843e_config_s *state) static void tsc_clear(struct ads7843e_config_s *state)
{ {
/* Does nothing */ /* Does nothing */
} }
static bool tsc_busy(FAR struct ads7843e_config_s *state) static bool tsc_busy(struct ads7843e_config_s *state)
{ {
#if defined(CONFIG_DEBUG_INPUT) && defined(CONFIG_DEBUG_INFO) #if defined(CONFIG_DEBUG_INPUT) && defined(CONFIG_DEBUG_INFO)
static bool last = (bool)-1; static bool last = (bool)-1;
@@ -185,7 +185,7 @@ static bool tsc_busy(FAR struct ads7843e_config_s *state)
return busy; return busy;
} }
static bool tsc_pendown(FAR struct ads7843e_config_s *state) static bool tsc_pendown(struct ads7843e_config_s *state)
{ {
/* The /PENIRQ value is active low */ /* The /PENIRQ value is active low */
@@ -217,7 +217,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
int sam_tsc_setup(int minor) int sam_tsc_setup(int minor)
{ {
FAR struct spi_dev_s *dev; struct spi_dev_s *dev;
int ret; int ret;
iinfo("minor %d\n", minor); iinfo("minor %d\n", minor);
+2 -2
View File
@@ -58,8 +58,8 @@
int sam_at25_automount(int minor) int sam_at25_automount(int minor)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
FAR struct mtd_dev_s *mtd; struct mtd_dev_s *mtd;
static bool initialized = false; static bool initialized = false;
int ret; int ret;
+1 -1
View File
@@ -151,7 +151,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
switch (id) switch (id)
{ {
+1 -1
View File
@@ -173,7 +173,7 @@ void weak_function sam_netinitialize(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SAM34_GPIOD_IRQ #ifdef CONFIG_SAM34_GPIOD_IRQ
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) phy_enable_t *enable)
{ {
irqstate_t flags; irqstate_t flags;
+1 -1
View File
@@ -76,7 +76,7 @@ static struct sam_hsmci_state_s g_hsmci;
* *
****************************************************************************/ ****************************************************************************/
static int sam_hsmci_cardetect(int irq, void *regs, FAR void *arg) static int sam_hsmci_cardetect(int irq, void *regs, void *arg)
{ {
bool inserted; bool inserted;
+24 -24
View File
@@ -291,24 +291,24 @@ static void sam_set_cursor(uint16_t col, uint16_t row);
static void sam_disable_backlight(void); static void sam_disable_backlight(void);
static void sam_set_backlight(unsigned int power); static void sam_set_backlight(unsigned int power);
static int sam_poweroff(FAR struct sam_dev_s *priv); static int sam_poweroff(struct sam_dev_s *priv);
/* LCD Data Transfer Methods */ /* LCD Data Transfer Methods */
static int sam_putrun(fb_coord_t row, fb_coord_t col, static int sam_putrun(fb_coord_t row, fb_coord_t col,
FAR const uint8_t *buffer, const uint8_t *buffer,
size_t npixels); size_t npixels);
static int sam_getrun(fb_coord_t row, fb_coord_t col, static int sam_getrun(fb_coord_t row, fb_coord_t col,
FAR uint8_t *buffer, uint8_t *buffer,
size_t npixels); size_t npixels);
/* LCD Configuration */ /* LCD Configuration */
static int sam_getvideoinfo(FAR struct lcd_dev_s *dev, static int sam_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo); struct fb_videoinfo_s *vinfo);
static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, static int sam_getplaneinfo(struct lcd_dev_s *dev,
unsigned int planeno, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo); struct lcd_planeinfo_s *pinfo);
/* LCD RGB Mapping */ /* LCD RGB Mapping */
@@ -545,7 +545,7 @@ static void sam_set_cursor(uint16_t col, uint16_t row)
****************************************************************************/ ****************************************************************************/
#if 0 /* Sometimes useful */ #if 0 /* Sometimes useful */
static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, static void sam_dumprun(const char *msg, uint16_t *run,
size_t npixels) size_t npixels)
{ {
int i; int i;
@@ -636,7 +636,7 @@ static void sam_set_backlight(unsigned int power)
* *
****************************************************************************/ ****************************************************************************/
static int sam_poweroff(FAR struct sam_dev_s *priv) static int sam_poweroff(struct sam_dev_s *priv)
{ {
/* Turn the display off */ /* Turn the display off */
@@ -667,15 +667,15 @@ static int sam_poweroff(FAR struct sam_dev_s *priv)
****************************************************************************/ ****************************************************************************/
static int sam_putrun(fb_coord_t row, fb_coord_t col, static int sam_putrun(fb_coord_t row, fb_coord_t col,
FAR const uint8_t *buffer, const uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
#if defined(CONFIG_SAM4EEK_LCD_RGB565) #if defined(CONFIG_SAM4EEK_LCD_RGB565)
FAR const uint16_t *src = (FAR const uint16_t *)buffer; const uint16_t *src = (const uint16_t *)buffer;
#elif defined(CONFIG_SAM4EEK_LCD_RGB24) #elif defined(CONFIG_SAM4EEK_LCD_RGB24)
FAR const uint8_t *src = (FAR const uint8_t *)buffer; const uint8_t *src = (const uint8_t *)buffer;
#elif defined(CONFIG_SAM4EEK_LCD_RGB32) #elif defined(CONFIG_SAM4EEK_LCD_RGB32)
FAR const uint32_t *src = (FAR const uint32_t *)buffer; const uint32_t *src = (const uint32_t *)buffer;
#endif #endif
/* Buffer must be provided and aligned to a 16-bit address boundary */ /* Buffer must be provided and aligned to a 16-bit address boundary */
@@ -729,12 +729,12 @@ static int sam_putrun(fb_coord_t row, fb_coord_t col,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, static int sam_getrun(fb_coord_t row, fb_coord_t col, uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
uint8_t value[2]; uint8_t value[2];
#if defined(CONFIG_SAM4EEK_LCD_RGB24) #if defined(CONFIG_SAM4EEK_LCD_RGB24)
FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t *ptr = (uint8_t *)buffer;
#endif #endif
/* Set the cursor position */ /* Set the cursor position */
@@ -794,8 +794,8 @@ static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getvideoinfo(FAR struct lcd_dev_s *dev, static int sam_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo) struct fb_videoinfo_s *vinfo)
{ {
DEBUGASSERT(dev && vinfo); DEBUGASSERT(dev && vinfo);
lcdinfo("fmt: %d xres: %d yres: %d nplanes: %d\n", lcdinfo("fmt: %d xres: %d yres: %d nplanes: %d\n",
@@ -813,8 +813,8 @@ static int sam_getvideoinfo(FAR struct lcd_dev_s *dev,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int sam_getplaneinfo(struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo) struct lcd_planeinfo_s *pinfo)
{ {
DEBUGASSERT(dev && pinfo && planeno == 0); DEBUGASSERT(dev && pinfo && planeno == 0);
lcdinfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp); lcdinfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp);
@@ -834,7 +834,7 @@ static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
static int sam_getpower(struct lcd_dev_s *dev) static int sam_getpower(struct lcd_dev_s *dev)
{ {
FAR struct sam_dev_s *priv = (FAR struct sam_dev_s *)dev; struct sam_dev_s *priv = (struct sam_dev_s *)dev;
lcdinfo("power: %d\n", 0); lcdinfo("power: %d\n", 0);
return priv->power; return priv->power;
@@ -852,7 +852,7 @@ static int sam_getpower(struct lcd_dev_s *dev)
static int sam_setpower(struct lcd_dev_s *dev, int power) static int sam_setpower(struct lcd_dev_s *dev, int power)
{ {
FAR struct sam_dev_s *priv = (FAR struct sam_dev_s *)dev; struct sam_dev_s *priv = (struct sam_dev_s *)dev;
lcdinfo("power: %d\n", power); lcdinfo("power: %d\n", power);
DEBUGASSERT((unsigned)power <= CONFIG_LCD_MAXPOWER); DEBUGASSERT((unsigned)power <= CONFIG_LCD_MAXPOWER);
@@ -1312,7 +1312,7 @@ static inline int sam_lcd_initialize(void)
int board_lcd_initialize(void) int board_lcd_initialize(void)
{ {
FAR struct sam_dev_s *priv = &g_lcddev; struct sam_dev_s *priv = &g_lcddev;
int ret; int ret;
lcdinfo("Initializing\n"); lcdinfo("Initializing\n");
@@ -1356,7 +1356,7 @@ int board_lcd_initialize(void)
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) struct lcd_dev_s *board_lcd_getdev(int lcddev)
{ {
DEBUGASSERT(lcddev == 0); DEBUGASSERT(lcddev == 0);
return &g_lcddev.dev; return &g_lcddev.dev;
@@ -1372,7 +1372,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
void board_lcd_uninitialize(void) void board_lcd_uninitialize(void)
{ {
FAR struct sam_dev_s *priv = &g_lcddev; struct sam_dev_s *priv = &g_lcddev;
/* Put the LCD in the lowest possible power state */ /* Put the LCD in the lowest possible power state */
+30 -30
View File
@@ -283,9 +283,9 @@ struct sam_dev_s
/* Low Level LCD access */ /* Low Level LCD access */
static void sam_putreg(uint8_t regaddr, FAR const uint8_t *buffer, static void sam_putreg(uint8_t regaddr, const uint8_t *buffer,
unsigned int buflen); unsigned int buflen);
static void sam_getreg(uint8_t regaddr, FAR uint8_t *buffer, static void sam_getreg(uint8_t regaddr, uint8_t *buffer,
unsigned int buflen); unsigned int buflen);
static void sam_setwindow(sam_color_t row, sam_color_t col, static void sam_setwindow(sam_color_t row, sam_color_t col,
sam_color_t width, sam_color_t height); sam_color_t width, sam_color_t height);
@@ -298,24 +298,24 @@ static inline sam_color_t sam_gram_read(void);
static void sam_disable_backlight(void); static void sam_disable_backlight(void);
static void sam_set_backlight(unsigned int power); static void sam_set_backlight(unsigned int power);
static int sam_poweroff(FAR struct sam_dev_s *priv); static int sam_poweroff(struct sam_dev_s *priv);
/* LCD Data Transfer Methods */ /* LCD Data Transfer Methods */
static int sam_putrun(fb_coord_t row, fb_coord_t col, static int sam_putrun(fb_coord_t row, fb_coord_t col,
FAR const uint8_t *buffer, const uint8_t *buffer,
size_t npixels); size_t npixels);
static int sam_getrun(fb_coord_t row, fb_coord_t col, static int sam_getrun(fb_coord_t row, fb_coord_t col,
FAR uint8_t *buffer, uint8_t *buffer,
size_t npixels); size_t npixels);
/* LCD Configuration */ /* LCD Configuration */
static int sam_getvideoinfo(FAR struct lcd_dev_s *dev, static int sam_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo); struct fb_videoinfo_s *vinfo);
static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, static int sam_getplaneinfo(struct lcd_dev_s *dev,
unsigned int planeno, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo); struct lcd_planeinfo_s *pinfo);
/* LCD RGB Mapping */ /* LCD RGB Mapping */
@@ -428,7 +428,7 @@ static struct sam_dev_s g_lcddev =
* *
****************************************************************************/ ****************************************************************************/
static void sam_putreg(uint8_t regaddr, FAR const uint8_t *buffer, static void sam_putreg(uint8_t regaddr, const uint8_t *buffer,
unsigned int buflen) unsigned int buflen)
{ {
LCD_INDEX = 0; LCD_INDEX = 0;
@@ -450,7 +450,7 @@ static void sam_putreg(uint8_t regaddr, FAR const uint8_t *buffer,
* *
****************************************************************************/ ****************************************************************************/
static void sam_getreg(uint8_t regaddr, FAR uint8_t *buffer, static void sam_getreg(uint8_t regaddr, uint8_t *buffer,
unsigned int buflen) unsigned int buflen)
{ {
LCD_INDEX = 0; LCD_INDEX = 0;
@@ -579,7 +579,7 @@ static inline sam_color_t sam_gram_read(void)
****************************************************************************/ ****************************************************************************/
#if 0 /* Sometimes useful */ #if 0 /* Sometimes useful */
static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, static void sam_dumprun(const char *msg, uint16_t *run,
size_t npixels) size_t npixels)
{ {
int i; int i;
@@ -672,7 +672,7 @@ static void sam_set_backlight(unsigned int power)
* *
****************************************************************************/ ****************************************************************************/
static int sam_poweroff(FAR struct sam_dev_s *priv) static int sam_poweroff(struct sam_dev_s *priv)
{ {
lcdinfo("OFF\n"); lcdinfo("OFF\n");
@@ -705,15 +705,15 @@ static int sam_poweroff(FAR struct sam_dev_s *priv)
****************************************************************************/ ****************************************************************************/
static int sam_putrun(fb_coord_t row, fb_coord_t col, static int sam_putrun(fb_coord_t row, fb_coord_t col,
FAR const uint8_t *buffer, const uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
#if defined(CONFIG_SAM4EEK_LCD_RGB565) #if defined(CONFIG_SAM4EEK_LCD_RGB565)
FAR const uint16_t *src = (FAR const uint16_t *)buffer; const uint16_t *src = (const uint16_t *)buffer;
#elif defined(CONFIG_SAM4EEK_LCD_RGB24) #elif defined(CONFIG_SAM4EEK_LCD_RGB24)
FAR const uint8_t *src = (FAR const uint8_t *)buffer; const uint8_t *src = (const uint8_t *)buffer;
#elif defined(CONFIG_SAM4EEK_LCD_RGB32) #elif defined(CONFIG_SAM4EEK_LCD_RGB32)
FAR const uint32_t *src = (FAR const uint32_t *)buffer; const uint32_t *src = (const uint32_t *)buffer;
#endif #endif
/* Buffer must be provided and aligned to a 16-bit address boundary */ /* Buffer must be provided and aligned to a 16-bit address boundary */
@@ -763,15 +763,15 @@ static int sam_putrun(fb_coord_t row, fb_coord_t col,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, static int sam_getrun(fb_coord_t row, fb_coord_t col, uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
#if defined(CONFIG_SAM4EEK_LCD_RGB565) #if defined(CONFIG_SAM4EEK_LCD_RGB565)
FAR uint16_t *dest = (FAR uint16_t *)buffer; uint16_t *dest = (uint16_t *)buffer;
#elif defined(CONFIG_SAM4EEK_LCD_RGB24) #elif defined(CONFIG_SAM4EEK_LCD_RGB24)
FAR uint8_t *dest = (FAR uint8_t *)buffer; uint8_t *dest = (uint8_t *)buffer;
#elif defined(dest) #elif defined(dest)
FAR uint32_t *dest = (FAR uint32_t *)buffer; uint32_t *dest = (uint32_t *)buffer;
#endif #endif
/* Buffer must be provided and aligned to a 16-bit address boundary */ /* Buffer must be provided and aligned to a 16-bit address boundary */
@@ -815,8 +815,8 @@ static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getvideoinfo(FAR struct lcd_dev_s *dev, static int sam_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo) struct fb_videoinfo_s *vinfo)
{ {
DEBUGASSERT(dev && vinfo); DEBUGASSERT(dev && vinfo);
lcdinfo("fmt: %d xres: %d yres: %d nplanes: %d\n", lcdinfo("fmt: %d xres: %d yres: %d nplanes: %d\n",
@@ -834,8 +834,8 @@ static int sam_getvideoinfo(FAR struct lcd_dev_s *dev,
* *
****************************************************************************/ ****************************************************************************/
static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int sam_getplaneinfo(struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo) struct lcd_planeinfo_s *pinfo)
{ {
DEBUGASSERT(dev && pinfo && planeno == 0); DEBUGASSERT(dev && pinfo && planeno == 0);
lcdinfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp); lcdinfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp);
@@ -855,7 +855,7 @@ static int sam_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
static int sam_getpower(struct lcd_dev_s *dev) static int sam_getpower(struct lcd_dev_s *dev)
{ {
FAR struct sam_dev_s *priv = (FAR struct sam_dev_s *)dev; struct sam_dev_s *priv = (struct sam_dev_s *)dev;
lcdinfo("power: %d\n", 0); lcdinfo("power: %d\n", 0);
return priv->power; return priv->power;
@@ -873,7 +873,7 @@ static int sam_getpower(struct lcd_dev_s *dev)
static int sam_setpower(struct lcd_dev_s *dev, int power) static int sam_setpower(struct lcd_dev_s *dev, int power)
{ {
FAR struct sam_dev_s *priv = (FAR struct sam_dev_s *)dev; struct sam_dev_s *priv = (struct sam_dev_s *)dev;
lcdinfo("power: %d\n", power); lcdinfo("power: %d\n", power);
DEBUGASSERT((unsigned)power <= CONFIG_LCD_MAXPOWER); DEBUGASSERT((unsigned)power <= CONFIG_LCD_MAXPOWER);
@@ -1178,7 +1178,7 @@ static inline int sam_lcd_initialize(void)
int board_lcd_initialize(void) int board_lcd_initialize(void)
{ {
FAR struct sam_dev_s *priv = &g_lcddev; struct sam_dev_s *priv = &g_lcddev;
int ret; int ret;
lcdinfo("Initializing\n"); lcdinfo("Initializing\n");
@@ -1222,7 +1222,7 @@ int board_lcd_initialize(void)
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) struct lcd_dev_s *board_lcd_getdev(int lcddev)
{ {
DEBUGASSERT(lcddev == 0); DEBUGASSERT(lcddev == 0);
return &g_lcddev.dev; return &g_lcddev.dev;
@@ -1238,7 +1238,7 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
void board_lcd_uninitialize(void) void board_lcd_uninitialize(void)
{ {
FAR struct sam_dev_s *priv = &g_lcddev; struct sam_dev_s *priv = &g_lcddev;
/* Put the LCD in the lowest possible power state */ /* Put the LCD in the lowest possible power state */
+1 -1
View File
@@ -173,7 +173,7 @@ void sam_spi0select(uint32_t devid, bool selected)
* *
****************************************************************************/ ****************************************************************************/
uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi0status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
+1 -1
View File
@@ -69,7 +69,7 @@
* *
****************************************************************************/ ****************************************************************************/
void sam_udp_suspend(FAR struct usbdev_s *dev, bool resume) void sam_udp_suspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
@@ -93,7 +93,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
int ret = -EINVAL; int ret = -EINVAL;
@@ -75,7 +75,7 @@
int sam_sdinitialize(int minor) int sam_sdinitialize(int minor)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
int ret; int ret;
/* Get the SPI driver instance for the SD chip select */ /* Get the SPI driver instance for the SD chip select */
+29 -29
View File
@@ -231,7 +231,7 @@
struct slcd_instream_s struct slcd_instream_s
{ {
struct lib_instream_s stream; struct lib_instream_s stream;
FAR const char *buffer; const char *buffer;
ssize_t nbytes; ssize_t nbytes;
}; };
@@ -260,8 +260,8 @@ struct slcd_pixel_s
/* Debug */ /* Debug */
#ifdef CONFIG_DEBUG_LCD_INFO #ifdef CONFIG_DEBUG_LCD_INFO
static void slcd_dumpstate(FAR const char *msg); static void slcd_dumpstate(const char *msg);
static void slcd_dumpslcd(FAR const char *msg); static void slcd_dumpslcd(const char *msg);
#else #else
# define slcd_dumpstate(msg) # define slcd_dumpstate(msg)
# define slcd_dumpslcd(msg) # define slcd_dumpslcd(msg)
@@ -272,11 +272,11 @@ static void slcd_dumpslcd(FAR const char *msg);
#if 0 /* Not used */ #if 0 /* Not used */
static void slcd_clear(void); static void slcd_clear(void);
#endif #endif
static void slcd_setpixel(FAR const struct slcd_pixel_s *info); static void slcd_setpixel(const struct slcd_pixel_s *info);
static void slcd_clrpixel(FAR const struct slcd_pixel_s *info); static void slcd_clrpixel(const struct slcd_pixel_s *info);
static inline void slcd_setdp(uint8_t curpos); static inline void slcd_setdp(uint8_t curpos);
static inline void slcd_clrdp(uint8_t curpos); static inline void slcd_clrdp(uint8_t curpos);
static int slcd_getstream(FAR struct lib_instream_s *instream); static int slcd_getstream(struct lib_instream_s *instream);
static uint8_t slcd_getcontrast(void); static uint8_t slcd_getcontrast(void);
static int slcd_setcontrast(unsigned int contrast); static int slcd_setcontrast(unsigned int contrast);
static void slcd_writech(uint8_t ch, uint8_t curpos, uint8_t options); static void slcd_writech(uint8_t ch, uint8_t curpos, uint8_t options);
@@ -284,10 +284,10 @@ static void slcd_action(enum slcdcode_e code, uint8_t count);
/* Character driver methods */ /* Character driver methods */
static ssize_t slcd_read(FAR struct file *, FAR char *, size_t); static ssize_t slcd_read(struct file *, char *, size_t);
static ssize_t slcd_write(FAR struct file *, FAR const char *, size_t); static ssize_t slcd_write(struct file *, const char *, size_t);
static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg); static int slcd_ioctl(struct file *filep, int cmd, unsigned long arg);
static int slcd_poll(FAR struct file *filep, FAR struct pollfd *fds, static int slcd_poll(struct file *filep, struct pollfd *fds,
bool setup); bool setup);
/**************************************************************************** /****************************************************************************
@@ -393,7 +393,7 @@ static const struct slcd_pixel_s g_einfo[SLCD_NE] =
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_LCD_INFO #ifdef CONFIG_DEBUG_LCD_INFO
static void slcd_dumpstate(FAR const char *msg) static void slcd_dumpstate(const char *msg)
{ {
lcdinfo("%s:\n", msg); lcdinfo("%s:\n", msg);
lcdinfo(" curpos: %d\n", lcdinfo(" curpos: %d\n",
@@ -418,7 +418,7 @@ static void slcd_dumpstate(FAR const char *msg)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_LCD_INFO #ifdef CONFIG_DEBUG_LCD_INFO
static void slcd_dumpslcd(FAR const char *msg) static void slcd_dumpslcd(const char *msg)
{ {
lcdinfo("%s:\n", msg); lcdinfo("%s:\n", msg);
lcdinfo(" CFG: %08x TIM: %08x SR: %08x\n", lcdinfo(" CFG: %08x TIM: %08x SR: %08x\n",
@@ -458,7 +458,7 @@ static void slcd_clear(void)
* Name: slcd_setpixel * Name: slcd_setpixel
****************************************************************************/ ****************************************************************************/
static void slcd_setpixel(FAR const struct slcd_pixel_s *info) static void slcd_setpixel(const struct slcd_pixel_s *info)
{ {
uintptr_t regaddr; uintptr_t regaddr;
uint32_t regval; uint32_t regval;
@@ -473,7 +473,7 @@ static void slcd_setpixel(FAR const struct slcd_pixel_s *info)
* Name: slcd_clrpixel * Name: slcd_clrpixel
****************************************************************************/ ****************************************************************************/
static void slcd_clrpixel(FAR const struct slcd_pixel_s *info) static void slcd_clrpixel(const struct slcd_pixel_s *info)
{ {
uintptr_t regaddr; uintptr_t regaddr;
uint32_t regval; uint32_t regval;
@@ -522,10 +522,10 @@ static inline void slcd_clrdp(uint8_t curpos)
* *
****************************************************************************/ ****************************************************************************/
static int slcd_getstream(FAR struct lib_instream_s *instream) static int slcd_getstream(struct lib_instream_s *instream)
{ {
FAR struct slcd_instream_s *slcdstream = struct slcd_instream_s *slcdstream =
(FAR struct slcd_instream_s *)instream; (struct slcd_instream_s *)instream;
DEBUGASSERT(slcdstream && slcdstream->buffer); DEBUGASSERT(slcdstream && slcdstream->buffer);
if (slcdstream->nbytes > 0) if (slcdstream->nbytes > 0)
@@ -858,8 +858,8 @@ static void slcd_action(enum slcdcode_e code, uint8_t count)
* Name: slcd_read * Name: slcd_read
****************************************************************************/ ****************************************************************************/
static ssize_t slcd_read(FAR struct file *filep, static ssize_t slcd_read(struct file *filep,
FAR char *buffer, size_t len) char *buffer, size_t len)
{ {
int ret = 0; int ret = 0;
int i; int i;
@@ -896,8 +896,8 @@ static ssize_t slcd_read(FAR struct file *filep,
* Name: slcd_write * Name: slcd_write
****************************************************************************/ ****************************************************************************/
static ssize_t slcd_write(FAR struct file *filep, static ssize_t slcd_write(struct file *filep,
FAR const char *buffer, size_t len) const char *buffer, size_t len)
{ {
struct slcd_instream_s instream; struct slcd_instream_s instream;
struct slcdstate_s state; struct slcdstate_s state;
@@ -1011,7 +1011,7 @@ static ssize_t slcd_write(FAR struct file *filep,
* Name: slcd_poll * Name: slcd_poll
****************************************************************************/ ****************************************************************************/
static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int slcd_ioctl(struct file *filep, int cmd, unsigned long arg)
{ {
switch (cmd) switch (cmd)
{ {
@@ -1023,8 +1023,8 @@ static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case SLCDIOC_GETATTRIBUTES: case SLCDIOC_GETATTRIBUTES:
{ {
FAR struct slcd_attributes_s *attr = struct slcd_attributes_s *attr =
(FAR struct slcd_attributes_s *)((uintptr_t)arg); (struct slcd_attributes_s *)((uintptr_t)arg);
lcdinfo("SLCDIOC_GETATTRIBUTES:\n"); lcdinfo("SLCDIOC_GETATTRIBUTES:\n");
@@ -1049,8 +1049,8 @@ static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case SLCDIOC_CURPOS: case SLCDIOC_CURPOS:
{ {
FAR struct slcd_curpos_s *curpos = struct slcd_curpos_s *curpos =
(FAR struct slcd_curpos_s *)((uintptr_t)arg); (struct slcd_curpos_s *)((uintptr_t)arg);
lcdinfo("SLCDIOC_CURPOS: row=0 column=%d\n", g_slcdstate.curpos); lcdinfo("SLCDIOC_CURPOS: row=0 column=%d\n", g_slcdstate.curpos);
@@ -1119,7 +1119,7 @@ static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case SLCDIOC_GETCONTRAST: case SLCDIOC_GETCONTRAST:
{ {
FAR int *contrast = (FAR int *)((uintptr_t)arg); int *contrast = (int *)((uintptr_t)arg);
if (!contrast) if (!contrast)
{ {
return -EINVAL; return -EINVAL;
@@ -1161,8 +1161,8 @@ static int slcd_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* Name: slcd_poll * Name: slcd_poll
****************************************************************************/ ****************************************************************************/
static int slcd_poll(FAR struct file *filep, FAR struct pollfd *fds, static int slcd_poll(struct file *filep, struct pollfd *fds,
bool setup) bool setup)
{ {
if (setup) if (setup)
{ {
@@ -169,7 +169,7 @@ void sam_spi0select(uint32_t devid, bool selected)
* *
****************************************************************************/ ****************************************************************************/
uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi0status(struct spi_dev_s *dev, uint32_t devid)
{ {
uint8_t ret = 0; uint8_t ret = 0;
@@ -217,7 +217,7 @@ uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
int sam_spic0mddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) int sam_spic0mddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
{ {
#ifdef CONFIG_SAM4L_XPLAINED_OLED1MODULE #ifdef CONFIG_SAM4L_XPLAINED_OLED1MODULE
if (devid == SPIDEV_DISPLAY(0)) if (devid == SPIDEV_DISPLAY(0))
@@ -92,10 +92,10 @@
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) struct lcd_dev_s *board_graphics_setup(unsigned int devno)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
FAR struct lcd_dev_s *dev; struct lcd_dev_s *dev;
/* Configure the OLED GPIOs. This initial configuration is RESET low, /* Configure the OLED GPIOs. This initial configuration is RESET low,
* putting the OLED into reset state. * putting the OLED into reset state.
@@ -94,7 +94,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
int ret = -EINVAL; int ret = -EINVAL;
@@ -80,7 +80,7 @@ static struct sam_hsmci_state_s g_hsmci;
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_MMCSD_HAVE_CARDDETECT #ifdef CONFIG_MMCSD_HAVE_CARDDETECT
static int sam_hsmci_cardetect_int(int irq, void *regs, FAR void *arg) static int sam_hsmci_cardetect_int(int irq, void *regs, void *arg)
{ {
bool inserted; bool inserted;
@@ -184,7 +184,7 @@ int board_nandflash_config(int cs)
int sam_nand_automount(int minor) int sam_nand_automount(int minor)
{ {
FAR struct mtd_dev_s *mtd; struct mtd_dev_s *mtd;
static bool initialized = false; static bool initialized = false;
/* Have we already initialized? */ /* Have we already initialized? */
@@ -150,7 +150,7 @@ void sam_spi0select(uint32_t devid, bool selected)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SAM34_SPI0 #ifdef CONFIG_SAM34_SPI0
uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi0status(struct spi_dev_s *dev, uint32_t devid)
{ {
return SPI_STATUS_PRESENT; return SPI_STATUS_PRESENT;
} }
@@ -158,7 +158,7 @@ uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid)
int sam_sdinitialize(int port, int minor) int sam_sdinitialize(int port, int minor)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
int ret; int ret;
/* Get the SPI driver instance for the SD chip select */ /* Get the SPI driver instance for the SD chip select */
@@ -69,7 +69,7 @@
* *
****************************************************************************/ ****************************************************************************/
void sam_udp_suspend(FAR struct usbdev_s *dev, bool resume) void sam_udp_suspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
@@ -80,7 +80,7 @@
#if defined(CONFIG_WDT_THREAD) #if defined(CONFIG_WDT_THREAD)
static int wdog_daemon(int argc, char *argv[]) static int wdog_daemon(int argc, char *argv[])
{ {
FAR struct file filestruct; struct file filestruct;
int ret; int ret;
/* Open the watchdog device for reading */ /* Open the watchdog device for reading */
@@ -137,7 +137,7 @@ errout:
int sam_watchdog_initialize(void) int sam_watchdog_initialize(void)
{ {
#if (defined(CONFIG_SAM34_WDT) && !defined(CONFIG_WDT_DISABLE_ON_RESET)) #if (defined(CONFIG_SAM34_WDT) && !defined(CONFIG_WDT_DISABLE_ON_RESET))
FAR struct file filestruct; struct file filestruct;
int ret; int ret;
/* Initialize the watchdog timer device */ /* Initialize the watchdog timer device */
@@ -188,7 +188,7 @@ int sam_watchdog_initialize(void)
int taskid = kthread_create(CONFIG_WDT_THREAD_NAME, int taskid = kthread_create(CONFIG_WDT_THREAD_NAME,
CONFIG_WDT_THREAD_PRIORITY, CONFIG_WDT_THREAD_PRIORITY,
CONFIG_WDT_THREAD_STACKSIZE, CONFIG_WDT_THREAD_STACKSIZE,
(main_t)wdog_daemon, (FAR char * const *)NULL); (main_t)wdog_daemon, (char * const *)NULL);
DEBUGASSERT(taskid > 0); DEBUGASSERT(taskid > 0);
UNUSED(taskid); UNUSED(taskid);
@@ -94,7 +94,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
int ret = -EINVAL; int ret = -EINVAL;
@@ -85,18 +85,18 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t ajoy_supported(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_supported(const struct ajoy_lowerhalf_s
*lower); *lower);
static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, static int ajoy_sample(const struct ajoy_lowerhalf_s *lower,
FAR struct ajoy_sample_s *sample); struct ajoy_sample_s *sample);
static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_buttons(const struct ajoy_lowerhalf_s
*lower); *lower);
static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, static void ajoy_enable(const struct ajoy_lowerhalf_s *lower,
ajoy_buttonset_t press, ajoy_buttonset_t release, ajoy_buttonset_t press, ajoy_buttonset_t release,
ajoy_handler_t handler, FAR void *arg); ajoy_handler_t handler, void *arg);
static void ajoy_disable(void); static void ajoy_disable(void);
static int ajoy_interrupt(int irq, FAR void *context, FAR void *arg); static int ajoy_interrupt(int irq, void *context, void *arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -135,7 +135,7 @@ static struct file g_adcfile;
/* Current interrupt handler and argument */ /* Current interrupt handler and argument */
static ajoy_handler_t g_ajoyhandler; static ajoy_handler_t g_ajoyhandler;
static FAR void *g_ajoyarg; static void *g_ajoyarg;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -149,7 +149,7 @@ static FAR void *g_ajoyarg;
* *
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t ajoy_supported(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_supported(const struct ajoy_lowerhalf_s
*lower) *lower)
{ {
iinfo("Supported: %02x\n", AJOY_SUPPORTED); iinfo("Supported: %02x\n", AJOY_SUPPORTED);
@@ -164,11 +164,11 @@ static ajoy_buttonset_t ajoy_supported(FAR const struct ajoy_lowerhalf_s
* *
****************************************************************************/ ****************************************************************************/
static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, static int ajoy_sample(const struct ajoy_lowerhalf_s *lower,
FAR struct ajoy_sample_s *sample) struct ajoy_sample_s *sample)
{ {
struct adc_msg_s adcmsg[SAM_ADC_NCHANNELS]; struct adc_msg_s adcmsg[SAM_ADC_NCHANNELS];
FAR struct adc_msg_s *ptr; struct adc_msg_s *ptr;
ssize_t nread; ssize_t nread;
ssize_t offset; ssize_t offset;
int have; int have;
@@ -245,7 +245,7 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower,
* *
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_buttons(const struct ajoy_lowerhalf_s
*lower) *lower)
{ {
ajoy_buttonset_t ret = 0; ajoy_buttonset_t ret = 0;
@@ -278,9 +278,9 @@ static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s
* *
****************************************************************************/ ****************************************************************************/
static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, static void ajoy_enable(const struct ajoy_lowerhalf_s *lower,
ajoy_buttonset_t press, ajoy_buttonset_t release, ajoy_buttonset_t press, ajoy_buttonset_t release,
ajoy_handler_t handler, FAR void *arg) ajoy_handler_t handler, void *arg)
{ {
irqstate_t flags; irqstate_t flags;
ajoy_buttonset_t either = press | release; ajoy_buttonset_t either = press | release;
@@ -367,7 +367,7 @@ static void ajoy_disable(void)
* *
****************************************************************************/ ****************************************************************************/
static int ajoy_interrupt(int irq, FAR void *context, FAR void *arg) static int ajoy_interrupt(int irq, void *context, void *arg)
{ {
DEBUGASSERT(g_ajoyhandler); DEBUGASSERT(g_ajoyhandler);
if (g_ajoyhandler) if (g_ajoyhandler)
@@ -84,7 +84,7 @@
#ifdef HAVE_I2CTOOL #ifdef HAVE_I2CTOOL
static void sam_i2c_register(int bus) static void sam_i2c_register(int bus)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
int ret; int ret;
i2c = sam_i2cbus_initialize(bus); i2c = sam_i2cbus_initialize(bus);
+4 -4
View File
@@ -80,7 +80,7 @@ struct sam_sdmmc_state_s
/* SDMMC device state */ /* SDMMC device state */
#ifdef CONFIG_SAMA5_SDMMC0 #ifdef CONFIG_SAMA5_SDMMC0
static int sam_sdmmc0_cardetect(int irq, void *regs, FAR void *arg); static int sam_sdmmc0_cardetect(int irq, void *regs, void *arg);
static struct sam_sdmmc_state_s g_sdmmc0 = static struct sam_sdmmc_state_s g_sdmmc0 =
{ {
@@ -92,7 +92,7 @@ static struct sam_sdmmc_state_s g_sdmmc0 =
#endif #endif
#ifdef CONFIG_SAMA5_SDMMC1 #ifdef CONFIG_SAMA5_SDMMC1
static int sam_sdmmc1_cardetect(int irq, void *regs, FAR void *arg); static int sam_sdmmc1_cardetect(int irq, void *regs, void *arg);
static struct sam_sdmmc_state_s g_sdmmc1 = static struct sam_sdmmc_state_s g_sdmmc1 =
{ {
@@ -157,14 +157,14 @@ static int sam_sdmmc_cardetect(struct sam_sdmmc_state_s *state)
} }
#ifdef CONFIG_SAMA5_SDMMC0 #ifdef CONFIG_SAMA5_SDMMC0
static int sam_sdmmc0_cardetect(int irq, void *regs, FAR void *arg) static int sam_sdmmc0_cardetect(int irq, void *regs, void *arg)
{ {
return sam_sdmmc_cardetect(&g_sdmmc0); return sam_sdmmc_cardetect(&g_sdmmc0);
} }
#endif #endif
#ifdef CONFIG_SAMA5_SDMMC1 #ifdef CONFIG_SAMA5_SDMMC1
static int sam_sdmmc1_cardetect(int irq, void *regs, FAR void *arg) static int sam_sdmmc1_cardetect(int irq, void *regs, void *arg)
{ {
return sam_sdmmc_cardetect(&g_sdmmc1); return sam_sdmmc_cardetect(&g_sdmmc1);
} }
+2 -2
View File
@@ -150,14 +150,14 @@ void sam_spi1select(uint32_t devid, bool selected)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_SAMA5_SPI0
uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi0status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
#endif #endif
#ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_SAMA5_SPI0
uint8_t sam_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi1status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
+3 -3
View File
@@ -293,7 +293,7 @@ int sam_usbhost_initialize(void)
ret = kthread_create("OHCI Monitor", ret = kthread_create("OHCI Monitor",
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO, CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO,
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE, CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE,
(main_t)ohci_waiter, (FAR char * const *)NULL); (main_t)ohci_waiter, (char * const *)NULL);
if (ret < 0) if (ret < 0)
{ {
uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret); uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
@@ -316,7 +316,7 @@ int sam_usbhost_initialize(void)
ret = kthread_create("EHCI Monitor", ret = kthread_create("EHCI Monitor",
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO, CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO,
CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE, CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL); (main_t)ehci_waiter, (char * const *)NULL);
if (ret < 0) if (ret < 0)
{ {
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
@@ -470,7 +470,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_USBDEV #ifdef CONFIG_USBDEV
void sam_usbsuspend(FAR struct usbdev_s *dev, bool resume) void sam_usbsuspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
@@ -85,18 +85,18 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t ajoy_supported(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_supported(const struct ajoy_lowerhalf_s
*lower); *lower);
static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, static int ajoy_sample(const struct ajoy_lowerhalf_s *lower,
FAR struct ajoy_sample_s *sample); struct ajoy_sample_s *sample);
static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_buttons(const struct ajoy_lowerhalf_s
*lower); *lower);
static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, static void ajoy_enable(const struct ajoy_lowerhalf_s *lower,
ajoy_buttonset_t press, ajoy_buttonset_t release, ajoy_buttonset_t press, ajoy_buttonset_t release,
ajoy_handler_t handler, FAR void *arg); ajoy_handler_t handler, void *arg);
static void ajoy_disable(void); static void ajoy_disable(void);
static int ajoy_interrupt(int irq, FAR void *context, FAR void *arg); static int ajoy_interrupt(int irq, void *context, void *arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -135,7 +135,7 @@ static struct file g_adcfile;
/* Current interrupt handler and argument */ /* Current interrupt handler and argument */
static ajoy_handler_t g_ajoyhandler; static ajoy_handler_t g_ajoyhandler;
static FAR void *g_ajoyarg; static void *g_ajoyarg;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -149,7 +149,7 @@ static FAR void *g_ajoyarg;
* *
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t ajoy_supported(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_supported(const struct ajoy_lowerhalf_s
*lower) *lower)
{ {
iinfo("Supported: %02x\n", AJOY_SUPPORTED); iinfo("Supported: %02x\n", AJOY_SUPPORTED);
@@ -164,11 +164,11 @@ static ajoy_buttonset_t ajoy_supported(FAR const struct ajoy_lowerhalf_s
* *
****************************************************************************/ ****************************************************************************/
static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, static int ajoy_sample(const struct ajoy_lowerhalf_s *lower,
FAR struct ajoy_sample_s *sample) struct ajoy_sample_s *sample)
{ {
struct adc_msg_s adcmsg[SAM_ADC_NCHANNELS]; struct adc_msg_s adcmsg[SAM_ADC_NCHANNELS];
FAR struct adc_msg_s *ptr; struct adc_msg_s *ptr;
ssize_t nread; ssize_t nread;
ssize_t offset; ssize_t offset;
int have; int have;
@@ -245,7 +245,7 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower,
* *
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s static ajoy_buttonset_t ajoy_buttons(const struct ajoy_lowerhalf_s
*lower) *lower)
{ {
ajoy_buttonset_t ret = 0; ajoy_buttonset_t ret = 0;
@@ -278,9 +278,9 @@ static ajoy_buttonset_t ajoy_buttons(FAR const struct ajoy_lowerhalf_s
* *
****************************************************************************/ ****************************************************************************/
static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, static void ajoy_enable(const struct ajoy_lowerhalf_s *lower,
ajoy_buttonset_t press, ajoy_buttonset_t release, ajoy_buttonset_t press, ajoy_buttonset_t release,
ajoy_handler_t handler, FAR void *arg) ajoy_handler_t handler, void *arg)
{ {
irqstate_t flags; irqstate_t flags;
ajoy_buttonset_t either = press | release; ajoy_buttonset_t either = press | release;
@@ -367,7 +367,7 @@ static void ajoy_disable(void)
* *
****************************************************************************/ ****************************************************************************/
static int ajoy_interrupt(int irq, FAR void *context, FAR void *arg) static int ajoy_interrupt(int irq, void *context, void *arg)
{ {
DEBUGASSERT(g_ajoyhandler); DEBUGASSERT(g_ajoyhandler);
if (g_ajoyhandler) if (g_ajoyhandler)
+2 -2
View File
@@ -57,8 +57,8 @@
int sam_at25_automount(int minor) int sam_at25_automount(int minor)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
FAR struct mtd_dev_s *mtd; struct mtd_dev_s *mtd;
static bool initialized = false; static bool initialized = false;
int ret; int ret;
@@ -84,7 +84,7 @@
#ifdef HAVE_I2CTOOL #ifdef HAVE_I2CTOOL
static void sam_i2c_register(int bus) static void sam_i2c_register(int bus)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
int ret; int ret;
i2c = sam_i2cbus_initialize(bus); i2c = sam_i2cbus_initialize(bus);
@@ -104,7 +104,7 @@ uint32_t board_buttons(void)
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAMA5_PIOB_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAMA5_PIOB_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) int board_button_irq(int id, xcpt_t irqhandler, void *arg)
{ {
int ret = -EINVAL; int ret = -EINVAL;
@@ -241,7 +241,7 @@ void weak_function sam_netinitialize(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SAMA5_PIOE_IRQ #ifdef CONFIG_SAMA5_PIOE_IRQ
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) phy_enable_t *enable)
{ {
irqstate_t flags; irqstate_t flags;
@@ -152,7 +152,7 @@ int board_nandflash_config(int cs)
#ifdef HAVE_NAND #ifdef HAVE_NAND
int sam_nand_automount(int minor) int sam_nand_automount(int minor)
{ {
FAR struct mtd_dev_s *mtd; struct mtd_dev_s *mtd;
static bool initialized = false; static bool initialized = false;
int ret; int ret;
@@ -97,7 +97,7 @@ struct sam_sdmmc_state_s
/* SDMMC device state */ /* SDMMC device state */
#ifdef CONFIG_SAMA5_SDMMC0 #ifdef CONFIG_SAMA5_SDMMC0
static int sam_sdmmc0_cardetect(int irq, void *regs, FAR void *arg); static int sam_sdmmc0_cardetect(int irq, void *regs, void *arg);
static struct sam_sdmmc_state_s g_sdmmc0 = static struct sam_sdmmc_state_s g_sdmmc0 =
{ {
@@ -109,7 +109,7 @@ static struct sam_sdmmc_state_s g_sdmmc0 =
#endif #endif
#ifdef CONFIG_SAMA5_SDMMC1 #ifdef CONFIG_SAMA5_SDMMC1
static int sam_sdmmc1_cardetect(int irq, void *regs, FAR void *arg); static int sam_sdmmc1_cardetect(int irq, void *regs, void *arg);
static struct sam_sdmmc_state_s g_sdmmc1 = static struct sam_sdmmc_state_s g_sdmmc1 =
{ {
@@ -174,14 +174,14 @@ static int sam_sdmmc_cardetect(struct sam_sdmmc_state_s *state)
} }
#ifdef CONFIG_SAMA5_SDMMC0 #ifdef CONFIG_SAMA5_SDMMC0
static int sam_sdmmc0_cardetect(int irq, void *regs, FAR void *arg) static int sam_sdmmc0_cardetect(int irq, void *regs, void *arg)
{ {
return sam_sdmmc_cardetect(&g_sdmmc0); return sam_sdmmc_cardetect(&g_sdmmc0);
} }
#endif #endif
#ifdef CONFIG_SAMA5_SDMMC1 #ifdef CONFIG_SAMA5_SDMMC1
static int sam_sdmmc1_cardetect(int irq, void *regs, FAR void *arg) static int sam_sdmmc1_cardetect(int irq, void *regs, void *arg)
{ {
return sam_sdmmc_cardetect(&g_sdmmc1); return sam_sdmmc_cardetect(&g_sdmmc1);
} }
+2 -2
View File
@@ -163,14 +163,14 @@ void sam_spi1select(uint32_t devid, bool selected)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_SAMA5_SPI0
uint8_t sam_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi0status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
#endif #endif
#ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_SAMA5_SPI0
uint8_t sam_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) uint8_t sam_spi1status(struct spi_dev_s *dev, uint32_t devid)
{ {
return 0; return 0;
} }
+3 -3
View File
@@ -340,7 +340,7 @@ int sam_usbhost_initialize(void)
ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO, ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE, CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE,
(main_t)ohci_waiter, (FAR char * const *)NULL); (main_t)ohci_waiter, (char * const *)NULL);
if (ret < 0) if (ret < 0)
{ {
uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret); uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
@@ -362,7 +362,7 @@ int sam_usbhost_initialize(void)
ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO, ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE, CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE,
(main_t)ehci_waiter, (FAR char * const *)NULL); (main_t)ehci_waiter, (char * const *)NULL);
if (ret < 0) if (ret < 0)
{ {
uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
@@ -518,7 +518,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_USBDEV #ifdef CONFIG_USBDEV
void sam_usbsuspend(FAR struct usbdev_s *dev, bool resume) void sam_usbsuspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
@@ -86,17 +86,17 @@
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t static ajoy_buttonset_t
ajoy_supported(FAR const struct ajoy_lowerhalf_s *lower); ajoy_supported(const struct ajoy_lowerhalf_s *lower);
static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, static int ajoy_sample(const struct ajoy_lowerhalf_s *lower,
FAR struct ajoy_sample_s *sample); struct ajoy_sample_s *sample);
static ajoy_buttonset_t static ajoy_buttonset_t
ajoy_buttons(FAR const struct ajoy_lowerhalf_s *lower); ajoy_buttons(const struct ajoy_lowerhalf_s *lower);
static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, static void ajoy_enable(const struct ajoy_lowerhalf_s *lower,
ajoy_buttonset_t press, ajoy_buttonset_t release, ajoy_buttonset_t press, ajoy_buttonset_t release,
ajoy_handler_t handler, FAR void *arg); ajoy_handler_t handler, void *arg);
static void ajoy_disable(void); static void ajoy_disable(void);
static int ajoy_interrupt(int irq, FAR void *context, FAR void *arg); static int ajoy_interrupt(int irq, void *context, void *arg);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -135,7 +135,7 @@ static struct file g_adcfile;
/* Current interrupt handler and argument */ /* Current interrupt handler and argument */
static ajoy_handler_t g_ajoyhandler; static ajoy_handler_t g_ajoyhandler;
static FAR void *g_ajoyarg; static void *g_ajoyarg;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@@ -150,7 +150,7 @@ static FAR void *g_ajoyarg;
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t static ajoy_buttonset_t
ajoy_supported(FAR const struct ajoy_lowerhalf_s *lower) ajoy_supported(const struct ajoy_lowerhalf_s *lower)
{ {
iinfo("Supported: %02x\n", AJOY_SUPPORTED); iinfo("Supported: %02x\n", AJOY_SUPPORTED);
return (ajoy_buttonset_t)AJOY_SUPPORTED; return (ajoy_buttonset_t)AJOY_SUPPORTED;
@@ -164,11 +164,11 @@ ajoy_supported(FAR const struct ajoy_lowerhalf_s *lower)
* *
****************************************************************************/ ****************************************************************************/
static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, static int ajoy_sample(const struct ajoy_lowerhalf_s *lower,
FAR struct ajoy_sample_s *sample) struct ajoy_sample_s *sample)
{ {
struct adc_msg_s adcmsg[SAM_ADC_NCHANNELS]; struct adc_msg_s adcmsg[SAM_ADC_NCHANNELS];
FAR struct adc_msg_s *ptr; struct adc_msg_s *ptr;
ssize_t nread; ssize_t nread;
ssize_t offset; ssize_t offset;
int have; int have;
@@ -246,7 +246,7 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower,
****************************************************************************/ ****************************************************************************/
static ajoy_buttonset_t static ajoy_buttonset_t
ajoy_buttons(FAR const struct ajoy_lowerhalf_s *lower) ajoy_buttons(const struct ajoy_lowerhalf_s *lower)
{ {
ajoy_buttonset_t ret = 0; ajoy_buttonset_t ret = 0;
int i; int i;
@@ -278,9 +278,9 @@ ajoy_buttons(FAR const struct ajoy_lowerhalf_s *lower)
* *
****************************************************************************/ ****************************************************************************/
static void ajoy_enable(FAR const struct ajoy_lowerhalf_s *lower, static void ajoy_enable(const struct ajoy_lowerhalf_s *lower,
ajoy_buttonset_t press, ajoy_buttonset_t release, ajoy_buttonset_t press, ajoy_buttonset_t release,
ajoy_handler_t handler, FAR void *arg) ajoy_handler_t handler, void *arg)
{ {
irqstate_t flags; irqstate_t flags;
ajoy_buttonset_t either = press | release; ajoy_buttonset_t either = press | release;
@@ -367,7 +367,7 @@ static void ajoy_disable(void)
* *
****************************************************************************/ ****************************************************************************/
static int ajoy_interrupt(int irq, FAR void *context, FAR void *arg) static int ajoy_interrupt(int irq, void *context, void *arg)
{ {
DEBUGASSERT(g_ajoyhandler); DEBUGASSERT(g_ajoyhandler);
if (g_ajoyhandler) if (g_ajoyhandler)
@@ -57,8 +57,8 @@
int sam_at25_automount(int minor) int sam_at25_automount(int minor)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
FAR struct mtd_dev_s *mtd; struct mtd_dev_s *mtd;
static bool initialized = false; static bool initialized = false;
int ret; int ret;
@@ -75,7 +75,7 @@
#ifdef HAVE_I2CTOOL #ifdef HAVE_I2CTOOL
static void sam_i2c_register(int bus) static void sam_i2c_register(int bus)
{ {
FAR struct i2c_master_s *i2c; struct i2c_master_s *i2c;
int ret; int ret;
i2c = sam_i2cbus_initialize(bus); i2c = sam_i2cbus_initialize(bus);

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