Skip to content

Commit e00447f

Browse files
Jyri Sarhabroonie
authored andcommitted
ASoC: tlv320aic31xx: Add basic codec driver implementation
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: git@gitorious.org:ti-codecs/ti-codecs.git ajitk/topics/k3.10.1-aic31xx -branch at commit 77504eba0294764e9e63b4a0c696b44db187cd13. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent b46f2c5 commit e00447f

6 files changed

Lines changed: 1628 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Texas Instruments - tlv320aic31xx Codec module
2+
3+
The tlv320aic31xx serial control bus communicates through I2C protocols
4+
5+
Required properties:
6+
7+
- compatible - "string" - One of:
8+
"ti,tlv320aic310x" - Generic TLV320AIC31xx with mono speaker amp
9+
"ti,tlv320aic311x" - Generic TLV320AIC31xx with stereo speaker amp
10+
"ti,tlv320aic3100" - TLV320AIC3100 (mono speaker amp, no MiniDSP)
11+
"ti,tlv320aic3110" - TLV320AIC3110 (stereo speaker amp, no MiniDSP)
12+
"ti,tlv320aic3120" - TLV320AIC3120 (mono speaker amp, MiniDSP)
13+
"ti,tlv320aic3111" - TLV320AIC3111 (stereo speaker amp, MiniDSP)
14+
15+
- reg - <int> - I2C slave address
16+
17+
18+
Optional properties:
19+
20+
- gpio-reset - gpio pin number used for codec reset
21+
- ai31xx-micbias-vg - MicBias Voltage setting
22+
1 or MICBIAS_2_0V - MICBIAS output is powered to 2.0V
23+
2 or MICBIAS_2_5V - MICBIAS output is powered to 2.5V
24+
3 or MICBIAS_AVDD - MICBIAS output is connected to AVDD
25+
If this node is not mentioned or if the value is unknown, then
26+
micbias is set to 2.0V.
27+
- HPVDD-supply, SPRVDD-supply, SPLVDD-supply, AVDD-supply, IOVDD-supply,
28+
DVDD-supply : power supplies for the device as covered in
29+
Documentation/devicetree/bindings/regulator/regulator.txt
30+
31+
CODEC output pins:
32+
* HPL
33+
* HPR
34+
* SPL, devices with stereo speaker amp
35+
* SPR, devices with stereo speaker amp
36+
* SPK, devices with mono speaker amp
37+
* MICBIAS
38+
39+
CODEC input pins:
40+
* MIC1LP
41+
* MIC1RP
42+
* MIC1LM
43+
44+
The pins can be used in referring sound node's audio-routing property.
45+
46+
Example:
47+
#include <dt-bindings/sound/tlv320aic31xx-micbias.h>
48+
49+
tlv320aic31xx: tlv320aic31xx@18 {
50+
compatible = "ti,tlv320aic311x";
51+
reg = <0x18>;
52+
53+
ai31xx-micbias-vg = <MICBIAS_OFF>;
54+
55+
HPVDD-supply = <&regulator>;
56+
SPRVDD-supply = <&regulator>;
57+
SPLVDD-supply = <&regulator>;
58+
AVDD-supply = <&regulator>;
59+
IOVDD-supply = <&regulator>;
60+
DVDD-supply = <&regulator>;
61+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef __DT_TLV320AIC31XX_MICBIAS_H
2+
#define __DT_TLV320AIC31XX_MICBIAS_H
3+
4+
#define MICBIAS_2_0V 1
5+
#define MICBIAS_2_5V 2
6+
#define MICBIAS_AVDDV 3
7+
8+
#endif /* __DT_TLV320AIC31XX_MICBIAS_H */

‎sound/soc/codecs/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ config SND_SOC_ALL_CODECS
7373
select SND_SOC_TAS5086 if I2C
7474
select SND_SOC_TLV320AIC23 if I2C
7575
select SND_SOC_TLV320AIC26 if SPI_MASTER
76+
select SND_SOC_TLV320AIC31XX if I2C
7677
select SND_SOC_TLV320AIC32X4 if I2C
7778
select SND_SOC_TLV320AIC3X if I2C
7879
select SND_SOC_TPA6130A2 if I2C
@@ -361,6 +362,9 @@ config SND_SOC_TLV320AIC26
361362
tristate
362363
depends on SPI
363364

365+
config SND_SOC_TLV320AIC31XX
366+
tristate
367+
364368
config SND_SOC_TLV320AIC32X4
365369
tristate
366370

‎sound/soc/codecs/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ snd-soc-stac9766-objs := stac9766.o
6464
snd-soc-tas5086-objs := tas5086.o
6565
snd-soc-tlv320aic23-objs := tlv320aic23.o
6666
snd-soc-tlv320aic26-objs := tlv320aic26.o
67+
snd-soc-tlv320aic31xx-objs := tlv320aic31xx.o
6768
snd-soc-tlv320aic32x4-objs := tlv320aic32x4.o
6869
snd-soc-tlv320aic3x-objs := tlv320aic3x.o
6970
snd-soc-tlv320dac33-objs := tlv320dac33.o
@@ -194,6 +195,7 @@ obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o
194195
obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o
195196
obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o
196197
obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
198+
obj-$(CONFIG_SND_SOC_TLV320AIC31XX) += snd-soc-tlv320aic31xx.o
197199
obj-$(CONFIG_SND_SOC_TLV320AIC32X4) += snd-soc-tlv320aic32x4.o
198200
obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o
199201
obj-$(CONFIG_SND_SOC_TLV320DAC33) += snd-soc-tlv320dac33.o

0 commit comments

Comments
 (0)