Skip to contentSkip to conversation

ASoC: fsl-esai: fix ESAI TDM slot setting

PATCH Applied Xiubo Li 3 participants 6 messages Feb 10, 2014

Subsystems (3)
lore
Share & tools
lore

Xiubo Li

author
#0 lore raw

PATCH 1/1 ASoC: fsl-esai: fix ESAI TDM slot setting

Cc Nicolin Chen <[email protected]>
---
 sound/soc/fsl/fsl_esai.c | 4 ++--
 sound/soc/fsl/fsl_esai.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/fsl/fsl_esai.c +2 -2
index d0c72ed..c84026c 100644
@@ -326,7 +326,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMA,
 			   ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(tx_mask));
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMB,
-			   ESAI_xSMA_xS_MASK, ESAI_xSMB_xS(tx_mask));
+			   ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(tx_mask));
 
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,
 			   ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(slots));
@@ -334,7 +334,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMA,
 			   ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(rx_mask));
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMB,
-			   ESAI_xSMA_xS_MASK, ESAI_xSMB_xS(rx_mask));
+			   ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(rx_mask));
 
 	esai_priv->slot_width = slot_width;
 
sound/soc/fsl/fsl_esai.h +1 -1
index 9c9f957..75e1403 100644
@@ -322,7 +322,7 @@
 #define ESAI_xSMB_xS_SHIFT	0
 #define ESAI_xSMB_xS_WIDTH	16
 #define ESAI_xSMB_xS_MASK	(((1 << ESAI_xSMB_xS_WIDTH) - 1) << ESAI_xSMB_xS_SHIFT)
-#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) & ESAI_xSMA_xS_MASK)
+#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) & ESAI_xSMB_xS_MASK)
 
 /* Port C Direction Register -- REG_ESAI_PRRC 0xF8 */
 #define ESAI_PRRC_PDC_SHIFT	0
Signature · 1 line
1.8.4
Acked-by on v1 1/1
#1 lore raw
Quoted 34 lines · Xiubo Li
Cc Nicolin Chen <[email protected]>
---
 sound/soc/fsl/fsl_esai.c | 4 ++--
 sound/soc/fsl/fsl_esai.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/fsl/fsl_esai.c +2 -2
index d0c72ed..c84026c 100644
@@ -326,7 +326,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMA,
 			   ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(tx_mask));
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMB,
-			   ESAI_xSMA_xS_MASK, ESAI_xSMB_xS(tx_mask));
+			   ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(tx_mask));
 
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,
 			   ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(slots));
@@ -334,7 +334,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMA,
 			   ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(rx_mask));
 	regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMB,
-			   ESAI_xSMA_xS_MASK, ESAI_xSMB_xS(rx_mask));
+			   ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(rx_mask));
 
 	esai_priv->slot_width = slot_width;
 
sound/soc/fsl/fsl_esai.h +0 -0
index 9c9f957..75e1403 100644

sound/soc/fsl/fsl_esai.h line 325

Quoted 5 lines
sound/soc/fsl/fsl_esai.h +1 -1
@@ -322,7 +322,7 @@
 #define ESAI_xSMB_xS_SHIFT	0
 #define ESAI_xSMB_xS_WIDTH	16
 #define ESAI_xSMB_xS_MASK	(((1 << ESAI_xSMB_xS_WIDTH) - 1) << ESAI_xSMB_xS_SHIFT)
-#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) & ESAI_xSMA_xS_MASK)
+#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) & ESAI_xSMB_xS_MASK)

It should use ESAI_xSMB_xS_WIDTH.

Otherwise, it looks fine. Thank you.

---

Quoted 7 lines
sound/soc/fsl/fsl_esai.h +0 -0
 /* Port C Direction Register -- REG_ESAI_PRRC 0xF8 */
 #define ESAI_PRRC_PDC_SHIFT	0
Signature · 1 line
1.8.4
#2 lore raw

Sorry, my misunderstanding about your comment.

Please ignore the last mail.

I will send v2 of this patch.

Thanks very much.

Quoted 27 lines
Quoted 9 lines

sound/soc/fsl/fsl_esai.h line 324

