diff mbox series

[v4,5/6] ASoC: madera: Export clock config defines to dt-bindings

Message ID 20210108160501.7638-6-rf@opensource.cirrus.com (mailing list archive)
State New, archived
Headers show
Series Add support for Rpi4b + Cirrus Lochnagar2 and CS47L15 | expand

Commit Message

Richard Fitzgerald Jan. 8, 2021, 4:05 p.m. UTC
Move the defines for clock/fll IDs and sources into the dt-bindings
header so that they can be used by machine driver dts files.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 include/dt-bindings/sound/madera.h | 60 ++++++++++++++++++++++++++++++
 sound/soc/codecs/madera.h          | 56 +---------------------------
 2 files changed, 61 insertions(+), 55 deletions(-)
diff mbox series

Patch

diff --git a/include/dt-bindings/sound/madera.h b/include/dt-bindings/sound/madera.h
index d0096d5eb0da..5c5fc1bfe6f9 100644
--- a/include/dt-bindings/sound/madera.h
+++ b/include/dt-bindings/sound/madera.h
@@ -22,4 +22,64 @@ 
 #define CS47L35_DMIC_REF_MICBIAS2A	2
 #define CS47L35_DMIC_REF_MICBIAS2B	3
 
+/* FLL IDs */
+#define MADERA_FLL1_REFCLK		1
+#define MADERA_FLL2_REFCLK		2
+#define MADERA_FLL3_REFCLK		3
+#define MADERA_FLLAO_REFCLK		4
+#define MADERA_FLL1_SYNCCLK		5
+#define MADERA_FLL2_SYNCCLK		6
+#define MADERA_FLL3_SYNCCLK		7
+#define MADERA_FLLAO_SYNCCLK		8
+
+/* FLL input source pin IDs */
+#define MADERA_FLL_SRC_NONE		-1
+#define MADERA_FLL_SRC_MCLK1		0
+#define MADERA_FLL_SRC_MCLK2		1
+#define MADERA_FLL_SRC_MCLK3		2
+#define MADERA_FLL_SRC_SLIMCLK		3
+#define MADERA_FLL_SRC_FLL1		4
+#define MADERA_FLL_SRC_FLL2		5
+#define MADERA_FLL_SRC_AIF1BCLK		8
+#define MADERA_FLL_SRC_AIF2BCLK		9
+#define MADERA_FLL_SRC_AIF3BCLK		10
+#define MADERA_FLL_SRC_AIF4BCLK		11
+#define MADERA_FLL_SRC_AIF1LRCLK	12
+#define MADERA_FLL_SRC_AIF2LRCLK	13
+#define MADERA_FLL_SRC_AIF3LRCLK	14
+#define MADERA_FLL_SRC_AIF4LRCLK	15
+
+/* SYSCLK IDs */
+#define MADERA_CLK_SYSCLK_1		1
+#define MADERA_CLK_ASYNCCLK_1		2
+#define MADERA_CLK_OPCLK		3
+#define MADERA_CLK_ASYNC_OPCLK		4
+#define MADERA_CLK_SYSCLK_2		5
+#define MADERA_CLK_SYSCLK_3		6
+#define MADERA_CLK_ASYNCCLK_2		7
+#define MADERA_CLK_DSPCLK		8
+#define MADERA_CLK_OUTCLK		9
+
+/* SYSCLK source IDs */
+#define MADERA_CLK_SRC_MCLK1		0x0
+#define MADERA_CLK_SRC_MCLK2		0x1
+#define MADERA_CLK_SRC_MCLK3		0x2
+#define MADERA_CLK_SRC_FLL1		0x4
+#define MADERA_CLK_SRC_FLL2		0x5
+#define MADERA_CLK_SRC_FLL3		0x6
+#define MADERA_CLK_SRC_FLLAO_HI		0x7
+#define MADERA_CLK_SRC_FLL1_DIV6	0x7
+#define MADERA_CLK_SRC_AIF1BCLK		0x8
+#define MADERA_CLK_SRC_AIF2BCLK		0x9
+#define MADERA_CLK_SRC_AIF3BCLK		0xA
+#define MADERA_CLK_SRC_AIF4BCLK		0xB
+#define MADERA_CLK_SRC_FLLAO		0xF
+
+/* OPCLK source IDs */
+#define MADERA_OUTCLK_SYSCLK		0
+#define MADERA_OUTCLK_ASYNCCLK		1
+#define MADERA_OUTCLK_MCLK1		4
+#define MADERA_OUTCLK_MCLK2		5
+#define MADERA_OUTCLK_MCLK3		6
+
 #endif
