Skip to contentSkip to conversation

ASoC: hdmi-codec: avoid limiting params->msbits in hw_params()

PATCH In review Russell King 3 participants 3 messages Feb 28, 2019 – Mar 4, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: hdmi-codec: avoid limiting params->msbits in hw_params()

Limiting the value of the passed in params->msbits in the hw_params() callback is redundant on three counts:

1. We already specify in the DAI driver that we can only handle up to 24 bits. This means msbits will be limited to 24 via the ALSA constraints imposed by the ASoC core, unless we have multiple codecs that can handle more bits.

2. Nothing in our hw_params() implementation uses this value.

3. The copy of the params that we are passed by the ASoC core never reads back the msbits value.

Consequently, this code is unnecessary and does nothing useful. Remove it.

---
 sound/soc/codecs/hdmi-codec.c | 3 ---
 1 file changed, 3 deletions(-)
sound/soc/codecs/hdmi-codec.c +0 -3
index d5f73c837281..35df73e42cbc 100644
@@ -484,9 +484,6 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
 		params_width(params), params_rate(params),
 		params_channels(params));
 
-	if (params_width(params) > 24)
-		params->msbits = 24;
-
 	ret = snd_pcm_create_iec958_consumer_hw_params(params, hp.iec.status,
 						       sizeof(hp.iec.status));
 	if (ret < 0) {
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Russell King

Limiting the value of the passed in params->msbits in the hw_params() callback is redundant on three counts:

1. We already specify in the DAI driver that we can only handle up to 24 bits. This means msbits will be limited to 24 via the ALSA constraints imposed by the ASoC core, unless we have multiple codecs that can handle more bits.

2. Nothing in our hw_params() implementation uses this value.

Quoted 7 lines

3. The copy of the params that we are passed by the ASoC core never reads back the msbits value.

Consequently, this code is unnecessary and does nothing useful. Remove it.

Quoted 19 lines
---
 sound/soc/codecs/hdmi-codec.c | 3 ---
 1 file changed, 3 deletions(-)
sound/soc/codecs/hdmi-codec.c +0 -3
index d5f73c837281..35df73e42cbc 100644
@@ -484,9 +484,6 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
 		params_width(params), params_rate(params),
 		params_channels(params));
 
-	if (params_width(params) > 24)
-		params->msbits = 24;
-
 	ret = snd_pcm_create_iec958_consumer_hw_params(params, hp.iec.status,
 						       sizeof(hp.iec.status));
 	if (ret < 0) {
Signature · 2 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
maintainer
#2 lore raw

Applied "ASoC: hdmi-codec: avoid limiting params->msbits in hw_params()" to the asoc tree

In reply to Russell King

The patch

ASoC: hdmi-codec: avoid limiting params->msbits in hw_params()

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

Quoted 1 line

From bbf62563d8622434c761cb96569c132467f88597 Mon Sep 17 00:00:00 2001

From: Russell King <[email protected]>
Date: Thu, 28 Feb 2019 15:30:40 +0000
Subject: [PATCH] ASoC: hdmi-codec: avoid limiting params->msbits in
hw_params()

Limiting the value of the passed in params->msbits in the hw_params() callback is redundant on three counts:

1. We already specify in the DAI driver that we can only handle up to 24 bits. This means msbits will be limited to 24 via the ALSA constraints imposed by the ASoC core, unless we have multiple codecs that can handle more bits.

2. Nothing in our hw_params() implementation uses this value.

3. The copy of the params that we are passed by the ASoC core never reads back the msbits value.

Consequently, this code is unnecessary and does nothing useful. Remove it.

---
 sound/soc/codecs/hdmi-codec.c | 3 ---
 1 file changed, 3 deletions(-)
sound/soc/codecs/hdmi-codec.c +0 -3
index d5f73c837281..35df73e42cbc 100644
@@ -484,9 +484,6 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
 		params_width(params), params_rate(params),
 		params_channels(params));
 
-	if (params_width(params) > 24)
-		params->msbits = 24;
-
 	ret = snd_pcm_create_iec958_consumer_hw_params(params, hp.iec.status,
 						       sizeof(hp.iec.status));
 	if (ret < 0) {
Signature · 1 line
2.20.1