Skip to content

Commit

Permalink
ASoC: qcom: q6apm-lpass-dais: pass max number of channels to Audioreach
Browse files Browse the repository at this point in the history
Using the params_channels() helper when setting hw_params, results in
passing to Audioreach minimum number of channels valid for given
hardware.  This is not valid for any hardware which sets minimum
channels to two and maximum to something bigger, like four channels.

Instead pass the maximum number of supported channels to allow playback
of multi-channel formats.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231017161429.431663-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Oct 25, 2023
1 parent 109cb21 commit e29de7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int q6hdmi_hw_params(struct snd_pcm_substream *substream,
{
struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev);
struct audioreach_module_config *cfg = &dai_data->module_config[dai->id];
int channels = params_channels(params);
int channels = hw_param_interval_c(params, SNDRV_PCM_HW_PARAM_CHANNELS)->max;
int ret;

cfg->bit_width = params_width(params);
Expand Down Expand Up @@ -131,7 +131,7 @@ static int q6dma_hw_params(struct snd_pcm_substream *substream,

cfg->bit_width = params_width(params);
cfg->sample_rate = params_rate(params);
cfg->num_channels = params_channels(params);
cfg->num_channels = hw_param_interval_c(params, SNDRV_PCM_HW_PARAM_CHANNELS)->max;

return 0;
}
Expand Down

0 comments on commit e29de7a

Please sign in to comment.