summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/Makefile
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2021-05-13 13:41:29 +0300
committerMark Brown <broonie@kernel.org>2021-05-24 11:51:32 +0300
commitaf00978a0a06bab60bd5adf54a65ea69d19ce35d (patch)
tree1a74fbb1f53c304d28a539af4eb5331712dd87ca /sound/soc/codecs/Makefile
parent17ba36b704692a433d38cb230e99ec333ecd14a2 (diff)
downloadlinux-af00978a0a06bab60bd5adf54a65ea69d19ce35d.tar.xz
ASoC: codecs: Add driver for NXP/Goodix TFA989x (TFA1) amplifiers
NXP's TFA98xx (now part of Goodix) are fairly popular speaker amplifiers used in many smartphones and tablets. Most of them are sold as "smart amplifiers" with built-in "CoolFlux DSP" that is used for volume control, plus a "sophisticated speaker-boost and protection algorithm". Unfortunately, they are also almost entirely undocumented. The short datasheets (e.g. [1] for TFA9897) describe the available features, but do not provide any information about the registers or how to use the "CoolFlux DSP". The amplifiers are most often configured through proprietary userspace libraries. There are also some (rather complex) kernel drivers (e.g. [2]) but even those rely on obscure firmware blobs for configuration (so-called "containers"). They seem to contain different "profiles" with tuned speaker settings, sample rates and volume steps (which would be better exposed as separate ALSA mixers). The format of the firmware files seems to have changed a lot over the time, so it's not even possible to simply re-use the firmware originally provided by the vendor. Overall, it seems close to impossible to develop a proper mainline driver for these amplifiers that could make proper use of the built-in DSP. This commit implements a compromise: At least the TFA1 family of the TFA98xx amplifiers (usually called TFA989x) provide a way to *bypass* the DSP using a special register sequence. The register sequence can be found in similar variations in the kernel drivers from lots of vendors e.g. in [3] and was probably mainly used for factory testing. With the DSP bypassed, the amplifier acts mostly like a dumb standard speaker amplifier, without (hardware) volume control. However, the setup is much simpler and it works without any obscure firmware. This driver implements the DSP bypass combined with chip-specific initialization sequences adapted from [2]. Only TFA9895 is supported in this initial commit. Except for the lack of volume control I can not hear any difference with or without the DSP, it works just fine. This driver allows the speaker to work on mainline Linux running on the Samsung Galaxy A3/A5 (2015) [TFA9895] and Alcatel Idol 3 [TFA9897]. TFA9897 support will be added in separate patch set later. [1]: https://product.goodix.com/en/docview/TFA9897%20SDS_Rev.3.1?objectId=47&objectType=document&version=78 [2]: https://source.codeaurora.org/external/mas/tfa98xx [3]: https://github.com/sonyxperiadev/kernel/blob/57b5050e340f40a88e1ddb8d16fd9adb44418923/sound/soc/codecs/tfa98xx.c#L1422-L1462 Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20210513104129.36583-2-stephan@gerhold.net Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/Makefile')
-rw-r--r--sound/soc/codecs/Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 0efdba609048..8c7257035e4c 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -229,6 +229,7 @@ snd-soc-tas6424-objs := tas6424.o
snd-soc-tda7419-objs := tda7419.o
snd-soc-tas2770-objs := tas2770.o
snd-soc-tfa9879-objs := tfa9879.o
+snd-soc-tfa989x-objs := tfa989x.o
snd-soc-tlv320aic23-objs := tlv320aic23.o
snd-soc-tlv320aic23-i2c-objs := tlv320aic23-i2c.o
snd-soc-tlv320aic23-spi-objs := tlv320aic23-spi.o
@@ -551,6 +552,7 @@ obj-$(CONFIG_SND_SOC_TAS6424) += snd-soc-tas6424.o
obj-$(CONFIG_SND_SOC_TDA7419) += snd-soc-tda7419.o
obj-$(CONFIG_SND_SOC_TAS2770) += snd-soc-tas2770.o
obj-$(CONFIG_SND_SOC_TFA9879) += snd-soc-tfa9879.o
+obj-$(CONFIG_SND_SOC_TFA989X) += snd-soc-tfa989x.o
obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o
obj-$(CONFIG_SND_SOC_TLV320AIC23_I2C) += snd-soc-tlv320aic23-i2c.o
obj-$(CONFIG_SND_SOC_TLV320AIC23_SPI) += snd-soc-tlv320aic23-spi.o