Skip to contentSkip to conversation

ASoC: meson: aiu: fixups

PATCH Applied Jerome Brunet 3 participants 12 messages Feb 14, 2020 – Apr 16, 2020

Subsystems (4)
lore
Share & tools
lore

Jerome Brunet

author maintainer
#0 lore raw

cover ASoC: meson: aiu: fixups

This patchset fixes some mistakes which slipped through my initial submission.

Most of these issues have been reported by coccinelle and sparse.

Jerome Brunet (5):
ASoC: meson: aiu: remove unused encoder structure
ASoC: meson: aiu: fix clk bulk size allocation
ASoC: meson: aiu: fix irq registration
ASoC: meson: aiu: fix acodec dai input name init
ASoC: meson: codec-glue: fix pcm format cast warning

 sound/soc/meson/aiu-acodec-ctrl.c  |  1 -
 sound/soc/meson/aiu-encoder-i2s.c  |  7 -------
 sound/soc/meson/aiu.c              | 10 +++-------
 sound/soc/meson/aiu.h              |  2 +-
 sound/soc/meson/meson-codec-glue.c |  2 +-
 5 files changed, 5 insertions(+), 17 deletions(-)
Signature · 1 line
2.24.1
author maintainer
#1 lore raw

PATCH 1/5 ASoC: meson: aiu: remove unused encoder structure

Remove an unused structure definition which slipped through the initial driver submission.

Fixes 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support")
---
 sound/soc/meson/aiu-encoder-i2s.c | 7 -------
 1 file changed, 7 deletions(-)
sound/soc/meson/aiu-encoder-i2s.c +0 -7
index 13bf029086a9..4900e38e7e49 100644
@@ -28,13 +28,6 @@
 #define AIU_CLK_CTRL_MORE_I2S_DIV	GENMASK(5, 0)
 #define AIU_CODEC_DAC_LRCLK_CTRL_DIV	GENMASK(11, 0)
 
-struct aiu_encoder_i2s {
-	struct clk *aoclk;
-	struct clk *mclk;
-	struct clk *mixer;
-	struct clk *pclk;
-};
-
 static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component,
 					   bool enable)
 {
Signature · 1 line
2.24.1
maintainer
#2 lore raw

Applied "ASoC: meson: aiu: remove unused encoder structure" to the asoc tree

The patch

ASoC: meson: aiu: remove unused encoder structure

has been applied to the asoc tree at

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

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

From 51c366e38aaa6b298ba1e6ceef0f2c3de1180b29 Mon Sep 17 00:00:00 2001
From: Jerome Brunet <[email protected]>
Date: Fri, 14 Feb 2020 14:13:46 +0100
Subject: [PATCH] ASoC: meson: aiu: remove unused encoder structure

Remove an unused structure definition which slipped through the initial driver submission.

Fixes 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support")
---
 sound/soc/meson/aiu-encoder-i2s.c | 7 -------
 1 file changed, 7 deletions(-)
sound/soc/meson/aiu-encoder-i2s.c +0 -7
index 13bf029086a9..4900e38e7e49 100644
@@ -28,13 +28,6 @@
 #define AIU_CLK_CTRL_MORE_I2S_DIV	GENMASK(5, 0)
 #define AIU_CODEC_DAC_LRCLK_CTRL_DIV	GENMASK(11, 0)
 
-struct aiu_encoder_i2s {
-	struct clk *aoclk;
-	struct clk *mclk;
-	struct clk *mixer;
-	struct clk *pclk;
-};
-
 static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component,
 					   bool enable)
 {
Signature · 1 line
2.20.1
author maintainer
#3 lore raw

PATCH 2/5 ASoC: meson: aiu: fix clk bulk size allocation

In reply to Jerome Brunet

Fix the size of allocated memory for the clock bulk data

Fixes 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support")
---
 sound/soc/meson/aiu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/aiu.c +1 -1
index 5c4845a23a34..de678a9d5cab 100644
@@ -203,7 +203,7 @@ static int aiu_clk_bulk_get(struct device *dev,
 	struct clk_bulk_data *clks;
 	int i, ret;
 
-	clks = devm_kcalloc(dev, num, sizeof(clks), GFP_KERNEL);
+	clks = devm_kcalloc(dev, num, sizeof(*clks), GFP_KERNEL);
 	if (!clks)
 		return -ENOMEM;
 
Signature · 1 line
2.24.1
maintainer
#4 lore raw

Applied "ASoC: meson: aiu: fix clk bulk size allocation" to the asoc tree

The patch

ASoC: meson: aiu: fix clk bulk size allocation

has been applied to the asoc tree at

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

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

From 269f00171273e47eebc915cc6ee8ceececa37a3a Mon Sep 17 00:00:00 2001
From: Jerome Brunet <[email protected]>
Date: Fri, 14 Feb 2020 14:13:47 +0100
Subject: [PATCH] ASoC: meson: aiu: fix clk bulk size allocation

Fix the size of allocated memory for the clock bulk data

Fixes 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support")
---
 sound/soc/meson/aiu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/aiu.c +1 -1
index 5c4845a23a34..de678a9d5cab 100644
@@ -203,7 +203,7 @@ static int aiu_clk_bulk_get(struct device *dev,
 	struct clk_bulk_data *clks;
 	int i, ret;
 
-	clks = devm_kcalloc(dev, num, sizeof(clks), GFP_KERNEL);
+	clks = devm_kcalloc(dev, num, sizeof(*clks), GFP_KERNEL);
 	if (!clks)
 		return -ENOMEM;
 
Signature · 1 line
2.20.1
author maintainer
#5 lore raw

PATCH 3/5 ASoC: meson: aiu: fix irq registration

In reply to Jerome Brunet

The aiu stored the irq in an unsigned integer which may have discarded an error returned by platform_get_irq_byname(). This is incorrect and should have been a signed integer.

Also drop the irq error traces from the probe function as this is already done by platform_get_irq_byname().

Fixes 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support")
---
 sound/soc/meson/aiu.c | 8 ++------
 sound/soc/meson/aiu.h | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)
sound/soc/meson/aiu.c +2 -6
index de678a9d5cab..34b40b8b8299 100644
@@ -314,16 +314,12 @@ static int aiu_probe(struct platform_device *pdev)
 	}
 
 	aiu->i2s.irq = platform_get_irq_byname(pdev, "i2s");
-	if (aiu->i2s.irq < 0) {
-		dev_err(dev, "Can't get i2s irq\n");
+	if (aiu->i2s.irq < 0)
 		return aiu->i2s.irq;
-	}
 
 	aiu->spdif.irq = platform_get_irq_byname(pdev, "spdif");
-	if (aiu->spdif.irq < 0) {
-		dev_err(dev, "Can't get spdif irq\n");
+	if (aiu->spdif.irq < 0)
 		return aiu->spdif.irq;
-	}
 
 	ret = aiu_clk_get(dev);
 	if (ret)
sound/soc/meson/aiu.h +1 -1
index a65a576e3400..097c26de7b7c 100644
@@ -26,7 +26,7 @@ enum aiu_clk_ids {
 struct aiu_interface {
 	struct clk_bulk_data *clks;
 	unsigned int clk_num;
-	unsigned int irq;
+	int irq;
 };
 
 struct aiu {
Signature · 1 line
2.24.1
maintainer
#6 lore raw

Applied "ASoC: meson: aiu: fix irq registration" to the asoc tree

The patch

ASoC: meson: aiu: fix irq registration

has been applied to the asoc tree at

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

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

From 6e700f0672199f773ad645c2b7e886c1d2e2046e Mon Sep 17 00:00:00 2001
From: Jerome Brunet <[email protected]>
Date: Fri, 14 Feb 2020 14:13:48 +0100
Subject: [PATCH] ASoC: meson: aiu: fix irq registration

The aiu stored the irq in an unsigned integer which may have discarded an error returned by platform_get_irq_byname(). This is incorrect and should have been a signed integer.

Also drop the irq error traces from the probe function as this is already done by platform_get_irq_byname().

Fixes 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support")
---
 sound/soc/meson/aiu.c | 8 ++------
 sound/soc/meson/aiu.h | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)
sound/soc/meson/aiu.c +2 -6
index de678a9d5cab..34b40b8b8299 100644
@@ -314,16 +314,12 @@ static int aiu_probe(struct platform_device *pdev)
 	}
 
 	aiu->i2s.irq = platform_get_irq_byname(pdev, "i2s");
-	if (aiu->i2s.irq < 0) {
-		dev_err(dev, "Can't get i2s irq\n");
+	if (aiu->i2s.irq < 0)
 		return aiu->i2s.irq;
-	}
 
 	aiu->spdif.irq = platform_get_irq_byname(pdev, "spdif");
-	if (aiu->spdif.irq < 0) {
-		dev_err(dev, "Can't get spdif irq\n");
+	if (aiu->spdif.irq < 0)
 		return aiu->spdif.irq;
-	}
 
 	ret = aiu_clk_get(dev);
 	if (ret)
sound/soc/meson/aiu.h +1 -1
index a65a576e3400..097c26de7b7c 100644
@@ -26,7 +26,7 @@ enum aiu_clk_ids {
 struct aiu_interface {
 	struct clk_bulk_data *clks;
 	unsigned int clk_num;
-	unsigned int irq;
+	int irq;
 };
 
 struct aiu {
Signature · 1 line
2.20.1
author maintainer
#7 lore raw

PATCH 4/5 ASoC: meson: aiu: fix acodec dai input name init

In reply to Jerome Brunet

Remove the double initialization of the dai input name as reported by sparse.

Fixes 65816025d461 ("ASoC: meson: aiu: add internal dac codec control support")
---
 sound/soc/meson/aiu-acodec-ctrl.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/meson/aiu-acodec-ctrl.c +0 -1
index 12d8a4d351a1..b8e88b1a4fc8 100644
@@ -128,7 +128,6 @@ static const struct snd_soc_dai_ops aiu_acodec_ctrl_output_ops = {
 
 #define AIU_ACODEC_INPUT(xname) {				\
 	.name = "ACODEC CTRL " xname,				\
-	.name = xname,						\
 	.playback = AIU_ACODEC_STREAM(xname, "Playback", 8),	\
 	.ops = &aiu_acodec_ctrl_input_ops,			\
 	.probe = meson_codec_glue_input_dai_probe,		\
Signature · 1 line
2.24.1
maintainer
#8 lore raw

Applied "ASoC: meson: aiu: fix acodec dai input name init" to the asoc tree

The patch

ASoC: meson: aiu: fix acodec dai input name init

has been applied to the asoc tree at

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

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

From 74a56f2a4a9ec72ef1daceeb2dda8b41370c1419 Mon Sep 17 00:00:00 2001
From: Jerome Brunet <[email protected]>
Date: Fri, 14 Feb 2020 14:13:49 +0100
Subject: [PATCH] ASoC: meson: aiu: fix acodec dai input name init

Remove the double initialization of the dai input name as reported by sparse.

Fixes 65816025d461 ("ASoC: meson: aiu: add internal dac codec control support")
---
 sound/soc/meson/aiu-acodec-ctrl.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/meson/aiu-acodec-ctrl.c +0 -1
index 12d8a4d351a1..b8e88b1a4fc8 100644
@@ -128,7 +128,6 @@ static const struct snd_soc_dai_ops aiu_acodec_ctrl_output_ops = {
 
 #define AIU_ACODEC_INPUT(xname) {				\
 	.name = "ACODEC CTRL " xname,				\
-	.name = xname,						\
 	.playback = AIU_ACODEC_STREAM(xname, "Playback", 8),	\
 	.ops = &aiu_acodec_ctrl_input_ops,			\
 	.probe = meson_codec_glue_input_dai_probe,		\
Signature · 1 line
2.20.1
author maintainer
#9 lore raw

PATCH 5/5 ASoC: meson: codec-glue: fix pcm format cast warning

In reply to Jerome Brunet

Clarify the cast of snd_pcm_format_t and fix the sparse warning:
restricted snd_pcm_format_t degrades to integer

Fixes 9c29fd9bdf92 ("ASoC: meson: g12a: extract codec-to-codec utils")
---
 sound/soc/meson/meson-codec-glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/meson-codec-glue.c +1 -1
index 97bbc967e176..524a33472337 100644
@@ -74,7 +74,7 @@ int meson_codec_glue_input_hw_params(struct snd_pcm_substream *substream,
 	data->params.rates = snd_pcm_rate_to_rate_bit(params_rate(params));
 	data->params.rate_min = params_rate(params);
 	data->params.rate_max = params_rate(params);
-	data->params.formats = 1 << params_format(params);
+	data->params.formats = 1ULL << (__force int) params_format(params);
 	data->params.channels_min = params_channels(params);
 	data->params.channels_max = params_channels(params);
 	data->params.sig_bits = dai->driver->playback.sig_bits;
Signature · 1 line
2.24.1
maintainer
#10 lore raw

Applied "ASoC: meson: codec-glue: fix pcm format cast warning" to the asoc tree

The patch

ASoC: meson: codec-glue: fix pcm format cast warning

has been applied to the asoc tree at

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

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

From 3cd23f021e2e5f3350125abcb39f12430df87d06 Mon Sep 17 00:00:00 2001
From: Jerome Brunet <[email protected]>
Date: Fri, 14 Feb 2020 14:13:50 +0100
Subject: [PATCH] ASoC: meson: codec-glue: fix pcm format cast warning

Clarify the cast of snd_pcm_format_t and fix the sparse warning:
restricted snd_pcm_format_t degrades to integer

Fixes 9c29fd9bdf92 ("ASoC: meson: g12a: extract codec-to-codec utils")
---
 sound/soc/meson/meson-codec-glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/meson-codec-glue.c +1 -1
index 97bbc967e176..524a33472337 100644
@@ -74,7 +74,7 @@ int meson_codec_glue_input_hw_params(struct snd_pcm_substream *substream,
 	data->params.rates = snd_pcm_rate_to_rate_bit(params_rate(params));
 	data->params.rate_min = params_rate(params);
 	data->params.rate_max = params_rate(params);
-	data->params.formats = 1 << params_format(params);
+	data->params.formats = 1ULL << (__force int) params_format(params);
 	data->params.channels_min = params_channels(params);
 	data->params.channels_max = params_channels(params);
 	data->params.sig_bits = dai->driver->playback.sig_bits;
Signature · 1 line
2.20.1
#11 lore raw
In reply to Jerome Brunet
This series was applied to khilman/linux-amlogic.git (refs/heads/for-next).

Hello:

This series was applied to khilman/linux-amlogic.git (refs/heads/for-next).

Quoted 5 lines · On Fri, 14 Feb 2020 14:13:45 +0100 you wrote:

This patchset fixes some mistakes which slipped through my initial submission.

Most of these issues have been reported by coccinelle and sparse.

Quoted 8 lines

Jerome Brunet (5):
ASoC: meson: aiu: remove unused encoder structure
ASoC: meson: aiu: fix clk bulk size allocation
ASoC: meson: aiu: fix irq registration
ASoC: meson: aiu: fix acodec dai input name init
ASoC: meson: codec-glue: fix pcm format cast warning

[...]

Here is a summary with links:
- [1/5] ASoC: meson: aiu: remove unused encoder structure

    https://git.kernel.org/khilman/linux-amlogic/c/51c366e38aaa6b298ba1e6ceef0f2c3de1180b29
  - [2/5] ASoC: meson: aiu: fix clk bulk size allocation
    https://git.kernel.org/khilman/linux-amlogic/c/269f00171273e47eebc915cc6ee8ceececa37a3a
  - [3/5] ASoC: meson: aiu: fix irq registration
    https://git.kernel.org/khilman/linux-amlogic/c/6e700f0672199f773ad645c2b7e886c1d2e2046e
  - [4/5] ASoC: meson: aiu: fix acodec dai input name init
    https://git.kernel.org/khilman/linux-amlogic/c/74a56f2a4a9ec72ef1daceeb2dda8b41370c1419
  - [5/5] ASoC: meson: codec-glue: fix pcm format cast warning
    https://git.kernel.org/khilman/linux-amlogic/c/3cd23f021e2e5f3350125abcb39f12430df87d06

You are awesome, thank you!

Signature · 7 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic