summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek
AgeCommit message (Collapse)AuthorFilesLines
2022-07-20ASoC: mediatek: mt8186: add machine driver with mt6366, rt1019 and rt5682sJiaxin Yu3-0/+995
Add support for mt8186 board with mt6366, rt1019 and rt5682s. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220718162204.26238-8-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-20ASoC: mediatek: mt8186: add machine driver with mt6366, da7219 and max98357Jiaxin Yu3-0/+1019
Add support for mt8186 board with mt6366, da7219 and max98357. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220718162204.26238-6-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-20ASoC: mediatek: mt8186: add mt8186-mt6366 common driverJiaxin Yu3-0/+75
Add mt8186-mt6366 common driver for mt8186 series machine. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220718162204.26238-4-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-20ASoC: mediatek: mt8186: add platform driverJiaxin Yu8-2/+3485
Add mt8186 platform and affiliated driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220718162204.26238-3-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-18ASoC: mediatek: mt8195: extract SOF common codeChunxu Li5-183/+301
The functions related to SOF can be reused in different machine drivers, such as mt8195 or mt8186, so extract the common code to avoid duplication. Set mtk_soc_card_data which include machine private data and SOF private data as card drvdata, then the difference between machine private can be ignored such as mt8195_mt6359_priv or mt8186_mt6366_priv, at the same time the SOF related code can be reused in different machine drivers. Signed-off-by: Chunxu Li <chunxu.li@mediatek.com> Link: https://lore.kernel.org/r/20220715085903.7796-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11ASoC: mediatek: mt8186: Remove condition with no effectZhongjun Tan1-2/+0
Remove condition with no effect Signed-off-by: Zhongjun Tan <tanzhongjun@coolpad.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220708024651.42999-1-hbut_tan@163.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-17ASoC: mediatek: mt8186: Fix mutex double unlock in GPIO requestFei Shao1-1/+0
The lockdep mechanism revealed an unbalanced unlocking on MT8186: [ 2.993966] WARNING: bad unlock balance detected! [ 2.993978] ------------------------------------- [ 2.993983] kworker/u16:1/10 is trying to release lock (gpio_request_mutex) at: [ 2.993994] [<ffffffdcd9adebf8>] mt8186_afe_gpio_request+0xf8/0x210 [ 2.994012] but there are no more locks to release! The cause is that the mutex will be double unlocked if dai is unknown during GPIO selection, and this patch fixes it. Fixes: cfa9a966f12a ("ASoC: mediatek: mt8186: support gpio control in platform driver") Signed-off-by: Fei Shao <fshao@chromium.org> Link: https://lore.kernel.org/r/20220617111003.2014395-1-fshao@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-14ASoC: mediatek: mt8186: Use new direct clock definesCharles Keepax1-2/+2
Update this driver to the new direct clock producer/consumer defines. It appears this driver was added with the inversion taken account of but still uses the CODEC defines so no inversion of the producer/consumer is necessary. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220613161552.481337-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-09Specify clock provider directly to CPU DAIsMark Brown2-6/+6
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>: Currently the set_fmt callback always passes clock provider/consumer with respect to the CODEC. This made sense when the framework was directly broken down into platforms and CODECs. However, as things are now broken down into components which can be connected as either the CPU or CODEC side of a DAI link it simplifies things if each side of the link is just told if it is provider or consumer of the clocks. Making this change allows us to remove one of the last parts of the ASoC core that needs to know if a driver is a CODEC driver, where it flips the clock format specifier if a CODEC driver is used on the CPU side of a DAI link, as well as just being conceptually more consistent with componentisation. The basic idea of this patch chain is to change the set_fmt callback from specifying if the CODEC is provider/consumer into directly specifying if the component is provider/consumer. To do this we add some new defines, and then to preserve bisectability, the migration is done by adding a new callback, converting over all existing CPU side drivers, converting the core, and then finally reverting back to the old callback. Converting the platform drivers makes sense as the existing defines are from the perspective of the CODEC and there are more CODEC drivers than platform drivers. Obviously a fair amount of this patch chain I was only able to build test, so any testing that can be done would be greatly appreciated.
2022-06-08ASoC: mediatek: mt8186: Fix a handful of spelling mistakesColin Ian King2-5/+5
There are several spelling mistakes in dev_err messages. Fix them. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20220608082338.2083456-1-colin.i.king@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-07ASoC: mediatek: mt8173-rt5650: Fix refcount leak in mt8173_rt5650_dev_probeMiaoqian Lin1-3/+6
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Fix refcount leak in some error paths. Fixes: 0f83f9296d5c ("ASoC: mediatek: Add machine driver for ALC5650 codec") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220603124243.31358-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-07ASoC: trivial changes for cppcheck warningsMark Brown1-4/+4
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: This can probably wait for the next merge window, I found a number of cppcheck warnings that I didn't see in my last checks. The irony is that the only really important issue found by cppcheck was on one of my previous DPCM changes (submitted separately as a fix).
2022-06-07ASoC: Intel: soc-acpi and machine driver updatesMark Brown17-0/+8973
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: Small updates to add initial tables for MeteorLake, SoundWire machine driver support for tests without HDMI and RT1019 for consistency on Chromebooks.
2022-06-06ASoC: mediatek: mt8186: add misc driver and register definitionsJiaxin Yu3-0/+3234
Add mt8186 platform misc driver and data tables/register definitions files. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/20220523132858.22166-14-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support gpio control in platform driverJiaxin Yu2-0/+263
Add gpio control for all audio interface separately. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/20220523132858.22166-13-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support audio clock control in platform driverJiaxin Yu2-0/+757
Add audio clock control with CCF interface. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/20220523132858.22166-12-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support tdm in platform driverJiaxin Yu1-0/+698
Add mt8186 tdm dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/20220523132858.22166-11-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support src in platform driverJiaxin Yu1-0/+695
Add mt8186 src dai driver Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/20220523132858.22166-10-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support pcm in platform driverJiaxin Yu1-0/+423
Add mt8186 pcm dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220523132858.22166-9-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support i2s in platform driverJiaxin Yu1-0/+1286
Add mt8186 i2s dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220523132858.22166-8-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support hw gain in platform driverJiaxin Yu1-0/+236
Add mt8186 hw gain dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220523132858.22166-7-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support hostless in platform driverJiaxin Yu1-0/+298
Add mt8186 hostless dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220523132858.22166-6-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support adda in platform driverJiaxin Yu1-0/+873
Add mt8186 adda dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220523132858.22166-5-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8186: support audsys clock controlJiaxin Yu3-0/+210
Add mt8186 audio cg control. Audio clock gates are registered to CCF for reference count and clock parent management. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220523132858.22166-4-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: remove unnecessary check of clk_disable_unprepareMinghao Chi1-4/+2
Because clk_disable_unprepare already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220602071809.278134-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mt6797-mt6351: Fix refcount leak in mt6797_mt6351_dev_probeMiaoqian Lin1-1/+5
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: f0ab0bf250da ("ASoC: add mt6797-mt6351 driver and config option") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220603083417.9011-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8173: Fix refcount leak in mt8173_rt5650_rt5676_dev_probeMiaoqian Lin1-3/+7
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Fix missing of_node_put() in error paths. Fixes: 94319ba10eca ("ASoC: mediatek: Use platform_of_node for machine drivers") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220602034144.60159-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: mt8195: simplify error handlingPierre-Louis Bossart1-4/+4
cppcheck warnings: sound/soc/mediatek/mt8195/mt8195-afe-clk.c:311:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/mediatek/mt8195/mt8195-afe-clk.c:297:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/mediatek/mt8195/mt8195-afe-clk.c:311:9: note: Returning identical expression 'ret' return ret; ^ sound/soc/mediatek/mt8195/mt8195-afe-clk.c:341:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/mediatek/mt8195/mt8195-afe-clk.c:338:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/mediatek/mt8195/mt8195-afe-clk.c:341:9: note: Returning identical expression 'ret' return ret; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220520211719.607543-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: Rename set_fmt_new back to set_fmtCharles Keepax2-3/+3
Now the core has been migrated across to the new direct clock specification we can move the drivers back to the normal set_fmt callback. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220519154318.2153729-41-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: mediatek: Update to use set_fmt_new callbackCharles Keepax2-9/+9
As part of updating the core to directly tell drivers if they are clock provider or consumer update these CPU side drivers to use the new direct callback. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220519154318.2153729-14-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-09ASoC: mediatek: mt8195: Fix build warning without CONFIG_OFYueHaibing1-4/+0
sound/soc/mediatek/mt8195/mt8195-mt6359.c:1639:32: warning: ‘mt8195_mt6359_max98390_rt5682_card’ defined but not used [-Wunused-variable] 1639 | static struct mt8195_card_data mt8195_mt6359_max98390_rt5682_card = { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/mediatek/mt8195/mt8195-mt6359.c:1634:32: warning: ‘mt8195_mt6359_rt1011_rt5682_card’ defined but not used [-Wunused-variable] 1634 | static struct mt8195_card_data mt8195_mt6359_rt1011_rt5682_card = { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/mediatek/mt8195/mt8195-mt6359.c:1629:32: warning: ‘mt8195_mt6359_rt1019_rt5682_card’ defined but not used [-Wunused-variable] 1629 | static struct mt8195_card_data mt8195_mt6359_rt1019_rt5682_card = { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since all users of this driver do need CONFIG_OF anyway, there is no need to save a few bytes on kernel builds while CONFIG_OF disabled, so just remove the #ifdef to fix this warning. Fixes: 86a6b9c9dfff ("ASoC: mediatek: mt8195: add machine support for max98390 and rt5682") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20220509120918.9000-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-09ASoC: mediatek: simplify the return expression of mtk_dai_pcm_prepare()Minghao Chi1-7/+1
Simplify the return expression. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220505021808.54337-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-14ASoC: soc-card: Create jack kcontrol without pinsAkihiko Odaki8-19/+17
snd_soc_card_jack_new() allowed to create jack kcontrol without pins, but did not create kcontrols. The jack would not have kcontrols if pins were not going to be added. This renames the old snd_soc_card_jack_new() to snd_soc_card_jack_new_pins() for use when pins are provided or will be added later. The new snd_soc_card_jack_new() appropriately creates a jack for use without pins and adds a kcontrol. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-08ASoC: mediatek: mt8192: support rt1015p_rt5682sMark Brown2-79/+121
Merge series from Jiaxin Yu <jiaxin.yu@mediatek.com>: The series reuses mt8192-mt6359-rt1015-rt5682.c for supporting machine driver with rt1015p speaker amplifier and rt5682s headset codec.
2022-04-08ASoC: mediatek: mt8195: Make sure of_device_id table are NULL terminatedLv Ruyi1-0/+1
Fix the following coccicheck review: ./sound/soc/mediatek/mt8195/mt8195-mt6359.c:1657:1-2: mt8195_mt6359_dt_match is not NULL terminated at line 1657 Fixes: 86a6b9c9dfff ("ASoC: mediatek: mt8195: add machine support for max98390 and rt5682") Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Link: https://lore.kernel.org/r/20220408100309.2495462-1-lv.ruyi@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-08ASoC: mediatek: mt8192: support rt1015p_rt5682sJiaxin Yu2-22/+40
Add support for using the rt5682s codec together with rt1015p on mt8192-mt6359 machines. All configurations are shared with the rt5682 codec variant, so simply select the SND_SOC_RT5682S config to ensure the codec is present and set the correct card name. The codec will be linked to by pointing to it in the headset-codec property in the devicetree. While at it, also create macros for the names of the different codec variants supported by this driver, as well as rename occurrences of rt1015p_rt5682 to rt1015p_rt5682x, since they are shared between rt5682 and rt5682s. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220408060552.26607-5-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-08ASoC: mediatek: mt8192: refactor for I2S8/I2S9 DAI links of headsetJiaxin Yu1-8/+26
As part of the refactoring to allow the same machine driver to be used for the rt1015(p) and rt5682(s) codecs on the MT8192 platform, parse the rt5682(s) codec from the headset-codec property in the devicetree and wire it to the I2S8 and I2S9 backends. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220408060552.26607-4-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-08ASoC: mediatek: mt8192: refactor for I2S3 DAI link of speakerJiaxin Yu1-51/+57
As part of the refactoring to allow the same machine driver to be used for the rt1015(p) and rt5682(s) codecs on the MT8192 platform, parse the rt1015(p) codecs from the speaker-codecs property in the devicetree and wire them to the I2S3 backend, instead of hardcoding the links and selecting through the compatible. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220408060552.26607-3-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-05ASoC: mediatek: Fix missing of_node_put in mt2701_wm8960_machine_probeMiaoqian Lin1-2/+7
This node pointer is returned by of_parse_phandle() with refcount incremented in this function. Calling of_node_put() to avoid the refcount leak. Fixes: 8625c1dbd876 ("ASoC: mediatek: Add mt2701-wm8960 machine driver") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220404093526.30004-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-05ASoC: mediatek: Fix error handling in mt8173_max98090_dev_probeMiaoqian Lin1-1/+4
Call of_node_put(platform_node) to avoid refcount leak in the error path. Fixes: 94319ba10eca ("ASoC: mediatek: Use platform_of_node for machine drivers") Fixes: 493433785df0 ("ASoC: mediatek: mt8173: fix device_node leak") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220404092903.26725-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-04ASoC: mediatek: mt8195: add machine support for max98390 and rt5682Trevor Wu2-0/+72
This patch adds support for mt8195 board with mt6359, max98390 and rt5682. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220324053851.27350-6-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-04ASoC: mediatek: mt8195: rename card controlsTrevor Wu1-13/+13
In order to be able to reuse the same configurations in user space, rename the controls to generic names. "Headphone Jack" -> "Headphone" "Speakers" -> "Ext Spk" "Left Speaker" -> "Left Spk" "Right Speaker" -> "Right SPk" Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220324053851.27350-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-04ASoC: mediatek: mt8195: merge machine driverTrevor Wu4-1274/+241
Because most functions can be reused in different codec combinations, mt8195 machine drivers are combined to one common file. The model and compatible string are used to decide which codecs are being used. As a result, We can prevent from copy-paste functions when new codec combination is introduced. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220324053851.27350-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-04ASoC: mediatek: mt8195: revise mt8195-mt6359-rt1019-rt5682.cTrevor Wu1-248/+240
Revise driver for the coming driver combination. There are two major parts including in the patch. 1. Apply some suggested changes used in mt8195-mt6359-rt1011-rt5682.c. 2. Reorder the layout for centralizing the codec related code. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220324053851.27350-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-16ASoC: mediatek: mt8195: Fix error handling in ↵Miaoqian Lin1-1/+3
mt8195_mt6359_rt1019_rt5682_dev_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error path. Fixes: 082482a50227 ("ASoC: mediatek: mt8195: release device_node after snd_soc_register_card") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220316084623.24238-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-16ASoC: mediatek: Fix error handling in mt8183_da7219_max98357_dev_probeMiaoqian Lin1-7/+16
The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error paths. Fix this by calling of_node_put() in error handling too. Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220316014059.19292-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-11ASoC: mediatek: mt8195: add reset controllerTrevor Wu1-0/+16
Audio hardware is possibly used in the firmware stage, so resetting audio hardware before regcache records default register values is required. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220308072435.22460-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08ASoC: mediatek: mt8192-mt6359: Fix error handling in mt8192_mt6359_dev_probeMiaoqian Lin1-6/+12
The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error paths. Fix this by calling of_node_put() in error handling too. Fixes: 4e28491a7a19 ("ASoC: mediatek: mt8192-mt6359: fix device_node leak") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220308015224.23585-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08ASoC: mediatek: mt8183: support wb bt audioJiaxin Yu1-4/+2
Use "bt-sco-pcm-wb" codec dai driver for wb bt audio. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220307033056.11463-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-28ASoC: mediatek: mt8195: Remove unnecessary print function dev_err()Yang Li1-3/+1
The print function dev_err() is redundant because platform_get_irq() already prints an error. Eliminate the follow coccicheck warning: ./sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:3126:2-9: line 3126 is redundant because platform_get_irq() already prints an error Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20220224011046.76904-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>