alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 12/20] ASoC: S3C2412: I2S: Debug IMS field
@ 2010-03-10  8:12 Jassi Brar
  0 siblings, 0 replies; 2+ messages in thread
From: Jassi Brar @ 2010-03-10  8:12 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, Jassi Brar, ben-linux

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>
---
 sound/soc/s3c24xx/regs-i2s-v2.h |    6 ++----
 sound/soc/s3c24xx/s3c-i2s-v2.c  |   25 ++-----------------------
 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 dea199e..f612468 100644
--- a/sound/soc/s3c24xx/regs-i2s-v2.h
+++ b/sound/soc/s3c24xx/regs-i2s-v2.h
@@ -76,10 +76,8 @@
 #define S3C64XX_IISMOD_IMS_PCLK		(0 << 10)
 #define S3C64XX_IISMOD_IMS_SYSMUX	(1 << 10)
 
-#define S3C2412_IISMOD_MASTER_INTERNAL	(0 << 10)
-#define S3C2412_IISMOD_MASTER_EXTERNAL	(1 << 10)
-#define S3C2412_IISMOD_SLAVE		(2 << 10)
-#define S3C2412_IISMOD_MASTER_MASK	(3 << 10)
+#define S3C2412_IISMOD_IMS_SYSMUX	(1 << 10)
+#define S3C2412_IISMOD_SLAVE		(1 << 11)
 #define S3C2412_IISMOD_MODE_TXONLY	(0 << 8)
 #define S3C2412_IISMOD_MODE_RXONLY	(1 << 8)
 #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 b690078..1b29b4b 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -251,35 +251,14 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
 	iismod = readl(i2s->regs + S3C2412_IISMOD);
 	pr_debug("hw_params r: IISMOD: %x \n", iismod);
 
-#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
-#define IISMOD_MASTER_MASK S3C2412_IISMOD_MASTER_MASK
-#define IISMOD_SLAVE S3C2412_IISMOD_SLAVE
-#define IISMOD_MASTER S3C2412_IISMOD_MASTER_INTERNAL
-#endif
-
-#if defined(CONFIG_PLAT_S3C64XX)
-/* From Rev1.1 datasheet, we have two master and two slave modes:
- * IMS[11:10]:
- *	00 = master mode, fed from PCLK
- *	01 = master mode, fed from CLKAUDIO
- *	10 = slave mode, using PCLK
- *	11 = slave mode, using I2SCLK
- */
-#define IISMOD_MASTER_MASK (1 << 11)
-#define IISMOD_SLAVE (1 << 11)
-#define IISMOD_MASTER (0 << 11)
-#endif
-
 	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
 	case SND_SOC_DAIFMT_CBM_CFM:
 		i2s->master = 0;
-		iismod &= ~IISMOD_MASTER_MASK;
-		iismod |= IISMOD_SLAVE;
+		iismod |= S3C2412_IISMOD_SLAVE;
 		break;
 	case SND_SOC_DAIFMT_CBS_CFS:
 		i2s->master = 1;
-		iismod &= ~IISMOD_MASTER_MASK;
-		iismod |= IISMOD_MASTER;
+		iismod &= ~S3C2412_IISMOD_SLAVE;
 		break;
 	default:
 		pr_err("unknwon master/slave format\n");
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c
index 42fb663..e6871f7 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,
 
 	switch (clk_id) {
 	case S3C2412_CLKSRC_PCLK:
-		s3c2412_i2s.master = 1;
-		iismod &= ~S3C2412_IISMOD_MASTER_MASK;
-		iismod |= S3C2412_IISMOD_MASTER_INTERNAL;
+		iismod &= ~S3C2412_IISMOD_IMS_SYSMUX;
 		break;
 	case S3C2412_CLKSRC_I2SCLK:
-		s3c2412_i2s.master = 0;
-		iismod &= ~S3C2412_IISMOD_MASTER_MASK;
-		iismod |= S3C2412_IISMOD_MASTER_EXTERNAL;
+		iismod |= S3C2412_IISMOD_IMS_SYSMUX;
 		break;
 	default:
 		return -EINVAL;
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH 01/20] ASoC: S3C: I2Sv2: Add missing semicolon
@ 2010-03-10  7:48 Jassi Brar
  2010-03-10  7:48 ` [PATCH 02/20] ASoC: S3C: I2Sv2: Reject immidiate register value Jassi Brar
  0 siblings, 1 reply; 2+ messages in thread
From: Jassi Brar @ 2010-03-10  7:48 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, Jassi Brar, ben-linux

Add missing semicolon after s3c2412_i2s_delay

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
---
 sound/soc/s3c24xx/s3c-i2s-v2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index aa84f4c..8f08508 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -753,7 +753,7 @@ int s3c_i2sv2_register_dai(struct snd_soc_dai *dai)
 
 	/* Allow overriding by (for example) IISv4 */
 	if (!ops->delay)
-		ops->delay = s3c2412_i2s_delay,
+		ops->delay = s3c2412_i2s_delay;
 
 	dai->suspend = s3c2412_i2s_suspend;
 	dai->resume = s3c2412_i2s_resume;
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-10  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-10  8:12 [PATCH 12/20] ASoC: S3C2412: I2S: Debug IMS field Jassi Brar
  -- strict thread matches above, loose matches on Subject: below --
2010-03-10  7:48 [PATCH 01/20] ASoC: S3C: I2Sv2: Add missing semicolon Jassi Brar
2010-03-10  7:48 ` [PATCH 02/20] ASoC: S3C: I2Sv2: Reject immidiate register value Jassi Brar
2010-03-10  7:48   ` [PATCH 03/20] ASoC: S3C64XX: I2S: Make BCLK independent of sample size Jassi Brar
2010-03-10  7:48     ` [PATCH 04/20] ASoC: S3C: I2Sv2: Remove S3C_IIS_V2_SUPPORTED define Jassi Brar
2010-03-10  7:48       ` [PATCH 05/20] ASoC: S3C: I2Sv2: Unify clock source IDs Jassi Brar
2010-03-10  7:48         ` [PATCH 06/20] ASoC: s3c-i2s-v2 remove unnecessary headers Jassi Brar
2010-03-10  7:48           ` [PATCH 07/20] ASoC: s3c64xx-i2s remove unncessary headers Jassi Brar
2010-03-10  7:48             ` [PATCH 08/20] ASoC: S3C64XX: I2S: Move RATE and FMT defines to header Jassi Brar
2010-03-10  7:48               ` [PATCH 09/20] ASoC: S3C: I2Sv2: Segregate hw_params callback Jassi Brar
2010-03-10  7:48                 ` [PATCH 10/20] ASoC: S3C: I2Sv2: Move register definitions closer to driver Jassi Brar
2010-03-10  7:49                   ` [PATCH 11/20] ASoC: SAMSUNG: I2S: Add bit definitions Jassi Brar
2010-03-10  7:49                     ` [PATCH 12/20] ASoC: S3C2412: I2S: Debug IMS field Jassi Brar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).