diff options
author | Nicolin Chen <nicoleotsuka@gmail.com> | 2018-02-12 17:03:09 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-02-21 07:30:47 -0500 |
commit | 1476105c3f4a6b8f0c6c1fe07295fc85cbffbd83 (patch) | |
tree | c5176be911f3d7677bad9f6951e61ac4b0f1eca6 | |
parent | da18bcf72291bd4324ba249f881d7d0c205fd00a (diff) |
ASoC: fsl_ssi: Redefine RX and TX macros
The RX and TX macros were defined implicitly and there was
a potential risk if someone changes their values.
Since they were defined to index the array ssi->regvals[2],
this patch moves these two macros to fsl_ssi.c, closer to
its owner ssi->regvals. And it also puts some comments here
to limit their value within [0, 1].
Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Tested-by: Caleb Crome <caleb@crome.org>
Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Reviewed-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 4 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_ssi.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 24fb672f3c65..3c8dd609e42e 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -56,6 +56,10 @@ | |||
56 | #include "fsl_ssi.h" | 56 | #include "fsl_ssi.h" |
57 | #include "imx-pcm.h" | 57 | #include "imx-pcm.h" |
58 | 58 | ||
59 | /* Define RX and TX to index ssi->regvals array; Can be 0 or 1 only */ | ||
60 | #define RX 0 | ||
61 | #define TX 1 | ||
62 | |||
59 | /** | 63 | /** |
60 | * FSLSSI_I2S_FORMATS: audio formats supported by the SSI | 64 | * FSLSSI_I2S_FORMATS: audio formats supported by the SSI |
61 | * | 65 | * |
diff --git a/sound/soc/fsl/fsl_ssi.h b/sound/soc/fsl/fsl_ssi.h index de2fdc5db726..18f8dd5209d5 100644 --- a/sound/soc/fsl/fsl_ssi.h +++ b/sound/soc/fsl/fsl_ssi.h | |||
@@ -12,9 +12,6 @@ | |||
12 | #ifndef _MPC8610_I2S_H | 12 | #ifndef _MPC8610_I2S_H |
13 | #define _MPC8610_I2S_H | 13 | #define _MPC8610_I2S_H |
14 | 14 | ||
15 | #define RX 0 | ||
16 | #define TX 1 | ||
17 | |||
18 | /* -- SSI Register Map -- */ | 15 | /* -- SSI Register Map -- */ |
19 | 16 | ||
20 | /* SSI Transmit Data Register 0 */ | 17 | /* SSI Transmit Data Register 0 */ |