Skip to content

Commit

Permalink
ASoC: amd: vg: apply sample bits pcm constraint
Browse files Browse the repository at this point in the history
ACP I2S controller has limitation to program different BCLK
for TX and RX paths.
Headset path uses I2S SP controller instance.
As per requirement, Restricted 32 bits as sample bits by
applying pcm constraint in startup calabck for Headset path.

Signed-off-by: Vijendar Mukunda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
vijendarmukunda authored and broonie committed Feb 24, 2022
1 parent 9a617f0 commit 0c38cc1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sound/soc/amd/vangogh/acp5x-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
.mask = 0,
};

static const unsigned int acp5x_nau8821_format[] = {32};

static struct snd_pcm_hw_constraint_list constraints_sample_bits = {
.list = acp5x_nau8821_format,
.count = ARRAY_SIZE(acp5x_nau8821_format),
};

static int acp5x_8821_startup(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
Expand All @@ -115,6 +122,9 @@ static int acp5x_8821_startup(struct snd_pcm_substream *substream)
&constraints_channels);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
&constraints_sample_bits);
return 0;
}

Expand Down

0 comments on commit 0c38cc1

Please sign in to comment.