Centralize definitions associated with CONFIG_DEBUG_SDIO/MEMCARD

This commit is contained in:
Gregory Nutt 2016-06-16 07:50:54 -06:00
parent b7f0fbc073
commit 7a9f1814a2
3 changed files with 136 additions and 53 deletions

35
Kconfig
View File

@ -1225,15 +1225,44 @@ config DEBUG_RTC_INFO
endif # DEBUG_RTC endif # DEBUG_RTC
config DEBUG_SDIO config DEBUG_MEMCARD
bool "SDIO Debug Output" bool "Memory Card Driver Debug Features"
default n default n
depends on MMCSD_SDIO depends on MMCSD_SDIO
---help--- ---help---
Enable SDIO driver debug SYSLOG output (disabled by default). Enable MMC/SD memory card Driver debug features.
Support for this debug option is architecture-specific and may not Support for this debug option is architecture-specific and may not
be available for some MCUs. be available for some MCUs.
if DEBUG_MEMCARD
config DEBUG_MEMCARD_ERROR
bool "Memory Card Driver Error Output"
default n
depends on DEBUG_ERROR
---help---
Enable MMC/SD memory card driver error output to SYSLOG.
Support for this debug option is architecture-specific and may not
be available for some MCUs.
config DEBUG_MEMCARD_WARN
bool "Memory Card Driver Warnings Output"
default n
depends on DEBUG_WARN
---help---
Enable MMC/SD memory card driver warning output to SYSLOG.
config DEBUG_MEMCARD_INFO
bool "Memory Card Driver Informational Output"
default n
depends on DEBUG_INFO
---help---
Enable MMC/SD memory card driver informational output to SYSLOG.
endif # DEBUG_MEMCARD
config DEBUG_SENSORS config DEBUG_SENSORS
bool "Sensor Debug Features" bool "Sensor Debug Features"
default n default n

View File

