Skip to contentSkip to conversation

AM43xx-ePOS-EVM audio support with TLV320AIC31XX driver

PATCH Applied Jyri Sarha 2 participants 5 messages Mar 7, 2014 – Mar 9, 2014

Subsystems (4)

v3 of 6 Applied Latest is v6 →

lore
Share & tools
lore

Jyri Sarha

author
#0 lore raw

v3 cover AM43xx-ePOS-EVM audio support with TLV320AIC31XX driver

Since the v2 version of the patches [1] I have dropped davinci-evm related patches since I plan to start using simple-card for machine driver. I have also addressed Mark Brown's comments [2] as I described in my mail here [3].

Best regards,
Jyri

[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2014-March/073809.html

[2] http://mailman.alsa-project.org/pipermail/alsa-devel/2014-March/073814.html

[3] http://mailman.alsa-project.org/pipermail/alsa-devel/2014-March/073992.html

Jyri Sarha (2):
ASoC: tlv320aic32x4: Sort Makefile in alphabetic order
ASoC: tlv320aic31xx: Add basic codec driver implementation

 .../devicetree/bindings/sound/tlv320aic31xx.txt    |   61 +
 include/dt-bindings/sound/tlv320aic31xx-micbias.h  |    9 +
 sound/soc/codecs/Kconfig                           |    4 +
 sound/soc/codecs/Makefile                          |    6 +-
 sound/soc/codecs/tlv320aic31xx.c                   | 1343 ++++++++++++++++++++
 sound/soc/codecs/tlv320aic31xx.h                   |  258 ++++
 6 files changed, 1679 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/tlv320aic31xx.txt
 create mode 100644 include/dt-bindings/sound/tlv320aic31xx-micbias.h
 create mode 100644 sound/soc/codecs/tlv320aic31xx.c
 create mode 100644 sound/soc/codecs/tlv320aic31xx.h
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v3 1/2 ASoC: tlv320aic32x4: Sort Makefile in alphabetic order

The tlv320aic32x4 related lines were wrongly placed after tlv320aic3x lines.

---
 sound/soc/codecs/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/Makefile +2 -2
index 4c9b70a..90ab24b 100644
@@ -75,8 +75,8 @@ snd-soc-stac9766-objs := stac9766.o
 snd-soc-tas5086-objs := tas5086.o
 snd-soc-tlv320aic23-objs := tlv320aic23.o
 snd-soc-tlv320aic26-objs := tlv320aic26.o
-snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320aic32x4-objs := tlv320aic32x4.o
+snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320dac33-objs := tlv320dac33.o
 snd-soc-twl4030-objs := twl4030.o
 snd-soc-twl6040-objs := twl6040.o
@@ -215,8 +215,8 @@ obj-$(CONFIG_SND_SOC_STAC9766)	+= snd-soc-stac9766.o
 obj-$(CONFIG_SND_SOC_TAS5086)	+= snd-soc-tas5086.o
 obj-$(CONFIG_SND_SOC_TLV320AIC23)	+= snd-soc-tlv320aic23.o
 obj-$(CONFIG_SND_SOC_TLV320AIC26)	+= snd-soc-tlv320aic26.o
-obj-$(CONFIG_SND_SOC_TLV320AIC3X)	+= snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320AIC32X4)     += snd-soc-tlv320aic32x4.o
+obj-$(CONFIG_SND_SOC_TLV320AIC3X)	+= snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320DAC33)	+= snd-soc-tlv320dac33.o
 obj-$(CONFIG_SND_SOC_TWL4030)	+= snd-soc-twl4030.o
 obj-$(CONFIG_SND_SOC_TWL6040)	+= snd-soc-twl6040.o
Signature · 1 line
1.7.9.5
maintainer Applied
#2 lore raw

Re: [PATCH v3 1/2] ASoC: tlv320aic32x4: Sort Makefile in alphabetic order

Quoted 1 line · Jyri Sarha

The tlv320aic32x4 related lines were wrongly placed after tlv320aic3x lines.

Applied, thanks.

author
#3 lore raw

PATCH v3 2/2 ASoC: tlv320aic31xx: Add basic codec driver implementation

In reply to Jyri Sarha

This commit adds a bare bones driver support for TLV320AIC31XX family audio codecs. The driver adds basic stereo playback trough headphone and speaker outputs and mono capture trough microphone inputs.

The driver is currently missing support at least for mini DSP features and jack detection. I have tested the driver only on TLV320AIC3111, but based on the data sheets TLV320AIC3100, TLV320AIC3110, and TLV320AIC3120 should work Ok too.

The base for the implementation was taken from:
[email protected]:ti-codecs/ti-codecs.git ajitk/topics/k3.10.1-aic31xx -branch at commit 77504eba0294764e9e63b4a0c696b44db187cd13.

---
 .../devicetree/bindings/sound/tlv320aic31xx.txt    |   61 +
 include/dt-bindings/sound/tlv320aic31xx-micbias.h  |    9 +
 sound/soc/codecs/Kconfig                           |    4 +
 sound/soc/codecs/Makefile                          |    2 +
 sound/soc/codecs/tlv320aic31xx.c                   | 1343 ++++++++++++++++++++
 sound/soc/codecs/tlv320aic31xx.h                   |  258 ++++
 6 files changed, 1677 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/tlv320aic31xx.txt
 create mode 100644 include/dt-bindings/sound/tlv320aic31xx-micbias.h
 create mode 100644 sound/soc/codecs/tlv320aic31xx.c
 create mode 100644 sound/soc/codecs/tlv320aic31xx.h
Documentation/devicetree/bindings/sound/tlv320aic31xx.txt new file +61 -0
new file mode 100644
index 0000000..0109df1
@@ -0,0 +1,61 @@
+Texas Instruments - tlv320aic31xx Codec module
+
+The tlv320aic31xx serial control bus communicates through I2C protocols
+
+Required properties:
+
+- compatible - "string" - One of:
+    "ti,tlv320aic310x" - Generic TLV320AIC31xx with mono speaker amp
+    "ti,tlv320aic311x" - Generic TLV320AIC31xx with stereo speaker amp
+    "ti,tlv320aic3100" - TLV320AIC3100 (mono speaker amp, no MiniDSP)
+    "ti,tlv320aic3110" - TLV320AIC3110 (stereo speaker amp, no MiniDSP)
+    "ti,tlv320aic3120" - TLV320AIC3120 (mono speaker amp, MiniDSP)
+    "ti,tlv320aic3111" - TLV320AIC3111 (stereo speaker amp, MiniDSP)
+
+- reg - <int> -  I2C slave address
+
+
+Optional properties:
+
+- gpio-reset - gpio pin number used for codec reset
+- ai31xx-micbias-vg - MicBias Voltage setting
+        0 or MICBIAS_OFF - MICBIAS output it not powered
+        1 or MICBIAS_2_0V - MICBIAS output is powered to 2.0V
+        2 or MICBIAS_2_5V - MICBIAS output is powered to 2.5V
+        3 or MICBIAS_AVDD - MICBIAS output is connected to AVDD
+	If this node is not mentioned or if the value is unknown, then
+	micbias	is set to 2.0V.
+- HPVDD-supply, SPRVDD-supply, SPLVDD-supply, AVDD-supply, IOVDD-supply,
+  DVDD-supply : power supplies for the device as covered in
+  Documentation/devicetree/bindings/regulator/regulator.txt
+
+CODEC output pins:
+  * HPL
+  * HPR
+  * SPL, devices with stereo speaker amp
+  * SPR, devices with stereo speaker amp
+  * SPK, devices with mono speaker amp
+
+CODEC input pins:
+  * MIC1LP
+  * MIC1RP
+  * MIC1LM
+
+The pins can be used in referring sound node's audio-routing property.
+
+Example:
+#include <dt-bindings/sound/tlv320aic31xx-micbias.h>
+
+tlv320aic31xx: tlv320aic31xx@18 {
+	compatible = "ti,tlv320aic311x";
+	reg = <0x18>;
+
+	ai31xx-micbias-vg = <MICBIAS_OFF>;
+
+	HPVDD-supply = <&regulator>;
+	SPRVDD-supply = <&regulator>;
+	SPLVDD-supply = <&regulator>;
+	AVDD-supply = <&regulator>;
+	IOVDD-supply = <&regulator>;
+	DVDD-supply = <&regulator>;
+};
include/dt-bindings/sound/tlv320aic31xx-micbias.h new file +9 -0
new file mode 100644
index 0000000..da9360f
@@ -0,0 +1,9 @@
+#ifndef __DT_TLV320AIC31XX_MICBIAS_H
+#define __DT_TLV320AIC31XX_MICBIAS_H
+
+#define MICBIAS_OFF		0
+#define MICBIAS_2_0V		1
+#define MICBIAS_2_5V		2
+#define MICBIAS_AVDDV		3
+
+#endif /* __DT_TLV320AIC31XX_MICBIAS_H */
sound/soc/codecs/Kconfig +4 -0
index e19b64f..af3c049 100644
@@ -83,6 +83,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_TAS5086 if I2C
 	select SND_SOC_TLV320AIC23 if I2C
 	select SND_SOC_TLV320AIC26 if SPI_MASTER
