linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: AMD: Set constraints for DMIC and MAX98357a codec
@ 2018-08-21  6:55 Akshu Agrawal
  2018-08-27 23:01 ` Daniel Kurtz
  2018-08-28 20:27 ` Applied "ASoC: AMD: Set constraints for DMIC and MAX98357a codec" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Akshu Agrawal @ 2018-08-21  6:55 UTC (permalink / raw)
  Cc: djkurtz, akshu.agrawal, Alexander.Deucher, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Mukunda, Vijendar,
	Kuninori Morimoto, Wei Yongjun,
	moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

We support dual channel, 48Khz. This constraint was set only for
da7219. It is being extended to DMIC and MAX98357a.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 sound/soc/amd/acp-da7219-max98357a.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c
index 066d5489..cf2f648 100644
--- a/sound/soc/amd/acp-da7219-max98357a.c
+++ b/sound/soc/amd/acp-da7219-max98357a.c
@@ -162,10 +162,21 @@ static void cz_da7219_shutdown(struct snd_pcm_substream *substream)
 
 static int cz_max_startup(struct snd_pcm_substream *substream)
 {
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
 
+	/*
+	 * On this platform for PCM device we support stereo
+	 */
+
+	runtime->hw.channels_max = DUAL_CHANNEL;
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+				   &constraints_channels);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+				   &constraints_rates);
+
 	machine->i2s_instance = I2S_BT_INSTANCE;
 	return da7219_clk_enable(substream);
 }
@@ -177,20 +188,42 @@ static void cz_max_shutdown(struct snd_pcm_substream *substream)
 
 static int cz_dmic0_startup(struct snd_pcm_substream *substream)
 {
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
 
+	/*
+	 * On this platform for PCM device we support stereo
+	 */
+
+	runtime->hw.channels_max = DUAL_CHANNEL;
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+				   &constraints_channels);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+				   &constraints_rates);
+
 	machine->i2s_instance = I2S_BT_INSTANCE;
 	return da7219_clk_enable(substream);
 }
 
 static int cz_dmic1_startup(struct snd_pcm_substream *substream)
 {
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
 
+	/*
+	 * On this platform for PCM device we support stereo
+	 */
+
+	runtime->hw.channels_max = DUAL_CHANNEL;
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+				   &constraints_channels);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+				   &constraints_rates);
+
 	machine->i2s_instance = I2S_SP_INSTANCE;
 	machine->capture_channel = CAP_CHANNEL0;
 	return da7219_clk_enable(substream);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: AMD: Set constraints for DMIC and MAX98357a codec
  2018-08-21  6:55 [PATCH] ASoC: AMD: Set constraints for DMIC and MAX98357a codec Akshu Agrawal
@ 2018-08-27 23:01 ` Daniel Kurtz
  2018-08-28 20:27 ` Applied "ASoC: AMD: Set constraints for DMIC and MAX98357a codec" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Kurtz @ 2018-08-27 23:01 UTC (permalink / raw)
  To: Akshu Agrawal
  Cc: Alexander.Deucher, Liam Girdwood, Mark Brown, perex, tiwai,
	Vijendar.Mukunda, Kuninori Morimoto, weiyongjun1, alsa-devel,
	linux-kernel

On Tue, Aug 21, 2018 at 12:55 AM Akshu Agrawal <akshu.agrawal@amd.com> wrote:
>
> We support dual channel, 48Khz. This constraint was set only for
> da7219. It is being extended to DMIC and MAX98357a.
>
> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>

Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>

