Subject: [PATCH 0/5] ASoC: mt8188-mt6359: Cleanups

This series performs some cleanups to the mt8188-mt6359 driver,
including usage of bitfield macros, adding definitions of register
fields and some others for readability and consistency.

AngeloGioacchino Del Regno (4):
ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return
ret
ASoC: mediatek: mt8188-mt6359: Clean up log levels
ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers

Dan Carpenter (1):
ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init

sound/soc/mediatek/mt8188/mt8188-mt6359.c | 87 ++++++++++++-----------
1 file changed, 45 insertions(+), 42 deletions(-)

--
2.40.1



Subject: [PATCH 4/5] ASoC: mediatek: mt8188-mt6359: Clean up log levels

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 <[email protected]>
---
sound/soc/mediatek/mt8188/mt8188-mt6359.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
index 260cace408b9..5b2660139421 100644
--- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
+++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
@@ -337,9 +337,8 @@ static int mt8188_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)

/* handle if never test done */
if (++counter > 10000) {
- dev_info(afe->dev, "%s(), test fail, cycle_1 %d, cycle_2 %d, monitor 0x%x\n",
- __func__,
- cycle_1, cycle_2, monitor);
+ dev_err(afe->dev, "%s(), test fail, cycle_1 %d, cycle_2 %d, monitor 0x%x\n",
+ __func__, cycle_1, cycle_2, monitor);
mtkaif_calibration_ok = false;
break;
}
@@ -398,8 +397,8 @@ static int mt8188_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)
for (i = 0; i < MT8188_MTKAIF_MISO_NUM; i++)
param->mtkaif_phase_cycle[i] = mtkaif_phase_cycle[i];

- dev_info(afe->dev, "%s(), end, calibration ok %d\n",
- __func__, param->mtkaif_calibration_ok);
+ dev_dbg(afe->dev, "%s(), end, calibration ok %d\n",
+ __func__, param->mtkaif_calibration_ok);

return 0;
}
@@ -486,14 +485,14 @@ static int mt8188_hdmi_codec_init(struct snd_soc_pcm_runtime *rtd)
mt8188_hdmi_jack_pins,
ARRAY_SIZE(mt8188_hdmi_jack_pins));
if (ret) {
- dev_info(rtd->dev, "%s, new jack failed: %d\n", __func__, ret);
+ dev_err(rtd->dev, "%s, new jack failed: %d\n", __func__, ret);
return ret;
}

ret = snd_soc_component_set_jack(component, &priv->hdmi_jack, NULL);
if (ret) {
- dev_info(rtd->dev, "%s, set jack failed on %s (ret=%d)\n",
- __func__, component->name, ret);
+ dev_err(rtd->dev, "%s, set jack failed on %s (ret=%d)\n",
+ __func__, component->name, ret);
return ret;
}

@@ -510,14 +509,14 @@ static int mt8188_dptx_codec_init(struct snd_soc_pcm_runtime *rtd)
&priv->dp_jack, mt8188_dp_jack_pins,
ARRAY_SIZE(mt8188_dp_jack_pins));
if (ret) {
- dev_info(rtd->dev, "%s, new jack failed: %d\n", __func__, ret);
+ dev_err(rtd->dev, "%s, new jack failed: %d\n", __func__, ret);
return ret;
}

ret = snd_soc_component_set_jack(component, &priv->dp_jack, NULL);
if (ret) {
- dev_info(rtd->dev, "%s, set jack failed on %s (ret=%d)\n",
- __func__, component->name, ret);
+ dev_err(rtd->dev, "%s, set jack failed on %s (ret=%d)\n",
+ __func__, component->name, ret);
return ret;
}

--
2.40.1


Subject: [PATCH 2/5] ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init

From: Dan Carpenter <[email protected]>

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 <[email protected]>
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
---
sound/soc/mediatek/mt8188/mt8188-mt6359.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
index 643a7a12a96b..b2735496d140 100644
--- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
+++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
@@ -594,7 +594,7 @@ static int mt8188_max98390_codec_init(struct snd_soc_pcm_runtime *rtd)
}

if (rtd->dai_link->num_codecs <= 2)
- return ret;
+ return 0;

/* add widgets/controls/dapm for rear speakers */
ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_rear_spk_widgets,
--
2.40.1


Subject: [PATCH 1/5] ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries

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 <[email protected]>
---
sound/soc/mediatek/mt8188/mt8188-mt6359.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
index bc4b74970a46..643a7a12a96b 100644
--- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
+++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
@@ -1117,15 +1117,9 @@ static struct mt8188_card_data mt8188_nau8825_card = {
};

static const struct of_device_id mt8188_mt6359_dt_match[] = {
- {
- .compatible = "mediatek,mt8188-mt6359-evb",
- .data = &mt8188_evb_card,
- },
- {
- .compatible = "mediatek,mt8188-nau8825",
- .data = &mt8188_nau8825_card,
- },
- {},
+ { .compatible = "mediatek,mt8188-mt6359-evb", .data = &mt8188_evb_card, },
+ { .compatible = "mediatek,mt8188-nau8825", .data = &mt8188_nau8825_card, },
+ { /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, mt8188_mt6359_dt_match);

--
2.40.1


2023-06-08 09:46:05

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH 1/5] ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries

On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> Those entries fit in one line: compress them to reduce line count.
> While at it, also add the sentinel comment to the last entry.

Reviewed-by: Alexandre Mergnat <[email protected]>

--
Regards,
Alexandre


2023-06-08 09:49:12

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH 4/5] ASoC: mediatek: mt8188-mt6359: Clean up log levels

On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> Change some dev_info prints to dev_err() and some to dev_dbg(),
> depending on the actual severity of them.

Reviewed-by: Alexandre Mergnat <[email protected]>

--
Regards,
Alexandre


2023-06-08 09:50:58

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH 2/5] ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init

On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> 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.

Reviewed-by: Alexandre Mergnat <[email protected]>

--
Regards,
Alexandre


2023-06-08 15:25:30

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/5] ASoC: mt8188-mt6359: Cleanups

On Thu, 08 Jun 2023 10:47:22 +0200, AngeloGioacchino Del Regno wrote:
> This series performs some cleanups to the mt8188-mt6359 driver,
> including usage of bitfield macros, adding definitions of register
> fields and some others for readability and consistency.
>
> AngeloGioacchino Del Regno (4):
> ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
> ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return
> ret
> ASoC: mediatek: mt8188-mt6359: Clean up log levels
> ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/5] ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries
commit: 22628e92d76a403181916f7bac7848dd2326d750
[2/5] ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init
commit: 1148b42257e2bf30093708398db2c4570ae9fe97
[3/5] ASoC: mediatek: mt8188-mt6359: Cleanup return 0 disguised as return ret
commit: 4882ef44f51bbb759b8a738b747fdbcbad38e51b
[4/5] ASoC: mediatek: mt8188-mt6359: Clean up log levels
commit: acb43baf8b7e75acdb14920de29881e3f70c6819
[5/5] ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers
commit: b0e2e4fb8a5467f4f64bcf64d1454d18cb665cc8

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


2023-06-08 17:13:37

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH 2/5] ASoC: mediatek: mt8188-mt6359: clean up a return in codec_init



On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> From: Dan Carpenter <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>

Reviewed-by: Matthias Brugger <[email protected]>

> ---
> sound/soc/mediatek/mt8188/mt8188-mt6359.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> index 643a7a12a96b..b2735496d140 100644
> --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> @@ -594,7 +594,7 @@ static int mt8188_max98390_codec_init(struct snd_soc_pcm_runtime *rtd)
> }
>
> if (rtd->dai_link->num_codecs <= 2)
> - return ret;
> + return 0;
>
> /* add widgets/controls/dapm for rear speakers */
> ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_rear_spk_widgets,

2023-06-08 17:13:59

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH 1/5] ASoC: mediatek: mt8188-mt6359: Compress of_device_id entries



On 08/06/2023 10:47, AngeloGioacchino Del Regno wrote:
> 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 <[email protected]>

Reviewed-by: Matthias Brugger <[email protected]>

> ---
> sound/soc/mediatek/mt8188/mt8188-mt6359.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> index bc4b74970a46..643a7a12a96b 100644
> --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> @@ -1117,15 +1117,9 @@ static struct mt8188_card_data mt8188_nau8825_card = {
> };
>
> static const struct of_device_id mt8188_mt6359_dt_match[] = {
> - {
> - .compatible = "mediatek,mt8188-mt6359-evb",
> - .data = &mt8188_evb_card,
> - },
> - {
> - .compatible = "mediatek,mt8188-nau8825",
> - .data = &mt8188_nau8825_card,
> - },
> - {},
> + { .compatible = "mediatek,mt8188-mt6359-evb", .data = &mt8188_evb_card, },
> + { .compatible = "mediatek,mt8188-nau8825", .data = &mt8188_nau8825_card, },
> + { /* sentinel */ },
> };
> MODULE_DEVICE_TABLE(of, mt8188_mt6359_dt_match);
>