History log of /linux-master/sound/soc/codecs/tfa989x.c
Revision Date Author Comments
# 9abcd240 25-Apr-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org


# 9b9def51 20-Sep-2022 Alexander Martinz <amartinz@shiftphones.com>

ASoC: codecs: tfa989x: fix register access comments

Fix comments regarding register access based on review feedback[1].

[1]: https://lore.kernel.org/all/YppQ7BiqlBDMNsuc@gerhold.net/

Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
Link: https://lore.kernel.org/r/20220920115014.952062-1-amartinz@shiftphones.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# c91f7e94 23-Jun-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: tfa*: Remove now redundant non_legacy_dai_naming flag

The ASoC core has now been changed to default to the non-legacy DAI
naming, as such drivers using the new scheme no longer need to specify
the non_legacy_dai_naming flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-62-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# ef6c3209 02-Jun-2022 Alexander Martinz <amartinz@shiftphones.com>

ASoC: codecs: tfa989x: Add support for tfa9890

The initialization sequence is taken from the version provided
by the supplier [1].

This allows speakers using the TFA9890 amplifier to work, which are
used by various mobile phones such as the SHIFT6mq.

[1]: https://source.codeaurora.org/external/mas/tfa98xx/tree/src/tfa_init.c?id=d2cd12931fbc48df988b62931fb9960d4e9dc05d#n1827

Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20220602164504.261361-1-amartinz@shiftphones.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9da52c39 31-Oct-2021 Vincent Knecht <vincent.knecht@mailoo.org>

ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpios

Some OEM use a GPIO in addition to the tfa9897 RCV bit to
switch between loudspeaker and earpiece/receiver mode.

Add support for the GPIO switching by specifying rcv-gpios in DT.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20211031210956.812101-3-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# b6a4e209 24-Oct-2021 Vincent Knecht <vincent.knecht@mailoo.org>

ASoC: codecs: tfa989x: Add support for tfa9897 RCV bit

TFA9897 has an internal 'rcv' switch so that it can manage both
loudspeaker and earpiece modes with the same physical speaker.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20211024085840.1536438-3-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8e5607e9 27-May-2021 Vincent Knecht <vincent.knecht@mailoo.org>

ASoC: codecs: tfa989x: Add support for optional vddd-supply

Allow specifying Vddd regulator/supply to be enabled on I2C probing.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210528105101.508254-4-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1ba1d69d 27-May-2021 Vincent Knecht <vincent.knecht@mailoo.org>

ASoC: codecs: tfa989x: Add support for tfa9897

Add specific init function to poke needed registers & values for this IC

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210528105101.508254-2-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# af00978a 12-May-2021 Stephan Gerhold <stephan@gerhold.net>

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>