summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()Kuninori Morimoto2023-06-201-1/+1
| | | | | | | | | | Current snd_soc_of_get_dai_name() doesn't accept index for #sound-dai-cells. It is not useful for user. This patch adds it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pm5qdgng.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Merge fixes due to dependenciesMark Brown2023-06-1610-70/+48
|\ | | | | | | So we can apply the tlv320aic3xxx DT conversion.
| * ASoC: mediatek: mt8195: fix use-after-free in driver remove pathTrevor Wu2023-06-015-34/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During mt8195_afe_init_clock(), mt8195_audsys_clk_register() was called followed by several other devm functions. At mt8195_afe_deinit_clock() located at mt8195_afe_pcm_dev_remove(), mt8195_audsys_clk_unregister() was called. However, there was an issue with the order in which these functions were called. Specifically, the remove callback of platform_driver was called before devres released the resource, resulting in a use-after-free issue during remove time. At probe time, the order of calls was: 1. mt8195_audsys_clk_register 2. afe_priv->clk = devm_kcalloc 3. afe_priv->clk[i] = devm_clk_get At remove time, the order of calls was: 1. mt8195_audsys_clk_unregister 3. free afe_priv->clk[i] 2. free afe_priv->clk To resolve the problem, we can utilize devm_add_action_or_reset() in mt8195_audsys_clk_register() so that the remove order can be changed to 3->2->1. Fixes: 6746cc858259 ("ASoC: mediatek: mt8195: add platform driver") Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230601033318.10408-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: mediatek: mt8188: fix use-after-free in driver remove pathTrevor Wu2023-06-015-36/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During mt8188_afe_init_clock(), mt8188_audsys_clk_register() was called followed by several other devm functions. The caller of mt8188_afe_init_clock() utilized devm_add_action_or_reset() to call mt8188_afe_deinit_clock(). However, the order was incorrect, causing a use-after-free issue during remove time. At probe time, the order of calls was: 1. mt8188_audsys_clk_register 2. afe_priv->clk = devm_kcalloc 3. afe_priv->clk[i] = devm_clk_get At remove time, the order of calls was: 1. mt8188_audsys_clk_unregister 3. free afe_priv->clk[i] 2. free afe_priv->clk To resolve the problem, it's necessary to move devm_add_action_or_reset() to the appropriate position so that the remove order can be 3->2->1. Fixes: f6b026479b13 ("ASoC: mediatek: mt8188: support audio clock control") Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230601033318.10408-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8173: Fix irq error pathRicardo Ribalda Delgado2023-06-121-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | After reordering the irq probe, the error path was not properly done. Lets fix it. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Cc: stable@kernel.org Fixes: 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready") Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-2-432aa99ce24d@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error pathRicardo Ribalda Delgado2023-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | If the second component fails to initialize, cleanup the first on. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Cc: stable@kernel.org Fixes: f1b5bf07365d ("ASoC: mt2701/mt8173: replace platform to component") Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-1-432aa99ce24d@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8192-mt6359: Go back to old headphone pin nameNícolas F. R. A. Prado2023-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cbbc0ec6dea09c ("ASoC: mediatek: mt8192-mt6359: Remove " Jack" from Headphone pin name"). That commit removed the " Jack" suffix with the reasoning that it is automatically added to the name of the kcontrol created, which is true, but this name is also used to look for the DAPM widget that will be toggled when the jack status is updated. Since the widget is still called "Headphone Jack" the jack can't link to the widget and the following error is shown: mt8192_mt6359 sound: ASoC: DAPM unknown pin Headphone It is not possible to also rename the headphone DAPM widget because its name is used by a switch kcontrol, "Headphone Jack Switch", both to link to the headphone widget and to assemble its name. This switch's name is referenced in the upstream UCM file, so renaming it would break userspace. Since the original commit didn't bring any benefit, besides sparing a few CPU cycles, simply revert it. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Link: https://lore.kernel.org/r/20230608221050.217968-1-nfraprado@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registersAngeloGioacchino Del Regno2023-06-081-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace open coded instances of FIELD_GET() with it, move register definitions at the top of the file and also replace magic numbers with register definitions. While at it, also change a regmap_update_bits() call to regmap_write() because the top 29 bits of AUD_TOP_CFG (31:3) are reserved (unused). Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230608084727.74403-6-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: Clean up log levelsAngeloGioacchino Del Regno2023-06-081-11/+10
| | | | | | | | | | | | | | | | | | | | Change some dev_info prints to dev_err() and some to dev_dbg(), depending on the actual severity of them. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230608084727.74403-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return retAngeloGioacchino Del Regno2023-06-081-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | Change all instances of `return ret` to `return 0` at the end of functions where ret is always zero and also change functions mt8188_{hdmi,dptx}_codec_init to be consistent with how other functions are returning errors Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230608084727.74403-4-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: clean up a return in codec_initDan Carpenter2023-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code triggers a Smatch static checker warning and does sort of look like an error path. sound/soc/mediatek/mt8188/mt8188-mt6359.c:597 mt8188_max98390_codec_init() warn: missing error code? 'ret' However, returning 0 is intentional. Make that explicit. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230608084727.74403-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: Compress of_device_id entriesAngeloGioacchino Del Regno2023-06-081-9/+3
| | | | | | | | | | | | | | | | | | | | Those entries fit in one line: compress them to reduce line count. While at it, also add the sentinel comment to the last entry. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230608084727.74403-2-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: add i2c dependencyArnd Bergmann2023-06-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newly added driver is missing this dependency, causing a possible build failure: WARNING: unmet direct dependencies detected for SND_SOC_MAX98390 WARNING: unmet direct dependencies detected for SND_SOC_NAU8825 Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=m] Selected by [y]: - SND_SOC_MT8188_MT6359 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_MT8188 [=y] && MTK_PMIC_WRAP [=y] aarch64-linux-ld: sound/soc/codecs/max98390.o: in function `max98390_i2c_probe': max98390.c:(.text+0x514): undefined reference to `__devm_regmap_init_i2c' Fixes: 9f08dcbddeb30 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230607120831.3587379-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: support new board with nau88255Trevor Wu2023-06-022-1/+330
| | | | | | | | | | | | | | | | | | | | This patch adds multiple i2s codecs support including NAU88L25, MAX98390, and the dumb amp like NAU8318 usage. In addition, dmic-codec is also added to skip the beginning pop noise. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230526093150.22923-7-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: common: soundcard driver add dai_fmt supportTrevor Wu2023-06-021-2/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two changes included in the patch. First, add set_dailink_daifmt() function, so dai_fmt can be updated by the configuration in dai-link sub node. Second, remove codec phandle from required property in dai-link sub node. For example, user possibly needs to update dai-format for all etdm co-clock dai-links, but codec doesn't need to be specified in capture dai-link for a speaker amp. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230526093150.22923-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pinsTrevor Wu2023-06-021-4/+23
| | | | | | | | | | | | | | | | | | | | Some userspace applications need jack control events, so register hdmi and dp jack pins to activate jack control events. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230526093150.22923-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8188: separate ADDA playback dai from capture daiTrevor Wu2023-06-023-45/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MT8188 will support SOF. In SOF, be_hw_params_fixup callback are used to configure BE hardware parameters. However, playback and capture stream share the same callback function in which it can't know the stream type. It's possible to require different parameters for playback and capture stream, so separate them into two dais for SOF usage. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://lore.kernel.org/r/20230526093150.22923-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ES8316 audio codec fixes on Rock5BMark Brown2023-05-305-34/+24
|\| | | | | | | | | | | | | Merge series from Cristian Ciocaltea <cristian.ciocaltea@collabora.com>: This patch series handles a few issues related to the ES8316 audio codec, discovered while doing some testing on the Rock 5B board.
| * ASoC: mediatek: mt8186: Fix use-after-free in driver remove pathDouglas Anderson2023-05-155-34/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When devm runs function in the "remove" path for a device it runs them in the reverse order. That means that if you have parts of your driver that aren't using devm or are using "roll your own" devm w/ devm_add_action_or_reset() you need to keep that in mind. The mt8186 audio driver didn't quite get this right. Specifically, in mt8186_init_clock() it called mt8186_audsys_clk_register() and then went on to call a bunch of other devm function. The caller of mt8186_init_clock() used devm_add_action_or_reset() to call mt8186_deinit_clock() but, because of the intervening devm functions, the order was wrong. Specifically at probe time, the order was: 1. mt8186_audsys_clk_register() 2. afe_priv->clk = devm_kcalloc(...) 3. afe_priv->clk[i] = devm_clk_get(...) At remove time, the order (which should have been 3, 2, 1) was: 1. mt8186_audsys_clk_unregister() 3. Free all of afe_priv->clk[i] 2. Free afe_priv->clk The above seemed to be causing a use-after-free. Luckily, it's easy to fix this by simply using devm more correctly. Let's move the devm_add_action_or_reset() to the right place. In addition to fixing the use-after-free, code inspection shows that this fixes a leak (missing call to mt8186_audsys_clk_unregister()) that would have happened if any of the syscon_regmap_lookup_by_phandle() calls in mt8186_init_clock() had failed. Fixes: 55b423d5623c ("ASoC: mediatek: mt8186: support audio clock control in platform driver") Signed-off-by: Douglas Anderson <dianders@chromium.org Link: https://lore.kernel.org/r/20230511092437.1.I31cceffc8c45bb1af16eb613e197b3df92cdc19e@changeid Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: do not include pm_runtime.h if not usedClaudiu Beznea2023-05-234-5/+0
| | | | | | | | | | | | | | | | | | | | Do not include pm_runtime.h header in files where APIs exported by pm_runtime.h are not used. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> # for omap-mcbsp-st.c Link: https://lore.kernel.org/r/20230517094903.2895238-2-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: mt8192-mt6359: Remove " Jack" from Headphone pin nameAngeloGioacchino Del Regno2023-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Function jack_kctl_name_gen() will remove the redundant " Jack" from the name, if present, and then it will add it back, so that all of the controls are named "(pin-name) Jack". Remove " Jack" from the Headphone pin name to spare some CPU cycles. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230517151516.343037-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8188: add required clocksTrevor Wu2023-05-152-0/+8
| | | | | | | | | | | | | | | | | | | | apll2_d4, apll12_div4, top_a2sys and top_aud_iec are possibly used in the future. To prevent from breaking binding ABI after any mt8188 dts upstream, add these clocks to clock list in advance. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com Link: https://lore.kernel.org/r/20230510035526.18137-8-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8188: add bus protectionTrevor Wu2023-05-151-0/+76
| | | | | | | | | | | | | | | | Add bus protection for reset controller. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com Link: https://lore.kernel.org/r/20230510035526.18137-7-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8188: combine afe component registrationTrevor Wu2023-05-151-35/+2
| | | | | | | | | | | | | | | | | | | | There is no benefit to separate two components for AFE, so DAI driver registration is moved to dev_snd_soc_register_component to merge these two components. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com Link: https://lore.kernel.org/r/20230510035526.18137-6-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8188: refine APLL controlTrevor Wu2023-05-153-23/+241
| | | | | | | | | | | | | | | | | | | | Currently, APLL is only used in ETDM module, so APLL and APLL tuner don't need to be enabled when AFE is used. Integrate APLL control into ETDM DAPM routes, so that APLL can be enabled when it is really required. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com Link: https://lore.kernel.org/r/20230510035526.18137-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8188: revise ETDM control flowTrevor Wu2023-05-152-386/+406
| | | | | | | | | | | | | | | | | | | | | | Replace register controls in snd_soc_dai_ops with snd_soc_dapm_widgets. startup, shutdown and trigger ops are removed, and create DAPM_SUPPLY to handle mclk, clock gating and etdm enabling. Additionally, mclk setup sequence is also updated because of new supply enabling sequence. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com Link: https://lore.kernel.org/r/20230510035526.18137-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8188: complete set_tdm_slot functionTrevor Wu2023-05-151-3/+18
| | | | | | | | | | | | | | | | User can configures slot number of TDM mode via set_tdm_slot callback. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com Link: https://lore.kernel.org/r/20230510035526.18137-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8188: remove supply AUDIO_HIRESTrevor Wu2023-05-151-37/+0
| | | | | | | | | | | | | | | | | | | | AUDIO_HIRES is not required in MT8188. Because top_audio_h is disabled when hires clock is not used, set_parent is a redundant operation. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230510035526.18137-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8195-afe-pcm: Simplify with dev_err_probe()AngeloGioacchino Del Regno2023-05-081-31/+14
| | | | | | | | | | | | | | | | | | Shorten the probe function by switching to dev_err_probe() where possible. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230503113413.149235-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8195-afe-pcm: Simplify runtime PM during probeAngeloGioacchino Del Regno2023-05-081-10/+12
| | | | | | | | | | | | | | | | | | Use devm_pm_runtime_enable() and pm_runtime_resume_and_get() to to simplify the probe function. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230503113413.149235-4-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: mediatek: mt8195-afe-pcm: Clean up unnecessary functionsAngeloGioacchino Del Regno2023-05-081-24/+8
|/ | | | | | | | | | | | | | | | Function mt8195_afe_init_registers() performs just a single call to regmap_multi_reg_write(), it returns int and it's not error checked; move that call to the probe function and also add some error check. While at it, also move the contents of mt8195_afe_parse_of() to the probe function as well: since this is getting a handle to topckgen and since that's optional, the ifdef for CONFIG_SND_SOC_MT6359 can also be removed. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Acked-by: Trevor Wu <trevor.wu@mediatek.com Link: https://lore.kernel.org/r/20230503113413.149235-6-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org
* ASoC: mediatek: common: Fix refcount leak in parse_dai_link_infoAashish Sharma2023-04-111-3/+9
| | | | | | | | | | | | | | | | | Add missing of_node_put()s before the returns to balance of_node_get()s and of_node_put()s, which may get unbalanced in case the for loop 'for_each_available_child_of_node' returns early. Fixes: 4302187d955f ("ASoC: mediatek: common: add soundcard driver common code") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@inria.fr> Link: https://lore.kernel.org/r/202304090504.2K8L6soj-lkp@intel.com/ Signed-off-by: Aashish Sharma <shraash@google.com> Reviewed-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230411003431.4048700-1-shraash@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8186: set variable aud_pinctrl to staticTom Rix2023-04-071-1/+1
| | | | | | | | | | | | smatch reports sound/soc/mediatek/mt8186/mt8186-afe-gpio.c:14:16: warning: symbol 'aud_pinctrl' was not declared. Should it be static? This variable is only used in one file so should be static. Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20230407115553.1968111-1-trix@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8186: Move some prints to debug levelAllen-KH Cheng2023-04-034-19/+19
| | | | | | | | | | | There are many log messages scattered throughout the mt8186 sound drivers, and they are frequently triggered. To avoid spamming the console, move these messages to the debug level. Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> Link: https://lore.kernel.org/r/20230329080418.1100-1-allen-kh.cheng@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8195-afe-pcm: Convert to platform remove callback ↵Uwe Kleine-König2023-03-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-114-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8192-afe-pcm: Convert to platform remove callback ↵Uwe Kleine-König2023-03-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-113-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8188-afe-pcm: Convert to platform remove callback ↵Uwe Kleine-König2023-03-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-112-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8183-afe-pcm: Convert to platform remove callback ↵Uwe Kleine-König2023-03-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-111-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8173-afe-pcm: Convert to platform remove callback ↵Uwe Kleine-König2023-03-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-110-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt6797-afe-pcm: Convert to platform remove callback ↵Uwe Kleine-König2023-03-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-109-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt2701-afe-pcm: Convert to platform remove callback ↵Uwe Kleine-König2023-03-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-108-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mtk-btcvsd: Convert to platform remove callback returning voidUwe Kleine-König2023-03-201-3/+2
| | | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-107-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mt8192: Move spammy messages to debug levelNícolas F. R. A. Prado2023-03-143-19/+19
| | | | | | | | | | | There are many log messages throughout the mt8192 sound drivers that print to the info level and are triggered very frequently. Move these messages to the debug level to avoid spamming the console. Signed-off-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/20230313212908.2282961-3-nfraprado@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mt8192: Remove function name log messagesNícolas F. R. A. Prado via Alsa-devel2023-03-144-12/+0
| | | | | | | | | | | There are some log messages in the mt8192 sound code that print the function name, presumably to aid in tracing. However this can also be achieved by ftrace and without spamming the console, so remove these messages. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Link: https://lore.kernel.org/r/167874298172.26.17917791030607314817@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt9195-mt6359: fix UNINIT problemTrevor Wu2023-03-131-1/+1
| | | | | | | | | | | Coverity shows using uninitialized value monitor. When regmap_read returns an error, monitor keeps the value left from earlier computation. To prevent from the unexpected result in the case, assign 0 to monitor. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230307040938.7484-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8195: add dai id check before accessing arrayTrevor Wu2023-03-133-35/+185
| | | | | | | | | | | Coverity shows "afe_priv->dai_priv[dai_id] evaluates to an address that could be at negative offset of an array.". Add dai id check before accessing the array element. This ensures that the offset of an array must be a valid index. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230307040938.7484-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8195: add missing initializationTrevor Wu2023-03-011-0/+3
| | | | | | | | | | | | | | | | | In etdm dai driver, dai_etdm_parse_of() function is used to parse dts properties to get parameters. There are two for-loops which are sepearately for all etdm and etdm input only cases. In etdm in only loop, dai_id is not initialized, so it keeps the value intiliazed in another loop. In the patch, add the missing initialization to fix the unexpected parsing problem. Fixes: 1de9a54acafb ("ASoC: mediatek: mt8195: support etdm in platform driver") Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230301110200.26177-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8188: add missing initializationTrevor Wu2023-03-011-0/+3
| | | | | | | | | | | | | | | | | In etdm dai driver, dai_etdm_parse_of() function is used to parse dts properties to get parameters. There are two for-loops which are sepearately for all etdm and etdm input only cases. In etdm in only loop, dai_id is not initialized, so it keeps the value intiliazed in another loop. In the patch, add the missing initialization to fix the unexpected parsing problem. Fixes: 2babb4777489 ("ASoC: mediatek: mt8188: support etdm in platform driver") Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230301110200.26177-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mt8183: Fixes from an initial glance at aMark Brown2023-02-281-18/+3
|\ | | | | | | | | | | | | | | | | Merge series from Mark Brown <broonie@kernel.org>: This is a collection of fixes I came up after glancing through an initial test run with the snappily named Kukui Jacuzzi SKU16 Chromebook on KernelCI. There are more issues flagged, this is just what I fixed thus far.
| * ASoC: mt8183: Fix event generation for I2S DAI operationsMark Brown2023-02-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | ALSA control put() operations should return 0 if the value changed so that events can be generated appropriately for userspace but the custom control in the MT8183 I2S DAI driver doesn't do that, fix it. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230224-asoc-mt8183-quick-fixes-v1-2-041f29419ed5@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>