boards: cxd56: spresense: nxstyle fixes

nxstyle fixes for the Sony Spresense board

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea 2020-04-17 11:23:05 +02:00 committed by patacongo
parent f2a6d88c9d
commit efbd6ada21
12 changed files with 61 additions and 29 deletions

View File

@ -78,7 +78,7 @@
* Pre-processor Definitions
****************************************************************************/
/* Clocking ****************************************************************/
/* Clocking *****************************************************************/
#ifdef CONFIG_CXD56_80MHz
# define BOARD_FCLKOUT_FREQUENCY (80000000)
@ -86,7 +86,7 @@
# define BOARD_FCLKOUT_FREQUENCY (100000000)
#endif
/* UART clocking ***********************************************************/
/* UART clocking ************************************************************/
/* Configure all UARTs to use the XTAL input frequency */
@ -94,7 +94,7 @@
#define BOARD_UART1_BASEFREQ BOARD_FCLKOUT_FREQUENCY
#define BOARD_UART2_BASEFREQ CONFIG_CXD56_XOSC_CLOCK
/* LED definitions *********************************************************/
/* LED definitions **********************************************************/
#define GPIO_LED1 (PIN_I2S1_BCK)
#define GPIO_LED2 (PIN_I2S1_LRCK)
@ -125,11 +125,11 @@
#define LED_ASSERTION (BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT)
#define LED_PANIC (BOARD_LED4_BIT)
/* Buttons definitions *****************************************************/
/* Buttons definitions ******************************************************/
#define BOARD_NUM_BUTTONS (2)
/* Power Control definitions ***********************************************/
/* Power Control definitions ************************************************/
/* For SPRESENSE board:
*
@ -192,17 +192,17 @@ enum board_power_device
POWER_LTE = PMIC_GPO(2),
};
/* CXD5247 audio control definitions ***************************************/
/* CXD5247 audio control definitions ****************************************/
#define CXD5247_XRST PIN_SPI3_CS2_X
#define CXD5247_AVDD (0x01)
#define CXD5247_DVDD (0x02)
/* LCD Display clocking ****************************************************/
/* LCD Display clocking *****************************************************/
#define ILI9340_SPI_MAXFREQUENCY 40000000
/* Display device pin definitions ******************************************/
/* Display device pin definitions *******************************************/
#if defined(CONFIG_LCD_ON_MAIN_BOARD) /* Display connected to main board. */
@ -234,12 +234,12 @@ enum board_power_device
#endif
/* Sensor device bus definitions *******************************************/
/* Sensor device bus definitions ********************************************/
#define SENSOR_I2C 0
#define SENSOR_SPI 3
/* Imager device pin definitions *******************************************/
/* Imager device pin definitions ********************************************/
#define IMAGER_RST PIN_SDIO_DIR1_3
#define IMAGER_SLEEP PIN_SDIO_DIR0

View File

@ -49,7 +49,7 @@
* Pre-processor Definitions
****************************************************************************/
/* Altair modem gpio definitions *******************************************/
/* Altair modem gpio definitions ********************************************/
#if defined(CONFIG_MODEM_ALTMDM) && defined(CONFIG_CXD56_GPIO_IRQ)

View File

@ -1,4 +1,4 @@
/***************************************************************************
/****************************************************************************
* boards/arm/cxd56xx/spresense/include/cxd56_imageproc.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
@ -32,6 +32,10 @@
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_IMAGEPROC_H
#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_IMAGEPROC_H
@ -55,6 +59,10 @@ extern "C"
};
typedef struct imageproc_rect_s imageproc_rect_t;
/****************************************************************************
* Public Functions Prototypes
****************************************************************************/
/* Initialize imageproc library
*/

View File

@ -61,8 +61,9 @@
* Public Functions
****************************************************************************/
/* Below functions are template to support the Board button for NuttX original
* feature. If you support the feature, copy this file into your board
/* Below functions are template to support the Board button for NuttX
* original feature.
* If you support the feature, copy this file into your board
* directory and implement the contents.
*/

View File

@ -57,7 +57,12 @@ static int g_chargerinitialized = 0;
*
****************************************************************************/
int board_charger_initialize(FAR const char *devpath, FAR int16_t *gaugemeter)
/****************************************************************************
* Public Functions
****************************************************************************/
int board_charger_initialize(FAR const char *devpath,
FAR int16_t *gaugemeter)
{
int ret;
@ -69,6 +74,7 @@ int board_charger_initialize(FAR const char *devpath, FAR int16_t *gaugemeter)
_err("ERROR: Failed to initialize charger.\n");
return -ENODEV;
}
g_chargerinitialized = 1;
}
@ -95,6 +101,7 @@ int board_charger_uninitialize(FAR const char *devpath)
_err("ERROR: Failed to finalize charger.\n");
return -ENODEV;
}
g_chargerinitialized = 0;
}