+	select SND_SOC_TLV320AIC31XX if I2C
 	select SND_SOC_TLV320AIC32X4 if I2C
 	select SND_SOC_TLV320AIC3X if I2C
 	select SND_SOC_TPA6130A2 if I2C
@@ -428,6 +429,9 @@ config SND_SOC_TLV320AIC26
 	tristate
 	depends on SPI
 
+config SND_SOC_TLV320AIC31XX
+        tristate
+
 config SND_SOC_TLV320AIC32X4
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 90ab24b..018e3f3 100644
@@ -75,6 +75,7 @@ snd-soc-stac9766-objs := stac9766.o
 snd-soc-tas5086-objs := tas5086.o
 snd-soc-tlv320aic23-objs := tlv320aic23.o
 snd-soc-tlv320aic26-objs := tlv320aic26.o
+snd-soc-tlv320aic31xx-objs := tlv320aic31xx.o
 snd-soc-tlv320aic32x4-objs := tlv320aic32x4.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320dac33-objs := tlv320dac33.o
@@ -215,6 +216,7 @@ obj-$(CONFIG_SND_SOC_STAC9766)	+= snd-soc-stac9766.o
 obj-$(CONFIG_SND_SOC_TAS5086)	+= snd-soc-tas5086.o
 obj-$(CONFIG_SND_SOC_TLV320AIC23)	+= snd-soc-tlv320aic23.o
 obj-$(CONFIG_SND_SOC_TLV320AIC26)	+= snd-soc-tlv320aic26.o
+obj-$(CONFIG_SND_SOC_TLV320AIC31XX)     += snd-soc-tlv320aic31xx.o
 obj-$(CONFIG_SND_SOC_TLV320AIC32X4)     += snd-soc-tlv320aic32x4.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)	+= snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320DAC33)	+= snd-soc-tlv320dac33.o
sound/soc/codecs/tlv320aic31xx.c new file +1343 -0

1,343 lines not on this page · raw message

sound/soc/codecs/tlv320aic31xx.h new file +258 -0

258 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#4 lore raw

Re: [PATCH v3 2/2] ASoC: tlv320aic31xx: Add basic codec driver implementation

Quoted 3 lines · Jyri Sarha

This commit adds a bare bones driver support for TLV320AIC31XX family audio codecs. The driver adds basic stereo playback trough headphone and speaker outputs and mono capture trough microphone inputs.

I've not looked at this since at least the issue with the mic bias naming still applies.