diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-08-02 05:58:05 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:01:00 -0400 |
commit | 9c5e14c463b81d1bc34f2e9605db30f302b4cff5 (patch) | |
tree | db91cee786ca4494291ca9b68ba56ff3244e4973 /sound/soc/fsl/fsl_ssi.c | |
parent | 07c52bf46057772ca2eee701fafd57cf2d9a47ba (diff) |
ENGR00273838-1 ASoC: fsl: Add debug interface for ssi
Add debug interface for ssi to dump its register values.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Diffstat (limited to 'sound/soc/fsl/fsl_ssi.c')
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 2b6457038cb1..fd171fdcf932 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -51,6 +51,24 @@ static inline void write_ssi_mask(u32 __iomem *addr, u32 clear, u32 set) | |||
51 | } | 51 | } |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #ifdef DEBUG | ||
55 | #define NUM_OF_SSI_REG (sizeof(struct ccsr_ssi) / sizeof(__be32)) | ||
56 | |||
57 | void dump_reg(struct ccsr_ssi __iomem *ssi) | ||
58 | { | ||
59 | u32 val, i; | ||
60 | |||
61 | for (i = 0; i < NUM_OF_SSI_REG; i++) { | ||
62 | if (&ssi->stx0 + i == NULL) | ||
63 | continue; | ||
64 | val = read_ssi(&ssi->stx0 + i); | ||
65 | pr_debug("REG %x = %x\n", (u32)(&ssi->stx0 + i) & 0xff, val); | ||
66 | } | ||
67 | } | ||
68 | #else | ||
69 | void dump_reg(struct ccsr_ssi __iomem *ssi) {} | ||
70 | #endif | ||
71 | |||
54 | /** | 72 | /** |
55 | * FSLSSI_I2S_RATES: sample rates supported by the I2S | 73 | * FSLSSI_I2S_RATES: sample rates supported by the I2S |
56 | * | 74 | * |
@@ -500,6 +518,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
500 | else | 518 | else |
501 | write_ssi_mask(&ssi->scr, 0, | 519 | write_ssi_mask(&ssi->scr, 0, |
502 | CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE); | 520 | CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE); |
521 | dump_reg(ssi); | ||
503 | break; | 522 | break; |
504 | 523 | ||
505 | case SNDRV_PCM_TRIGGER_STOP: | 524 | case SNDRV_PCM_TRIGGER_STOP: |