View File

@ -137,9 +137,9 @@ static int board_mscclassobject(int minor,
* Name: board_mscuninitialize
*
* Description:
* Un-initialize the USB storage class driver. This is just an application-
* specific wrapper aboutn usbmsc_unitialize() that is called form the
* composite device logic.
* Un-initialize the USB storage class driver.
* This is just an application specific wrapper for usbmsc_unitialize()
* that is called form the composite device logic.
*
* Input Parameters:
* classdev - The class driver instrance previously give to the composite

View File

@ -49,6 +49,10 @@
static int g_gaugeinitialized = 0;
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_gauge_initialize
*
@ -69,6 +73,7 @@ int board_gauge_initialize(FAR const char *devpath, FAR int16_t *gaugemeter)
_err("ERROR: Failed to initialize gauge.\n");
return -ENODEV;
}
g_gaugeinitialized = 1;
}
@ -95,6 +100,7 @@ int board_gauge_uninitialize(FAR const char *devpath)
_err("ERROR: Failed to finalize gauge.\n");
return -ENODEV;
}
g_gaugeinitialized = 0;
}

View File

@ -110,6 +110,7 @@ int board_gpio_status(uint32_t pin, bool *input, bool *output, bool *drive,
{
return ret;
}
*input = PINCONF_INPUT_ENABLED(pstat.input_en);
*drive = PINCONF_IS_DRIVE_HIGH(pstat.drive);
if (PINCONF_IS_FLOAT(pstat.pull))
@ -149,6 +150,7 @@ void board_gpio_write(uint32_t pin, int value)
{
cxd56_gpio_write(pin, (value > 0));
}
return;
}
@ -212,7 +214,10 @@ int board_gpio_intconfig(uint32_t pin, int mode, bool filter, xcpt_t isr)
* Name: board_gpio_intstatus
****************************************************************************/
int board_gpio_intstatus(uint32_t pin, int *mode, bool *filter, bool *enabled)
int board_gpio_intstatus(uint32_t pin,
int *mode,
bool *filter,
bool *enabled)
{
#ifdef CONFIG_CXD56_GPIO_IRQ
int ret;
@ -249,6 +254,7 @@ int board_gpio_intstatus(uint32_t pin, int *mode, bool *filter, bool *enabled)
*mode = 0;
break;
}
*filter = stat.filter;
*enabled = stat.enable;
@ -278,6 +284,7 @@ int board_gpio_int(uint32_t pin, bool enable)
cxd56_gpioint_disable(pin);
}
}
return irq;
#else
return -ENOTSUP;

View File

@ -67,10 +67,11 @@
* calls. This, however, may not be practical in many cases and will lead
* to "correct" but awkward implementations.
*
* boardctl() is non-standard OS interface to alleviate the problem. It
* basically circumvents the normal device driver ioctl interlace and allows
* the application to perform direct IOCTL-like calls to the board-specific
* logic. It is especially useful for setting up board operational and
* boardctl() is non-standard OS interface to alleviate the problem.
* It basically circumvents the normal device driver ioctl interlace and
* allows the application to perform direct IOCTL-like calls to the
* board-specific logic.
* It is especially useful for setting up board operational and
* test configurations.
*
* Input Parameters:

View File

@ -295,6 +295,7 @@ int board_flash_power_control(bool en)
board_power_control(POWER_FLASH, false);
}
return ret;
}

View File

@ -166,7 +166,8 @@ static void board_sdcard_enable(FAR void *arg)
ret = mount("/dev/mmcsd0", "/mnt/sd0", "vfat", 0, NULL);
if (ret == 0)
{
finfo("Successfully mount a SDCARD via the MMC/SD driver\n");
finfo(
"Successfully mount a SDCARD via the MMC/SD driver\n");
}
else
{
@ -181,9 +182,9 @@ static void board_sdcard_enable(FAR void *arg)
release_frequency_lock:
/* Release frequency lock */
/* Release frequency lock */
up_pm_release_freqlock(&g_hv_lock);
up_pm_release_freqlock(&g_hv_lock);
}
/****************************************************************************
@ -317,7 +318,7 @@ static int board_sdcard_detect_int(int irq, FAR void *context, FAR void *arg)
NULL);
}
return OK;
return OK;
}
#endif

View File

@ -74,8 +74,8 @@
* functions in your board-specific logic.
* These functions will perform chip selection and status operations
* using GPIOs in the way your board is configured.
* 3. Add a calls to cxd56_spibus_initialize() in your low level application
* initialization logic
* 3. Add a calls to cxd56_spibus_initialize() in your low level
* application initialization logic
* 4. The handle returned by cxd56_spibus_initialize() may then be used to
* bind the SPI driver to higher level logic (e.g., calling
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to