[PATCH 2/4] soc-dai: add bitfields for hardware I2S formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds bitfields for I2S serial formats that differ from the
amount of data actually sent on the line. Some codecs (namely the
cs4270) require 64 sysclks being sent during each frame period, even
though the number of acutal data bits might be less.

Signed-off-by: Daniel Mack <daniel@xxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: Liam Girdwood <lrg@xxxxxxxxxx>
Cc: Tim Ruetz <tim@xxxxxxxx>
---
 include/sound/soc-dai.h |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 24247f7..83b617f 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -85,10 +85,22 @@ struct snd_pcm_substream;
 #define SND_SOC_DAIFMT_CBM_CFS		(2 << 12) /* codec clk master & frame slave */
 #define SND_SOC_DAIFMT_CBS_CFS		(3 << 12) /* codec clk & frm slave */
 
-#define SND_SOC_DAIFMT_FORMAT_MASK	0x000f
-#define SND_SOC_DAIFMT_CLOCK_MASK	0x00f0
-#define SND_SOC_DAIFMT_INV_MASK		0x0f00
-#define SND_SOC_DAIFMT_MASTER_MASK	0xf000
+/*
+ * DAI hardware frame formats.
+ *
+ * Independently, these bits the define the audio format on the
+ * pysical channel in case it differs from the audio sample the
+ * DAI is configured to
+ */
+#define SND_SOC_DAIFMT_FF_SAMPLE	(0 << 16)
+#define SND_SOC_DAIFMT_FF_I2S_16	(1 << 16)
+#define SND_SOC_DAIFMT_FF_I2S_32	(2 << 16)
+
+#define SND_SOC_DAIFMT_FORMAT_MASK		0x0000f
+#define SND_SOC_DAIFMT_CLOCK_MASK		0x000f0
+#define SND_SOC_DAIFMT_INV_MASK			0x00f00
+#define SND_SOC_DAIFMT_MASTER_MASK		0x0f000
+#define SND_SOC_DAIFMT_FRAME_FORMAT_MASK	0xf0000
 
 /*
  * Master Clock Directions
-- 
1.6.1.3

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux