aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/codecs/tfa989x.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-05-08ASoC: Switch i2c drivers back to use .probe()Uwe Kleine-König1-1/+1
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
2022-09-20ASoC: codecs: tfa989x: fix register access commentsAlexander Martinz1-2/+2
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>
2022-06-27ASoC: tfa*: Remove now redundant non_legacy_dai_naming flagCharles Keepax1-1/+0
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>
2022-06-06ASoC: codecs: tfa989x: Add support for tfa9890Alexander Martinz1-0/+30
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>
2021-11-15ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpiosVincent Knecht1-1/+19
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>
2021-10-29ASoC: codecs: tfa989x: Add support for tfa9897 RCV bitVincent Knecht1-0/+21
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>
2021-06-02ASoC: codecs: tfa989x: Add support for optional vddd-supplyVincent Knecht1-0/+34
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>
2021-06-02ASoC: codecs: tfa989x: Add support for tfa9897Vincent Knecht1-0/+25
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>
2021-05-24ASoC: codecs: Add driver for NXP/Goodix TFA989x (TFA1) amplifiersStephan Gerhold1-0/+298
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>