> ---
>  sound/soc/amd/acp-da7219-max98357a.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
>
> diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c
> index 066d5489..cf2f648 100644
> --- a/sound/soc/amd/acp-da7219-max98357a.c
> +++ b/sound/soc/amd/acp-da7219-max98357a.c
> @@ -162,10 +162,21 @@ static void cz_da7219_shutdown(struct snd_pcm_substream *substream)
>
>  static int cz_max_startup(struct snd_pcm_substream *substream)
>  {
> +       struct snd_pcm_runtime *runtime = substream->runtime;
>         struct snd_soc_pcm_runtime *rtd = substream->private_data;
>         struct snd_soc_card *card = rtd->card;
>         struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
>
> +       /*
> +        * On this platform for PCM device we support stereo
> +        */
> +
> +       runtime->hw.channels_max = DUAL_CHANNEL;
> +       snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
> +                                  &constraints_channels);
> +       snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
> +                                  &constraints_rates);
> +
>         machine->i2s_instance = I2S_BT_INSTANCE;
>         return da7219_clk_enable(substream);
>  }
> @@ -177,20 +188,42 @@ static void cz_max_shutdown(struct snd_pcm_substream *substream)
>
>  static int cz_dmic0_startup(struct snd_pcm_substream *substream)
>  {
> +       struct snd_pcm_runtime *runtime = substream->runtime;
>         struct snd_soc_pcm_runtime *rtd = substream->private_data;
>         struct snd_soc_card *card = rtd->card;
>         struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
>
> +       /*
> +        * On this platform for PCM device we support stereo
> +        */
> +
> +       runtime->hw.channels_max = DUAL_CHANNEL;
> +       snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
> +                                  &constraints_channels);
> +       snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
> +                                  &constraints_rates);
> +
>         machine->i2s_instance = I2S_BT_INSTANCE;
>         return da7219_clk_enable(substream);
>  }
>
>  static int cz_dmic1_startup(struct snd_pcm_substream *substream)
>  {
> +       struct snd_pcm_runtime *runtime = substream->runtime;
>         struct snd_soc_pcm_runtime *rtd = substream->private_data;
>         struct snd_soc_card *card = rtd->card;
>         struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
>
> +       /*
> +        * On this platform for PCM device we support stereo
> +        */
> +
> +       runtime->hw.channels_max = DUAL_CHANNEL;
> +       snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
> +                                  &constraints_channels);
> +       snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
> +                                  &constraints_rates);
> +
>         machine->i2s_instance = I2S_SP_INSTANCE;
>         machine->capture_channel = CAP_CHANNEL0;
>         return da7219_clk_enable(substream);
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: AMD: Set constraints for DMIC and MAX98357a codec" to the asoc tree
  2018-08-21  6:55 [PATCH] ASoC: AMD: Set constraints for DMIC and MAX98357a codec Akshu Agrawal
  2018-08-27 23:01 ` Daniel Kurtz
@ 2018-08-28 20:27 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-08-28 20:27 UTC (permalink / raw)
  To: Akshu Agrawal
  Cc: Mark Brown,
	moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	Kuninori Morimoto, open list, Takashi Iwai, Liam Girdwood,
	djkurtz, Mark Brown, Wei Yongjun, Mukunda, Vijendar,
	Alexander.Deucher, akshu.agrawal, alsa-devel

The patch

   ASoC: AMD: Set constraints for DMIC and MAX98357a codec

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 c736cbd3a668c3befd3ce08e0fbccac302fbecac Mon Sep 17 00:00:00 2001
From: Akshu Agrawal <akshu.agrawal@amd.com>
Date: Tue, 21 Aug 2018 12:25:05 +0530
Subject: [PATCH] ASoC: AMD: Set constraints for DMIC and MAX98357a codec

We support dual channel, 48Khz. This constraint was set only for
da7219. It is being extended to DMIC and MAX98357a.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/amd/acp-da7219-max98357a.c | 33 ++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c
index 8e3275a96a82..95c5701e2a30 100644
--- a/sound/soc/amd/acp-da7219-max98357a.c
+++ b/sound/soc/amd/acp-da7219-max98357a.c
@@ -162,10 +162,21 @@ static void cz_da7219_shutdown(struct snd_pcm_substream *substream)
 
 static int cz_max_startup(struct snd_pcm_substream *substream)
 {
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
 
+	/*
+	 * On this platform for PCM device we support stereo
+	 */
+
+	runtime->hw.channels_max = DUAL_CHANNEL;
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+				   &constraints_channels);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+				   &constraints_rates);
+
 	machine->i2s_instance = I2S_BT_INSTANCE;
 	return da7219_clk_enable(substream);
 }
@@ -177,20 +188,42 @@ static void cz_max_shutdown(struct snd_pcm_substream *substream)
 
 static int cz_dmic0_startup(struct snd_pcm_substream *substream)
 {
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
 
+	/*
+	 * On this platform for PCM device we support stereo
+	 */
+
+	runtime->hw.channels_max = DUAL_CHANNEL;
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+				   &constraints_channels);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+				   &constraints_rates);
+
 	machine->i2s_instance = I2S_BT_INSTANCE;
 	return da7219_clk_enable(substream);
 }
 
 static int cz_dmic1_startup(struct snd_pcm_substream *substream)
 {
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
 	struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
 
+	/*
+	 * On this platform for PCM device we support stereo
+	 */
+
+	runtime->hw.channels_max = DUAL_CHANNEL;
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+				   &constraints_channels);
+	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+				   &constraints_rates);
+
 	machine->i2s_instance = I2S_SP_INSTANCE;
 	machine->capture_channel = CAP_CHANNEL0;
 	return da7219_clk_enable(substream);
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-28 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-21  6:55 [PATCH] ASoC: AMD: Set constraints for DMIC and MAX98357a codec Akshu Agrawal
2018-08-27 23:01 ` Daniel Kurtz
2018-08-28 20:27 ` Applied "ASoC: AMD: Set constraints for DMIC and MAX98357a codec" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).