History log of /linux-master/sound/soc/mediatek/mt8186/mt8186-dai-i2s.c
Revision Date Author Comments
# 0fe153a9 23-Oct-2023 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

ASoC: mediatek: mt8186: Handle component name prefix

Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names,
to include also the component's name prefix.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20231023095428.166563-14-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 62da80c6 07-Sep-2022 Nícolas F. R. A. Prado <nfraprado@collabora.com>

ASoC: mediatek: mt8186: Remove clock share parsing from DT

Now that the clock sharing for i2s ports can be configured from the
sound machine driver, remove the logic that was used to parse the
properties from the devicetree.

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/20220908161154.648557-11-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4132a778 07-Sep-2022 Nícolas F. R. A. Prado <nfraprado@collabora.com>

ASoC: mediatek: mt8186: Allow setting shared clocks from machine driver

Add a new function to configure the shared clock between two i2s ports,
and export it. This will allow the clock sharing to be set from the
machine driver instead of the devicetree.

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/20220908161154.648557-9-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3c15abbe 17-Aug-2022 Chunxu Li <chunxu.li@mediatek.com>

ASoC: mediatek: mt8186: support DSP downlink

1. add DSP downlink link widget
2. add DSP to I2S route path

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220818025113.17144-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# b9f0a8ff 02-Aug-2022 Dan Carpenter <dan.carpenter@oracle.com>

ASoC: mediatek: mt8186: remove unnecessary NULL check

The "i2s_priv" pointer cannot be NULL. Some NULL checks were deleted
in commit d7bffbe9cbd3 ("ASoC: mediatek: mt8186: remove unnecessary
judgments") but this one was accidentally left behind.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yuo7LGPk8KnBW6ac@kili
Signed-off-by: Mark Brown <broonie@kernel.org>


# d7bffbe9 26-Jul-2022 Jiaxin Yu <jiaxin.yu@mediatek.com>

ASoC: mediatek: mt8186: remove unnecessary judgments

The afe_priv->dai_priv[] is allocated when platform driver probe(), if it
failed, the ASoC platform driver probe() will return fail first.
Therefore, this is excessive judgment, and the condition will never be
established.

Bug report: https://www.spinics.net/lists/alsa-devel/msg145609.html

This is a semi-automatic email about new static checker warnings.

The patch ae92dcbee8b6: "ASoC: mediatek: mt8186: support tdm in
platform driver" from May 23, 2022, leads to the following Smatch
complaint:

sound/soc/mediatek/mt8186/mt8186-dai-tdm.c:424 mtk_dai_tdm_hw_params()
warn: variable dereferenced before check 'tdm_priv' (see line 406)

sound/soc/mediatek/mt8186/mt8186-dai-tdm.c
405 struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[tdm_id];
406 unsigned int tdm_mode = tdm_priv->tdm_mode;
^^^^^^^^^^^^^^^^^^^
Lot's of dereferences

407 unsigned int data_mode = tdm_priv->data_mode;
408 unsigned int rate = params_rate(params);
409 unsigned int channels = params_channels(params);
410 snd_pcm_format_t format = params_format(params);
411 unsigned int bit_width =
412 snd_pcm_format_physical_width(format);
413 unsigned int tdm_channels = (data_mode == TDM_DATA_ONE_PIN) ?
414 get_tdm_ch_per_sdata(tdm_mode, channels) : 2;
415 unsigned int lrck_width =
416 get_tdm_lrck_width(format, tdm_mode);
417 unsigned int tdm_con = 0;
418 bool slave_mode = tdm_priv->slave_mode;
419 bool lrck_inv = tdm_priv->lck_invert;
420 bool bck_inv = tdm_priv->bck_invert;
421 unsigned int tran_rate;
422 unsigned int tran_relatch_rate;
423
424 if (!tdm_priv) {
^^^^^^^^^
Checked too late

425 dev_err(afe->dev, "%s(), tdm_priv == NULL", __func__);
426 return -EINVAL;

Fixes: ae92dcbee8b6 ("ASoC: mediatek: mt8186: support tdm in platform driver")
Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/20220726154220.28141-1-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2907d261 23-May-2022 Jiaxin Yu <jiaxin.yu@mediatek.com>

ASoC: mediatek: mt8186: support i2s in platform driver

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>