Quoted 8 lines
sound/soc/fsl/fsl_esai.h +0 -0
index 9c9f957..75e1403 100644
@@ -322,7 +322,7 @@
 #define ESAI_xSMB_xS_SHIFT	0
 #define ESAI_xSMB_xS_WIDTH	16
 #define ESAI_xSMB_xS_MASK	(((1 << ESAI_xSMB_xS_WIDTH) - 1) <<

ESAI_xSMB_xS_SHIFT)

Quoted 7 lines

sound/soc/fsl/fsl_esai.h line 325

Quoted 1 line
sound/soc/fsl/fsl_esai.h +0 -1
-#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) &

ESAI_xSMA_xS_MASK)

sound/soc/fsl/fsl_esai.h line 325

Quoted 1 line
sound/soc/fsl/fsl_esai.h +1 -0
+#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) &

ESAI_xSMB_xS_MASK)

It should use ESAI_xSMB_xS_WIDTH.

Well, the ESAI_xSMB_xS_WIDTH is 0x0010(16), and ESAI_xSMB_xS_MASK will be 0xFFFF.

Thanks,

--
Best Regards,
Xiubo

#3 lore raw
Quoted 5 lines · On Mon, Feb 10, 2014 at 04:24:43PM +0800, Xiubo Li-B47053 wrote:

Sorry, my misunderstanding about your comment.

Please ignore the last mail.

I will send v2 of this patch.

No, you don't need to.

Just rechecked it with RM. Your patch is correct.

I forgot I used A's WIDTH intentionally at the first place.

TSMA-> [15:0]
TSMB-> [31:16] -> higher 16bits.

Thus its shift should be corresponding to A's WIDTH.

The patch is fine. Acked.

Thank you.

Quoted 27 lines
Quoted 27 lines
Quoted 9 lines

sound/soc/fsl/fsl_esai.h line 324

Quoted 8 lines
sound/soc/fsl/fsl_esai.h +0 -0
index 9c9f957..75e1403 100644
@@ -322,7 +322,7 @@
 #define ESAI_xSMB_xS_SHIFT	0
 #define ESAI_xSMB_xS_WIDTH	16
 #define ESAI_xSMB_xS_MASK	(((1 << ESAI_xSMB_xS_WIDTH) - 1) <<

ESAI_xSMB_xS_SHIFT)

Quoted 7 lines

sound/soc/fsl/fsl_esai.h line 325

Quoted 1 line
sound/soc/fsl/fsl_esai.h +0 -1
-#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) &

ESAI_xSMA_xS_MASK)

sound/soc/fsl/fsl_esai.h line 325

Quoted 1 line
sound/soc/fsl/fsl_esai.h +1 -0
+#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) &

ESAI_xSMB_xS_MASK)

It should use ESAI_xSMB_xS_WIDTH.

Well, the ESAI_xSMB_xS_WIDTH is 0x0010(16), and ESAI_xSMB_xS_MASK will be 0xFFFF.

Thanks,

--
Best Regards,
Xiubo

#4 lore raw
In reply to Nicolin Chen
Quoted 10 lines

sound/soc/fsl/fsl_esai.h line 324

Quoted 9 lines
sound/soc/fsl/fsl_esai.h +0 -0
index 9c9f957..75e1403 100644
@@ -322,7 +322,7 @@
 #define ESAI_xSMB_xS_SHIFT	0
 #define ESAI_xSMB_xS_WIDTH	16
 #define ESAI_xSMB_xS_MASK	(((1 << ESAI_xSMB_xS_WIDTH) - 1) <<

ESAI_xSMB_xS_SHIFT)

Quoted 7 lines

sound/soc/fsl/fsl_esai.h line 325

Quoted 1 line
sound/soc/fsl/fsl_esai.h +0 -1
-#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) &

ESAI_xSMA_xS_MASK)

sound/soc/fsl/fsl_esai.h line 325

Quoted 1 line
sound/soc/fsl/fsl_esai.h +1 -0
+#define ESAI_xSMB_xS(v)		(((v) >> ESAI_xSMA_xS_WIDTH) &

ESAI_xSMB_xS_MASK)

It should use ESAI_xSMB_xS_WIDTH.

Well, the ESAI_xSMB_xS_WIDTH is 0x0010(16), and ESAI_xSMB_xS_MASK will be 0xFFFF.

Thanks,

--
Best Regards,
Xiubo