From ba03134bed2fac1b462e1c311331acaa524cc8de Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 15 Jun 2016 10:41:13 -0600 Subject: [PATCH] Centralize definitions associated with CONFIG_DEBUG_SPI --- Kconfig | 30 ++- arch/arm/src/efm32/efm32_spi.c | 20 -- arch/arm/src/kl/kl_spi.c | 23 -- arch/arm/src/lpc11xx/lpc11_spi.c | 20 -- arch/arm/src/lpc11xx/lpc11_ssp.c | 20 -- arch/arm/src/lpc17xx/lpc17_spi.c | 20 -- arch/arm/src/lpc17xx/lpc17_ssp.c | 20 -- arch/arm/src/lpc2378/lpc23xx_spi.c | 15 -- arch/arm/src/lpc43xx/lpc43_gpdma.c | 42 ---- arch/arm/src/lpc43xx/lpc43_spi.c | 12 -- arch/arm/src/lpc43xx/lpc43_ssp.c | 29 +-- arch/arm/src/sam34/sam_spi.c | 14 +- arch/arm/src/sama5/sam_spi.c | 14 +- arch/arm/src/samdl/sam_spi.c | 21 +- arch/arm/src/samv7/sam_qspi.c | 16 +- arch/arm/src/samv7/sam_spi.c | 14 +- arch/arm/src/samv7/sam_spi_slave.c | 23 +- arch/arm/src/stm32/stm32_spi.c | 14 -- arch/arm/src/stm32f7/stm32_spi.c | 13 -- arch/arm/src/stm32l4/stm32l4_qspi.c | 200 ++++++++---------- arch/arm/src/stm32l4/stm32l4_spi.c | 13 -- arch/arm/src/tiva/tiva_ssi.c | 58 +++-- arch/avr/src/avr/up_spi.c | 16 -- arch/mips/src/pic32mx/pic32mx-spi.c | 12 -- arch/mips/src/pic32mz/pic32mz-spi.c | 12 -- arch/sim/src/up_spiflash.c | 13 -- arch/z16/src/z16f/z16f_espi.c | 20 +- configs/cloudctrl/src/stm32_spi.c | 16 -- configs/demo9s12ne64/src/m9s12_spi.c | 16 -- configs/dk-tm4c129x/src/tm4c_ssi.c | 10 +- configs/ea3131/src/lpc31_spi.c | 16 -- configs/ea3152/src/lpc31_spi.c | 16 -- configs/eagle100/src/lm_ssi.c | 10 +- configs/ekk-lm3s9b96/src/lm_ssi.c | 10 +- configs/fire-stm32v2/src/stm32_spi.c | 16 -- configs/freedom-kl25z/src/kl_spi.c | 22 -- configs/freedom-kl26z/src/kl_spi.c | 22 -- configs/hymini-stm32v/src/stm32_spi.c | 16 -- configs/kwikstik-k40/src/k40_spi.c | 16 -- configs/lm3s6432-s2e/src/lm_ssi.c | 10 +- configs/lm3s6965-ek/src/lm_ssi.c | 10 +- configs/lm3s8962-ek/src/lm_ssi.c | 10 +- configs/lm4f120-launchpad/src/lm4f_ssi.c | 10 +- configs/lpcxpresso-lpc1115/src/lpc11_ssp.c | 22 +- configs/lpcxpresso-lpc1768/src/lpc17_ssp.c | 22 +- configs/maple/src/stm32_spi.c | 16 -- configs/mcu123-lpc214x/src/lpc2148_spi1.c | 14 -- configs/mikroe-stm32f4/src/stm32_spi.c | 16 -- configs/mirtoo/src/pic32_spi2.c | 15 -- configs/ne64badge/src/m9s12_spi.c | 16 -- configs/nucleo-144/src/stm32_spi.c | 12 -- configs/nucleo-f303re/src/stm32_spi.c | 16 -- configs/nucleo-f4x1re/src/stm32_spi.c | 16 -- configs/nucleo-l476rg/src/stm32_spi.c | 16 -- configs/olimex-lpc-h3131/src/lpc31_spi.c | 16 -- configs/olimex-lpc1766stk/src/lpc17_ssp.c | 21 +- configs/olimex-stm32-p107/src/stm32_spi.c | 16 -- configs/olimexino-stm32/src/stm32_spi.c | 16 -- configs/open1788/src/lpc17_ssp.c | 26 +-- configs/pic32mx-starterkit/src/pic32mx_spi.c | 16 -- configs/pic32mx7mmb/src/pic32_spi.c | 15 -- configs/pic32mz-starterkit/src/pic32mz_spi.c | 16 -- configs/sam3u-ek/src/sam_spi.c | 16 -- configs/sam4e-ek/src/sam_spi.c | 16 -- configs/sam4l-xplained/src/sam_spi.c | 16 -- configs/sama5d3-xplained/src/sam_spi.c | 16 -- configs/sama5d3x-ek/src/sam_spi.c | 16 -- configs/sama5d4-ek/src/sam_spi.c | 16 -- configs/samd20-xplained/src/sam_spi.c | 16 -- configs/samd21-xplained/src/sam_spi.c | 16 -- configs/same70-xplained/src/sam_spi.c | 16 -- configs/saml21-xplained/src/sam_spi.c | 16 -- configs/samv71-xult/src/sam_spi.c | 16 -- configs/shenzhou/src/stm32_spi.c | 22 -- configs/spark/src/stm32_spi.c | 16 -- configs/stm3210e-eval/src/stm32_spi.c | 16 -- configs/stm3220g-eval/src/stm32_spi.c | 16 -- configs/stm3240g-eval/src/stm32_spi.c | 16 -- configs/stm32_tiny/src/stm32_spi.c | 27 --- configs/stm32f103-minimum/src/stm32_spi.c | 23 -- configs/stm32f3discovery/src/stm32_spi.c | 16 -- .../stm32f429i-disco/src/stm32_ili93414ws.c | 2 +- configs/stm32f429i-disco/src/stm32_spi.c | 20 -- configs/stm32f4discovery/src/stm32_spi.c | 16 -- configs/stm32f746g-disco/src/stm32_spi.c | 14 -- configs/stm32l476vg-disco/src/stm32_spi.c | 21 -- configs/stm32ldiscovery/src/stm32_spi.c | 16 -- configs/sure-pic32mx/src/pic32mx_spi.c | 27 --- configs/teensy-2.0/src/at90usb_spi.c | 16 +- configs/teensy-3.x/src/k20_spi.c | 16 -- configs/teensy-lc/src/kl_spi.c | 22 -- configs/tm4c123g-launchpad/src/tm4c_ssi.c | 26 +-- configs/twr-k60n512/src/k60_spi.c | 16 -- configs/u-blox-c027/src/lpc17_ssp.c | 22 +- configs/viewtool-stm32f107/src/stm32_spi.c | 16 -- configs/zkit-arm-1769/src/lpc17_spi.c | 18 +- configs/zkit-arm-1769/src/lpc17_ssp.c | 28 +-- configs/zp214xpa/src/lpc2148_spi1.c | 20 +- drivers/analog/pga11x.c | 20 -- drivers/spi/spi_bitbang.c | 25 --- include/debug.h | 152 ++++++++----- include/nuttx/analog/pga11x.h | 4 +- include/nuttx/spi/spi_bitbang.c | 26 --- include/nuttx/spi/spi_bitbang.h | 26 +-- 104 files changed, 335 insertions(+), 1835 deletions(-) diff --git a/Kconfig b/Kconfig index b47091e1db8..9ea4948e01d 100644 --- a/Kconfig +++ b/Kconfig @@ -1091,14 +1091,40 @@ config DEBUG_SENSORS_INFO endif # DEBUG_SENSORS config DEBUG_SPI - bool "SPI Debug Output" + bool "SPI Debug Features" default n depends on SPI ---help--- - Enable I2C driver debug SYSLOG output (disabled by default). + Enable SPI debug features. + Support for this debug option is architecture-specific and may not be available for some MCUs. +if DEBUG_SPI + +config DEBUG_SPI_ERROR + bool "SPI Error Output" + default n + depends on DEBUG_ERROR + ---help--- + Enable SPI error output to SYSLOG. + +config DEBUG_SPI_WARN + bool "SPI Warnings Output" + default n + depends on DEBUG_WARN + ---help--- + Enable SPI warning output to SYSLOG. + +config DEBUG_SPI_INFO + bool "SPI Informational Output" + default n + depends on DEBUG_INFO + ---help--- + Enable SPI informational output to SYSLOG. + +endif # DEBUG_SPI + config DEBUG_TIMER bool "Timer Debug Output" default n diff --git a/arch/arm/src/efm32/efm32_spi.c b/arch/arm/src/efm32/efm32_spi.c index 7eafb1a7793..c4dbb3b282d 100644 --- a/arch/arm/src/efm32/efm32_spi.c +++ b/arch/arm/src/efm32/efm32_spi.c @@ -91,26 +91,6 @@ #define SPI_DMA16_CONFIG (EFM32_DMA_XFERSIZE_HWORD | EFM32_DMA_MEMINCR) #define SPI_DMA16NULL_CONFIG (EFM32_DMA_XFERSIZE_HWORD | EFM32_DMA_NOINCR) -/* Debug ********************************************************************/ -/* Check if SPI debug is enabled */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index 50553e3cf7c..abc587caff9 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -59,29 +59,6 @@ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ -/* Debug ********************************************************************/ -/* The following enable debug output from this file: - * - * CONFIG_DEBUG_FEATURES - Define to enable general debug features - * CONFIG_DEBUG_SPI - Define to enable basic SSP debug (needs CONFIG_DEBUG_FEATURES) - * CONFIG_DEBUG_INFO - Define to enable verbose SSP debug - */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/lpc11xx/lpc11_spi.c b/arch/arm/src/lpc11xx/lpc11_spi.c index 2354977bff1..db01c47acec 100644 --- a/arch/arm/src/lpc11xx/lpc11_spi.c +++ b/arch/arm/src/lpc11xx/lpc11_spi.c @@ -71,26 +71,6 @@ # error "CONFIG_SPI_EXCHANGE must not be defined in the configuration" #endif -/* Debug ********************************************************************/ -/* The following enable debug output from this file: - * - * CONFIG_DEBUG_FEATURES - Define to enable general debug features - * CONFIG_DEBUG_SPI - Define to enable basic SSP debug (needs CONFIG_DEBUG_FEATURES) - * CONFIG_DEBUG_INFO - Define to enable verbose SSP debug - */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /* SSP Clocking *************************************************************/ /* The CPU clock by 1, 2, 4, or 8 to get the SPI peripheral clock (SPI_CLOCK). * SPI_CLOCK may be further divided by 8-254 to get the SPI clock. If we diff --git a/arch/arm/src/lpc11xx/lpc11_ssp.c b/arch/arm/src/lpc11xx/lpc11_ssp.c index ab34fd40f8a..5b33da49b33 100644 --- a/arch/arm/src/lpc11xx/lpc11_ssp.c +++ b/arch/arm/src/lpc11xx/lpc11_ssp.c @@ -72,26 +72,6 @@ # error "CONFIG_SPI_EXCHANGE must not be defined in the configuration" #endif -/* Debug ********************************************************************/ -/* The following enable debug output from this file: - * - * CONFIG_DEBUG_FEATURES - Define to enable general debug features - * CONFIG_DEBUG_SPI - Define to enable basic SSP debug (needs CONFIG_DEBUG_FEATURES) - * CONFIG_DEBUG_INFO - Define to enable verbose SSP debug - */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define ssperr(x...) -# define spiinfo(x...) -#endif - /* SSP Clocking *************************************************************/ #if defined(LPC111x) diff --git a/arch/arm/src/lpc17xx/lpc17_spi.c b/arch/arm/src/lpc17xx/lpc17_spi.c index a3a4f28b0fc..7a53a040228 100644 --- a/arch/arm/src/lpc17xx/lpc17_spi.c +++ b/arch/arm/src/lpc17xx/lpc17_spi.c @@ -71,26 +71,6 @@ # error "CONFIG_SPI_EXCHANGE must not be defined in the configuration" #endif -/* Debug ********************************************************************/ -/* The following enable debug output from this file: - * - * CONFIG_DEBUG_FEATURES - Define to enable general debug features - * CONFIG_DEBUG_SPI - Define to enable basic SSP debug (needs CONFIG_DEBUG_FEATURES) - * CONFIG_DEBUG_INFO - Define to enable verbose SSP debug - */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /* SSP Clocking *************************************************************/ /* The CPU clock by 1, 2, 4, or 8 to get the SPI peripheral clock (SPI_CLOCK). * SPI_CLOCK may be further divided by 8-254 to get the SPI clock. If we diff --git a/arch/arm/src/lpc17xx/lpc17_ssp.c b/arch/arm/src/lpc17xx/lpc17_ssp.c index 25d2ef42ffe..435e0be236d 100644 --- a/arch/arm/src/lpc17xx/lpc17_ssp.c +++ b/arch/arm/src/lpc17xx/lpc17_ssp.c @@ -72,26 +72,6 @@ # error "CONFIG_SPI_EXCHANGE must not be defined in the configuration" #endif -/* Debug ********************************************************************/ -/* The following enable debug output from this file: - * - * CONFIG_DEBUG_FEATURES - Define to enable general debug features - * CONFIG_DEBUG_SPI - Define to enable basic SSP debug (needs CONFIG_DEBUG_FEATURES) - * CONFIG_DEBUG_INFO - Define to enable verbose SSP debug - */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define ssperr(x...) -# define spiinfo(x...) -#endif - /* SSP Clocking *************************************************************/ #if defined(LPC176x) diff --git a/arch/arm/src/lpc2378/lpc23xx_spi.c b/arch/arm/src/lpc2378/lpc23xx_spi.c index 12601053731..95b0cdcd1d7 100644 --- a/arch/arm/src/lpc2378/lpc23xx_spi.c +++ b/arch/arm/src/lpc2378/lpc23xx_spi.c @@ -75,21 +75,6 @@ # error CONFIG_SPI_EXCHANGE is not supported by this driver #endif -/* Debug ********************************************************************/ -/* CONFIG_DEBUG_SPI enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /* SPI Clocking. * * The CPU clock is divided by by 1, 2, 4, or 8 to get the SPI peripheral diff --git a/arch/arm/src/lpc43xx/lpc43_gpdma.c b/arch/arm/src/lpc43xx/lpc43_gpdma.c index 242b169952e..d104080a94d 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpdma.c +++ b/arch/arm/src/lpc43xx/lpc43_gpdma.c @@ -57,48 +57,6 @@ #ifdef CONFIG_LPC43_GPDMA -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#undef DMA_DEBUG /* Define to enable debug */ -#undef DMA_VERBOSE /* Define to enable verbose debug */ - -#ifdef DMA_DEBUG -# define dmaerr llerr -# ifdef DMA_VERBOSE -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# undef DMA_VERBOSE -# define dmaerr(x...) -# define spiinfo(x...) -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index 16dde2582e1..e686fb50543 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -64,18 +64,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /* SPI Clocking. * * The CPU clock by 1, 2, 4, or 8 to get the SPI peripheral clock (SPI_CLOCK). diff --git a/arch/arm/src/lpc43xx/lpc43_ssp.c b/arch/arm/src/lpc43xx/lpc43_ssp.c index 78c880b92ec..3deb90d5030 100644 --- a/arch/arm/src/lpc43xx/lpc43_ssp.c +++ b/arch/arm/src/lpc43xx/lpc43_ssp.c @@ -62,25 +62,8 @@ #include "lpc43_ccu.h" #include "lpc43_pinconfig.h" - #if defined(CONFIG_LPC43_SSP0) || defined(CONFIG_LPC43_SSP1) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* The following enable debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ @@ -369,7 +352,7 @@ static uint32_t ssp_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - ssperr("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -420,7 +403,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; default: - ssperr("Bad mode: %d\n", mode); + spierr("Bad mode: %d\n", mode); DEBUGASSERT(FALSE); return; } @@ -508,7 +491,7 @@ static uint16_t ssp_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Get the value from the RX FIFO and return it */ regval = ssp_getreg(priv, LPC43_SSP_DR_OFFSET); - ssperr("%04x->%04x\n", wd, regval); + spierr("%04x->%04x\n", wd, regval); return (uint16_t)regval; } @@ -555,7 +538,7 @@ static void ssp_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, /* While there is remaining to be sent (and no synchronization error has occurred) */ - ssperr("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); tx.pv = txbuffer; rx.pv = rxbuffer; @@ -567,7 +550,7 @@ static void ssp_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, * and (3) there are more bytes to be sent. */ - sspinfo("TX: rxpending: %d nwords: %d\n", rxpending, nwords); + spiinfo("TX: rxpending: %d nwords: %d\n", rxpending, nwords); while ((ssp_getreg(priv, LPC43_SSP_SR_OFFSET) & SSP_SR_TNF) && (rxpending < LPC43_SSP_FIFOSZ) && nwords) { @@ -590,7 +573,7 @@ static void ssp_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, /* Now, read the RX data from the RX FIFO while the RX FIFO is not empty */ - sspinfo("RX: rxpending: %d\n", rxpending); + spiinfo("RX: rxpending: %d\n", rxpending); while (ssp_getreg(priv, LPC43_SSP_SR_OFFSET) & SSP_SR_RNE) { data = ssp_getreg(priv, LPC43_SSP_DR_OFFSET); diff --git a/arch/arm/src/sam34/sam_spi.c b/arch/arm/src/sam34/sam_spi.c index a495bb9007e..0c01cb7dada 100644 --- a/arch/arm/src/sam34/sam_spi.c +++ b/arch/arm/src/sam34/sam_spi.c @@ -138,16 +138,6 @@ # undef CONFIG_SAM34_SPI_DMADEBUG #endif -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - #define DMA_INITIAL 0 #define DMA_AFTER_SETUP 1 #define DMA_AFTER_START 2 @@ -241,7 +231,7 @@ static inline void spi_putreg(struct sam_spidev_s *spi, uint32_t value, unsigned int offset); static inline struct sam_spidev_s *spi_device(struct sam_spics_s *spics); -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *spi, const char *msg); #else # define spi_dumpregs(spi,msg) @@ -509,7 +499,7 @@ static inline void spi_putreg(struct sam_spidev_s *spi, uint32_t value, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *spi, const char *msg) { spiinfo("%s:\n", msg); diff --git a/arch/arm/src/sama5/sam_spi.c b/arch/arm/src/sama5/sam_spi.c index ed5283af048..0bc887534a3 100644 --- a/arch/arm/src/sama5/sam_spi.c +++ b/arch/arm/src/sama5/sam_spi.c @@ -131,16 +131,6 @@ # undef CONFIG_SAMA5_SPI_DMADEBUG #endif -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - #define DMA_INITIAL 0 #define DMA_AFTER_SETUP 1 #define DMA_AFTER_START 2 @@ -232,7 +222,7 @@ static inline void spi_putreg(struct sam_spidev_s *spi, uint32_t value, unsigned int offset); static inline struct sam_spidev_s *spi_device(struct sam_spics_s *spics); -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *spi, const char *msg); #else # define spi_dumpregs(spi,msg) @@ -498,7 +488,7 @@ static inline void spi_putreg(struct sam_spidev_s *spi, uint32_t value, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *spi, const char *msg) { spiinfo("%s:\n", msg); diff --git a/arch/arm/src/samdl/sam_spi.c b/arch/arm/src/samdl/sam_spi.c index f2108ff3681..6211147a856 100644 --- a/arch/arm/src/samdl/sam_spi.c +++ b/arch/arm/src/samdl/sam_spi.c @@ -73,23 +73,6 @@ #ifdef SAMDL_HAVE_SPI -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Debug *******************************************************************/ -/* Check if SPI debug is enabled */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ @@ -163,7 +146,7 @@ static uint32_t spi_getreg32(struct sam_spidev_s *priv, static void spi_putreg32(struct sam_spidev_s *priv, uint32_t regval, unsigned int offset); -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *priv, const char *msg); #else # define spi_dumpregs(priv,msg) @@ -727,7 +710,7 @@ static void spi_putreg32(struct sam_spidev_s *priv, uint32_t regval, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *priv, const char *msg) { spiinfo("%s:\n", msg); diff --git a/arch/arm/src/samv7/sam_qspi.c b/arch/arm/src/samv7/sam_qspi.c index 615894f9307..ade8399bf3b 100644 --- a/arch/arm/src/samv7/sam_qspi.c +++ b/arch/arm/src/samv7/sam_qspi.c @@ -144,16 +144,6 @@ # undef CONFIG_SAMV7_QSPI_DMADEBUG #endif -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - #define DMA_INITIAL 0 #define DMA_AFTER_SETUP 1 #define DMA_AFTER_START 2 @@ -232,7 +222,7 @@ static inline uint32_t qspi_getreg(struct sam_qspidev_s *priv, static inline void qspi_putreg(struct sam_qspidev_s *priv, uint32_t value, unsigned int offset); -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void qspi_dumpregs(struct sam_qspidev_s *priv, const char *msg); #else # define qspi_dumpregs(priv,msg) @@ -463,7 +453,7 @@ static inline void qspi_putreg(struct sam_qspidev_s *priv, uint32_t value, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void qspi_dumpregs(struct sam_qspidev_s *priv, const char *msg) { qspiinfo("%s:\n", msg); @@ -1352,7 +1342,7 @@ static int qspi_command(struct qspi_dev_s *dev, DEBUGASSERT(priv != NULL && cmdinfo != NULL); -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_INFO qspiinfo("Transfer:\n"); qspiinfo(" flags: %02x\n", cmdinfo->flags); qspiinfo(" cmd: %04x\n", cmdinfo->cmd); diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index 10ed7dd6aa0..7f200b04225 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -126,16 +126,6 @@ # undef CONFIG_SAMV7_SPI_DMADEBUG #endif -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - #define DMA_INITIAL 0 #define DMA_AFTER_SETUP 1 #define DMA_AFTER_START 2 @@ -228,7 +218,7 @@ static inline void spi_putreg(struct sam_spidev_s *spi, uint32_t value, unsigned int offset); static inline struct sam_spidev_s *spi_device(struct sam_spics_s *spics); -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *spi, const char *msg); #else # define spi_dumpregs(spi,msg) @@ -517,7 +507,7 @@ static inline void spi_putreg(struct sam_spidev_s *spi, uint32_t value, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *spi, const char *msg) { spiinfo("%s:\n", msg); diff --git a/arch/arm/src/samv7/sam_spi_slave.c b/arch/arm/src/samv7/sam_spi_slave.c index fe8d1f6f4b0..80d6f436e03 100644 --- a/arch/arm/src/samv7/sam_spi_slave.c +++ b/arch/arm/src/samv7/sam_spi_slave.c @@ -74,19 +74,6 @@ # define CONFIG_SAMV7_SPI_SLAVE_QSIZE 8 #endif -/* Debug *******************************************************************/ -/* Check if SPI debug is enabled */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ @@ -144,7 +131,7 @@ static uint32_t spi_getreg(struct sam_spidev_s *priv, static void spi_putreg(struct sam_spidev_s *priv, uint32_t value, unsigned int offset); -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *priv, const char *msg); #else # define spi_dumpregs(priv,msg) @@ -339,7 +326,7 @@ static void spi_putreg(struct sam_spidev_s *priv, uint32_t value, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(struct sam_spidev_s *priv, const char *msg) { spiinfo("%s:\n", msg); @@ -448,7 +435,7 @@ static int spi_interrupt(struct sam_spidev_s *priv) * bit. */ -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_ERROR /* Check the RX data overflow condition */ if ((pending & SPI_INT_OVRES) != 0) @@ -515,7 +502,7 @@ static int spi_interrupt(struct sam_spidev_s *priv) * Underrun Error Status Flag (UNDES) is set in the SPI_SR. */ -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_ERROR /* Check the TX data underflow condition */ if ((pending & SPI_INT_UNDES) != 0) @@ -882,7 +869,7 @@ static void spi_bind(struct spi_sctrlr_s *sctrlr, */ regval = (SPI_INT_RDRF | SPI_INT_NSSR); -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_ERROR regval |= SPI_INT_OVRES; #endif diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index d6744441451..807a13127f2 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -155,20 +155,6 @@ # error "Unknown STM32 DMA" #endif - -/* Debug ****************************************************************************/ -/* Check if SPI debug is enabled */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Private Types ************************************************************************************/ diff --git a/arch/arm/src/stm32f7/stm32_spi.c b/arch/arm/src/stm32f7/stm32_spi.c index 2a442daa94d..78b5eeaf06b 100644 --- a/arch/arm/src/stm32f7/stm32_spi.c +++ b/arch/arm/src/stm32f7/stm32_spi.c @@ -136,19 +136,6 @@ # define SPI_TXDMA8NULL_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_8BITS |DMA_SCR_DIR_M2P) #endif -/* Debug ****************************************************************************/ -/* Check if SPI debug is enabled */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Private Types ************************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_qspi.c b/arch/arm/src/stm32l4/stm32l4_qspi.c index c5863cc5def..14053a598f4 100644 --- a/arch/arm/src/stm32l4/stm32l4_qspi.c +++ b/arch/arm/src/stm32l4/stm32l4_qspi.c @@ -91,16 +91,6 @@ # undef CONFIG_STM32L4_QSPI_DMADEBUG #endif -#ifdef CONFIG_DEBUG_SPI -# define qspierr llerr -# define qspiwarn llwarn -# define qspiinfo llinfo -#else -# define qspierr(x...) -# define qspiwarn(x...) -# define qspiinfo(x...) -#endif - #define DMA_INITIAL 0 #define DMA_AFTER_SETUP 1 #define DMA_AFTER_START 2 @@ -275,13 +265,13 @@ static inline uint32_t qspi_getreg(struct stm32l4_qspidev_s *priv, static inline void qspi_putreg(struct stm32l4_qspidev_s *priv, uint32_t value, unsigned int offset); -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void qspi_dumpregs(struct stm32l4_qspidev_s *priv, const char *msg); #else # define qspi_dumpregs(priv,msg) #endif -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_GPIO) +#if defined(CONFIG_DEBUG_SPI_INFO) && defined(CONFIG_DEBUG_GPIO) static void qspi_dumpgpioconfig(const char *msg); #else # define qspi_dumpgpioconfig(msg) @@ -494,11 +484,11 @@ static inline void qspi_putreg(struct stm32l4_qspidev_s *priv, uint32_t value, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void qspi_dumpregs(struct stm32l4_qspidev_s *priv, const char *msg) { uint32_t regval; - qspiinfo("%s:\n", msg); + spiinfo("%s:\n", msg); #if 0 /* this extra verbose output may be helpful in some cases; you'll need @@ -506,77 +496,73 @@ static void qspi_dumpregs(struct stm32l4_qspidev_s *priv, const char *msg) */ regval = getreg32(priv->base + STM32L4_QUADSPI_CR_OFFSET); /* Control Register */ - qspiinfo("CR:%08x\n",regval); - qspiinfo(" EN:%1d ABORT:%1d DMAEN:%1d TCEN:%1d SSHIFT:%1d\n" - " FTHRES: %d\n" - " TEIE:%1d TCIE:%1d FTIE:%1d SMIE:%1d TOIE:%1d APMS:%1d PMM:%1d\n" - " PRESCALER: %d\n", - (regval&QSPI_CR_EN)?1:0, - (regval&QSPI_CR_ABORT)?1:0, - (regval&QSPI_CR_DMAEN)?1:0, - (regval&QSPI_CR_TCEN)?1:0, - (regval&QSPI_CR_SSHIFT)?1:0, - (regval&QSPI_CR_FTHRES_MASK)>>QSPI_CR_FTHRES_SHIFT, - (regval&QSPI_CR_TEIE)?1:0, - (regval&QSPI_CR_TCIE)?1:0, - (regval&QSPI_CR_FTIE)?1:0, - (regval&QSPI_CR_SMIE)?1:0, - (regval&QSPI_CR_TOIE)?1:0, - (regval&QSPI_CR_APMS)?1:0, - (regval&QSPI_CR_PMM)?1:0, - (regval&QSPI_CR_PRESCALER_MASK)>>QSPI_CR_PRESCALER_SHIFT - ); + spiinfo("CR:%08x\n",regval); + spiinfo(" EN:%1d ABORT:%1d DMAEN:%1d TCEN:%1d SSHIFT:%1d\n" + " FTHRES: %d\n" + " TEIE:%1d TCIE:%1d FTIE:%1d SMIE:%1d TOIE:%1d APMS:%1d PMM:%1d\n" + " PRESCALER: %d\n", + (regval & QSPI_CR_EN) ? 1 : 0, + (regval & QSPI_CR_ABORT) ? 1 : 0, + (regval & QSPI_CR_DMAEN) ? 1 : 0, + (regval & QSPI_CR_TCEN) ? 1 : 0, + (regval & QSPI_CR_SSHIFT) ? 1 : 0, + (regval & QSPI_CR_FTHRES_MASK) >> QSPI_CR_FTHRES_SHIFT, + (regval & QSPI_CR_TEIE) ? 1 : 0, + (regval & QSPI_CR_TCIE) ? 1 : 0, + (regval & QSPI_CR_FTIE) ? 1 : 0, + (regval & QSPI_CR_SMIE) ? 1 : 0, + (regval & QSPI_CR_TOIE) ? 1 : 0, + (regval & QSPI_CR_APMS) ? 1 : 0, + (regval & QSPI_CR_PMM) ? 1 : 0, + (regval & QSPI_CR_PRESCALER_MASK) >> QSPI_CR_PRESCALER_SHIFT); regval = getreg32(priv->base + STM32L4_QUADSPI_DCR_OFFSET); /* Device Configuration Register */ - qspiinfo("DCR:%08x\n",regval); - qspiinfo(" CKMODE:%1d CSHT:%d FSIZE:%d\n", - (regval&QSPI_DCR_CKMODE)?1:0, - (regval&QSPI_DCR_CSHT_MASK)>>QSPI_DCR_CSHT_SHIFT, - (regval&QSPI_DCR_FSIZE_MASK)>>QSPI_DCR_FSIZE_SHIFT - ); + spiinfo("DCR:%08x\n",regval); + spiinfo(" CKMODE:%1d CSHT:%d FSIZE:%d\n", + (regval & QSPI_DCR_CKMODE) ? 1 : 0, + (regval & QSPI_DCR_CSHT_MASK) >> QSPI_DCR_CSHT_SHIFT, + (regval & QSPI_DCR_FSIZE_MASK) >> QSPI_DCR_FSIZE_SHIFT); regval = getreg32(priv->base + STM32L4_QUADSPI_CCR_OFFSET); /* Communication Configuration Register */ - qspiinfo("CCR:%08x\n",regval); - qspiinfo(" INST:%02x IMODE:%d ADMODE:%d ADSIZE:%d ABMODE:%d\n" - " ABSIZE:%d DCYC:%d DMODE:%d FMODE:%d\n" - " SIOO:%1d DDRM:%1d\n", - (regval&QSPI_CCR_INSTRUCTION_MASK)>>QSPI_CCR_INSTRUCTION_SHIFT, - (regval&QSPI_CCR_IMODE_MASK)>>QSPI_CCR_IMODE_SHIFT, - (regval&QSPI_CCR_ADMODE_MASK)>>QSPI_CCR_ADMODE_SHIFT, - (regval&QSPI_CCR_ADSIZE_MASK)>>QSPI_CCR_ABSIZE_SHIFT, - (regval&QSPI_CCR_ABMODE_MASK)>>QSPI_CCR_ABMODE_SHIFT, - (regval&QSPI_CCR_ABSIZE_MASK)>>QSPI_CCR_ABSIZE_SHIFT, - (regval&QSPI_CCR_DCYC_MASK)>>QSPI_CCR_DCYC_SHIFT, - (regval&QSPI_CCR_DMODE_MASK)>>QSPI_CCR_DMODE_SHIFT, - (regval&QSPI_CCR_FMODE_MASK)>>QSPI_CCR_FMODE_SHIFT, - (regval&QSPI_CCR_SIOO)?1:0, - (regval&QSPI_CCR_DDRM)?1:0 - ); + spiinfo("CCR:%08x\n",regval); + spiinfo(" INST:%02x IMODE:%d ADMODE:%d ADSIZE:%d ABMODE:%d\n" + " ABSIZE:%d DCYC:%d DMODE:%d FMODE:%d\n" + " SIOO:%1d DDRM:%1d\n", + (regval & QSPI_CCR_INSTRUCTION_MASK) >> QSPI_CCR_INSTRUCTION_SHIFT, + (regval & QSPI_CCR_IMODE_MASK) >> QSPI_CCR_IMODE_SHIFT, + (regval & QSPI_CCR_ADMODE_MASK) >> QSPI_CCR_ADMODE_SHIFT, + (regval & QSPI_CCR_ADSIZE_MASK) >> QSPI_CCR_ABSIZE_SHIFT, + (regval & QSPI_CCR_ABMODE_MASK) >> QSPI_CCR_ABMODE_SHIFT, + (regval & QSPI_CCR_ABSIZE_MASK) >> QSPI_CCR_ABSIZE_SHIFT, + (regval & QSPI_CCR_DCYC_MASK) >> QSPI_CCR_DCYC_SHIFT, + (regval & QSPI_CCR_DMODE_MASK) >> QSPI_CCR_DMODE_SHIFT, + (regval & QSPI_CCR_FMODE_MASK) >> QSPI_CCR_FMODE_SHIFT, + (regval & QSPI_CCR_SIOO) ? 1 : 0, + (regval & QSPI_CCR_DDRM) ? 1 : 0); regval = getreg32(priv->base + STM32L4_QUADSPI_SR_OFFSET); /* Status Register */ - qspiinfo("SR:%08x\n",regval); - qspiinfo(" TEF:%1d TCF:%1d FTF:%1d SMF:%1d TOF:%1d BUSY:%1d FLEVEL:%d\n", - (regval&QSPI_SR_TEF)?1:0, - (regval&QSPI_SR_TCF)?1:0, - (regval&QSPI_SR_FTF)?1:0, - (regval&QSPI_SR_SMF)?1:0, - (regval&QSPI_SR_TOF)?1:0, - (regval&QSPI_SR_BUSY)?1:0, - (regval&QSPI_SR_FLEVEL_MASK)>>QSPI_SR_FLEVEL_SHIFT - ); + spiinfo("SR:%08x\n",regval); + spiinfo(" TEF:%1d TCF:%1d FTF:%1d SMF:%1d TOF:%1d BUSY:%1d FLEVEL:%d\n", + (regval & QSPI_SR_TEF) ? 1 : 0, + (regval & QSPI_SR_TCF) ? 1 : 0, + (regval & QSPI_SR_FTF) ? 1 : 0, + (regval & QSPI_SR_SMF) ? 1 : 0, + (regval & QSPI_SR_TOF) ? 1 : 0, + (regval & QSPI_SR_BUSY) ? 1 : 0, + (regval & QSPI_SR_FLEVEL_MASK) >> QSPI_SR_FLEVEL_SHIFT); #else - qspiinfo(" CR:%08x DCR:%08x CCR:%08x SR:%08x\n", + spiinfo(" CR:%08x DCR:%08x CCR:%08x SR:%08x\n", getreg32(priv->base + STM32L4_QUADSPI_CR_OFFSET), /* Control Register */ getreg32(priv->base + STM32L4_QUADSPI_DCR_OFFSET), /* Device Configuration Register */ getreg32(priv->base + STM32L4_QUADSPI_CCR_OFFSET), /* Communication Configuration Register */ getreg32(priv->base + STM32L4_QUADSPI_SR_OFFSET)); /* Status Register */ - qspiinfo(" DLR:%08x ABR:%08x PSMKR:%08x PSMAR:%08x\n", + spiinfo(" DLR:%08x ABR:%08x PSMKR:%08x PSMAR:%08x\n", getreg32(priv->base + STM32L4_QUADSPI_DLR_OFFSET), /* Data Length Register */ getreg32(priv->base + STM32L4_QUADSPI_ABR_OFFSET), /* Alternate Bytes Register */ getreg32(priv->base + STM32L4_QUADSPI_PSMKR_OFFSET), /* Polling Status mask Register */ getreg32(priv->base + STM32L4_QUADSPI_PSMAR_OFFSET)); /* Polling Status match Register */ - qspiinfo(" PIR:%08x LPTR:%08x\n", + spiinfo(" PIR:%08x LPTR:%08x\n", getreg32(priv->base + STM32L4_QUADSPI_PIR_OFFSET), /* Polling Interval Register */ getreg32(priv->base + STM32L4_QUADSPI_LPTR_OFFSET)); /* Low-Power Timeout Register */ (void)regval; @@ -584,29 +570,29 @@ static void qspi_dumpregs(struct stm32l4_qspidev_s *priv, const char *msg) } #endif -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_GPIO) +#if defined(CONFIG_DEBUG_SPI_INFO) && defined(CONFIG_DEBUG_GPIO) static void qspi_dumpgpioconfig(const char *msg) { uint32_t regval; - qspiinfo("%s:\n", msg); + spiinfo("%s:\n", msg); regval = getreg32(STM32L4_GPIOE_MODER); - qspiinfo("E_MODER:%08x\n",regval); + spiinfo("E_MODER:%08x\n",regval); regval = getreg32(STM32L4_GPIOE_OTYPER); - qspiinfo("E_OTYPER:%08x\n",regval); + spiinfo("E_OTYPER:%08x\n",regval); regval = getreg32(STM32L4_GPIOE_OSPEED); - qspiinfo("E_OSPEED:%08x\n",regval); + spiinfo("E_OSPEED:%08x\n",regval); regval = getreg32(STM32L4_GPIOE_PUPDR); - qspiinfo("E_PUPDR:%08x\n",regval); + spiinfo("E_PUPDR:%08x\n",regval); regval = getreg32(STM32L4_GPIOE_AFRL); - qspiinfo("E_AFRL:%08x\n",regval); + spiinfo("E_AFRL:%08x\n",regval); regval = getreg32(STM32L4_GPIOE_AFRH); - qspiinfo("E_AFRH:%08x\n",regval); + spiinfo("E_AFRH:%08x\n",regval); } #endif @@ -717,21 +703,21 @@ static int qspi_setupxctnfromcmd(struct qspi_xctnspec_s *xctn, { DEBUGASSERT(xctn != NULL && cmdinfo != NULL); -#ifdef CONFIG_DEBUG_SPI - qspiinfo("Transfer:\n"); - qspiinfo(" flags: %02x\n", cmdinfo->flags); - qspiinfo(" cmd: %04x\n", cmdinfo->cmd); +#ifdef CONFIG_DEBUG_SPI_INFO + spiinfo("Transfer:\n"); + spiinfo(" flags: %02x\n", cmdinfo->flags); + spiinfo(" cmd: %04x\n", cmdinfo->cmd); if (QSPICMD_ISADDRESS(cmdinfo->flags)) { - qspiinfo(" address/length: %08lx/%d\n", + spiinfo(" address/length: %08lx/%d\n", (unsigned long)cmdinfo->addr, cmdinfo->addrlen); } if (QSPICMD_ISDATA(cmdinfo->flags)) { - qspiinfo(" %s Data:\n", QSPICMD_ISWRITE(cmdinfo->flags) ? "Write" : "Read"); - qspiinfo(" buffer/length: %p/%d\n", cmdinfo->buffer, cmdinfo->buflen); + spiinfo(" %s Data:\n", QSPICMD_ISWRITE(cmdinfo->flags) ? "Write" : "Read"); + spiinfo(" buffer/length: %p/%d\n", cmdinfo->buffer, cmdinfo->buflen); } #endif @@ -841,14 +827,14 @@ static int qspi_setupxctnfrommem(struct qspi_xctnspec_s *xctn, { DEBUGASSERT(xctn != NULL && meminfo != NULL); -#ifdef CONFIG_DEBUG_SPI - qspiinfo("Transfer:\n"); - qspiinfo(" flags: %02x\n", meminfo->flags); - qspiinfo(" cmd: %04x\n", meminfo->cmd); - qspiinfo(" address/length: %08lx/%d\n", +#ifdef CONFIG_DEBUG_SPI_INFO + spiinfo("Transfer:\n"); + spiinfo(" flags: %02x\n", meminfo->flags); + spiinfo(" cmd: %04x\n", meminfo->cmd); + spiinfo(" address/length: %08lx/%d\n", (unsigned long)meminfo->addr, meminfo->addrlen); - qspiinfo(" %s Data:\n", QSPIMEM_ISWRITE(meminfo->flags) ? "Write" : "Read"); - qspiinfo(" buffer/length: %p/%d\n", meminfo->buffer, meminfo->buflen); + spiinfo(" %s Data:\n", QSPIMEM_ISWRITE(meminfo->flags) ? "Write" : "Read"); + spiinfo(" buffer/length: %p/%d\n", meminfo->buffer, meminfo->buflen); #endif DEBUGASSERT(meminfo->cmd < 256); @@ -1461,7 +1447,7 @@ static int qspi_memory_dma(struct stm32l4_qspidev_s *priv, (wdentry_t)qspi_dma_timeout, 1, (uint32_t)priv); if (ret != OK) { - qspierr("ERROR: wd_start failed: %d\n", ret); + spierr("ERROR: wd_start failed: %d\n", ret); } /* Wait for the DMA complete */ @@ -1524,7 +1510,7 @@ static int qspi_memory_dma(struct stm32l4_qspidev_s *priv, if (priv->result) { - qspierr("ERROR: DMA failed with result: %d\n", priv->result); + spierr("ERROR: DMA failed with result: %d\n", priv->result); } return priv->result; @@ -1694,7 +1680,7 @@ static int qspi_lock(struct qspi_dev_s *dev, bool lock) { struct stm32l4_qspidev_s *priv = (struct stm32l4_qspidev_s *)dev; - qspiinfo("lock=%d\n", lock); + spiinfo("lock=%d\n", lock); if (lock) { /* Take the semaphore (perhaps waiting) */ @@ -1747,7 +1733,7 @@ static uint32_t qspi_setfrequency(struct qspi_dev_s *dev, uint32_t frequency) return 0; } - qspiinfo("frequency=%d\n", frequency); + spiinfo("frequency=%d\n", frequency); DEBUGASSERT(priv); /* Wait till BUSY flag reset */ @@ -1799,14 +1785,14 @@ static uint32_t qspi_setfrequency(struct qspi_dev_s *dev, uint32_t frequency) /* Calculate the new actual frequency */ actual = STL32L4_QSPI_CLOCK / prescaler; - qspiinfo("prescaler=%d actual=%d\n", prescaler, actual); + spiinfo("prescaler=%d actual=%d\n", prescaler, actual); /* Save the frequency setting */ priv->frequency = frequency; priv->actual = actual; - qspiinfo("Frequency %d->%d\n", frequency, actual); + spiinfo("Frequency %d->%d\n", frequency, actual); return actual; } @@ -1839,7 +1825,7 @@ static void qspi_setmode(struct qspi_dev_s *dev, enum qspi_mode_e mode) return; } - qspiinfo("mode=%d\n", mode); + spiinfo("mode=%d\n", mode); /* Has the mode changed? */ @@ -1869,14 +1855,14 @@ static void qspi_setmode(struct qspi_dev_s *dev, enum qspi_mode_e mode) case QSPIDEV_MODE1: /* CPOL=0; CPHA=1 */ case QSPIDEV_MODE2: /* CPOL=1; CPHA=0 */ - qspiinfo("unsupported mode=%d\n", mode); + spiinfo("unsupported mode=%d\n", mode); default: DEBUGASSERT(FALSE); return; } qspi_putreg(priv, regval, STM32L4_QUADSPI_DCR); - qspiinfo("DCR=%08x\n", regval); + spiinfo("DCR=%08x\n", regval); /* Save the mode so that subsequent re-configurations will be faster */ @@ -1906,7 +1892,7 @@ static void qspi_setbits(struct qspi_dev_s *dev, int nbits) if (8 != nbits) { - qspiinfo("unsupported nbits=%d\n", nbits); + spiinfo("unsupported nbits=%d\n", nbits); DEBUGASSERT(FALSE); } } @@ -2445,7 +2431,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) /* The STM32L4 has only a single QSPI port */ - qspiinfo("intf: %d\n", intf); + spiinfo("intf: %d\n", intf); DEBUGASSERT(intf == 0); /* Select the QSPI interface */ @@ -2486,7 +2472,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) } else { - qspierr("ERROR: QSPI%d not supported\n", intf); + spierr("ERROR: QSPI%d not supported\n", intf); return NULL; } @@ -2509,7 +2495,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) priv->dmach = stm32l4_dmachannel(DMACHAN_QUADSPI); if (!priv->dmach) { - qspierr("ERROR: Failed to allocate the DMA channel\n"); + spierr("ERROR: Failed to allocate the DMA channel\n"); priv->candma = false; } } @@ -2525,7 +2511,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) priv->dmadog = wd_create(); if (priv->dmadog == NULL) { - qspierr("ERROR: Failed to create wdog\n"); + spierr("ERROR: Failed to create wdog\n"); goto errout_with_dmahandles; } #endif @@ -2536,7 +2522,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) ret = irq_attach(priv->irq, priv->handler); if (ret < 0) { - qspierr("ERROR: Failed to attach irq %d\n", priv->irq); + spierr("ERROR: Failed to attach irq %d\n", priv->irq); goto errout_with_dmadog; } @@ -2553,7 +2539,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) ret = qspi_hw_initialize(priv); if (ret < 0) { - qspierr("ERROR: Failed to initialize QSPI hardware\n"); + spierr("ERROR: Failed to initialize QSPI hardware\n"); goto errout_with_irq; } diff --git a/arch/arm/src/stm32l4/stm32l4_spi.c b/arch/arm/src/stm32l4/stm32l4_spi.c index d64e7d5ccfd..3d64d812729 100644 --- a/arch/arm/src/stm32l4/stm32l4_spi.c +++ b/arch/arm/src/stm32l4/stm32l4_spi.c @@ -136,19 +136,6 @@ #define SPI_TXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_16BITS |DMA_CCR_DIR) #define SPI_TXDMA8NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_DIR) -/* Debug ****************************************************************************/ -/* Check if SPI debug is enabled */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Private Types ************************************************************************************/ diff --git a/arch/arm/src/tiva/tiva_ssi.c b/arch/arm/src/tiva/tiva_ssi.c index a5a1b4d0451..882d6460df0 100644 --- a/arch/arm/src/tiva/tiva_ssi.c +++ b/arch/arm/src/tiva/tiva_ssi.c @@ -69,14 +69,8 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -462,7 +456,7 @@ static uint32_t ssi_disable(struct tiva_ssidev_s *priv) retval = ssi_getreg(priv, TIVA_SSI_CR1_OFFSET); regval = (retval & ~SSI_CR1_SSE); ssi_putreg(priv, TIVA_SSI_CR1_OFFSET, regval); - ssiinfo("CR1: %08x\n", regval); + spiinfo("CR1: %08x\n", regval); return retval; } @@ -489,7 +483,7 @@ static void ssi_enable(struct tiva_ssidev_s *priv, uint32_t enable) regval &= ~SSI_CR1_SSE; regval |= (enable & SSI_CR1_SSE); ssi_putreg(priv, TIVA_SSI_CR1_OFFSET, regval); - ssiinfo("CR1: %08x\n", regval); + spiinfo("CR1: %08x\n", regval); } /**************************************************************************** @@ -538,14 +532,14 @@ static void ssi_semtake(sem_t *sem) static void ssi_txnull(struct tiva_ssidev_s *priv) { - ssiinfo("TX: ->0xffff\n"); + spiinfo("TX: ->0xffff\n"); ssi_putreg(priv, TIVA_SSI_DR_OFFSET, 0xffff); } static void ssi_txuint16(struct tiva_ssidev_s *priv) { uint16_t *ptr = (uint16_t *)priv->txbuffer; - ssiinfo("TX: %p->%04x\n", ptr, *ptr); + spiinfo("TX: %p->%04x\n", ptr, *ptr); ssi_putreg(priv, TIVA_SSI_DR_OFFSET, (uint32_t)(*ptr++)); priv->txbuffer = (void *)ptr; } @@ -553,7 +547,7 @@ static void ssi_txuint16(struct tiva_ssidev_s *priv) static void ssi_txuint8(struct tiva_ssidev_s *priv) { uint8_t *ptr = (uint8_t *)priv->txbuffer; - ssiinfo("TX: %p->%02x\n", ptr, *ptr); + spiinfo("TX: %p->%02x\n", ptr, *ptr); ssi_putreg(priv, TIVA_SSI_DR_OFFSET, (uint32_t)(*ptr++)); priv->txbuffer = (void *)ptr; } @@ -577,9 +571,9 @@ static void ssi_txuint8(struct tiva_ssidev_s *priv) static void ssi_rxnull(struct tiva_ssidev_s *priv) { -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO uint32_t regval = ssi_getreg(priv, TIVA_SSI_DR_OFFSET); - ssiinfo("RX: discard %04x\n", regval); + spiinfo("RX: discard %04x\n", regval); #else (void)ssi_getreg(priv, TIVA_SSI_DR_OFFSET); #endif @@ -589,7 +583,7 @@ static void ssi_rxuint16(struct tiva_ssidev_s *priv) { uint16_t *ptr = (uint16_t *)priv->rxbuffer; *ptr = (uint16_t)ssi_getreg(priv, TIVA_SSI_DR_OFFSET); - ssiinfo("RX: %p<-%04x\n", ptr, *ptr); + spiinfo("RX: %p<-%04x\n", ptr, *ptr); priv->rxbuffer = (void *)(++ptr); } @@ -597,7 +591,7 @@ static void ssi_rxuint8(struct tiva_ssidev_s *priv) { uint8_t *ptr = (uint8_t *)priv->rxbuffer; *ptr = (uint8_t)ssi_getreg(priv, TIVA_SSI_DR_OFFSET); - ssiinfo("RX: %p<-%02x\n", ptr, *ptr); + spiinfo("RX: %p<-%02x\n", ptr, *ptr); priv->rxbuffer = (void *)(++ptr); } @@ -841,7 +835,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer, #endif int ntxd; - ssiinfo("txbuffer: %p rxbuffer: %p nwords: %d\n", + spiinfo("txbuffer: %p rxbuffer: %p nwords: %d\n", txbuffer, rxbuffer, nwords); /* Set up to perform the transfer */ @@ -883,7 +877,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer, #ifndef CONFIG_SSI_POLLWAIT flags = enter_critical_section(); - ssiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x\n", + spiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x\n", priv->ntxwords, priv->nrxwords, priv->nwords, ssi_getreg(priv, TIVA_SSI_SR_OFFSET)); @@ -897,7 +891,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer, ssi_performrx(priv); - ssiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x IM: %08x\n", + spiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x IM: %08x\n", priv->ntxwords, priv->nrxwords, priv->nwords, ssi_getreg(priv, TIVA_SSI_SR_OFFSET), ssi_getreg(priv, TIVA_SSI_IM_OFFSET)); @@ -907,14 +901,14 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer, * with the transfer, so it should be safe with no timeout. */ - ssiinfo("Waiting for transfer complete\n"); + spiinfo("Waiting for transfer complete\n"); leave_critical_section(flags); do { ssi_semtake(&priv->xfrsem); } while (priv->nrxwords < priv->nwords); - ssiinfo("Transfer complete\n"); + spiinfo("Transfer complete\n"); #else /* Perform the transfer using polling logic. This will totally @@ -1023,14 +1017,14 @@ static int ssi_interrupt(int irq, void *context) /* Check for Rx FIFO overruns */ -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_ERROR if ((regval & SSI_RIS_ROR) != 0) { - ssierr("ERROR: Rx FIFO Overrun!\n"); + spierr("ERROR: Rx FIFO Overrun!\n"); } #endif - ssiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x\n", + spiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x\n", priv->ntxwords, priv->nrxwords, priv->nwords, ssi_getreg(priv, TIVA_SSI_SR_OFFSET)); @@ -1042,7 +1036,7 @@ static int ssi_interrupt(int irq, void *context) ssi_performrx(priv); - ssiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x IM: %08x\n", + spiinfo("ntxwords: %d nrxwords: %d nwords: %d SR: %08x IM: %08x\n", priv->ntxwords, priv->nrxwords, priv->nwords, ssi_getreg(priv, TIVA_SSI_SR_OFFSET), ssi_getreg(priv, TIVA_SSI_IM_OFFSET)); @@ -1057,7 +1051,7 @@ static int ssi_interrupt(int irq, void *context) /* Wake up the waiting thread */ - ssiinfo("Transfer complete\n"); + spiinfo("Transfer complete\n"); ssi_semgive(&priv->xfrsem); } @@ -1138,7 +1132,7 @@ static uint32_t ssi_setfrequencyinternal(struct tiva_ssidev_s *priv, uint32_t scr; uint32_t actual; - ssiinfo("frequency: %d\n", frequency); + spiinfo("frequency: %d\n", frequency); DEBUGASSERT(frequency); /* Has the frequency changed? */ @@ -1208,7 +1202,7 @@ static uint32_t ssi_setfrequencyinternal(struct tiva_ssidev_s *priv, regval &= ~SSI_CR0_SCR_MASK; regval |= (scr << SSI_CR0_SCR_SHIFT); ssi_putreg(priv, TIVA_SSI_CR0_OFFSET, regval); - ssiinfo("CR0: %08x CPSR: %08x\n", regval, cpsdvsr); + spiinfo("CR0: %08x CPSR: %08x\n", regval, cpsdvsr); /* Calcluate the actual frequency */ @@ -1262,7 +1256,7 @@ static void ssi_setmodeinternal(struct tiva_ssidev_s *priv, enum spi_mode_e mode uint32_t modebits; uint32_t regval; - ssiinfo("mode: %d\n", mode); + spiinfo("mode: %d\n", mode); DEBUGASSERT(priv); /* Has the number of bits per word changed? */ @@ -1299,7 +1293,7 @@ static void ssi_setmodeinternal(struct tiva_ssidev_s *priv, enum spi_mode_e mode regval &= ~(SSI_CR0_FRF_MASK | SSI_CR0_SPH | SSI_CR0_SPO); regval |= modebits; ssi_putreg(priv, TIVA_SSI_CR0_OFFSET, regval); - ssiinfo("CR0: %08x\n", regval); + spiinfo("CR0: %08x\n", regval); /* Save the mode so that subsequent re-configuratins will be faster */ @@ -1341,7 +1335,7 @@ static void ssi_setbitsinternal(struct tiva_ssidev_s *priv, int nbits) { uint32_t regval; - ssiinfo("nbits: %d\n", nbits); + spiinfo("nbits: %d\n", nbits); DEBUGASSERT(priv); if (nbits != priv->nbits && nbits >= 4 && nbits <= 16) { @@ -1349,7 +1343,7 @@ static void ssi_setbitsinternal(struct tiva_ssidev_s *priv, int nbits) regval &= ~SSI_CR0_DSS_MASK; regval |= ((nbits - 1) << SSI_CR0_DSS_SHIFT); ssi_putreg(priv, TIVA_SSI_CR0_OFFSET, regval); - ssiinfo("CR0: %08x\n", regval); + spiinfo("CR0: %08x\n", regval); priv->nbits = nbits; } @@ -1508,7 +1502,7 @@ FAR struct spi_dev_s *tiva_ssibus_initialize(int port) struct tiva_ssidev_s *priv; irqstate_t flags; - ssiinfo("port: %d\n", port); + spiinfo("port: %d\n", port); /* Set up for the selected port */ diff --git a/arch/avr/src/avr/up_spi.c b/arch/avr/src/avr/up_spi.c index 29b236dcb06..bf6eda418ed 100644 --- a/arch/avr/src/avr/up_spi.c +++ b/arch/avr/src/avr/up_spi.c @@ -62,22 +62,6 @@ #ifdef CONFIG_AVR_SPI -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/mips/src/pic32mx/pic32mx-spi.c b/arch/mips/src/pic32mx/pic32mx-spi.c index 886dbcae0e5..dddadf2c027 100644 --- a/arch/mips/src/pic32mx/pic32mx-spi.c +++ b/arch/mips/src/pic32mx/pic32mx-spi.c @@ -72,18 +72,6 @@ # error CONFIG_SPI_EXCHANGE not supported by this driver #endif -/* Debug */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/mips/src/pic32mz/pic32mz-spi.c b/arch/mips/src/pic32mz/pic32mz-spi.c index 633698787c5..5297a370b8e 100644 --- a/arch/mips/src/pic32mz/pic32mz-spi.c +++ b/arch/mips/src/pic32mz/pic32mz-spi.c @@ -67,18 +67,6 @@ #define BOARD_PBCLOCK BOARD_PBCLK2 -/* Debug */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/sim/src/up_spiflash.c b/arch/sim/src/up_spiflash.c index 51be923fd38..fa3862727e3 100644 --- a/arch/sim/src/up_spiflash.c +++ b/arch/sim/src/up_spiflash.c @@ -60,19 +60,6 @@ ************************************************************************************/ /* Configuration ********************************************************************/ -/* Debug ****************************************************************************/ -/* Check if SPI debug is enabled */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /* Define the FLASH SIZE in bytes */ #ifdef CONFIG_SIM_SPIFLASH_1M diff --git a/arch/z16/src/z16f/z16f_espi.c b/arch/z16/src/z16f/z16f_espi.c index 354974e5807..60db49a88b1 100644 --- a/arch/z16/src/z16f/z16f_espi.c +++ b/arch/z16/src/z16f/z16f_espi.c @@ -55,22 +55,6 @@ #ifdef CONFIG_Z16F_ESPI -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ -/* Debug *******************************************************************/ -/* Check if SPI debug is enabled */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ @@ -117,7 +101,7 @@ static void spi_putreg16(FAR struct z16f_spi_s *priv, uint16_t regval, # define spi_putreg16(priv,regval,regaddr) putreg16(regval, regaddr) #endif -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(FAR struct z16f_spi_s *priv, const char *msg); #else # define spi_dumpregs(priv,msg) @@ -317,7 +301,7 @@ static void spi_putreg16(FAR struct z16f_spi_s *priv, uint16_t regval, * ****************************************************************************/ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_SPI_INFO static void spi_dumpregs(FAR struct z16f_spi_s *priv, FAR const char *msg) { spiinfo("%s:\n", msg); diff --git a/configs/cloudctrl/src/stm32_spi.c b/configs/cloudctrl/src/stm32_spi.c index aa28e24f7f4..13054c3165b 100644 --- a/configs/cloudctrl/src/stm32_spi.c +++ b/configs/cloudctrl/src/stm32_spi.c @@ -54,22 +54,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/demo9s12ne64/src/m9s12_spi.c b/configs/demo9s12ne64/src/m9s12_spi.c index 0cccbecbb6a..e296ee5595b 100644 --- a/configs/demo9s12ne64/src/m9s12_spi.c +++ b/configs/demo9s12ne64/src/m9s12_spi.c @@ -50,22 +50,6 @@ #if defined(CONFIG_HCS12_SPI) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/dk-tm4c129x/src/tm4c_ssi.c b/configs/dk-tm4c129x/src/tm4c_ssi.c index 6e889b94bdb..8e142bfe322 100644 --- a/configs/dk-tm4c129x/src/tm4c_ssi.c +++ b/configs/dk-tm4c129x/src/tm4c_ssi.c @@ -62,14 +62,8 @@ /* Enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -110,14 +104,14 @@ void weak_function tm4c_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/ea3131/src/lpc31_spi.c b/configs/ea3131/src/lpc31_spi.c index a49eba9477b..74914bdce63 100644 --- a/configs/ea3131/src/lpc31_spi.c +++ b/configs/ea3131/src/lpc31_spi.c @@ -55,22 +55,6 @@ #if 0 /* At present, EA3131 specific logic is hard-coded in the file lpc31_spi.c * in arch/arm/src/lpc31xx */ -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/ea3152/src/lpc31_spi.c b/configs/ea3152/src/lpc31_spi.c index a34576b900c..0995794a0fd 100644 --- a/configs/ea3152/src/lpc31_spi.c +++ b/configs/ea3152/src/lpc31_spi.c @@ -55,22 +55,6 @@ #if 0 /* At present, EA3152 specific logic is hard-coded in the file lpc31_spi.c * in arch/arm/src/lpc31xx */ -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/eagle100/src/lm_ssi.c b/configs/eagle100/src/lm_ssi.c index 9c3f5b04d35..7befb1f87d6 100644 --- a/configs/eagle100/src/lm_ssi.c +++ b/configs/eagle100/src/lm_ssi.c @@ -62,14 +62,8 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -115,7 +109,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_MMCSD) { /* Assert the CS pin to the card */ @@ -128,7 +122,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/ekk-lm3s9b96/src/lm_ssi.c b/configs/ekk-lm3s9b96/src/lm_ssi.c index 6fc632f65b4..911e923e848 100644 --- a/configs/ekk-lm3s9b96/src/lm_ssi.c +++ b/configs/ekk-lm3s9b96/src/lm_ssi.c @@ -61,14 +61,8 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -115,7 +109,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) { @@ -136,7 +130,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif diff --git a/configs/fire-stm32v2/src/stm32_spi.c b/configs/fire-stm32v2/src/stm32_spi.c index b92bbdd2b4f..8d28ceb07a5 100644 --- a/configs/fire-stm32v2/src/stm32_spi.c +++ b/configs/fire-stm32v2/src/stm32_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/freedom-kl25z/src/kl_spi.c b/configs/freedom-kl25z/src/kl_spi.c index 33747807d9e..5c41ae348c4 100644 --- a/configs/freedom-kl25z/src/kl_spi.c +++ b/configs/freedom-kl25z/src/kl_spi.c @@ -51,28 +51,6 @@ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/freedom-kl26z/src/kl_spi.c b/configs/freedom-kl26z/src/kl_spi.c index d6e7fbea665..9b3cd6ff240 100644 --- a/configs/freedom-kl26z/src/kl_spi.c +++ b/configs/freedom-kl26z/src/kl_spi.c @@ -51,28 +51,6 @@ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/hymini-stm32v/src/stm32_spi.c b/configs/hymini-stm32v/src/stm32_spi.c index 757dffb6cca..25f18c961e4 100644 --- a/configs/hymini-stm32v/src/stm32_spi.c +++ b/configs/hymini-stm32v/src/stm32_spi.c @@ -54,22 +54,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/kwikstik-k40/src/k40_spi.c b/configs/kwikstik-k40/src/k40_spi.c index 4c4769bf6c2..e8e2da248b0 100644 --- a/configs/kwikstik-k40/src/k40_spi.c +++ b/configs/kwikstik-k40/src/k40_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/lm3s6432-s2e/src/lm_ssi.c b/configs/lm3s6432-s2e/src/lm_ssi.c index 9c3e7ebc5ad..5c0e771a545 100644 --- a/configs/lm3s6432-s2e/src/lm_ssi.c +++ b/configs/lm3s6432-s2e/src/lm_ssi.c @@ -60,14 +60,8 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -113,7 +107,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) @@ -128,7 +122,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lm3s6965-ek/src/lm_ssi.c b/configs/lm3s6965-ek/src/lm_ssi.c index 829567da7e6..8cdf0b01223 100644 --- a/configs/lm3s6965-ek/src/lm_ssi.c +++ b/configs/lm3s6965-ek/src/lm_ssi.c @@ -62,14 +62,8 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -118,7 +112,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) @@ -140,7 +134,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lm3s8962-ek/src/lm_ssi.c b/configs/lm3s8962-ek/src/lm_ssi.c index c5b9efa53d3..23478955036 100644 --- a/configs/lm3s8962-ek/src/lm_ssi.c +++ b/configs/lm3s8962-ek/src/lm_ssi.c @@ -62,14 +62,8 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -118,7 +112,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) @@ -140,7 +134,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lm4f120-launchpad/src/lm4f_ssi.c b/configs/lm4f120-launchpad/src/lm4f_ssi.c index c89b6d4c131..2e8d3e49b5b 100644 --- a/configs/lm4f120-launchpad/src/lm4f_ssi.c +++ b/configs/lm4f120-launchpad/src/lm4f_ssi.c @@ -63,14 +63,8 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif @@ -111,14 +105,14 @@ void weak_function lm4f_spidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c b/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c index ad9a6803e00..0d7be5f71e3 100644 --- a/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c @@ -58,18 +58,6 @@ * Pre-processor Definitions ************************************************************************************/ -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /* Dump GPIO registers */ #ifdef CONFIG_DEBUG_GPIO_INFO @@ -144,7 +132,7 @@ void weak_function lpcxpresso_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc11_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc11_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -154,7 +142,7 @@ void lpc11_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc11_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif @@ -162,7 +150,7 @@ uint8_t lpc11_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc11_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc11_ssp1select() Entry"); if (devid == SPIDEV_MMCSD) @@ -190,12 +178,12 @@ uint8_t lpc11_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) if (lpc11_gpioread(LPCXPRESSO_SD_CD) == 0) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } } - sspinfo("Returning zero\n"); + spiinfo("Returning zero\n"); return 0; } #endif diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c b/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c index 285dc9a048d..c56ab469398 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c @@ -58,18 +58,6 @@ * Pre-processor Definitions ************************************************************************************/ -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /* Dump GPIO registers */ #ifdef CONFIG_DEBUG_GPIO_INFO @@ -144,7 +132,7 @@ void weak_function lpcxpresso_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -154,7 +142,7 @@ void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif @@ -162,7 +150,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp1select() Entry"); if (devid == SPIDEV_MMCSD) @@ -190,12 +178,12 @@ uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) if (lpc17_gpioread(LPCXPRESSO_SD_CD) == 0) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } } - sspinfo("Returning zero\n"); + spiinfo("Returning zero\n"); return 0; } #endif diff --git a/configs/maple/src/stm32_spi.c b/configs/maple/src/stm32_spi.c index 7c25c23f05c..95040a67bf7 100644 --- a/configs/maple/src/stm32_spi.c +++ b/configs/maple/src/stm32_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/mcu123-lpc214x/src/lpc2148_spi1.c b/configs/mcu123-lpc214x/src/lpc2148_spi1.c index 99a5fa71171..72f4b12ccba 100644 --- a/configs/mcu123-lpc214x/src/lpc2148_spi1.c +++ b/configs/mcu123-lpc214x/src/lpc2148_spi1.c @@ -86,20 +86,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /* Clocking */ #define LPC214X_CCLKFREQ (LPC214X_FOSC*LPC214X_PLL_M) diff --git a/configs/mikroe-stm32f4/src/stm32_spi.c b/configs/mikroe-stm32f4/src/stm32_spi.c index e4882185ba4..3831378ece4 100644 --- a/configs/mikroe-stm32f4/src/stm32_spi.c +++ b/configs/mikroe-stm32f4/src/stm32_spi.c @@ -59,22 +59,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/mirtoo/src/pic32_spi2.c b/configs/mirtoo/src/pic32_spi2.c index a81488facd0..3c1d513b833 100644 --- a/configs/mirtoo/src/pic32_spi2.c +++ b/configs/mirtoo/src/pic32_spi2.c @@ -92,21 +92,6 @@ #define GPIO_PGA117_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTB|GPIO_PIN7) #define GPIO_SST25VF032B_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTB|GPIO_PIN13) -/* The following enable debug output from this file (needs CONFIG_DEBUG_FEATURES too). - * - * CONFIG_DEBUG_SPI - Define to enable basic SPI debug - */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/ne64badge/src/m9s12_spi.c b/configs/ne64badge/src/m9s12_spi.c index 37708f4042c..1539d0ca475 100644 --- a/configs/ne64badge/src/m9s12_spi.c +++ b/configs/ne64badge/src/m9s12_spi.c @@ -50,22 +50,6 @@ #if defined(CONFIG_HCS12_SPI) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/nucleo-144/src/stm32_spi.c b/configs/nucleo-144/src/stm32_spi.c index f206a0a61fa..9a1f28a94e2 100644 --- a/configs/nucleo-144/src/stm32_spi.c +++ b/configs/nucleo-144/src/stm32_spi.c @@ -61,18 +61,6 @@ * Pre-processor Definitions ************************************************************************************/ -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - #define ArraySize(x) (sizeof((x)) / sizeof((x)[0])) #if defined(CONFIG_NUCLEO_SPI1_TEST) diff --git a/configs/nucleo-f303re/src/stm32_spi.c b/configs/nucleo-f303re/src/stm32_spi.c index dccd4ca9eab..6251ede1da3 100644 --- a/configs/nucleo-f303re/src/stm32_spi.c +++ b/configs/nucleo-f303re/src/stm32_spi.c @@ -56,22 +56,6 @@ #ifdef CONFIG_SPI -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/nucleo-f4x1re/src/stm32_spi.c b/configs/nucleo-f4x1re/src/stm32_spi.c index abe60c0c0f9..82026a0d26a 100644 --- a/configs/nucleo-f4x1re/src/stm32_spi.c +++ b/configs/nucleo-f4x1re/src/stm32_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Data ************************************************************************************/ diff --git a/configs/nucleo-l476rg/src/stm32_spi.c b/configs/nucleo-l476rg/src/stm32_spi.c index c8c055fbe8c..a400cd52677 100644 --- a/configs/nucleo-l476rg/src/stm32_spi.c +++ b/configs/nucleo-l476rg/src/stm32_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Data ************************************************************************************/ diff --git a/configs/olimex-lpc-h3131/src/lpc31_spi.c b/configs/olimex-lpc-h3131/src/lpc31_spi.c index 5fbc30ae7f3..c9e9c6eec52 100644 --- a/configs/olimex-lpc-h3131/src/lpc31_spi.c +++ b/configs/olimex-lpc-h3131/src/lpc31_spi.c @@ -55,22 +55,6 @@ #if 0 /* At present, LPC-H3131 specific logic is hard-coded in the file lpc31_spi.c * in arch/arm/src/lpc31xx */ -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimex-lpc1766stk/src/lpc17_ssp.c b/configs/olimex-lpc1766stk/src/lpc17_ssp.c index f0b6652159d..9bb9b563bb9 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_ssp.c +++ b/configs/olimex-lpc1766stk/src/lpc17_ssp.c @@ -74,19 +74,6 @@ #endif /* Debug ********************************************************************/ - -/* The following enable debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /* Dump GPIO registers */ #ifdef CONFIG_DEBUG_GPIO_INFO @@ -278,7 +265,7 @@ void weak_function lpc1766stk_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_DISPLAY) { /* Assert/de-assert the CS pin to the card */ @@ -291,7 +278,7 @@ void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning nothing\n"); + spiinfo("Returning nothing\n"); return 0; } #endif @@ -299,7 +286,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_MMCSD) { /* Assert/de-assert the CS pin to the card */ @@ -312,7 +299,7 @@ void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif diff --git a/configs/olimex-stm32-p107/src/stm32_spi.c b/configs/olimex-stm32-p107/src/stm32_spi.c index a466092b176..9a454cfcfa6 100644 --- a/configs/olimex-stm32-p107/src/stm32_spi.c +++ b/configs/olimex-stm32-p107/src/stm32_spi.c @@ -54,22 +54,6 @@ #if defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimexino-stm32/src/stm32_spi.c b/configs/olimexino-stm32/src/stm32_spi.c index e10a0861c56..249a3b39d84 100644 --- a/configs/olimexino-stm32/src/stm32_spi.c +++ b/configs/olimexino-stm32/src/stm32_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/open1788/src/lpc17_ssp.c b/configs/open1788/src/lpc17_ssp.c index 929c8a5a656..600b04474da 100644 --- a/configs/open1788/src/lpc17_ssp.c +++ b/configs/open1788/src/lpc17_ssp.c @@ -61,21 +61,9 @@ * Pre-processor Definitions ****************************************************************************/ -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /* Dump GPIO registers */ -#ifdef CONFIG_DEBUG_INFO +#ifdef CONFIG_DEBUG_GPIO_INFO # define ssp_dumpgpio(p,m) lpc17_dumpgpio(p,m) #else # define ssp_dumpgpio(p,m) @@ -144,12 +132,12 @@ void weak_function open1788_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning nothing\n"); + spiinfo("Returning nothing\n"); return 0; } #endif @@ -157,7 +145,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_TOUCHSCREEN) { /* Assert/de-assert the CS pin to the touchscreen */ @@ -170,7 +158,7 @@ void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning nothing\n"); + spiinfo("Returning nothing\n"); return 0; } #endif @@ -178,12 +166,12 @@ uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP2 void lpc17_ssp2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t lpc17_ssp2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning nothing\n"); + spiinfo("Returning nothing\n"); return 0; } #endif diff --git a/configs/pic32mx-starterkit/src/pic32mx_spi.c b/configs/pic32mx-starterkit/src/pic32mx_spi.c index f2f150952b4..4c0e2d2261e 100644 --- a/configs/pic32mx-starterkit/src/pic32mx_spi.c +++ b/configs/pic32mx-starterkit/src/pic32mx_spi.c @@ -54,22 +54,6 @@ #if defined(CONFIG_PIC32MX_SPI1) || defined(CONFIG_PIC32MX_SPI2) || \ defined(CONFIG_PIC32MX_SPI3) || defined(CONFIG_PIC32MX_SPI4) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/pic32mx7mmb/src/pic32_spi.c b/configs/pic32mx7mmb/src/pic32_spi.c index 23a190eec19..3cce76d53e2 100644 --- a/configs/pic32mx7mmb/src/pic32_spi.c +++ b/configs/pic32mx7mmb/src/pic32_spi.c @@ -75,21 +75,6 @@ #define GPIO_SD_WP (GPIO_INPUT|GPIO_PORTG|GPIO_PIN6) #define GPIO_SD_CD (GPIO_INPUT|GPIO_INT|GPIO_PORTG|GPIO_PIN7) -/* The following enable debug output from this file (needs CONFIG_DEBUG_FEATURES too). - * - * CONFIG_DEBUG_SPI - Define to enable basic SPI debug - */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/pic32mz-starterkit/src/pic32mz_spi.c b/configs/pic32mz-starterkit/src/pic32mz_spi.c index 6e28274b46f..f5093f9e6d0 100644 --- a/configs/pic32mz-starterkit/src/pic32mz_spi.c +++ b/configs/pic32mz-starterkit/src/pic32mz_spi.c @@ -52,22 +52,6 @@ #ifdef CONFIG_PIC32MZ_SPI -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sam3u-ek/src/sam_spi.c b/configs/sam3u-ek/src/sam_spi.c index 0802267498c..69215483606 100644 --- a/configs/sam3u-ek/src/sam_spi.c +++ b/configs/sam3u-ek/src/sam_spi.c @@ -55,22 +55,6 @@ #ifdef CONFIG_SAM34_SPI0 -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sam4e-ek/src/sam_spi.c b/configs/sam4e-ek/src/sam_spi.c index 3a238b2448a..a26a95c17db 100644 --- a/configs/sam4e-ek/src/sam_spi.c +++ b/configs/sam4e-ek/src/sam_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_SAM34_SPI0) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sam4l-xplained/src/sam_spi.c b/configs/sam4l-xplained/src/sam_spi.c index 5a43b8a6f59..47e7741e502 100644 --- a/configs/sam4l-xplained/src/sam_spi.c +++ b/configs/sam4l-xplained/src/sam_spi.c @@ -51,22 +51,6 @@ #ifdef CONFIG_SAM34_SPI0 -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sama5d3-xplained/src/sam_spi.c b/configs/sama5d3-xplained/src/sam_spi.c index 720d1f430f8..9c42a10d656 100644 --- a/configs/sama5d3-xplained/src/sam_spi.c +++ b/configs/sama5d3-xplained/src/sam_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_SAMA5_SPI0) || defined(CONFIG_SAMA5_SPI1) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sama5d3x-ek/src/sam_spi.c b/configs/sama5d3x-ek/src/sam_spi.c index 5b7b2f04ab5..f2932e5fb8d 100644 --- a/configs/sama5d3x-ek/src/sam_spi.c +++ b/configs/sama5d3x-ek/src/sam_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_SAMA5_SPI0) || defined(CONFIG_SAMA5_SPI1) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sama5d4-ek/src/sam_spi.c b/configs/sama5d4-ek/src/sam_spi.c index fff11d2cb7d..4b24a4b1cef 100644 --- a/configs/sama5d4-ek/src/sam_spi.c +++ b/configs/sama5d4-ek/src/sam_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_SAMA5_SPI0) || defined(CONFIG_SAMA5_SPI1) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/samd20-xplained/src/sam_spi.c b/configs/samd20-xplained/src/sam_spi.c index 9c647d9eb25..3ec3469adbe 100644 --- a/configs/samd20-xplained/src/sam_spi.c +++ b/configs/samd20-xplained/src/sam_spi.c @@ -53,22 +53,6 @@ #ifdef SAMDL_HAVE_SPI -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/samd21-xplained/src/sam_spi.c b/configs/samd21-xplained/src/sam_spi.c index 1b896da9c6b..eaf17020ec0 100644 --- a/configs/samd21-xplained/src/sam_spi.c +++ b/configs/samd21-xplained/src/sam_spi.c @@ -53,22 +53,6 @@ #ifdef SAMDL_HAVE_SPI -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/same70-xplained/src/sam_spi.c b/configs/same70-xplained/src/sam_spi.c index eda55db06fa..c21979060b7 100644 --- a/configs/same70-xplained/src/sam_spi.c +++ b/configs/same70-xplained/src/sam_spi.c @@ -55,22 +55,6 @@ #ifdef CONFIG_SAMV7_SPI -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/saml21-xplained/src/sam_spi.c b/configs/saml21-xplained/src/sam_spi.c index 0fcc1084f44..ae1238eb2d5 100644 --- a/configs/saml21-xplained/src/sam_spi.c +++ b/configs/saml21-xplained/src/sam_spi.c @@ -53,22 +53,6 @@ #ifdef SAMDL_HAVE_SPI -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/samv71-xult/src/sam_spi.c b/configs/samv71-xult/src/sam_spi.c index f84bfe2d2a2..58a4d30e24e 100644 --- a/configs/samv71-xult/src/sam_spi.c +++ b/configs/samv71-xult/src/sam_spi.c @@ -55,22 +55,6 @@ #ifdef CONFIG_SAMV7_SPI -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/shenzhou/src/stm32_spi.c b/configs/shenzhou/src/stm32_spi.c index 747f92cfc92..1f6a45ed818 100644 --- a/configs/shenzhou/src/stm32_spi.c +++ b/configs/shenzhou/src/stm32_spi.c @@ -53,28 +53,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/spark/src/stm32_spi.c b/configs/spark/src/stm32_spi.c index 572dd22c0aa..f631052d313 100644 --- a/configs/spark/src/stm32_spi.c +++ b/configs/spark/src/stm32_spi.c @@ -59,22 +59,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm3210e-eval/src/stm32_spi.c b/configs/stm3210e-eval/src/stm32_spi.c index be83e9618f5..4df6531cefb 100644 --- a/configs/stm3210e-eval/src/stm32_spi.c +++ b/configs/stm3210e-eval/src/stm32_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm3220g-eval/src/stm32_spi.c b/configs/stm3220g-eval/src/stm32_spi.c index 030283e6837..9e171b9bfaf 100644 --- a/configs/stm3220g-eval/src/stm32_spi.c +++ b/configs/stm3220g-eval/src/stm32_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm3240g-eval/src/stm32_spi.c b/configs/stm3240g-eval/src/stm32_spi.c index 6db6401c85b..45b7f894e14 100644 --- a/configs/stm3240g-eval/src/stm32_spi.c +++ b/configs/stm3240g-eval/src/stm32_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32_tiny/src/stm32_spi.c b/configs/stm32_tiny/src/stm32_spi.c index a723fd689e5..ac4e3eb68ed 100644 --- a/configs/stm32_tiny/src/stm32_spi.c +++ b/configs/stm32_tiny/src/stm32_spi.c @@ -54,33 +54,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32f103-minimum/src/stm32_spi.c b/configs/stm32f103-minimum/src/stm32_spi.c index 3d1577346c9..a1c8dbaadb1 100644 --- a/configs/stm32f103-minimum/src/stm32_spi.c +++ b/configs/stm32f103-minimum/src/stm32_spi.c @@ -54,29 +54,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32f3discovery/src/stm32_spi.c b/configs/stm32f3discovery/src/stm32_spi.c index 0397692abab..712db25d2dd 100644 --- a/configs/stm32f3discovery/src/stm32_spi.c +++ b/configs/stm32f3discovery/src/stm32_spi.c @@ -54,22 +54,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32f429i-disco/src/stm32_ili93414ws.c b/configs/stm32f429i-disco/src/stm32_ili93414ws.c index a862efdef99..150d5f95dec 100644 --- a/configs/stm32f429i-disco/src/stm32_ili93414ws.c +++ b/configs/stm32f429i-disco/src/stm32_ili93414ws.c @@ -134,7 +134,7 @@ /* Debug option */ -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_LCD # define lcderr err # define lcdwarn warn # define lcdinfo info diff --git a/configs/stm32f429i-disco/src/stm32_spi.c b/configs/stm32f429i-disco/src/stm32_spi.c index 293d378a88e..69d2de2997a 100644 --- a/configs/stm32f429i-disco/src/stm32_spi.c +++ b/configs/stm32f429i-disco/src/stm32_spi.c @@ -56,22 +56,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) ||\ defined(CONFIG_STM32_SPI4) || defined(CONFIG_STM32_SPI5) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Private Data ************************************************************************************/ @@ -80,10 +64,6 @@ FAR struct spi_dev_s *g_spidev5 = NULL; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32f4discovery/src/stm32_spi.c b/configs/stm32f4discovery/src/stm32_spi.c index 905dcd41b29..c6d7506fc18 100644 --- a/configs/stm32f4discovery/src/stm32_spi.c +++ b/configs/stm32f4discovery/src/stm32_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32f746g-disco/src/stm32_spi.c b/configs/stm32f746g-disco/src/stm32_spi.c index 54495266bbd..c2bea9894d6 100644 --- a/configs/stm32f746g-disco/src/stm32_spi.c +++ b/configs/stm32f746g-disco/src/stm32_spi.c @@ -57,20 +57,6 @@ defined(CONFIG_STM32F7_SPI3) || defined(CONFIG_STM32F7_SPI4) || \ defined(CONFIG_STM32F7_SPI5) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32l476vg-disco/src/stm32_spi.c b/configs/stm32l476vg-disco/src/stm32_spi.c index 4de5480adf6..3b8420c62af 100644 --- a/configs/stm32l476vg-disco/src/stm32_spi.c +++ b/configs/stm32l476vg-disco/src/stm32_spi.c @@ -55,27 +55,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_SPI -# undef CONFIG_DEBUG_INFO -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Data ************************************************************************************/ diff --git a/configs/stm32ldiscovery/src/stm32_spi.c b/configs/stm32ldiscovery/src/stm32_spi.c index d4a82df275d..d923a8b2c9c 100644 --- a/configs/stm32ldiscovery/src/stm32_spi.c +++ b/configs/stm32ldiscovery/src/stm32_spi.c @@ -55,22 +55,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sure-pic32mx/src/pic32mx_spi.c b/configs/sure-pic32mx/src/pic32mx_spi.c index 367d46bd104..74671256baa 100644 --- a/configs/sure-pic32mx/src/pic32mx_spi.c +++ b/configs/sure-pic32mx/src/pic32mx_spi.c @@ -118,33 +118,6 @@ # define GPIO_SOIC_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTB|GPIO_PIN11) #endif -/* The following enable debug output from this file. - * - * CONFIG_DEBUG_SPI && CONFIG_DEBUG_FEATURES - Define to enable basic SPI debug - * CONFIG_DEBUG_INFO - Define to enable verbose SPI debug - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_SPI -# undef CONFIG_DEBUG_INFO -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/teensy-2.0/src/at90usb_spi.c b/configs/teensy-2.0/src/at90usb_spi.c index 42304c55ada..6c55945b3d4 100644 --- a/configs/teensy-2.0/src/at90usb_spi.c +++ b/configs/teensy-2.0/src/at90usb_spi.c @@ -80,18 +80,6 @@ #define TEENSY_CD (1 << 4) #define TEENSY_WP (1 << 5) -/* The following enable debug output from this file */ - -#ifdef CONFIG_CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -150,7 +138,7 @@ void weak_function at90usb_spidev_initialize(void) void avr_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); /* Assert/de-assert the CS pin to the card */ @@ -183,7 +171,7 @@ uint8_t avr_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) ret |= SPI_STATUS_WRPROTECTED; } - sspinfo("Returning %02x\n", ret); + spiinfo("Returning %02x\n", ret); return ret; } diff --git a/configs/teensy-3.x/src/k20_spi.c b/configs/teensy-3.x/src/k20_spi.c index be31459de83..50ffef7ff35 100644 --- a/configs/teensy-3.x/src/k20_spi.c +++ b/configs/teensy-3.x/src/k20_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/teensy-lc/src/kl_spi.c b/configs/teensy-lc/src/kl_spi.c index b8eeb57aa66..b4d36cb7552 100644 --- a/configs/teensy-lc/src/kl_spi.c +++ b/configs/teensy-lc/src/kl_spi.c @@ -51,28 +51,6 @@ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/tm4c123g-launchpad/src/tm4c_ssi.c b/configs/tm4c123g-launchpad/src/tm4c_ssi.c index c0e39cc3a10..7b295f76aa8 100644 --- a/configs/tm4c123g-launchpad/src/tm4c_ssi.c +++ b/configs/tm4c123g-launchpad/src/tm4c_ssi.c @@ -59,32 +59,12 @@ * Pre-processor Definitions ************************************************************************************/ -/* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define ssierr llerr -# define ssiwarn llwarn -# define ssiinfo llinfo -#else -# define ssierr(x...) -# define ssiwarn(x...) -# define ssiinfo(x...) -#endif - -/* Dump GPIO registers */ - -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) -# define ssiinfo llerr +#ifdef CONFIG_DEBUG_SPI_INFO) # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) #else -# define ssiinfo(x...) # define ssi_dumpgpio(m) #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -122,14 +102,14 @@ void weak_function tm4c_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssiinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/twr-k60n512/src/k60_spi.c b/configs/twr-k60n512/src/k60_spi.c index 79e9e402bc3..2c63ed94cdd 100644 --- a/configs/twr-k60n512/src/k60_spi.c +++ b/configs/twr-k60n512/src/k60_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/u-blox-c027/src/lpc17_ssp.c b/configs/u-blox-c027/src/lpc17_ssp.c index c2f0a3a354c..7090bcbb313 100644 --- a/configs/u-blox-c027/src/lpc17_ssp.c +++ b/configs/u-blox-c027/src/lpc17_ssp.c @@ -58,18 +58,6 @@ * Pre-processor Definitions ************************************************************************************/ -/* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /* Dump GPIO registers */ #ifdef CONFIG_DEBUG_GPIO_INFO @@ -134,7 +122,7 @@ void weak_function c027_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -144,7 +132,7 @@ void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif @@ -152,7 +140,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp1select() Entry"); if (devid == SPIDEV_MMCSD) @@ -180,12 +168,12 @@ uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) if (lpc17_gpioread(C027_SD_CD) == 0) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } } - sspinfo("Returning zero\n"); + spiinfo("Returning zero\n"); return 0; } #endif diff --git a/configs/viewtool-stm32f107/src/stm32_spi.c b/configs/viewtool-stm32f107/src/stm32_spi.c index f27c43bc358..3e8996f3afa 100644 --- a/configs/viewtool-stm32f107/src/stm32_spi.c +++ b/configs/viewtool-stm32f107/src/stm32_spi.c @@ -53,22 +53,6 @@ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/zkit-arm-1769/src/lpc17_spi.c b/configs/zkit-arm-1769/src/lpc17_spi.c index 926298699c8..ca01150deed 100644 --- a/configs/zkit-arm-1769/src/lpc17_spi.c +++ b/configs/zkit-arm-1769/src/lpc17_spi.c @@ -63,30 +63,14 @@ * Pre-processor Definitions ************************************************************************************/ -/* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /* Dump GPIO registers */ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#if CONFIG_DEBUG_SPI_INFO # define spi_dumpgpio(m) lpc17_dumpgpio(SDCCS_GPIO, m) #else # define spi_dumpgpio(m) #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/zkit-arm-1769/src/lpc17_ssp.c b/configs/zkit-arm-1769/src/lpc17_ssp.c index cf55667df37..2302f15bd81 100644 --- a/configs/zkit-arm-1769/src/lpc17_ssp.c +++ b/configs/zkit-arm-1769/src/lpc17_ssp.c @@ -63,30 +63,14 @@ * Pre-processor Definitions ************************************************************************************/ -/* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ - -#ifdef CONFIG_DEBUG_SPI -# define ssperr llerr -# define sspwarn llwarn -# define sspinfo llinfo -#else -# define ssperr(x...) -# define sspwarn(x...) -# define sspinfo(x...) -#endif - /* Dump GPIO registers */ -#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_INFO) +#if CONFIG_DEBUG_SPI_INFO # define ssp_dumpgpio(m) lpc17_dumpgpio(SDCCS_GPIO, m) #else # define ssp_dumpgpio(m) #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -144,7 +128,7 @@ void weak_function zkit_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp1select() Entry"); #warning "Assert CS here (false)" @@ -154,7 +138,7 @@ void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } @@ -178,7 +162,7 @@ int weak_function lpc17_ssp1cmddata(FAR struct spi_dev_s *dev, #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp0select() Entry"); #ifdef CONFIG_NX_LCDDRIVER @@ -197,11 +181,11 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { if (devid == SPIDEV_DISPLAY) { - sspinfo("Returning SPI_STATUS_PRESENT\n"); + spiinfo("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } - sspinfo("Returning zero\n"); + spiinfo("Returning zero\n"); return 0; } diff --git a/configs/zp214xpa/src/lpc2148_spi1.c b/configs/zp214xpa/src/lpc2148_spi1.c index 90cc35953ad..72110a423ab 100644 --- a/configs/zp214xpa/src/lpc2148_spi1.c +++ b/configs/zp214xpa/src/lpc2148_spi1.c @@ -87,18 +87,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Enables debug output from this file */ - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# define spiwarn llwarn -# define spiinfo llinfo -#else -# define spierr(x...) -# define spiwarn(x...) -# define spiinfo(x...) -#endif - /* Clocking */ #define LPC214X_CCLKFREQ (LPC214X_FOSC*LPC214X_PLL_M) @@ -227,7 +215,7 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock) static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_INFO uint32_t regval; #endif uint32_t bit = 1 << 20; @@ -236,7 +224,7 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel * only thing on the bus. */ -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_INFO regval = getreg32(CS_PIN_REGISTER); #endif @@ -360,7 +348,7 @@ static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_SPI_CMDDATA static int spi_cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd) { -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_INFO uint32_t regval; #endif uint32_t bit = 1 << 23; @@ -376,7 +364,7 @@ static int spi_cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd * A0 = L: the inputs at D0 to D7 are transferred to the command registers." */ -#ifdef CONFIG_DEBUG_SPI +#ifdef CONFIG_DEBUG_SPI_INFO regval = getreg32(CS_PIN_REGISTER); #endif diff --git a/drivers/analog/pga11x.c b/drivers/analog/pga11x.c index 62b8d1b3388..de86444b385 100644 --- a/drivers/analog/pga11x.c +++ b/drivers/analog/pga11x.c @@ -101,26 +101,6 @@ #define SPI_DUMMY 0xff -/* Debug ********************************************************************/ -/* Check if (non-standard) SPI debug is enabled */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr err -# ifdef CONFIG_DEBUG_INFO -# define spiinfo err -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 429c4d18cdc..e20a28b2128 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c @@ -78,31 +78,6 @@ * information. */ -/* Debug ********************************************************************/ -/* Check if SPI debut is enabled (non-standard.. no support in - * include/debug.h - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llinfo -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ /**************************************************************************** * Private Function Prototypes diff --git a/include/debug.h b/include/debug.h index 707a78c2d56..85eea4fe5b8 100644 --- a/include/debug.h +++ b/include/debug.h @@ -381,30 +381,6 @@ # define illinfo(x...) #endif -#ifdef CONFIG_DEBUG_SENSORS_ERROR -# define snerr(format, ...) err(format, ##__VA_ARGS__) -# define snllerr(format, ...) llerr(format, ##__VA_ARGS__) -#else -# define snerr(x...) -# define snllerr(x...) -#endif - -#ifdef CONFIG_DEBUG_SENSORS_WARN -# define snwarn(format, ...) warn(format, ##__VA_ARGS__) -# define snllwarn(format, ...) llwarn(format, ##__VA_ARGS__) -#else -# define snwarn(x...) -# define snllwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_SENSORS_INFO -# define sninfo(format, ...) info(format, ##__VA_ARGS__) -# define snllinfo(format, ...) llinfo(format, ##__VA_ARGS__) -#else -# define sninfo(x...) -# define snllinfo(x...) -#endif - #ifdef CONFIG_DEBUG_ANALOG_ERROR # define aerr(format, ...) err(format, ##__VA_ARGS__) # define allerr(format, ...) llerr(format, ##__VA_ARGS__) @@ -597,6 +573,54 @@ # define gpiollinfo(x...) #endif +#ifdef CONFIG_DEBUG_SENSORS_ERROR +# define snerr(format, ...) err(format, ##__VA_ARGS__) +# define snllerr(format, ...) llerr(format, ##__VA_ARGS__) +#else +# define snerr(x...) +# define snllerr(x...) +#endif + +#ifdef CONFIG_DEBUG_SENSORS_WARN +# define snwarn(format, ...) warn(format, ##__VA_ARGS__) +# define snllwarn(format, ...) llwarn(format, ##__VA_ARGS__) +#else +# define snwarn(x...) +# define snllwarn(x...) +#endif + +#ifdef CONFIG_DEBUG_SENSORS_INFO +# define sninfo(format, ...) info(format, ##__VA_ARGS__) +# define snllinfo(format, ...) llinfo(format, ##__VA_ARGS__) +#else +# define sninfo(x...) +# define snllinfo(x...) +#endif + +#ifdef CONFIG_DEBUG_SPI_ERROR +# define spierr(format, ...) err(format, ##__VA_ARGS__) +# define spillerr(format, ...) llerr(format, ##__VA_ARGS__) +#else +# define spierr(x...) +# define spillerr(x...) +#endif + +#ifdef CONFIG_DEBUG_SPI_WARN +# define spiwarn(format, ...) warn(format, ##__VA_ARGS__) +# define spillwarn(format, ...) llwarn(format, ##__VA_ARGS__) +#else +# define spiwarn(x...) +# define spillwarn(x...) +#endif + +#ifdef CONFIG_DEBUG_SPI_INFO +# define spiinfo(format, ...) info(format, ##__VA_ARGS__) +# define spillinfo(format, ...) llinfo(format, ##__VA_ARGS__) +#else +# define spiinfo(x...) +# define spillinfo(x...) +#endif + #else /* CONFIG_CPP_HAVE_VARARGS */ /* Variadic macros NOT supported */ @@ -826,30 +850,6 @@ # define illinfo (void) #endif -#ifdef CONFIG_DEBUG_SENSORS_ERROR -# define snerr err -# define snllerr llerr -#else -# define snerr (void) -# define snllerr (void) -#endif - -#ifdef CONFIG_DEBUG_SENSORS_WARN -# define snwarn warn -# define snllwarn llwarn -#else -# define snwarn (void) -# define snllwarn (void) -#endif - -#ifdef CONFIG_DEBUG_SENSORS_INFO -# define sninfo info -# define snllinfo llinfo -#else -# define sninfo (void) -# define snllinfo (void) -#endif - #ifdef CONFIG_DEBUG_ANALOG_ERROR # define aerr err # define allerr llerr @@ -1042,6 +1042,54 @@ # define gpiollinfo (void) #endif +#ifdef CONFIG_DEBUG_SENSORS_ERROR +# define snerr err +# define snllerr llerr +#else +# define snerr (void) +# define snllerr (void) +#endif + +#ifdef CONFIG_DEBUG_SENSORS_WARN +# define snwarn warn +# define snllwarn llwarn +#else +# define snwarn (void) +# define snllwarn (void) +#endif + +#ifdef CONFIG_DEBUG_SENSORS_INFO +# define sninfo info +# define snllinfo llinfo +#else +# define sninfo (void) +# define snllinfo (void) +#endif + +#ifdef CONFIG_DEBUG_SPI_ERROR +# define spierr err +# define spillerr llerr +#else +# define spierr (void) +# define spillerr (void) +#endif + +#ifdef CONFIG_DEBUG_SPI_WARN +# define spiwarn warn +# define spillwarn llwarn +#else +# define spiwarn (void) +# define spillwarn (void) +#endif + +#ifdef CONFIG_DEBUG_SPI_INFO +# define spiinfo info +# define spillinfo llinfo +#else +# define spiinfo (void) +# define spillinfo (void) +#endif + #endif /* CONFIG_CPP_HAVE_VARARGS */ /* Buffer dumping macros do not depend on varargs */ @@ -1172,6 +1220,14 @@ # define gpioinfodumpbuffer(m,b,n) #endif +#ifdef CONFIG_DEBUG_SENSORS +# define snerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) +# define sninfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) +#else +# define snerrdumpbuffer(m,b,n) +# define sninfodumpbuffer(m,b,n) +#endif + /**************************************************************************** * Public Type Declarations ****************************************************************************/ diff --git a/include/nuttx/analog/pga11x.h b/include/nuttx/analog/pga11x.h index 789059504dc..e4e2ebbc922 100644 --- a/include/nuttx/analog/pga11x.h +++ b/include/nuttx/analog/pga11x.h @@ -73,8 +73,8 @@ * When SPI_SELECT is called with devid=SPIDEV_MUX. * * Other settings that effect the driver: - * CONFIG_DEBUG_SPI -- With CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_INFO, - * this will enable debug output from the PGA117 driver. + * CONFIG_DEBUG_SPI_ERR/WARN/INFO -- This will enable debug output from + * the PGA117 driver. */ #ifndef CONFIG_PGA11X_SPIFREQUENCY diff --git a/include/nuttx/spi/spi_bitbang.c b/include/nuttx/spi/spi_bitbang.c index 2ab152de3c8..86b340bcdc7 100644 --- a/include/nuttx/spi/spi_bitbang.c +++ b/include/nuttx/spi/spi_bitbang.c @@ -64,32 +64,6 @@ * in the bit bang interface and calls spi_create_bitbang(). */ -/* Debug ********************************************************************/ -/* Check if SPI debut is enabled (non-standard.. no support in - * include/debug.h - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/include/nuttx/spi/spi_bitbang.h b/include/nuttx/spi/spi_bitbang.h index 5da7374370d..f5058be9d30 100644 --- a/include/nuttx/spi/spi_bitbang.h +++ b/include/nuttx/spi/spi_bitbang.h @@ -48,34 +48,10 @@ #ifdef CONFIG_SPI_BITBANG -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ -/* Debug ********************************************************************/ -/* Check if SPI debut is enabled (non-standard.. no support in - * include/debug.h - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_SPI -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spierr llerr -# ifdef CONFIG_DEBUG_INFO -# define spiinfo llerr -# else -# define spiinfo(x...) -# endif -#else -# define spierr(x...) -# define spiinfo(x...) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ + #ifndef __ASSEMBLY__ /* These are the lower-half handlers that perform the level-level, platform-