From: Yan Wang yan.wang@linux.intel.com
It will use SSP trace class and global DMA trace API.
Signed-off-by: Yan Wang yan.wang@linux.intel.com --- Test with: CNL nocodec SOF master: c1f2682c210201bbbc96fce7b382b25b90d19775 SOF-Tool master: 86fe688a2b4f68a1ce87e0951686be12a00f1a3c https://github.com/plbossart/sound/tree/topic/sof-v4.14: d09db67c5a9d6dfc85f700669fa2e43c678c8d51 --- src/drivers/apl-ssp.c | 29 ++++++++++++----------------- src/drivers/byt-ssp.c | 7 +------ src/include/sof/ssp.h | 14 ++++++++++---- 3 files changed, 23 insertions(+), 27 deletions(-)
diff --git a/src/drivers/apl-ssp.c b/src/drivers/apl-ssp.c index a51f91c..2736171 100644 --- a/src/drivers/apl-ssp.c +++ b/src/drivers/apl-ssp.c @@ -38,11 +38,6 @@ #include <sof/interrupt.h> #include <config.h>
-/* tracing */ -#define trace_ssp(__e) trace_event(TRACE_CLASS_SSP, __e) -#define trace_ssp_error(__e) trace_error(TRACE_CLASS_SSP, __e) -#define tracev_ssp(__e) tracev_event(TRACE_CLASS_SSP, __e) - /* FIXME: move this to a helper and optimize */ static int hweight_32(uint32_t mask) { @@ -177,7 +172,7 @@ static inline int ssp_set_config(struct dai *dai, /* clock masters */ sscr1 &= ~SSCR1_SFRMDIR;
- trace_value(config->format); + trace_ssp_value(config->format); switch (config->format & SOF_DAI_FMT_MASTER_MASK) { case SOF_DAI_FMT_CBM_CFM: sscr0 |= SSCR0_ECS; /* external clock used */ @@ -529,16 +524,16 @@ static inline int ssp_set_config(struct dai *dai, ssp_write(dai, SSTSA, sstsa); ssp_write(dai, SSRSA, ssrsa);
- trace_value(sscr0); - trace_value(sscr1); - trace_value(ssto); - trace_value(sspsp); - trace_value(sstsa); - trace_value(ssrsa); - trace_value(sscr2); - trace_value(sspsp2); - trace_value(sscr3); - trace_value(ssioc); + trace_ssp_value(sscr0); + trace_ssp_value(sscr1); + trace_ssp_value(ssto); + trace_ssp_value(sspsp); + trace_ssp_value(sstsa); + trace_ssp_value(ssrsa); + trace_ssp_value(sscr2); + trace_ssp_value(sspsp2); + trace_ssp_value(sscr3); + trace_ssp_value(ssioc);
/* TODO: move this into M/N driver */ mn_reg_write(0x0, mdivc); @@ -672,7 +667,7 @@ static void ssp_irq_handler(void *data) struct dai *dai = data;
trace_ssp("irq"); - trace_value(ssp_read(dai, SSSR)); + trace_ssp_value(ssp_read(dai, SSSR));
/* clear IRQ */ ssp_write(dai, SSSR, ssp_read(dai, SSSR)); diff --git a/src/drivers/byt-ssp.c b/src/drivers/byt-ssp.c index ca3385d..a3cce24 100644 --- a/src/drivers/byt-ssp.c +++ b/src/drivers/byt-ssp.c @@ -36,11 +36,6 @@ #include <sof/alloc.h> #include <sof/interrupt.h>
-/* tracing */ -#define trace_ssp(__e) trace_event(TRACE_CLASS_SSP, __e) -#define trace_ssp_error(__e) trace_error(TRACE_CLASS_SSP, __e) -#define tracev_ssp(__e) tracev_event(TRACE_CLASS_SSP, __e) - /* FIXME: move this to a helper and optimize */ static int hweight_32(uint32_t mask) { @@ -578,7 +573,7 @@ static void ssp_irq_handler(void *data) struct dai *dai = data;
trace_ssp("irq"); - trace_value(ssp_read(dai, SSSR)); + trace_ssp_value(ssp_read(dai, SSSR));
/* clear IRQ */ ssp_write(dai, SSSR, ssp_read(dai, SSSR)); diff --git a/src/include/sof/ssp.h b/src/include/sof/ssp.h index 5a57d58..6fdb95d 100644 --- a/src/include/sof/ssp.h +++ b/src/include/sof/ssp.h @@ -218,10 +218,16 @@ extern const struct dai_ops ssp_ops; #endif
/* tracing */ -#define trace_ssp(__e) trace_event(TRACE_CLASS_SSP, __e) -#define trace_ssp_error(__e) trace_error(TRACE_CLASS_SSP, __e) -#define tracev_ssp(__e) tracev_event(TRACE_CLASS_SSP, __e) - +#define trace_ssp(__e) \ + trace_global_event(NORMAL_LEVEL, TRACE_CLASS_SSP, __e) +#define tracev_ssp(__e) \ + trace_global_event(VERBOSE_LEVEL, TRACE_CLASS_SSP, __e) +#define trace_ssp_error(__e) \ + trace_global_event(ERROR_LEVEL, TRACE_CLASS_SSP, __e) +#define trace_ssp_value(x) \ + trace_global_value(NORMAL_LEVEL, x) +#define trace_ssp_error_value(x) \ + trace_global_value(ERROR_LEVEL, x)
#define ssp_irq(ssp) \ ssp->plat_data.irq