ASoC: tas642x: Add initial support for TAS642x amplifiers.
Subsystems (3)
PATCH 1/1 ASoC: tas642x: Add initial support for TAS642x amplifiers.
This patch adds support for Texas Intrument Amplifier TAS642X.
Signed-off-by Aurelien Chanot <[email protected]>
--- .../devicetree/bindings/sound/tas642x.txt | 27 ++ sound/soc/codecs/Kconfig | 5 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/tas642x.c | 374 +++++++++++++++++++++ sound/soc/codecs/tas642x.h | 32 ++ 5 files changed, 440 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/tas642x.txt create mode 100644 sound/soc/codecs/tas642x.c create mode 100644 sound/soc/codecs/tas642x.h
Documentation/devicetree/bindings/sound/tas642x.txt new file +27 -0
@@ -0,0 +1,27 @@ +Texas Instruments TAS642X Audio amplifier + +The TAS642X serial control bus communicates through the I2C protocol only. The +serial bus is also used for periodic codec fault checking/reporting during +audio playback. For more product information please see the links below: + +http://www.ti.com/product/TAS6424-Q1 + + +Required properties: + +- compatible: "ti,tas6424" +- reg: I2C slave address + +Optional properties: + +- chan-swap : swap channels 1-2 with 3-4 +- chan-sel: uses channels 1 to 4 (0) or 5 to 8(1) from the TDM input. + +Example: + +tas6424: tas6424@64 { + status = "okay"; + compatible = "ti,tas6424"; + reg = <0x6c>; + chan-sel = <1>; +};
sound/soc/codecs/Kconfig +5 -0
@@ -135,6 +135,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_TAS5086 if I2C select SND_SOC_TAS571X if I2C select SND_SOC_TAS5720 if I2C + select SND_SOC_TAS642X if I2C select SND_SOC_TFA9879 if I2C select SND_SOC_TLV320AIC23_I2C if I2C select SND_SOC_TLV320AIC23_SPI if SPI_MASTER
@@ -812,6 +813,10 @@ config SND_SOC_TAS5720 Enable support for Texas Instruments TAS5720L/M high-efficiency mono Class-D audio power amplifiers. +config SND_SOC_TAS642X + tristate "Texas Instruments TAS6424 speaker amplifier" + depends on I2C + config SND_SOC_TFA9879 tristate "NXP Semiconductors TFA9879 amplifier" depends on I2C
sound/soc/codecs/Makefile +2 -0
@@ -142,6 +142,7 @@ snd-soc-sti-sas-objs := sti-sas.o snd-soc-tas5086-objs := tas5086.o snd-soc-tas571x-objs := tas571x.o snd-soc-tas5720-objs := tas5720.o +snd-soc-tas642x-objs := tas642x.o snd-soc-tfa9879-objs := tfa9879.o snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic23-i2c-objs := tlv320aic23-i2c.o
@@ -363,6 +364,7 @@ obj-$(CONFIG_SND_SOC_TAS2552) += snd-soc-tas2552.o obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o obj-$(CONFIG_SND_SOC_TAS571X) += snd-soc-tas571x.o obj-$(CONFIG_SND_SOC_TAS5720) += snd-soc-tas5720.o +obj-$(CONFIG_SND_SOC_TAS642X) += snd-soc-tas642x.o obj-$(CONFIG_SND_SOC_TFA9879) += snd-soc-tfa9879.o obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o obj-$(CONFIG_SND_SOC_TLV320AIC23_I2C) += snd-soc-tlv320aic23-i2c.o
sound/soc/codecs/tas642x.c new file +374 -0
374 lines not on this page · raw message
sound/soc/codecs/tas642x.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* TAS642X amplifier audio driver +* +* Copyright (C) 2016 Witekio +* +* 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. +*/ + +#ifndef _TAS642X_H +#define _TAS642X_H + +/* device registers */ +#define TAS642X_MODE_CTRL 0x00 +#define TAS642X_MISC_CTRL1 0x01 +#define TAS642X_MISC_CTRL2 0x02 + +#define TAS642X_SAP_CTRL 0x03 +# define TAS642X_SAP_SAMP_MSK 0xC0 +# define TAS642X_SAP_TDM_SEL_MSK 0x20 +# define TAS642X_SAP_TDM_SIZ_MSK 0x10 +# define TAS642X_SAP_CH_SWP_MSK 0x08 +# define TAS642X_SAP_FMT_MSK 0x07 +#define TAS642X_CH_STATE 0x04 +#define TAS642X_CH1_VOL 0x05 +#define TAS642X_CH2_VOL 0x06 +#define TAS642X_CH3_VOL 0x07 +#define TAS642X_CH4_VOL 0x08 + +#endif /* _TAS642X_H */
Signature · 1 line
2.9.3