diff options
author | Jassi Brar <jassi.brar@samsung.com> | 2010-04-27 02:56:27 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-05-05 10:11:29 -0400 |
commit | ce76f9fd34d4d39fbda330f14b327273551e2f54 (patch) | |
tree | 659dcd028e1ee8cef947fcc2ad82dc8ff0e604bb | |
parent | b720d56294187ea4167a20e59c4ea0bb4f064132 (diff) |
ASoC: S3C2412: I2S: Debug IMS field
The IMS field of s3c2412/13 is essentially the same as that of s3c64xx.
That is, the IISMOD[11] bit decides Master/Slave mode and IISMOD[10] bit
selects source clock for signal generation.
For that reason, remove improper defines for IISMOD[11:10] field mask
and define two 1bit fields that can be set independent of each other.
As a consequence, corresponding fields for PLAT_S3C64XX too get to use
these new defines.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/s3c24xx/regs-i2s-v2.h | 6 | ||||
-rw-r--r-- | sound/soc/s3c24xx/s3c-i2s-v2.c | 25 | ||||
-rw-r--r-- | sound/soc/s3c24xx/s3c2412-i2s.c | 8 |
3 files changed, 6 insertions, 33 deletions
diff --git a/sound/soc/s3c24xx/regs-i2s-v2.h b/sound/soc/s3c24xx/regs-i2s-v2.h index f3d90289e7be..484858a5f33b 100644 --- a/sound/soc/s3c24xx/regs-i2s-v2.h +++ b/sound/soc/s3c24xx/regs-i2s-v2.h | |||
@@ -76,10 +76,8 @@ | |||
76 | #define S3C64XX_IISMOD_IMS_PCLK (0 << 10) | 76 | #define S3C64XX_IISMOD_IMS_PCLK (0 << 10) |
77 | #define S3C64XX_IISMOD_IMS_SYSMUX (1 << 10) | 77 | #define S3C64XX_IISMOD_IMS_SYSMUX (1 << 10) |
78 | 78 | ||
79 | #define S3C2412_IISMOD_MASTER_INTERNAL (0 << 10) | 79 | #define S3C2412_IISMOD_IMS_SYSMUX (1 << 10) |
80 | #define S3C2412_IISMOD_MASTER_EXTERNAL (1 << 10) | 80 | #define S3C2412_IISMOD_SLAVE (1 << 11) |
81 | #define S3C2412_IISMOD_SLAVE (2 << 10) | ||
82 | #define S3C2412_IISMOD_MASTER_MASK (3 << 10) | ||
83 | #define S3C2412_IISMOD_MODE_TXONLY (0 << 8) | 81 | #define S3C2412_IISMOD_MODE_TXONLY (0 << 8) |
84 | #define S3C2412_IISMOD_MODE_RXONLY (1 << 8) | 82 | #define S3C2412_IISMOD_MODE_RXONLY (1 << 8) |
85 | #define S3C2412_IISMOD_MODE_TXRX (2 << 8) | 83 | #define S3C2412_IISMOD_MODE_TXRX (2 << 8) |
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c index cb3652ed057d..b8803a182cc1 100644 --- a/sound/soc/s3c24xx/s3c-i2s-v2.c +++ b/sound/soc/s3c24xx/s3c-i2s-v2.c | |||
@@ -265,35 +265,14 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai, | |||
265 | iismod = readl(i2s->regs + S3C2412_IISMOD); | 265 | iismod = readl(i2s->regs + S3C2412_IISMOD); |
266 | pr_debug("hw_params r: IISMOD: %x \n", iismod); | 266 | pr_debug("hw_params r: IISMOD: %x \n", iismod); |
267 | 267 | ||
268 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | ||
269 | #define IISMOD_MASTER_MASK S3C2412_IISMOD_MASTER_MASK | ||
270 | #define IISMOD_SLAVE S3C2412_IISMOD_SLAVE | ||
271 | #define IISMOD_MASTER S3C2412_IISMOD_MASTER_INTERNAL | ||
272 | #endif | ||
273 | |||
274 | #if defined(CONFIG_PLAT_S3C64XX) | ||
275 | /* From Rev1.1 datasheet, we have two master and two slave modes: | ||
276 | * IMS[11:10]: | ||
277 | * 00 = master mode, fed from PCLK | ||
278 | * 01 = master mode, fed from CLKAUDIO | ||
279 | * 10 = slave mode, using PCLK | ||
280 | * 11 = slave mode, using I2SCLK | ||
281 | */ | ||
282 | #define IISMOD_MASTER_MASK (1 << 11) | ||
283 | #define IISMOD_SLAVE (1 << 11) | ||
284 | #define IISMOD_MASTER (0 << 11) | ||
285 | #endif | ||
286 | |||
287 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 268 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
288 | case SND_SOC_DAIFMT_CBM_CFM: | 269 | case SND_SOC_DAIFMT_CBM_CFM: |
289 | i2s->master = 0; | 270 | i2s->master = 0; |
290 | iismod &= ~IISMOD_MASTER_MASK; | 271 | iismod |= S3C2412_IISMOD_SLAVE; |
291 | iismod |= IISMOD_SLAVE; | ||
292 | break; | 272 | break; |
293 | case SND_SOC_DAIFMT_CBS_CFS: | 273 | case SND_SOC_DAIFMT_CBS_CFS: |
294 | i2s->master = 1; | 274 | i2s->master = 1; |
295 | iismod &= ~IISMOD_MASTER_MASK; | 275 | iismod &= ~S3C2412_IISMOD_SLAVE; |
296 | iismod |= IISMOD_MASTER; | ||
297 | break; | 276 | break; |
298 | default: | 277 | default: |
299 | pr_err("unknwon master/slave format\n"); | 278 | pr_err("unknwon master/slave format\n"); |
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c index 7134465693e3..cf0c15482c34 100644 --- a/sound/soc/s3c24xx/s3c2412-i2s.c +++ b/sound/soc/s3c24xx/s3c2412-i2s.c | |||
@@ -78,14 +78,10 @@ static int s3c2412_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, | |||
78 | 78 | ||
79 | switch (clk_id) { | 79 | switch (clk_id) { |
80 | case S3C2412_CLKSRC_PCLK: | 80 | case S3C2412_CLKSRC_PCLK: |
81 | s3c2412_i2s.master = 1; | 81 | iismod &= ~S3C2412_IISMOD_IMS_SYSMUX; |
82 | iismod &= ~S3C2412_IISMOD_MASTER_MASK; | ||
83 | iismod |= S3C2412_IISMOD_MASTER_INTERNAL; | ||
84 | break; | 82 | break; |
85 | case S3C2412_CLKSRC_I2SCLK: | 83 | case S3C2412_CLKSRC_I2SCLK: |
86 | s3c2412_i2s.master = 0; | 84 | iismod |= S3C2412_IISMOD_IMS_SYSMUX; |
87 | iismod &= ~S3C2412_IISMOD_MASTER_MASK; | ||
88 | iismod |= S3C2412_IISMOD_MASTER_EXTERNAL; | ||
89 | break; | 85 | break; |
90 | default: | 86 | default: |
91 | return -EINVAL; | 87 | return -EINVAL; |