Skip to contentSkip to conversation

ASoC: cs47l15: Add codec driver for CS47L15

PATCH Superseded Charles Keepax 1 participant 3 messages Jul 25, 2019

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Charles Keepax

author maintainer
#0 lore raw

PATCH 1/2 ASoC: cs47l15: Add codec driver for CS47L15

From: Richard Fitzgerald <[email protected]>

Adds the codec driver for the CS47L15 SmartCodec. This is a multi-functional codec based on the Cirrus Logic Madera platform.

---
 sound/soc/codecs/Kconfig   |    6 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs47l15.c | 1498 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/madera.c  |    4 +
 4 files changed, 1510 insertions(+)
 create mode 100644 sound/soc/codecs/cs47l15.c
sound/soc/codecs/Kconfig +6 -0
index 9f89a5346299d..b027af8e9f39f 100644
@@ -71,6 +71,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS4341 if SND_SOC_I2C_AND_SPI
 	select SND_SOC_CS4349 if I2C
 	select SND_SOC_CS47L24 if MFD_CS47L24
+	select SND_SOC_CS47L15 if MFD_CS47L15
 	select SND_SOC_CS47L35 if MFD_CS47L35
 	select SND_SOC_CS47L85 if MFD_CS47L85
 	select SND_SOC_CS47L90 if MFD_CS47L90
@@ -584,6 +585,9 @@ config SND_SOC_CS4349
 config SND_SOC_CS47L24
 	tristate
 
+config SND_SOC_CS47L15
+	tristate
+
 config SND_SOC_CS47L35
 	tristate
 
@@ -722,9 +726,11 @@ config SND_SOC_LOCHNAGAR_SC
 
 config SND_SOC_MADERA
 	tristate
+	default y if SND_SOC_CS47L15=y
 	default y if SND_SOC_CS47L35=y
 	default y if SND_SOC_CS47L85=y
 	default y if SND_SOC_CS47L90=y
+	default m if SND_SOC_CS47L15=m
 	default m if SND_SOC_CS47L35=m
 	default m if SND_SOC_CS47L85=m
 	default m if SND_SOC_CS47L90=m
sound/soc/codecs/Makefile +2 -0
index 5b4bb8cf43256..2de423621ba4a 100644
@@ -65,6 +65,7 @@ snd-soc-cs43130-objs := cs43130.o
 snd-soc-cs4341-objs := cs4341.o
 snd-soc-cs4349-objs := cs4349.o
 snd-soc-cs47l24-objs := cs47l24.o
+snd-soc-cs47l15-objs := cs47l15.o
 snd-soc-cs47l35-objs := cs47l35.o
 snd-soc-cs47l85-objs := cs47l85.o
 snd-soc-cs47l90-objs := cs47l90.o
@@ -346,6 +347,7 @@ obj-$(CONFIG_SND_SOC_CS43130)   += snd-soc-cs43130.o
 obj-$(CONFIG_SND_SOC_CS4341)	+= snd-soc-cs4341.o
 obj-$(CONFIG_SND_SOC_CS4349)	+= snd-soc-cs4349.o
 obj-$(CONFIG_SND_SOC_CS47L24)	+= snd-soc-cs47l24.o
+obj-$(CONFIG_SND_SOC_CS47L15)	+= snd-soc-cs47l15.o
 obj-$(CONFIG_SND_SOC_CS47L35)	+= snd-soc-cs47l35.o
 obj-$(CONFIG_SND_SOC_CS47L85)	+= snd-soc-cs47l85.o
 obj-$(CONFIG_SND_SOC_CS47L90)	+= snd-soc-cs47l90.o
sound/soc/codecs/cs47l15.c new file +1498 -0

1,498 lines not on this page · raw message

sound/soc/codecs/madera.c +4 -0
index 5f1e32a5a8556..1c00e2a115bcd 100644
@@ -1041,6 +1041,10 @@ static void madera_configure_input_mode(struct madera *madera)
 	int max_analogue_inputs, max_dmic_sup, i;
 
 	switch (madera->type) {
+	case CS47L15:
+		max_analogue_inputs = 1;
+		max_dmic_sup = 2;
+		break;
 	case CS47L35:
 		max_analogue_inputs = 2;
 		max_dmic_sup = 2;
Signature · 1 line
2.11.0
author maintainer
#1 lore raw

PATCH 2/2 ASoC: cs47l92: Add codec driver for Cirrus Logic CS47L92

From: Stuart Henderson <[email protected]>

Adds the codec driver for the CS47L92 SmartCodec. This is a multi-functional codec based on the Cirrus Logic Madera platform.

---
 include/sound/madera-pdata.h |   11 +
 sound/soc/codecs/Kconfig     |    6 +
 sound/soc/codecs/Makefile    |    2 +
 sound/soc/codecs/cs47l92.c   | 2047 ++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/madera.c    |  430 ++++++++-
 sound/soc/codecs/madera.h    |   10 +
 6 files changed, 2497 insertions(+), 9 deletions(-)
 create mode 100644 sound/soc/codecs/cs47l92.c
include/sound/madera-pdata.h +11 -0
index e3060f48f1081..c9dba4a4225a8 100644
@@ -42,6 +42,13 @@
  *			  the datasheet for a description of this value.
  * @pdm_mute:		  PDM mute format. See the PDM_SPKn_CTRL_1 register
  *			  in the datasheet for a description of this value.
+ * @auxpdm_slave_mode:	  Auxiliary PDM out slave mode. The value TRUE
+ *			  indicates the codec is the clock slave. FALSE
+ *			  means the codec is master.
+ * @auxpdm_falling_edge:  Auxiliary PDM falling edge mode. The value TRUE
+ *			  indicates data is driven on the falling edge of
+ *			  the aux pdm clock.  FALSE means data is driven on
+ *			  the rising edge.
  */
 struct madera_codec_pdata {
 	u32 max_channels_clocked[MADERA_MAX_AIF];
@@ -54,6 +61,10 @@ struct madera_codec_pdata {
 
 	u32 pdm_fmt[MADERA_MAX_PDM_SPK];
 	u32 pdm_mute[MADERA_MAX_PDM_SPK];
+
+	bool auxpdm_slave_mode;
+
+	bool auxpdm_falling_edge;
 };
 
 #endif
sound/soc/codecs/Kconfig +6 -0
index b027af8e9f39f..9034f85455fb9 100644
@@ -75,6 +75,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS47L35 if MFD_CS47L35
 	select SND_SOC_CS47L85 if MFD_CS47L85
 	select SND_SOC_CS47L90 if MFD_CS47L90
+	select SND_SOC_CS47L92 if MFD_CS47L92
 	select SND_SOC_CS53L30 if I2C
 	select SND_SOC_CX20442 if TTY
 	select SND_SOC_CX2072X if I2C
@@ -597,6 +598,9 @@ config SND_SOC_CS47L85
 config SND_SOC_CS47L90
 	tristate
 
+config SND_SOC_CS47L92
+	tristate
+
 # Cirrus Logic Quad-Channel ADC
 config SND_SOC_CS53L30
 	tristate "Cirrus Logic CS53L30 CODEC"
@@ -730,10 +734,12 @@ config SND_SOC_MADERA
 	default y if SND_SOC_CS47L35=y
 	default y if SND_SOC_CS47L85=y
 	default y if SND_SOC_CS47L90=y
+	default y if SND_SOC_CS47L92=y
 	default m if SND_SOC_CS47L15=m
 	default m if SND_SOC_CS47L35=m
 	default m if SND_SOC_CS47L85=m
 	default m if SND_SOC_CS47L90=m
+	default m if SND_SOC_CS47L92=m
 
 config SND_SOC_MAX98088
 	tristate "Maxim MAX98088/9 Low-Power, Stereo Audio Codec"
sound/soc/codecs/Makefile +2 -0
index 2de423621ba4a..1ce7ab6d08dd4 100644
@@ -69,6 +69,7 @@ snd-soc-cs47l15-objs := cs47l15.o
 snd-soc-cs47l35-objs := cs47l35.o
 snd-soc-cs47l85-objs := cs47l85.o
 snd-soc-cs47l90-objs := cs47l90.o
+snd-soc-cs47l92-objs := cs47l92.o
 snd-soc-cs53l30-objs := cs53l30.o
 snd-soc-cx20442-objs := cx20442.o
 snd-soc-cx2072x-objs := cx2072x.o
@@ -351,6 +352,7 @@ obj-$(CONFIG_SND_SOC_CS47L15)	+= snd-soc-cs47l15.o
 obj-$(CONFIG_SND_SOC_CS47L35)	+= snd-soc-cs47l35.o
 obj-$(CONFIG_SND_SOC_CS47L85)	+= snd-soc-cs47l85.o
 obj-$(CONFIG_SND_SOC_CS47L90)	+= snd-soc-cs47l90.o
+obj-$(CONFIG_SND_SOC_CS47L92)	+= snd-soc-cs47l92.o
 obj-$(CONFIG_SND_SOC_CS53L30)	+= snd-soc-cs53l30.o
 obj-$(CONFIG_SND_SOC_CX20442)	+= snd-soc-cx20442.o
 obj-$(CONFIG_SND_SOC_CX2072X)	+= snd-soc-cx2072x.o
sound/soc/codecs/cs47l92.c new file +2047 -0

2,047 lines not on this page · raw message

sound/soc/codecs/madera.c +421 -9

502 lines not on this page · raw message

sound/soc/codecs/madera.h +10 -0
index 0af66f2807708..1f3e8e230cf25 100644
@@ -47,6 +47,7 @@
 #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
@@ -61,6 +62,12 @@
 #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
@@ -326,6 +333,7 @@ extern const struct soc_enum madera_sample_rate[];
 extern const struct soc_enum madera_isrc_fsl[];
 extern const struct soc_enum madera_isrc_fsh[];
 extern const struct soc_enum madera_asrc1_rate[];
+extern const struct soc_enum madera_asrc1_bidir_rate[];
 extern const struct soc_enum madera_asrc2_rate[];
 extern const struct soc_enum madera_dfc_width[];
 extern const struct soc_enum madera_dfc_type[];
@@ -403,6 +411,8 @@ int madera_set_fll_syncclk(struct madera_fll *fll, int source,
 			   unsigned int fref, unsigned int fout);
 int madera_set_fll_ao_refclk(struct madera_fll *fll, int source,
 			     unsigned int fin, unsigned int fout);
+int madera_fllhj_set_refclk(struct madera_fll *fll, int source,
+			    unsigned int fin, unsigned int fout);
 
 int madera_core_init(struct madera_priv *priv);
 int madera_core_free(struct madera_priv *priv);
Signature · 1 line
2.11.0
author maintainer
#2 lore raw

Re: [PATCH 2/2] ASoC: cs47l92: Add codec driver for Cirrus Logic CS47L92

Quoted 8 lines · Charles Keepax

From: Stuart Henderson <[email protected]>

Adds the codec driver for the CS47L92 SmartCodec. This is a multi-functional codec based on the Cirrus Logic Madera platform.

---

Sorry couple of things in here that shouldn't be will do a version two.

Thanks,
Charles