Skip to contentSkip to conversation

ASoC: Add support for CS42L52 Codec

PATCH Applied Brian Austin 2 participants 2 messages Apr 27, 2012 – Apr 30, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: Add support for CS42L52 Codec

This patch adds support for Cirrus Logic CS42L52 Low Power Stereo Codec

v2 Changes:
Fixes for regcache volatile and CHIPID
Add platform data structures for MIC, Charge Pump, MICBIAS levels Add input support for Beep Generator
Move L/R Swap into DAPM
Use DAPM Routes to hook AIF widgets to DAI's
Fix SND_SOC_BIAS cases
Use regmap_patch for magic writes at probe
Use devm_regmap_init_i2c()
Use module_i2c_driver()

---
 include/sound/cs42l52.h    |   36 ++
 sound/soc/codecs/Kconfig   |    4 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs42l52.c | 1302 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cs42l52.h |  274 ++++++++++
 5 files changed, 1618 insertions(+), 0 deletions(-)
 create mode 100644 include/sound/cs42l52.h
 create mode 100644 sound/soc/codecs/cs42l52.c
 create mode 100644 sound/soc/codecs/cs42l52.h
include/sound/cs42l52.h new file +36 -0
new file mode 100644
index 0000000..4c68955
@@ -0,0 +1,36 @@
+/*
+ * linux/sound/cs42l52.h -- Platform data for CS42L52
+ *
+ * Copyright (c) 2012 Cirrus Logic Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __CS42L52_H
+#define __CS42L52_H
+
+struct cs42l52_platform_data {
+
+	/* MICBIAS Level. Check datasheet Pg48 */
+	unsigned int micbias_lvl;
+
+	/* MICA mode selection 0=Single 1=Differential */
+	unsigned int mica_cfg;
+
+	/* MICB mode selection 0=Single 1=Differential */
+	unsigned int micb_cfg;
+
+	/* MICA Select 0=MIC1A 1=MIC2A */
+	unsigned int mica_sel;
+
+	/* MICB Select 0=MIC2A 1=MIC2B */
+	unsigned int micb_sel;
+
+	/* Charge Pump Freq. Check datasheet Pg73 */
+	unsigned int chgfreq;
+
+};
+
+#endif /* __CS42L52_H */
sound/soc/codecs/Kconfig +4 -0
index 2e51eb0..0235532 100644
@@ -29,6 +29,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_ALC5632 if I2C
 	select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC
 	select SND_SOC_CS42L51 if I2C
+	select SND_SOC_CS42L52 if I2C
 	select SND_SOC_CS42L73 if I2C
 	select SND_SOC_CS4270 if I2C
 	select SND_SOC_CS4271 if SND_SOC_I2C_AND_SPI
@@ -183,6 +184,9 @@ config SND_SOC_CQ0093VC
 config SND_SOC_CS42L51
 	tristate
 
+config SND_SOC_CS42L52
+	tristate
+
 config SND_SOC_CS42L73
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index db61c44..d11ab90 100644
@@ -15,6 +15,7 @@ snd-soc-ak4642-objs := ak4642.o
 snd-soc-ak4671-objs := ak4671.o
 snd-soc-cq93vc-objs := cq93vc.o
 snd-soc-cs42l51-objs := cs42l51.o
+snd-soc-cs42l52-objs := cs42l52.o
 snd-soc-cs42l73-objs := cs42l73.o
 snd-soc-cs4270-objs := cs4270.o
 snd-soc-cs4271-objs := cs4271.o
@@ -123,6 +124,7 @@ obj-$(CONFIG_SND_SOC_ALC5623)    += snd-soc-alc5623.o
 obj-$(CONFIG_SND_SOC_ALC5632)	+= snd-soc-alc5632.o
 obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o
 obj-$(CONFIG_SND_SOC_CS42L51)	+= snd-soc-cs42l51.o
+obj-$(CONFIG_SND_SOC_CS42L52)	+= snd-soc-cs42l52.o
 obj-$(CONFIG_SND_SOC_CS42L73)	+= snd-soc-cs42l73.o
 obj-$(CONFIG_SND_SOC_CS4270)	+= snd-soc-cs4270.o
 obj-$(CONFIG_SND_SOC_CS4271)	+= snd-soc-cs4271.o
sound/soc/codecs/cs42l52.c new file +1302 -0

1,302 lines not on this page · raw message

sound/soc/codecs/cs42l52.h new file +274 -0

274 lines not on this page · raw message

Signature · 1 line
1.7.9.1
Applied
#1 lore raw
Quoted 1 line · Brian Austin

This patch adds support for Cirrus Logic CS42L52 Low Power Stereo Codec

Applied, thanks, though there's one trivial issue which I've just fixed myself.