Skip to contentSkip to conversation

ASoC: Add PCM1792A spi mode codec support

RFC PATCH Applied Michael Trimarchi 2 participants 2 messages Aug 3, 2013 – Aug 5, 2013

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

RFC PATCH 1/1 ASoC: Add PCM1792A spi mode codec support

Add PCM1792A spi mode codec support. This version implements only a subset of functionalities. Tested connect to a pandaboard ES device and based on recently pcm1681 codec.

---
 .../devicetree/bindings/sound/pcm1792a.txt         |   18 ++
 sound/soc/codecs/Kconfig                           |    4 +
 sound/soc/codecs/Makefile                          |    2 +
 sound/soc/codecs/pcm1792a.c                        |  245 ++++++++++++++++++++
 sound/soc/codecs/pcm1792a.h                        |   26 +++
 5 files changed, 295 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/pcm1792a.txt
 create mode 100644 sound/soc/codecs/pcm1792a.c
 create mode 100644 sound/soc/codecs/pcm1792a.h
Documentation/devicetree/bindings/sound/pcm1792a.txt new file +18 -0
new file mode 100644
index 0000000..b8e48e8
@@ -0,0 +1,18 @@
+Texas Instruments pcm1792a DT bindings
+
+This driver supports the SPI bus.
+
+Required properties:
+
+ - compatible: "ti,pcm1792a"
+
+For required properties on SPI, please consult
+Documentation/devicetree/bindings/spi/spi-bus.txt
+
+Examples:
+
+	codec_spi: 1792a@0 {
+		compatible = "ti,pcm1792a";
+		spi-max-frequency = <600000>;
+	};
+
sound/soc/codecs/Kconfig +4 -0
index badb6fb..45a9e3c 100644
@@ -55,6 +55,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_ML26124 if I2C
 	select SND_SOC_HDMI_CODEC
 	select SND_SOC_PCM3008
+	select SND_SOC_PCM1792A if SPI_MASTER
 	select SND_SOC_RT5631 if I2C
 	select SND_SOC_RT5640 if I2C
 	select SND_SOC_SGTL5000 if I2C
@@ -295,6 +296,9 @@ config SND_SOC_HDMI_CODEC
 config SND_SOC_PCM3008
        tristate
 
+config SND_SOC_PCM1792A
+       tristate
+
 config SND_SOC_RT5631
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 70fd806..1f8ee0b 100644
@@ -43,6 +43,7 @@ snd-soc-mc13783-objs := mc13783.o
 snd-soc-ml26124-objs := ml26124.o
 snd-soc-hdmi-codec-objs := hdmi.o
 snd-soc-pcm3008-objs := pcm3008.o
+snd-soc-pcm1792a-codec-objs := pcm1792a.o
 snd-soc-rt5631-objs := rt5631.o
 snd-soc-rt5640-objs := rt5640.o
 snd-soc-sgtl5000-objs := sgtl5000.o
@@ -172,6 +173,7 @@ obj-$(CONFIG_SND_SOC_MC13783)	+= snd-soc-mc13783.o
 obj-$(CONFIG_SND_SOC_ML26124)	+= snd-soc-ml26124.o
 obj-$(CONFIG_SND_SOC_HDMI_CODEC) += snd-soc-hdmi-codec.o
 obj-$(CONFIG_SND_SOC_PCM3008)	+= snd-soc-pcm3008.o
+obj-$(CONFIG_SND_SOC_PCM1792A)	+= snd-soc-pcm1792a-codec.o
 obj-$(CONFIG_SND_SOC_RT5631)	+= snd-soc-rt5631.o
 obj-$(CONFIG_SND_SOC_RT5640)	+= snd-soc-rt5640.o
 obj-$(CONFIG_SND_SOC_SGTL5000)  += snd-soc-sgtl5000.o
sound/soc/codecs/pcm1792a.c new file +245 -0

245 lines not on this page · raw message

sound/soc/codecs/pcm1792a.h new file +26 -0
new file mode 100644
index 0000000..7a83d1f
@@ -0,0 +1,26 @@
+/*
+ * definitions for PCM1792A
+ *
+ * Copyright 2013 Amarula Solutions
+ *
+  * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __PCM1792A_H__
+#define __PCM1792A_H__
+
+#define PCM1792A_RATES (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_8000_48000 | \
+			SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000)
+
+#define PCM1792A_FORMATS (SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S24_LE | \
+			  SNDRV_PCM_FMTBIT_S16_LE)
+
+#endif
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw
Quoted 3 lines · Michael Trimarchi

Add PCM1792A spi mode codec support. This version implements only a subset of functionalities. Tested connect to a pandaboard ES device and based on recently pcm1681 codec.

Applied, thanks (having sorted the Kconfig and Makefile entries).