Centralize definitions associated with CONFIG_DEBUG_I2C
This commit is contained in:
parent
63b1eb09e6
commit
5c89b18af8
30
Kconfig
30
Kconfig
@ -1081,14 +1081,40 @@ config DEBUG_GPIO_INFO
|
||||
endif # DEBUG_GPIO
|
||||
|
||||
config DEBUG_I2C
|
||||
bool "I2C Debug Output"
|
||||
bool "I2C Debug Features"
|
||||
default n
|
||||
depends on I2C
|
||||
---help---
|
||||
Enable I2C driver debug SYSLOG output (disabled by default).
|
||||
Enable I2C debug features.
|
||||
|
||||
Support for this debug option is architecture-specific and may not
|
||||
be available for some MCUs.
|
||||
|
||||
if DEBUG_I2C
|
||||
|
||||
config DEBUG_I2C_ERROR
|
||||
bool "I2C Error Output"
|
||||
default n
|
||||
depends on DEBUG_ERROR
|
||||
---help---
|
||||
Enable I2C driver error output to SYSLOG.
|
||||
|
||||
config DEBUG_I2C_WARN
|
||||
bool "I2C Warnings Output"
|
||||
default n
|
||||
depends on DEBUG_WARN
|
||||
---help---
|
||||
Enable I2C drive warning output to SYSLOG.
|
||||
|
||||
config DEBUG_I2C_INFO
|
||||
bool "I2C Informational Output"
|
||||
default n
|
||||
depends on DEBUG_INFO
|
||||
---help---
|
||||
Enable I2C drive informational output to SYSLOG.
|
||||
|
||||
endif # DEBUG_I2C
|
||||
|
||||
config DEBUG_I2S
|
||||
bool "I2S Debug Output"
|
||||
default n
|
||||
|
@ -134,16 +134,6 @@
|
||||
|
||||
/* Debug ****************************************************************************/
|
||||
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
/* I2C event trace logic. NOTE: trace uses the internal, non-standard,
|
||||
* low-level debug interface syslog() but does not require that any other debug
|
||||
* is enabled.
|
||||
|
@ -95,21 +95,6 @@
|
||||
|
||||
#define TWI_MAX_FREQUENCY 66000000 /* Maximum TWI frequency */
|
||||
|
||||
/* Debug ***********************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
# define i2cllerr llerr
|
||||
# define i2cllinfo llinfo
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
# define i2cllerr(x...)
|
||||
# define i2cllinfo(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -96,14 +96,14 @@
|
||||
#endif
|
||||
|
||||
/* Driver internal definitions *************************************************/
|
||||
/* If verbose I2C debug output is enable, then allow more time before we declare
|
||||
/* If verbose I2C debug output is enabled, then allow more time before we declare
|
||||
* a timeout. The debug output from twi_interrupt will really slow things down!
|
||||
*
|
||||
* With a very slow clock (say 100,000 Hz), less than 100 usec would be required
|
||||
* to transfer on byte. So these define a "long" timeout.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_I2C) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_I2C_INFO
|
||||
# define TWI_TIMEOUT_MSPB (50) /* 50 msec/byte */
|
||||
#else
|
||||
# define TWI_TIMEOUT_MSPB (5) /* 5 msec/byte */
|
||||
@ -123,21 +123,6 @@
|
||||
#define MKI2C_INPUT(p) (((p) & (PIO_PORT_MASK | PIO_PIN_MASK)) | I2C_INPUT)
|
||||
#define MKI2C_OUTPUT(p) (((p) & (PIO_PORT_MASK | PIO_PIN_MASK)) | I2C_OUTPUT)
|
||||
|
||||
/* Debug ***********************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
# define i2cllerr llerr
|
||||
# define i2cllinfo llinfo
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
# define i2cllerr(x...)
|
||||
# define i2cllinfo(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -99,7 +99,7 @@
|
||||
* to transfer on byte. So these define a "long" timeout.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_I2C) && defined(CONFIG_DEBUG_INFO)
|
||||
#ifdef CONFIG_DEBUG_I2C_INFO
|
||||
# define TWIHS_TIMEOUT_MSPB (50) /* 50 msec/byte */
|
||||
#else
|
||||
# define TWIHS_TIMEOUT_MSPB (5) /* 5 msec/byte */
|
||||
@ -120,21 +120,6 @@
|
||||
#define MKI2C_INPUT(p) (((p) & (PIO_PORT_MASK | PIO_PIN_MASK)) | I2C_INPUT)
|
||||
#define MKI2C_OUTPUT(p) (((p) & (PIO_PORT_MASK | PIO_PIN_MASK)) | I2C_OUTPUT)
|
||||
|
||||
/* Debug ***********************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
# define i2cllerr llerr
|
||||
# define i2cllinfo llinfo
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
# define i2cllerr(x...)
|
||||
# define i2cllinfo(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -162,15 +162,6 @@
|
||||
#define MKI2C_OUTPUT(p) (((p) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | I2C_OUTPUT)
|
||||
|
||||
/* Debug ****************************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
/* I2C event trace logic. NOTE: trace uses the internal, non-standard, low-level
|
||||
* debug interface syslog() but does not require that any other debug
|
||||
|
@ -169,15 +169,6 @@
|
||||
#define MKI2C_OUTPUT(p) (((p) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | I2C_OUTPUT)
|
||||
|
||||
/* Debug ****************************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
/* I2C event trace logic. NOTE: trace uses the internal, non-standard, low-level
|
||||
* debug interface syslog() but does not require that any other debug
|
||||
|
@ -154,15 +154,6 @@
|
||||
#define STATUS_BUSY(status) (status & I2C_ISR_BUSY)
|
||||
|
||||
/* Debug ****************************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
/* I2C event trace logic. NOTE: trace uses the internal, non-standard, low-level
|
||||
* debug interface syslog() but does not require that any other debug
|
||||
|
@ -178,7 +178,7 @@
|
||||
*
|
||||
* Debugging output enabled with:
|
||||
*
|
||||
* CONFIG_DEBUG and CONFIG_DEBUG_I2C
|
||||
* CONFIG_DEBUG_I2C_INFO
|
||||
*
|
||||
* ISR Debugging output may be enabled with:
|
||||
*
|
||||
@ -287,16 +287,6 @@
|
||||
#define I2C_CR1_ALLINTS \
|
||||
(I2C_CR1_TXRX | I2C_CR1_TCIE | I2C_CR1_ERRIE)
|
||||
|
||||
/* I2C Debugging */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
/* I2C event tracing
|
||||
*
|
||||
* To enable tracing statements which show the details of the state machine
|
||||
|
@ -146,15 +146,6 @@
|
||||
#define STATUS_BUSY(status) (status & I2C_ISR_BUSY)
|
||||
|
||||
/* Debug ****************************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
/* I2C event trace logic. NOTE: trace uses the internal, non-standard, low-level
|
||||
* debug interface syslog() but does not require that any other debug
|
||||
|
@ -783,7 +783,7 @@ config TIVA_I2C_HIGHSPEED
|
||||
config TIVA_I2C_REGDEBUG
|
||||
bool "Register level debug"
|
||||
default n
|
||||
depends on DEBUG_INFO
|
||||
depends on DEBUG_I2C_INFO
|
||||
---help---
|
||||
Enables extremely detailed register access debug output.
|
||||
|
||||
|
@ -119,17 +119,8 @@
|
||||
#define MKI2C_OUTPUT(p) (((p) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | I2C_OUTPUT)
|
||||
|
||||
/* Debug ****************************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DEBUG_FEATURES
|
||||
#ifndef CONFIG_DEBUG_I2C_INFO
|
||||
# undef CONFIG_TIVA_I2C_REGDEBUG
|
||||
#endif
|
||||
|
||||
@ -609,7 +600,7 @@ static bool tiva_i2c_checkreg(struct tiva_i2c_priv_s *priv, bool wr,
|
||||
{
|
||||
/* Yes... show how many times we did it */
|
||||
|
||||
llerr("...[Repeats %d times]...\n", priv->ntimes);
|
||||
i2cinfo("...[Repeats %d times]...\n", priv->ntimes);
|
||||
}
|
||||
|
||||
/* Save information about the new access */
|
||||
@ -642,7 +633,7 @@ static uint32_t tiva_i2c_getreg(struct tiva_i2c_priv_s *priv, unsigned int offse
|
||||
|
||||
if (tiva_i2c_checkreg(priv, false, regval, regaddr))
|
||||
{
|
||||
llerr("%08x->%08x\n", regaddr, regval);
|
||||
i2cinfo("%08x->%08x\n", regaddr, regval);
|
||||
}
|
||||
|
||||
return regval;
|
||||
@ -671,7 +662,7 @@ static void tiva_i2c_putreg(struct tiva_i2c_priv_s *priv, unsigned int offset,
|
||||
|
||||
if (tiva_i2c_checkreg(priv, true, regval, regaddr))
|
||||
{
|
||||
llerr("%08x<-%08x\n", regaddr, regval);
|
||||
i2cinfo("%08x<-%08x\n", regaddr, regval);
|
||||
}
|
||||
|
||||
putreg32(regval, regaddr);
|
||||
|
@ -62,17 +62,6 @@
|
||||
#define DEVNAME_FMT "/dev/i2c%d"
|
||||
#define DEVNAME_FMTLEN (8 + 3 + 1)
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerr err
|
||||
# define i2cinfo info
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cinfo(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
@ -645,6 +645,30 @@
|
||||
# define gpiollinfo(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C_ERROR
|
||||
# define i2cerr(format, ...) err(format, ##__VA_ARGS__)
|
||||
# define i2cllerr(format, ...) llerr(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define i2cerr(x...)
|
||||
# define i2cllerr(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C_WARN
|
||||
# define i2cwarn(format, ...) warn(format, ##__VA_ARGS__)
|
||||
# define i2cllwarn(format, ...) llwarn(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define i2cwarn(x...)
|
||||
# define i2cllwarn(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C_INFO
|
||||
# define i2cinfo(format, ...) info(format, ##__VA_ARGS__)
|
||||
# define i2cllinfo(format, ...) llinfo(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define i2cinfo(x...)
|
||||
# define i2cllinfo(x...)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_ERROR
|
||||
# define snerr(format, ...) err(format, ##__VA_ARGS__)
|
||||
# define snllerr(format, ...) llerr(format, ##__VA_ARGS__)
|
||||
@ -1186,6 +1210,30 @@
|
||||
# define gpiollinfo (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C_ERROR
|
||||
# define i2cerr err
|
||||
# define i2cllerr llerr
|
||||
#else
|
||||
# define i2cerr (void)
|
||||
# define i2cllerr (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C_WARN
|
||||
# define i2cwarn warn
|
||||
# define i2cllwarn llwarn
|
||||
#else
|
||||
# define i2cwarn (void)
|
||||
# define i2cllwarn (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C_INFO
|
||||
# define i2cinfo info
|
||||
# define i2cllinfo llinfo
|
||||
#else
|
||||
# define i2cinfo (void)
|
||||
# define i2cllinfo (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_ERROR
|
||||
# define snerr err
|
||||
# define snllerr llerr
|
||||
@ -1396,6 +1444,14 @@
|
||||
# define gpioinfodumpbuffer(m,b,n)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_I2C
|
||||
# define i2cerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
|
||||
# define i2cinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)
|
||||
#else
|
||||
# define i2cerrdumpbuffer(m,b,n)
|
||||
# define i2cinfodumpbuffer(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)
|
||||
|
Loading…
Reference in New Issue
Block a user