diff --git a/sound/soc/codecs/madera.h b/sound/soc/codecs/madera.h
index e0c0be59e2ef..1f4ea15648c5 100644
--- a/sound/soc/codecs/madera.h
+++ b/sound/soc/codecs/madera.h
@@ -9,67 +9,13 @@ 
 #ifndef ASOC_MADERA_H
 #define ASOC_MADERA_H
 
+#include <dt-bindings/sound/madera.h>
 #include <linux/completion.h>
 #include <sound/soc.h>
 #include <sound/madera-pdata.h>
 
 #include "wm_adsp.h"
 
-#define MADERA_FLL1_REFCLK		1
-#define MADERA_FLL2_REFCLK		2
-#define MADERA_FLL3_REFCLK		3
-#define MADERA_FLLAO_REFCLK		4
-#define MADERA_FLL1_SYNCCLK		5
-#define MADERA_FLL2_SYNCCLK		6
-#define MADERA_FLL3_SYNCCLK		7
-#define MADERA_FLLAO_SYNCCLK		8
-
-#define MADERA_FLL_SRC_NONE		-1
-#define MADERA_FLL_SRC_MCLK1		0
-#define MADERA_FLL_SRC_MCLK2		1
-#define MADERA_FLL_SRC_MCLK3		2
-#define MADERA_FLL_SRC_SLIMCLK		3
-#define MADERA_FLL_SRC_FLL1		4
-#define MADERA_FLL_SRC_FLL2		5
-#define MADERA_FLL_SRC_AIF1BCLK		8
-#define MADERA_FLL_SRC_AIF2BCLK		9
-#define MADERA_FLL_SRC_AIF3BCLK		10
-#define MADERA_FLL_SRC_AIF4BCLK		11
-#define MADERA_FLL_SRC_AIF1LRCLK	12
-#define MADERA_FLL_SRC_AIF2LRCLK	13
-#define MADERA_FLL_SRC_AIF3LRCLK	14
-#define MADERA_FLL_SRC_AIF4LRCLK	15
-
-#define MADERA_CLK_SYSCLK_1		1
-#define MADERA_CLK_ASYNCCLK_1		2
-#define MADERA_CLK_OPCLK		3
-#define MADERA_CLK_ASYNC_OPCLK		4
-#define MADERA_CLK_SYSCLK_2		5
-#define MADERA_CLK_SYSCLK_3		6
-#define MADERA_CLK_ASYNCCLK_2		7
-#define MADERA_CLK_DSPCLK		8
-#define MADERA_CLK_OUTCLK		9
-
-#define MADERA_CLK_SRC_MCLK1		0x0
-#define MADERA_CLK_SRC_MCLK2		0x1
-#define MADERA_CLK_SRC_MCLK3		0x2
-#define MADERA_CLK_SRC_FLL1		0x4
-#define MADERA_CLK_SRC_FLL2		0x5
-#define MADERA_CLK_SRC_FLL3		0x6
-#define MADERA_CLK_SRC_FLLAO_HI		0x7
-#define MADERA_CLK_SRC_FLL1_DIV6	0x7
-#define MADERA_CLK_SRC_AIF1BCLK		0x8
-#define MADERA_CLK_SRC_AIF2BCLK		0x9
-#define MADERA_CLK_SRC_AIF3BCLK		0xA
-#define MADERA_CLK_SRC_AIF4BCLK		0xB
-#define MADERA_CLK_SRC_FLLAO		0xF
-
-#define MADERA_OUTCLK_SYSCLK		0
-#define MADERA_OUTCLK_ASYNCCLK		1
-#define MADERA_OUTCLK_MCLK1		4
-#define MADERA_OUTCLK_MCLK2		5
-#define MADERA_OUTCLK_MCLK3		6
-
 #define MADERA_MIXER_VOL_MASK		0x00FE
 #define MADERA_MIXER_VOL_SHIFT		1
 #define MADERA_MIXER_VOL_WIDTH		7