- May 24, 2021
-
-
Stephan Gerhold authored
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>
-
- May 18, 2021
-
-
Yang Yingliang authored
Fix the missing clk_disable_unprepare() before return from rk3328_platform_probe() in the error handling case. Fixes: c3275903 ("ASoC: rockchip: support ACODEC for rk3328") Reported-by:
Hulk Robot <hulkci@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210518075847.1116983-1-yangyingliang@huawei.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- May 12, 2021
-
-
Vitaly Rodionov authored
HSBIAS_SENSE_EN configures HSBIAS output current sense through the external 2.21-k resistor. HSBIAS_SENSE is hardware feature to reduce the potential pop noise during the headset plug out slowly. But on some platforms ESD voltage will affect it causing test to fail, especially with CTIA headset type. For different hardware setups, a designer might want to tweak default behavior. Signed-off-by:
Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511145220.125760-1-vitalyr@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Simon Trimmer authored
We want all wm_adsp clients to use the wm_adsp.h header as they shouldn't need to include internal sub-headers. Signed-off-by:
Simon Trimmer <simont@opensource.cirrus.com> Acked-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511171514.270219-1-simont@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Simon Trimmer authored
The callback structures and memory region type table can be marked as const as they will not change during use. Fix checkpatch warning against wm_adsp_find_region function by moving const keyword to form the 'static const struct' pattern. Signed-off-by:
Simon Trimmer <simont@opensource.cirrus.com> Acked-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511171459.270169-1-simont@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- May 11, 2021
-
-
Charles Keepax authored
Fixup a needlessly initialised variable and an unchecked return value. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511101051.17726-3-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Fixup a needlessly initialised variable and an unchecked return value. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511101051.17726-2-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511101051.17726-1-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- May 10, 2021
-
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-11-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-10-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-9-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-8-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Currently the check of errata_chk will always evaluate to false since the values tested don't come under the mask used. A shift of the field is missing, add this. Also there is an error in the values tested, they don't match the comment and the value 0x3 is not a valid value for the field in question. Update the value to match the comment. Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-7-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-6-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-5-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-4-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Correct some unchecked re-allocations of ret whilst reading the device ID and ensure the hardware state is returned to off on the error paths. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-3-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Many of the older Cirrus devices share very similar code for reading the device ID, and frequently this code is generating cppcheck warnings such as: sound/soc/codecs/cs42l42.c:1886:6: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_CD, ®); Add a small helper function that older Cirrus devices can use to read the device ID, which should help correct these issues. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210510131357.17170-2-ckeepax@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Derek Fang authored
Register the codec dai name as 'rt1019-aif' by adding non_legacy_dai_naming configuration. Signed-off-by:
Derek Fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/20210503031732.22035-1-derek.fang@realtek.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Vitaly Rodionov authored
Adding support for ACPI-based systems. Signed-off-by:
Vitaly Rodionov <vitalyr@opensource.cirrus.com> Signed-off-by:
Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210426155303.853236-3-tanureal@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Richard Fitzgerald authored
Use the device_property APIs so that the code will work on devicetree and ACPI systems. Signed-off-by:
Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by:
Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210426155303.853236-2-tanureal@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Lucas Tanure authored
Replace the internal jack creation by set_jack call, so users can map buttons in their machine driver Also only enable jack detection IRQ after set_jack call Signed-off-by:
Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210426155303.853236-1-tanureal@opensource.cirrus.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Stephen Boyd authored
Let's implement a remove callback for this driver that's similar to the shutdown hook, but also disables the regulators before they're put by devm code. Cc: Jairaj Arava <jairaj.arava@intel.com> Cc: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@intel.com> Cc: Shuming Fan <shumingf@realtek.com> Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210508075151.1626903-2-swboyd@chromium.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Stephen Boyd authored
We cancel the work queues, and reset the device on shutdown, but the irq isn't disabled so the work queues could be queued again. Let's disable the irq during shutdown so that we don't have to worry about this device trying to do anything anymore. This fixes a problem seen where the i2c bus is shutdown at reboot but this device irq still comes in and tries to make another i2c transaction when the bus doesn't work. Cc: Jairaj Arava <jairaj.arava@intel.com> Cc: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@intel.com> Cc: Shuming Fan <shumingf@realtek.com> Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Fixes: 45a2702c ("ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown") Signed-off-by:
Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210508075151.1626903-1-swboyd@chromium.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Tom Rix authored
Static analysis reports this problem lpass-wsa-macro.c:1732:6: warning: Array subscript is undefined if (wsa->ec_hq[ec_tx]) { ^~~~~~~~~~~~~~~~~ The happens because 'ec_tx' is never initialized and there is no default in switch statement that sets ec_tx. Add a default case that returns an error before the array is accessed. Signed-off-by:
Tom Rix <trix@redhat.com> Reviewed-by:
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210430142117.3272772-1-trix@redhat.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Jiapeng Chong authored
Variable d_len_code is set to zero, but this value is never read as it is overwritten or not used later on, hence it is a redundant assignment and can be removed. Clean up the following clang-analyzer warning: sound/soc/codecs/rt286.c:728:2: warning: Value stored to 'd_len_code' is never read [clang-analyzer-deadcode.DeadStores]. Reported-by:
Abaci Robot <abaci@linux.alibaba.com> Signed-off-by:
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1620298735-31708-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Wan Jiabing authored
Fix the following coccicheck warning: ./sound/soc/codecs/lpass-rx-macro.c:2631:2-3: Unneeded semicolon Signed-off-by:
Wan Jiabing <wanjiabing@vivo.com> Link: https://lore.kernel.org/r/20210506021005.4897-1-wanjiabing@vivo.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
cppcheck warning, add parentheses: sound/soc/codecs/rt1019.c:375:61: style: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] (pll_code.m_bp ? 0 : pll_code.m_code) << RT1019_PLL_M_SFT | ^ Signed-off-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210426214701.235106-4-pierre-louis.bossart@linux.intel.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
cppcheck warning: sound/soc/codecs/mt6359.c:274:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ sound/soc/codecs/mt6359.c:274:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ Signed-off-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210426214701.235106-3-pierre-louis.bossart@linux.intel.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
cppcheck warning sound/soc/codecs/mt6359-accdet.c:417:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ sound/soc/codecs/mt6359-accdet.c:464:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ Signed-off-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210426214701.235106-2-pierre-louis.bossart@linux.intel.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- May 05, 2021
-
-
Shuming Fan authored
The function number should be FUNC_NUM_MIC_ARRAY(0x2) for the feature unit 0x1E. Fixes: ca5118c0 ('ASoC: rt711-sdca: change capture switch controls') Signed-off-by:
Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20210504100424.8760-1-shumingf@realtek.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Apr 28, 2021
-
-
Jerome Brunet authored
This reverts commit 12f8127f. There is problem with clk_hw_get_hw(). Using it pins the clock provider to itself, making it impossible to remove the module. Revert commit 12f8127f ("ASoC: da7219: properly get clk from the provider") until this gets sorted out. Reported-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Tested-by:
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210428122632.46244-3-jbrunet@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Apr 26, 2021
-
-
Marco Felsch authored
The ni1/ni2 ratio formula [1] uses the pclk which is the prescaled mclk. The max98088 datasheet [2] has no such formula but table-12 equals so we can assume that it is the same for both devices. While on it make use of DIV_ROUND_CLOSEST_ULL(). [1] https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf; page 86 [2] https://datasheets.maximintegrated.com/en/ds/MAX98088.pdf; page 82 Signed-off-by:
Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.kernel.org/r/20210423135402.32105-1-m.felsch@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Apr 23, 2021
-
-
Shuming Fan authored
This patch adds the return value when the volume settings were changed. The userspace application might monitor the kcontrols to check which control changed. Signed-off-by:
Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20210422103235.22048-1-shumingf@realtek.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Shuming Fan authored
The DAPM event and mixer control could mute/unmute the capture directly. That will be confused that capture still works if the user settings is unmute before the capture. Therefore, this patch uses the variables to record the capture switch status of DAPM and mixer. Signed-off-by:
Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20210422103220.21987-1-shumingf@realtek.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Jerome Brunet authored
Instead of using the clk embedded in the clk_hw (which is meant to go away), a clock provider which need to interact with its own clock should request clk reference through the clock provider API. Reviewed-by:
Stephen Boyd <sboyd@kernel.org> Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20210421120512.413057-6-jbrunet@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Jerome Brunet authored
Clock providers should be registered using the clk_hw API. Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20210421120512.413057-5-jbrunet@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Jerome Brunet authored
Clock drivers ops should not call the clk API but the clock provider (clk_hw) instead. Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20210421120512.413057-4-jbrunet@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Jerome Brunet authored
Clock providers should use the clk_hw API Reviewed-by:
Stephen Boyd <sboyd@kernel.org> Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20210421120512.413057-3-jbrunet@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Apr 22, 2021
-
-
Niklas Carlsson authored
Configuring number of channels per LRCLK frame by using e.g. snd_soc_dai_set_tdm_slot before configuring DAI format was being overwritten by the latter due to a regmap_write which would write over the whole register. Signed-off-by:
Niklas Carlsson <niklasc@axis.com> Link: https://lore.kernel.org/r/20210422130226.15201-1-Niklas.Carlsson@axis.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-