@ -93,7 +93,7 @@
* CONFIG_SDIO_WIDTH_D1_ONLY - This may be selected to force the driver * CONFIG_SDIO_WIDTH_D1_ONLY - This may be selected to force the driver
* operate with only a single data line (the default is to use all * operate with only a single data line (the default is to use all
* 4 SD data lines). * 4 SD data lines).
* CONFIG_DEBUG_SDIO - Enables some very low-level debug output * CONFIG_DEBUG_MEMCARD_* - Enables some very low-level debug output
* This also requires CONFIG_DEBUG_FS and CONFIG_DEBUG_INFO * This also requires CONFIG_DEBUG_FS and CONFIG_DEBUG_INFO
*/ */
@ -109,10 +109,6 @@
# error "Callback support requires CONFIG_SCHED_WORKQUEUE" # error "Callback support requires CONFIG_SCHED_WORKQUEUE"
#endif #endif
#if !defined(CONFIG_DEBUG_FS) || !defined(CONFIG_DEBUG_FEATURES)
# undef CONFIG_DEBUG_SDIO
#endif
/* Friendly CLKCR bit re-definitions ****************************************/ /* Friendly CLKCR bit re-definitions ****************************************/
/* Mode dependent settings. These depend on clock devisor settings that must /* Mode dependent settings. These depend on clock devisor settings that must
@ -213,7 +209,7 @@
/* Register logging support */ /* Register logging support */
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
# ifdef CONFIG_SDIO_DMA # ifdef CONFIG_SDIO_DMA
# define SAMPLENDX_BEFORE_SETUP 0 # define SAMPLENDX_BEFORE_SETUP 0
# define SAMPLENDX_BEFORE_ENABLE 1 # define SAMPLENDX_BEFORE_ENABLE 1
@ -274,7 +270,7 @@ struct lpc17_dev_s
/* Register logging support */ /* Register logging support */
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
struct lpc17_sdcard_regs_s struct lpc17_sdcard_regs_s
{ {
uint8_t pwr; uint8_t pwr;
@ -314,7 +310,7 @@ static inline uint32_t lpc17_getpwrctrl(void);
/* DMA Helpers **************************************************************/ /* DMA Helpers **************************************************************/
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static void lpc17_sampleinit(void); static void lpc17_sampleinit(void);
static void lpc17_sdcard_sample(struct lpc17_sdcard_regs_s *regs); static void lpc17_sdcard_sample(struct lpc17_sdcard_regs_s *regs);
static void lpc17_sample(struct lpc17_dev_s *priv, int index); static void lpc17_sample(struct lpc17_dev_s *priv, int index);
@ -452,7 +448,7 @@ struct lpc17_dev_s g_scard_dev =
/* Register logging support */ /* Register logging support */
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static struct lpc17_sampleregs_s g_sampleregs[DEBUG_NSAMPLES]; static struct lpc17_sampleregs_s g_sampleregs[DEBUG_NSAMPLES];
#endif #endif
@ -529,8 +525,8 @@ static inline void lpc17_setclock(uint32_t clkcr)
regval |= clkcr; regval |= clkcr;
putreg32(regval, LPC17_SDCARD_CLOCK); putreg32(regval, LPC17_SDCARD_CLOCK);
finfo("CLKCR: %08x PWR: %08x\n", mcinfo("CLKCR: %08x PWR: %08x\n",
getreg32(LPC17_SDCARD_CLOCK), getreg32(LPC17_SDCARD_PWR)); getreg32(LPC17_SDCARD_CLOCK), getreg32(LPC17_SDCARD_PWR));
} }
/**************************************************************************** /****************************************************************************
@ -659,7 +655,7 @@ static inline uint32_t lpc17_getpwrctrl(void)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static void lpc17_sampleinit(void) static void lpc17_sampleinit(void)
{ {
memset(g_sampleregs, 0xff, DEBUG_NSAMPLES * sizeof(struct lpc17_sampleregs_s)); memset(g_sampleregs, 0xff, DEBUG_NSAMPLES * sizeof(struct lpc17_sampleregs_s));
@ -674,7 +670,7 @@ static void lpc17_sampleinit(void)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static void lpc17_sdcard_sample(struct lpc17_sdcard_regs_s *regs) static void lpc17_sdcard_sample(struct lpc17_sdcard_regs_s *regs)
{ {
regs->pwr = (uint8_t)getreg32(LPC17_SDCARD_PWR); regs->pwr = (uint8_t)getreg32(LPC17_SDCARD_PWR);
@ -697,7 +693,7 @@ static void lpc17_sdcard_sample(struct lpc17_sdcard_regs_s *regs)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static void lpc17_sample(struct lpc17_dev_s *priv, int index) static void lpc17_sample(struct lpc17_dev_s *priv, int index)
{ {
struct lpc17_sampleregs_s *regs = &g_sampleregs[index]; struct lpc17_sampleregs_s *regs = &g_sampleregs[index];
@ -707,6 +703,7 @@ static void lpc17_sample(struct lpc17_dev_s *priv, int index)
lpc17_dmasample(priv->dma, &regs->dma); lpc17_dmasample(priv->dma, &regs->dma);
} }
#endif #endif
lpc17_sdcard_sample(&regs->sdcard); lpc17_sdcard_sample(&regs->sdcard);
} }
#endif #endif
@ -719,19 +716,19 @@ static void lpc17_sample(struct lpc17_dev_s *priv, int index)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static void lpc17_sdcard_dump(struct lpc17_sdcard_regs_s *regs, const char *msg) static void lpc17_sdcard_dump(struct lpc17_sdcard_regs_s *regs, const char *msg)
{ {
ferr("SD Card Registers: %s\n", msg); mcinfo("SD Card Registers: %s\n", msg);
ferr(" POWER[%08x]: %08x\n", LPC17_SDCARD_PWR, regs->pwr); mcinfo(" POWER[%08x]: %08x\n", LPC17_SDCARD_PWR, regs->pwr);
ferr(" CLKCR[%08x]: %08x\n", LPC17_SDCARD_CLOCK, regs->clkcr); mcinfo(" CLKCR[%08x]: %08x\n", LPC17_SDCARD_CLOCK, regs->clkcr);
ferr(" DCTRL[%08x]: %08x\n", LPC17_SDCARD_DCTRL, regs->dctrl); mcinfo(" DCTRL[%08x]: %08x\n", LPC17_SDCARD_DCTRL, regs->dctrl);
ferr(" DTIMER[%08x]: %08x\n", LPC17_SDCARD_DTIMER, regs->dtimer); mcinfo(" DTIMER[%08x]: %08x\n", LPC17_SDCARD_DTIMER, regs->dtimer);
ferr(" DLEN[%08x]: %08x\n", LPC17_SDCARD_DLEN, regs->dlen); mcinfo(" DLEN[%08x]: %08x\n", LPC17_SDCARD_DLEN, regs->dlen);
ferr(" DCOUNT[%08x]: %08x\n", LPC17_SDCARD_DCOUNT, regs->dcount); mcinfo(" DCOUNT[%08x]: %08x\n", LPC17_SDCARD_DCOUNT, regs->dcount);
ferr(" STA[%08x]: %08x\n", LPC17_SDCARD_STATUS, regs->sta); mcinfo(" STA[%08x]: %08x\n", LPC17_SDCARD_STATUS, regs->sta);
ferr(" MASK[%08x]: %08x\n", LPC17_SDCARD_MASK0, regs->mask); mcinfo(" MASK[%08x]: %08x\n", LPC17_SDCARD_MASK0, regs->mask);
ferr("FIFOCNT[%08x]: %08x\n", LPC17_SDCARD_FIFOCNT, regs->fifocnt); mcinfo("FIFOCNT[%08x]: %08x\n", LPC17_SDCARD_FIFOCNT, regs->fifocnt);
} }
#endif #endif
@ -743,7 +740,7 @@ static void lpc17_sdcard_dump(struct lpc17_sdcard_regs_s *regs, const char *msg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static void lpc17_dumpsample(struct lpc17_dev_s *priv, static void lpc17_dumpsample(struct lpc17_dev_s *priv,
struct lpc17_sampleregs_s *regs, const char *msg) struct lpc17_sampleregs_s *regs, const char *msg)
{ {
@ -765,7 +762,7 @@ static void lpc17_dumpsample(struct lpc17_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_SDIO #ifdef CONFIG_DEBUG_MEMCARD_INFO
static void lpc17_dumpsamples(struct lpc17_dev_s *priv) static void lpc17_dumpsamples(struct lpc17_dev_s *priv)
{ {
lpc17_dumpsample(priv, &g_sampleregs[SAMPLENDX_BEFORE_SETUP], "Before setup"); lpc17_dumpsample(priv, &g_sampleregs[SAMPLENDX_BEFORE_SETUP], "Before setup");
@ -1480,8 +1477,8 @@ static void lpc17_reset(FAR struct sdio_dev_s *dev)
lpc17_setpwrctrl(SDCARD_PWR_CTRL_ON); lpc17_setpwrctrl(SDCARD_PWR_CTRL_ON);
leave_critical_section(flags); leave_critical_section(flags);
finfo("CLCKR: %08x POWER: %08x\n", mcinfo("CLCKR: %08x POWER: %08x\n",
getreg32(LPC17_SDCARD_CLOCK), getreg32(LPC17_SDCARD_PWR)); getreg32(LPC17_SDCARD_CLOCK), getreg32(LPC17_SDCARD_PWR));
} }
/**************************************************************************** /****************************************************************************
@ -1689,7 +1686,7 @@ static int lpc17_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg)
cmdidx = (cmd & MMCSD_CMDIDX_MASK) >> MMCSD_CMDIDX_SHIFT; cmdidx = (cmd & MMCSD_CMDIDX_MASK) >> MMCSD_CMDIDX_SHIFT;
regval |= cmdidx | SDCARD_CMD_CPSMEN; regval |= cmdidx | SDCARD_CMD_CPSMEN;
finfo("cmd: %08x arg: %08x regval: %08x\n", cmd, arg, regval); mcinfo("cmd: %08x arg: %08x regval: %08x\n", cmd, arg, regval);
/* Write the SD card CMD */ /* Write the SD card CMD */
@ -1920,7 +1917,7 @@ static int lpc17_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
{ {
if (--timeout <= 0) if (--timeout <= 0)
{ {
ferr("ERROR: Timeout cmd: %08x events: %08x STA: %08x\n", mcerr("ERROR: Timeout cmd: %08x events: %08x STA: %08x\n",
cmd, events, getreg32(LPC17_SDCARD_STATUS)); cmd, events, getreg32(LPC17_SDCARD_STATUS));
return -ETIMEDOUT; return -ETIMEDOUT;
@ -1987,7 +1984,7 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t
#ifdef CONFIG_DEBUG_FEATURES #ifdef CONFIG_DEBUG_FEATURES
if (!rshort) if (!rshort)
{ {
ferr("ERROR: rshort=NULL\n"); mcerr("ERROR: rshort=NULL\n");
ret = -EINVAL; ret = -EINVAL;
} }
@ -1997,7 +1994,7 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t
(cmd & MMCSD_RESPONSE_MASK) != MMCSD_R1B_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R1B_RESPONSE &&
(cmd & MMCSD_RESPONSE_MASK) != MMCSD_R6_RESPONSE) (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R6_RESPONSE)
{ {
ferr("ERROR: Wrong response CMD=%08x\n", cmd); mcerr("ERROR: Wrong response CMD=%08x\n", cmd);
ret = -EINVAL; ret = -EINVAL;
} }
else else
@ -2008,12 +2005,12 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t
regval = getreg32(LPC17_SDCARD_STATUS); regval = getreg32(LPC17_SDCARD_STATUS);
if ((regval & SDCARD_STATUS_CTIMEOUT) != 0) if ((regval & SDCARD_STATUS_CTIMEOUT) != 0)
{ {
ferr("ERROR: Command timeout: %08x\n", regval); mcerr("ERROR: Command timeout: %08x\n", regval);
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
} }
else if ((regval & SDCARD_STATUS_CCRCFAIL) != 0) else if ((regval & SDCARD_STATUS_CCRCFAIL) != 0)
{ {
ferr("ERROR: CRC failure: %08x\n", regval); mcerr("ERROR: CRC failure: %08x\n", regval);
ret = -EIO; ret = -EIO;
} }
#ifdef CONFIG_DEBUG_FEATURES #ifdef CONFIG_DEBUG_FEATURES
@ -2024,7 +2021,7 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t
respcmd = getreg32(LPC17_SDCARD_RESPCMD); respcmd = getreg32(LPC17_SDCARD_RESPCMD);
if ((uint8_t)(respcmd & SDCARD_RESPCMD_MASK) != (cmd & MMCSD_CMDIDX_MASK)) if ((uint8_t)(respcmd & SDCARD_RESPCMD_MASK) != (cmd & MMCSD_CMDIDX_MASK))
{ {
ferr("ERROR: RESCMD=%02x CMD=%08x\n", respcmd, cmd); mcerr("ERROR: RESCMD=%02x CMD=%08x\n", respcmd, cmd);
ret = -EINVAL; ret = -EINVAL;
} }
} }
@ -2057,7 +2054,7 @@ static int lpc17_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo
if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE) if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE)
{ {
ferr("ERROR: Wrong response CMD=%08x\n", cmd); mcerr("ERROR: Wrong response CMD=%08x\n", cmd);
ret = -EINVAL; ret = -EINVAL;
} }
else else
@ -2068,12 +2065,12 @@ static int lpc17_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo
regval = getreg32(LPC17_SDCARD_STATUS); regval = getreg32(LPC17_SDCARD_STATUS);
if (regval & SDCARD_STATUS_CTIMEOUT) if (regval & SDCARD_STATUS_CTIMEOUT)
{ {
ferr("ERROR: Timeout STA: %08x\n", regval); mcerr("ERROR: Timeout STA: %08x\n", regval);
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
} }
else if (regval & SDCARD_STATUS_CCRCFAIL) else if (regval & SDCARD_STATUS_CCRCFAIL)
{ {
ferr("ERROR: CRC fail STA: %08x\n", regval); mcerr("ERROR: CRC fail STA: %08x\n", regval);
ret = -EIO; ret = -EIO;
} }
} }
@ -2111,7 +2108,7 @@ static int lpc17_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r
if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE && if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE &&
(cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE) (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE)
{ {
ferr("ERROR: Wrong response CMD=%08x\n", cmd); mcerr("ERROR: Wrong response CMD=%08x\n", cmd);
ret = -EINVAL; ret = -EINVAL;
} }
else else
@ -2124,7 +2121,7 @@ static int lpc17_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r
regval = getreg32(LPC17_SDCARD_STATUS); regval = getreg32(LPC17_SDCARD_STATUS);
if (regval & SDCARD_STATUS_CTIMEOUT) if (regval & SDCARD_STATUS_CTIMEOUT)
{ {
ferr("ERROR: Timeout STA: %08x\n", regval); mcerr("ERROR: Timeout STA: %08x\n", regval);
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
} }
} }
@ -2269,7 +2266,7 @@ static sdio_eventset_t lpc17_eventwait(FAR struct sdio_dev_s *dev,
1, (uint32_t)priv); 1, (uint32_t)priv);
if (ret != OK) if (ret != OK)
{ {
ferr("ERROR: wd_start failed: %d\n", ret); mcerr("ERROR: wd_start failed: %d\n", ret);
} }
} }
@ -2341,7 +2338,7 @@ static void lpc17_callbackenable(FAR struct sdio_dev_s *dev,
{ {
struct lpc17_dev_s *priv = (struct lpc17_dev_s *)dev; struct lpc17_dev_s *priv = (struct lpc17_dev_s *)dev;
finfo("eventset: %02x\n", eventset); mcinfo("eventset: %02x\n", eventset);
DEBUGASSERT(priv != NULL); DEBUGASSERT(priv != NULL);
priv->cbevents = eventset; priv->cbevents = eventset;
@ -2377,7 +2374,7 @@ static int lpc17_registercallback(FAR struct sdio_dev_s *dev,
/* Disable callbacks and register this callback and is argument */ /* Disable callbacks and register this callback and is argument */
finfo("Register %p(%p)\n", callback, arg); mcinfo("Register %p(%p)\n", callback, arg);
DEBUGASSERT(priv != NULL); DEBUGASSERT(priv != NULL);
priv->cbevents = 0; priv->cbevents = 0;
@ -2590,8 +2587,8 @@ static void lpc17_callback(void *arg)
/* Is a callback registered? */ /* Is a callback registered? */
DEBUGASSERT(priv != NULL); DEBUGASSERT(priv != NULL);
finfo("Callback %p(%p) cbevents: %02x cdstatus: %02x\n", mcinfo("Callback %p(%p) cbevents: %02x cdstatus: %02x\n",
priv->callback, priv->cbarg, priv->cbevents, priv->cdstatus); priv->callback, priv->cbarg, priv->cbevents, priv->cdstatus);
if (priv->callback) if (priv->callback)
{ {
@ -2635,14 +2632,14 @@ static void lpc17_callback(void *arg)
{ {
/* Yes.. queue it */ /* Yes.. queue it */
finfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg);
(void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0); (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, priv->cbarg, 0);
} }
else else
{ {
/* No.. then just call the callback here */ /* No.. then just call the callback here */
finfo("Callback to %p(%p)\n", priv->callback, priv->cbarg); mcinfo("Callback to %p(%p)\n", priv->callback, priv->cbarg);
priv->callback(priv->cbarg); priv->callback(priv->cbarg);
} }
} }
@ -2781,7 +2778,7 @@ void sdio_mediachange(FAR struct sdio_dev_s *dev, bool cardinslot)
{ {
priv->cdstatus &= ~SDIO_STATUS_PRESENT; priv->cdstatus &= ~SDIO_STATUS_PRESENT;
} }
finfo("cdstatus OLD: %02x NEW: %02x\n", cdstatus, priv->cdstatus); mcinfo("cdstatus OLD: %02x NEW: %02x\n", cdstatus, priv->cdstatus);
/* Perform any requested callback if the status has changed */ /* Perform any requested callback if the status has changed */
@ -2824,7 +2821,8 @@ void sdio_wrprotect(FAR struct sdio_dev_s *dev, bool wrprotect)
{ {
priv->cdstatus &= ~SDIO_STATUS_WRPROTECTED; priv->cdstatus &= ~SDIO_STATUS_WRPROTECTED;
} }
finfo("cdstatus: %02x\n", priv->cdstatus);
mcinfo("cdstatus: %02x\n", priv->cdstatus);
leave_critical_section(flags); leave_critical_section(flags);
} }
#endif /* CONFIG_LPC17_SDCARD */ #endif /* CONFIG_LPC17_SDCARD */

View File

@ -717,6 +717,30 @@
# define rtcllinfo(x...) # define rtcllinfo(x...)
#endif #endif
#ifdef CONFIG_DEBUG_MEMCARD_ERROR
# define mcerr(format, ...) err(format, ##__VA_ARGS__)
# define mcllerr(format, ...) llerr(format, ##__VA_ARGS__)
#else
# define mcerr(x...)
# define mcllerr(x...)
#endif
#ifdef CONFIG_DEBUG_MEMCARD_WARN
# define mcwarn(format, ...) warn(format, ##__VA_ARGS__)
# define mcllwarn(format, ...) llwarn(format, ##__VA_ARGS__)
#else
# define mcwarn(x...)
# define mcllwarn(x...)
#endif
#ifdef CONFIG_DEBUG_MEMCARD_INFO
# define mcinfo(format, ...) info(format, ##__VA_ARGS__)
# define mcllinfo(format, ...) llinfo(format, ##__VA_ARGS__)
#else
# define mcinfo(x...)
# define mcllinfo(x...)
#endif
#ifdef CONFIG_DEBUG_SENSORS_ERROR #ifdef CONFIG_DEBUG_SENSORS_ERROR
# define snerr(format, ...) err(format, ##__VA_ARGS__) # define snerr(format, ...) err(format, ##__VA_ARGS__)
# define snllerr(format, ...) llerr(format, ##__VA_ARGS__) # define snllerr(format, ...) llerr(format, ##__VA_ARGS__)
@ -1402,6 +1426,30 @@
# define rtcllinfo (void) # define rtcllinfo (void)
#endif #endif
#ifdef CONFIG_DEBUG_MEMCARD_ERROR
# define mcerr err
# define mcllerr llerr
#else
# define mcerr (void)
# define mcllerr (void)
#endif
#ifdef CONFIG_DEBUG_MEMCARD_WARN
# define mcwarn warn
# define mcllwarn llwarn
#else
# define mcwarn (void)
# define mcllwarn (void)
#endif
#ifdef CONFIG_DEBUG_MEMCARD_INFO
# define mcinfo info
# define mcllinfo llinfo
#else
# define mcinfo (void)
# define mcllinfo (void)
#endif
#ifdef CONFIG_DEBUG_SENSORS_ERROR #ifdef CONFIG_DEBUG_SENSORS_ERROR
# define snerr err # define snerr err
# define snllerr llerr # define snllerr llerr
@ -1708,6 +1756,14 @@
# define rtcinfodumpbuffer(m,b,n) # define rtcinfodumpbuffer(m,b,n)
#endif #endif
#ifdef CONFIG_DEBUG_MEMCARD
# define mcerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
# define mcinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)
#else
# define mcerrdumpbuffer(m,b,n)
# define mcinfodumpbuffer(m,b,n)
#endif
#ifdef CONFIG_DEBUG_SENSORS #ifdef CONFIG_DEBUG_SENSORS
# define snerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define snerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
# define sninfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) # define sninfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)