Skip to contentSkip to conversation

ASoC CS4270 codec device driver

PATCH Superseded Timur Tabi 2 participants 3 messages Jul 30, 2007

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 ASoC CS4270 codec device driver

This patch adds ALSA SoC support for the Cirrus Logic CS4270 codec. The following features are suppored:

1) Stand-alone and software mode
2) Software mode via I2C only
3) Master mode, not Slave
4) No power management

---

This code is based on the Liam Girdwood's ASoC tree.

Please note that I was unable to clone Liam's ASoC git repositories because the http interface does not work for me, and my corporate firewall blocks the git protocol. I had to download a snapshot and create a bare git repository from it. Therefore, git may complain when trying to apply this patch.

 include/linux/i2c-id.h    |    1 +
 sound/soc/codecs/Kconfig  |   20 ++
 sound/soc/codecs/Makefile |    2 +
 sound/soc/codecs/cs4270.c |  803 +++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cs4270.h |   28 ++
 5 files changed, 854 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/cs4270.c
 create mode 100644 sound/soc/codecs/cs4270.h
include/linux/i2c-id.h +1 -0
index 0051203..6b3d207 100644
@@ -119,6 +119,7 @@
 #define I2C_DRIVERID_WM8750		90	/* Wolfson WM8750 audio codec */
 #define I2C_DRIVERID_WM8753		91	/* Wolfson WM8753 audio codec */
 #define I2C_DRIVERID_WM8951             92      /* Wolfson WM8753 audio codec */
+#define I2C_DRIVERID_CS4270	93	/* Cirrus Logic 4270 audio codec */
 
 #define I2C_DRIVERID_I2CDEV	900
 #define I2C_DRIVERID_ARP        902    /* SMBus ARP Client              */
sound/soc/codecs/Kconfig +20 -0
index e71667f..9c84eb2 100644
@@ -78,4 +78,24 @@ config SND_SOC_WM9713
 	tristate
 	depends on SND_SOC
 
+# Cirrus Logic CS4270 Codec
+config SND_SOC_CS4270
+	tristate
+	depends on SND_SOC
+
+# Cirrus Logic CS4270 Codec Hardware Mute Support
+# Select if you have external muting circuitry attached to your CS4270.
+config SND_SOC_CS4270_HWMUTE
+	bool
+	depends on SND_SOC_CS4270
+
+# Cirrus Logic CS4270 Codec VD = 3.3V Errata
+# Select if you are affected by the errata where the part will not function
+# if MCLK divide-by-1.5 is selected and VD is set to 3.3V.  The driver will
+# not select any sample rates that require MCLK to be divided by 1.5.
+config SND_SOC_CS4270_VD33_ERRATA
+	bool
+	depends on SND_SOC_CS4270
+
+
 
sound/soc/codecs/Makefile +2 -0
index 07d0b59..d9237a1 100644
@@ -18,6 +18,7 @@ snd-soc-wm8976-objs := wm8976.o
 snd-soc-wm8980-objs := wm8980.o
 snd-soc-wm9712-objs := wm9712.o
 snd-soc-wm9713-objs := wm9713.o
+snd-soc-cs4270-objs := cs4270.o
 
 obj-$(CONFIG_SND_SOC_AC97_CODEC)	+= snd-soc-ac97.o
 obj-$(CONFIG_SND_SOC_AK4535)	+= snd-soc-ak4535.o
@@ -39,3 +40,4 @@ obj-$(CONFIG_SND_SOC_WM8976)	+= snd-soc-wm8976.o
 obj-$(CONFIG_SND_SOC_WM8980)	+= snd-soc-wm8980.o
 obj-$(CONFIG_SND_SOC_WM9712)	+= snd-soc-wm9712.o
 obj-$(CONFIG_SND_SOC_WM9713)	+= snd-soc-wm9713.o
+obj-$(CONFIG_SND_SOC_CS4270)	+= snd-soc-cs4270.o
sound/soc/codecs/cs4270.c new file +803 -0

803 lines not on this page · raw message

sound/soc/codecs/cs4270.h new file +28 -0
new file mode 100644
index 0000000..35e5fe3
@@ -0,0 +1,28 @@
+/*
+ * Cirrus Logic CS4270 ALSA SoC Codec Driver
+ *
+ * Author: Timur Tabi <[email protected]>
+ *
+ * Copyright 2007 Freescale Semiconductor, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#ifndef _CS4270_H
+#define _CS4270_H
+
+/**
+ * The ASoC codec DAI structure for the CS4270.  Assign this structure to
+ * the .codec_dai field of your machine driver's snd_soc_dai_link structure.
+ */
+extern struct snd_soc_codec_dai cs4270_dai;
+
+/**
+ * The ASoC codec device structure for the CS4270.  Assign this structure
+ * to the .codec_dev field of your machine driver's snd_soc_device
+ * structure.
+ */
+extern struct snd_soc_codec_device soc_codec_device_cs4270;
+
+#endif
Signature · 1 line
1.5.2.4
#1 lore raw

At Mon, 30 Jul 2007 13:18:12 -0500,

Quoted 19 lines · Timur Tabi

This patch adds ALSA SoC support for the Cirrus Logic CS4270 codec. The following features are suppored:

1) Stand-alone and software mode
2) Software mode via I2C only
3) Master mode, not Slave
4) No power management

---

This code is based on the Liam Girdwood's ASoC tree.

Please note that I was unable to clone Liam's ASoC git repositories because the http interface does not work for me, and my corporate firewall blocks the git protocol. I had to download a snapshot and create a bare git repository from it. Therefore, git may complain when trying to apply this patch.

Quoted 8 lines
 include/linux/i2c-id.h    |    1 +
 sound/soc/codecs/Kconfig  |   20 ++
 sound/soc/codecs/Makefile |    2 +
 sound/soc/codecs/cs4270.c |  803 +++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cs4270.h |   28 ++
 5 files changed, 854 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/cs4270.c
 create mode 100644 sound/soc/codecs/cs4270.h

Thanks for the patch.
The patch looks OK at a brief glance, but it seems to have tiny coding-style issues in some places. Try to run scripts/checkpatch.pl in the linux kernel.

Takashi

author
#2 lore raw
Quoted 3 lines · Takashi Iwai

The patch looks OK at a brief glance, but it seems to have tiny coding-style issues in some places. Try to run scripts/checkpatch.pl in the linux kernel.

Is checkpatch.pl new? I've never seen it before. It's very nice, though.

I have submitted a new patch that verifies with checkpatch.pl.

Signature · 2 lines
Timur Tabi
Linux Kernel Developer @ Freescale