diff --git a/boards/arm/cxd56xx/common/src/cxd56_altmdm.c b/boards/arm/cxd56xx/common/src/cxd56_altmdm.c index fc746f12ea7..0fed0f75cab 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_altmdm.c +++ b/boards/arm/cxd56xx/common/src/cxd56_altmdm.c @@ -143,8 +143,8 @@ void board_altmdm_poweron(void) } } - /* Slave request seems to float in Lite Hibernation and becomes HIGH at some - * times when it should stay LOW. + /* Slave request seems to float in Lite Hibernation and becomes HIGH at + * some times when it should stay LOW. */ cxd56_pin_config(PINCONF_SET(SLAVE_REQUEST, diff --git a/boards/arm/cxd56xx/common/src/cxd56_apds9930_scu.c b/boards/arm/cxd56xx/common/src/cxd56_apds9930_scu.c index 78c81b0d906..6d1740ac01e 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_apds9930_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_apds9930_scu.c @@ -50,6 +50,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_APDS9930_SCU int board_apds9930_initialize(int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_apds9960_i2c.c b/boards/arm/cxd56xx/common/src/cxd56_apds9960_i2c.c index 4004e72251f..0b028273742 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_apds9960_i2c.c +++ b/boards/arm/cxd56xx/common/src/cxd56_apds9960_i2c.c @@ -49,6 +49,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #if defined(CONFIG_CXD56_I2C) && defined(CONFIG_APDS9960) int board_apds9960_initialize(FAR const char *devpath, int bus) diff --git a/boards/arm/cxd56xx/common/src/cxd56_bh1721fvc_scu.c b/boards/arm/cxd56xx/common/src/cxd56_bh1721fvc_scu.c index e6802dacceb..df4e2bb6455 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bh1721fvc_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bh1721fvc_scu.c @@ -50,6 +50,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_BH1721FVC_SCU int board_bh1721fvc_initialize(FAR const char *devpath, int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_bh1745nuc_scu.c b/boards/arm/cxd56xx/common/src/cxd56_bh1745nuc_scu.c index fa9eefeb8d8..056532e1104 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bh1745nuc_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bh1745nuc_scu.c @@ -50,6 +50,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_BH1745NUC_SCU int board_bh1745nuc_initialize(FAR const char *devpath, int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_bm1383glv_scu.c b/boards/arm/cxd56xx/common/src/cxd56_bm1383glv_scu.c index ac0f272bfd7..5f366bc51a2 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bm1383glv_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bm1383glv_scu.c @@ -50,6 +50,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_BM1383GLV_SCU int board_bm1383glv_initialize(FAR const char *devpath, int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_bm1422gmv_scu.c b/boards/arm/cxd56xx/common/src/cxd56_bm1422gmv_scu.c index 74ee69720c6..37bfd520a6e 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bm1422gmv_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bm1422gmv_scu.c @@ -56,6 +56,10 @@ # define BM1422GMV_PATH_CNT 1 #endif +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_BM1422GMV_SCU int board_bm1422gmv_initialize(FAR const char *devpath, int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_bmi160_scu.c b/boards/arm/cxd56xx/common/src/cxd56_bmi160_scu.c index b20aa539404..04da76d3c73 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bmi160_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bmi160_scu.c @@ -62,6 +62,10 @@ # define ACCEL_NR_SEQS 1 #endif +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #if defined(CONFIG_SENSORS_BMI160_SCU) int board_bmi160_initialize(int bus) diff --git a/boards/arm/cxd56xx/common/src/cxd56_bmi160_spi.c b/boards/arm/cxd56xx/common/src/cxd56_bmi160_spi.c index 8e57be23aee..fd8d29968d7 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bmi160_spi.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bmi160_spi.c @@ -61,6 +61,10 @@ # define ACCEL_NR_SEQS 1 #endif +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #if defined(CONFIG_CXD56_SPI) && defined(CONFIG_SENSORS_BMI160) int board_bmi160_initialize(int bus) diff --git a/boards/arm/cxd56xx/common/src/cxd56_bmp280_i2c.c b/boards/arm/cxd56xx/common/src/cxd56_bmp280_i2c.c index eb32f7b25c1..3c62fcf1576 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bmp280_i2c.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bmp280_i2c.c @@ -49,6 +49,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #if defined(CONFIG_CXD56_I2C) && defined(CONFIG_SENSORS_BMP280) int board_bmp280_initialize(int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c b/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c index 2435baead79..b6486d2192e 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c @@ -62,6 +62,10 @@ # define TEMP_NR_SEQS 1 #endif +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_BMP280_SCU int board_bmp280_initialize(int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_crashdump.c b/boards/arm/cxd56xx/common/src/cxd56_crashdump.c index ca179bd6ceb..9ce0b8f4d0c 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_crashdump.c +++ b/boards/arm/cxd56xx/common/src/cxd56_crashdump.c @@ -225,9 +225,9 @@ void board_crashdump(uintptr_t currentsp, FAR void *tcb, /* Is it Invalid? */ - if (!(pdump->info.stacks.interrupt.sp <= pdump->info.stacks.interrupt.top && - pdump->info.stacks.interrupt.sp > pdump->info.stacks.interrupt.top - - pdump->info.stacks.interrupt.size)) + if (!(pdump->info.stacks.interrupt.sp <= pdump->info.stacks.interrupt.top + && pdump->info.stacks.interrupt.sp > pdump->info.stacks.interrupt.top + - pdump->info.stacks.interrupt.size)) { pdump->info.flags |= INVALID_INTSTACK_PTR; } diff --git a/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c b/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c index 25b405bc7f7..211a4112fa7 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c +++ b/boards/arm/cxd56xx/common/src/cxd56_gs2200m.c @@ -199,6 +199,7 @@ static void spi_pincontrol(int bus, bool on) CXD56_PIN_CONFIGS(PINCONFS_EMMCA_GPIO); } #endif + #ifdef CONFIG_CXD56_SPI5_PINMAP_SDIO if (on) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_i2cdev.c b/boards/arm/cxd56xx/common/src/cxd56_i2cdev.c index 5c7ff050b58..d2f7359aa16 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_i2cdev.c +++ b/boards/arm/cxd56xx/common/src/cxd56_i2cdev.c @@ -45,6 +45,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + /**************************************************************************** * Name: board_i2cdev_initialize * diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index 4dc81c24af8..9123adc73c6 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -146,69 +146,69 @@ /* Copy command (32 bytes) */ -struct ge2d_copycmd_s - { - uint32_t cmd; /* 0x00 */ - uint16_t srch; /* 0x04 */ - uint16_t srcv; /* 0x06 */ - uint32_t saddr; /* 0x08 */ - uint32_t daddr; /* 0x0c */ - uint16_t spitch; /* 0x10 */ - uint16_t dpitch; /* 0x12 */ - uint32_t reserved[3]; - } __attribute__ ((aligned(16))); +struct __attribute__ ((aligned(16))) ge2d_copycmd_s +{ + uint32_t cmd; /* 0x00 */ + uint16_t srch; /* 0x04 */ + uint16_t srcv; /* 0x06 */ + uint32_t saddr; /* 0x08 */ + uint32_t daddr; /* 0x0c */ + uint16_t spitch; /* 0x10 */ + uint16_t dpitch; /* 0x12 */ + uint32_t reserved[3]; +}; /* Raster operation (ROP) command (48 bytes) */ -struct ge2d_ropcmd_s - { - uint16_t cmd; /* 0x00 */ - uint8_t rop; /* 0x02 */ - uint8_t options; /* 0x03 */ - uint16_t srch; /* 0x04 */ - uint16_t srcv; /* 0x06 */ - uint32_t saddr; /* 0x08 */ - uint32_t daddr; /* 0x0c */ - uint16_t spitch; /* 0x10 */ - uint16_t dpitch; /* 0x12 */ +struct __attribute__ ((aligned(16))) ge2d_ropcmd_s +{ + uint16_t cmd; /* 0x00 */ + uint8_t rop; /* 0x02 */ + uint8_t options; /* 0x03 */ + uint16_t srch; /* 0x04 */ + uint16_t srcv; /* 0x06 */ + uint32_t saddr; /* 0x08 */ + uint32_t daddr; /* 0x0c */ + uint16_t spitch; /* 0x10 */ + uint16_t dpitch; /* 0x12 */ - uint32_t fixedcolor; /* 0x14 */ - uint32_t pataddr; /* 0x18 */ - uint16_t patpitch; /* 0x1c */ - uint8_t pathoffset; /* 0x1e */ - uint8_t patvoffset; /* 0x1f */ + uint32_t fixedcolor; /* 0x14 */ + uint32_t pataddr; /* 0x18 */ + uint16_t patpitch; /* 0x1c */ + uint8_t pathoffset; /* 0x1e */ + uint8_t patvoffset; /* 0x1f */ - uint16_t desth; /* 0x20 */ - uint16_t destv; /* 0x22 */ - uint16_t ratioh; /* 0x24 */ - uint16_t ratiov; /* 0x26 */ + uint16_t desth; /* 0x20 */ + uint16_t destv; /* 0x22 */ + uint16_t ratioh; /* 0x24 */ + uint16_t ratiov; /* 0x26 */ - uint8_t hphaseinit; /* 0x28 */ - uint8_t hphaseoffset; /* 0x29: must be 0 */ - uint8_t vphaseinit; /* 0x2a */ - uint8_t vphaseoffset; /* 0x2b: must be 0 */ + uint8_t hphaseinit; /* 0x28 */ + uint8_t hphaseoffset; /* 0x29: must be 0 */ + uint8_t vphaseinit; /* 0x2a */ + uint8_t vphaseoffset; /* 0x2b: must be 0 */ - uint32_t intpmode; /* 0x2c: interpolation mode */ - } __attribute__ ((aligned(16))); + uint32_t intpmode; /* 0x2c: interpolation mode */ +}; /* Alpha blending (AB) command (32 bytes) */ -struct ge2d_abcmd_s - { - uint16_t cmd; /* 0x00 */ - uint16_t mode; /* 0x02 */ - uint16_t srch; /* 0x04 */ - uint16_t srcv; /* 0x06 */ - uint32_t saddr; /* 0x08 */ - uint32_t daddr; /* 0x0c */ - uint16_t spitch; /* 0x10 */ - uint16_t dpitch; /* 0x12 */ +struct __attribute__ ((aligned(16))) ge2d_abcmd_s +{ + uint16_t cmd; /* 0x00 */ + uint16_t mode; /* 0x02 */ + uint16_t srch; /* 0x04 */ + uint16_t srcv; /* 0x06 */ + uint32_t saddr; /* 0x08 */ + uint32_t daddr; /* 0x0c */ + uint16_t spitch; /* 0x10 */ + uint16_t dpitch; /* 0x12 */ - uint32_t fixedsrc; /* 0x14 */ - uint32_t aaddr; /* 0x18 */ - uint16_t apitch; /* 0x1c */ - uint16_t reserved; - } __attribute__ ((aligned(16))); + uint32_t fixedsrc; /* 0x14 */ + uint32_t aaddr; /* 0x18 */ + uint16_t apitch; /* 0x1c */ + uint16_t reserved; +}; /**************************************************************************** * Private Data @@ -235,7 +235,7 @@ static void ip_semgive(sem_t * id) nxsem_post(id); } -static int intr_handler_ROT(int irq, FAR void *context, FAR void *arg) +static int intr_handler_rot(int irq, FAR void *context, FAR void *arg) { putreg32(1, ROT_INTR_CLEAR); putreg32(0, ROT_INTR_ENABLE); @@ -295,11 +295,19 @@ static uint16_t calc_ratio(uint16_t src, uint16_t dest) return 0; } -static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, - uint16_t srcwidth, uint16_t srcheight, - uint16_t srcpitch, uint16_t destwidth, - uint16_t destheight, uint16_t destpitch, uint8_t bpp, - uint8_t rop, uint8_t options, uint16_t patcolor) +static void *set_rop_cmd(void *cmdbuf, + void *srcaddr, + void *destaddr, + uint16_t srcwidth, + uint16_t srcheight, + uint16_t srcpitch, + uint16_t destwidth, + uint16_t destheight, + uint16_t destpitch, + uint8_t bpp, + uint8_t rop, + uint8_t options, + uint16_t patcolor) { struct ge2d_ropcmd_s *rc = (struct ge2d_ropcmd_s *)cmdbuf; uint16_t rv; @@ -321,6 +329,7 @@ static void *set_rop_cmd(void *cmdbuf, void *srcaddr, void *destaddr, { return NULL; } + rh = calc_ratio(srcwidth, destwidth); if (rh == 0) { @@ -389,7 +398,7 @@ void imageproc_initialize(void) putreg32(0, ROT_INTR_ENABLE); putreg32(1, ROT_INTR_DISABLE); - irq_attach(CXD56_IRQ_ROT, intr_handler_ROT, NULL); + irq_attach(CXD56_IRQ_ROT, intr_handler_rot, NULL); up_enable_irq(CXD56_IRQ_ROT); } @@ -411,7 +420,9 @@ void imageproc_finalize(void) nxsem_destroy(&g_geexc); } -void imageproc_convert_yuv2rgb(uint8_t * ibuf, uint32_t hsize, uint32_t vsize) +void imageproc_convert_yuv2rgb(uint8_t * ibuf, + uint32_t hsize, + uint32_t vsize) { int ret; @@ -471,9 +482,13 @@ void imageproc_convert_yuv2gray(uint8_t * ibuf, uint8_t * obuf, size_t hsize, } } -int imageproc_resize(uint8_t * ibuf, uint16_t ihsize, - uint16_t ivsize, uint8_t * obuf, - uint16_t ohsize, uint16_t ovsize, int bpp) +int imageproc_resize(uint8_t * ibuf, + uint16_t ihsize, + uint16_t ivsize, + uint8_t * obuf, + uint16_t ohsize, + uint16_t ovsize, + int bpp) { void *cmd = g_gcmdbuf; size_t len; @@ -497,7 +512,8 @@ int imageproc_resize(uint8_t * ibuf, uint16_t ihsize, return -EINVAL; } - if ((ratio_check(ihsize, ohsize) != 0) || (ratio_check(ivsize, ovsize) != 0)) + if ((ratio_check(ihsize, ohsize) != 0) || + (ratio_check(ivsize, ovsize) != 0)) { return -EINVAL; } @@ -510,8 +526,19 @@ int imageproc_resize(uint8_t * ibuf, uint16_t ihsize, /* Create descriptor to graphics engine */ - cmd = set_rop_cmd(cmd, ibuf, obuf, ihsize, ivsize, ihsize, - ohsize, ovsize, ohsize, bpp, SRCCOPY, FIXEDCOLOR, 0x0080); + cmd = set_rop_cmd(cmd, + ibuf, + obuf, + ihsize, + ivsize, + ihsize, + ohsize, + ovsize, + ohsize, + bpp, + SRCCOPY, + FIXEDCOLOR, + 0x0080); if (cmd == NULL) { ip_semgive(&g_geexc); @@ -537,10 +564,14 @@ int imageproc_resize(uint8_t * ibuf, uint16_t ihsize, return 0; } -int imageproc_clip_and_resize(uint8_t * ibuf, uint16_t ihsize, - uint16_t ivsize, uint8_t * obuf, - uint16_t ohsize, uint16_t ovsize, - int bpp, imageproc_rect_t * clip_rect) +int imageproc_clip_and_resize(uint8_t * ibuf, + uint16_t ihsize, + uint16_t ivsize, + uint8_t * obuf, + uint16_t ohsize, + uint16_t ovsize, + int bpp, + imageproc_rect_t * clip_rect) { void *cmd = g_gcmdbuf; size_t len; @@ -569,7 +600,8 @@ int imageproc_clip_and_resize(uint8_t * ibuf, uint16_t ihsize, if (clip_rect != NULL) { - if ((clip_rect->x2 < clip_rect->x1) || (clip_rect->y2 < clip_rect->y1)) + if ((clip_rect->x2 < clip_rect->x1) || + (clip_rect->y2 < clip_rect->y1)) { return -EINVAL; } @@ -589,8 +621,8 @@ int imageproc_clip_and_resize(uint8_t * ibuf, uint16_t ihsize, } pix_bytes = bpp >> 3; - ibuf = - ibuf + (clip_rect->x1 * pix_bytes + clip_rect->y1 * ihsize * pix_bytes); + ibuf = ibuf + (clip_rect->x1 * pix_bytes + + clip_rect->y1 * ihsize * pix_bytes); } else { @@ -599,6 +631,7 @@ int imageproc_clip_and_resize(uint8_t * ibuf, uint16_t ihsize, { return -EINVAL; } + clip_width = ihsize; clip_height = ivsize; } @@ -611,9 +644,19 @@ int imageproc_clip_and_resize(uint8_t * ibuf, uint16_t ihsize, /* Create descriptor to graphics engine */ - cmd = set_rop_cmd(cmd, ibuf, obuf, - clip_width, clip_height, ihsize, - ohsize, ovsize, ohsize, bpp, SRCCOPY, FIXEDCOLOR, 0x0080); + cmd = set_rop_cmd(cmd, + ibuf, + obuf, + clip_width, + clip_height, + ihsize, + ohsize, + ovsize, + ohsize, + bpp, + SRCCOPY, + FIXEDCOLOR, + 0x0080); if (cmd == NULL) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_kx022_scu.c b/boards/arm/cxd56xx/common/src/cxd56_kx022_scu.c index d53da470482..7bab6a794a6 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_kx022_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_kx022_scu.c @@ -56,6 +56,10 @@ # define KX022_FIFO_CNT 1 #endif +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_KX022_SCU int board_kx022_initialize(FAR const char *devpath, int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_lt1pa01_scu.c b/boards/arm/cxd56xx/common/src/cxd56_lt1pa01_scu.c index f6430ea5f17..378bbae0cd0 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_lt1pa01_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_lt1pa01_scu.c @@ -50,6 +50,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_LT1PA01_SCU int board_lt1pa01_initialize(int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_rpr0521rs_scu.c b/boards/arm/cxd56xx/common/src/cxd56_rpr0521rs_scu.c index c20074b5458..dc9b10fb711 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_rpr0521rs_scu.c +++ b/boards/arm/cxd56xx/common/src/cxd56_rpr0521rs_scu.c @@ -50,6 +50,10 @@ #include "cxd56_i2c.h" +/**************************************************************************** + * Public Functions + ****************************************************************************/ + #ifdef CONFIG_SENSORS_RPR0521RS_SCU int board_rpr0521rs_initialize(int bus) { diff --git a/boards/arm/cxd56xx/common/src/cxd56_sensors.c b/boards/arm/cxd56xx/common/src/cxd56_sensors.c index f9fa4dcea35..d625e5c871e 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_sensors.c +++ b/boards/arm/cxd56xx/common/src/cxd56_sensors.c @@ -166,9 +166,9 @@ #define _I2C_DEVICE_WOPATH(_name) _DEVICE_WOPATH(_name, SENSOR_I2C) #define _SPI_DEVICE_WOPATH(_name) _DEVICE_WOPATH(_name, SENSOR_SPI) -/************************************************************************************ +/**************************************************************************** * Private Types - ************************************************************************************/ + ****************************************************************************/ typedef int (*_init_t)(int bus); typedef int (*_initdev_t)(FAR const char *devpath, int bus); @@ -278,7 +278,8 @@ int board_sensors_initialize(void) if (ret < 0) { - _err("Failed to init %s at bus %d: %d\n", dev->name, dev->bus, ret); + _err("Failed to init %s at bus %d: %d\n", + dev->name, dev->bus, ret); } }