linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Agrawal, Akshu" <Akshu.Agrawal@amd.com>
Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..."  <alsa-devel@alsa-project.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	open list <linux-kernel@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"djkurtz@chromium.org" <djkurtz@chromium.org>,
	Mark Brown <broonie@kernel.org>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	"Mukunda, Vijendar" <Vijendar.Mukunda@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Adam.Thomson.Opensource@diasemi.com" 
	<Adam.Thomson.Opensource@diasemi.com>
Subject: Re: [alsa-devel] [PATCH] ASoC: AMD: Configure master codec on all playback/capture cases
Date: Mon, 4 Mar 2019 09:49:07 -0800	[thread overview]
Message-ID: <20190304174907.GA25016@roeck-us.net> (raw)
In-Reply-To: <20190215070539.22150-1-akshu.agrawal@amd.com>

On Fri, Feb 15, 2019 at 07:06:15AM +0000, Agrawal, Akshu wrote:
> In the system design da7219 is the master codec and clocks are
> generated by it.
> Bclk is to be generated at the required rate for other codecs used when
> da7219 is acting only as clock master. For this call hw_params of da7219
> during playback/capture on non da7219 codecs.
> 
> Being able to set bclk at lower rate also fixes noise issue observed on
> some dmics.
> 
> Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
> Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
> ---
>  sound/soc/amd/acp-da7219-max98357a.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c
> index a5daad973ce5..ad327415290a 100644
> --- a/sound/soc/amd/acp-da7219-max98357a.c
> +++ b/sound/soc/amd/acp-da7219-max98357a.c
> @@ -45,6 +45,7 @@
>  #define CZ_PLAT_CLK 48000000
>  #define DUAL_CHANNEL		2
>  
> +static struct snd_soc_dai *codec_dai;
>  static struct snd_soc_jack cz_jack;
>  static struct clk *da7219_dai_clk;
>  extern int bt_uart_enable;
> @@ -53,8 +54,10 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
>  {
>  	int ret;
>  	struct snd_soc_card *card = rtd->card;
> -	struct snd_soc_dai *codec_dai = rtd->codec_dai;
> -	struct snd_soc_component *component = codec_dai->component;
> +	struct snd_soc_component *component;
> +
> +	codec_dai = rtd->codec_dai;
> +	component = codec_dai->component;
>  
>  	dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name);
>  
> @@ -255,6 +258,16 @@ static void cz_dmic_shutdown(struct snd_pcm_substream *substream)
>  	da7219_clk_disable();
>  }
>  
> +static static int cz_da7219_hw_params(struct snd_pcm_substream *substream,

s/static static/static/

gcc doesn't like the double static (at least neither gcc 6.5.0 nor 8.1.0
do), and it doesn't seem to be syntactically correct (even though,
oddly enough, clang accepts it w/o error message).

Guenter

> +				    struct snd_pcm_hw_params *params)
> +{
> +	/* da7219 Codec is clock master so setup as per the needs */
> +	if (codec_dai->driver->ops->hw_params)
> +		return codec_dai->driver->ops->hw_params(substream, params,
> +							 codec_dai);
> +	return 0;
> +}
> +
>  static const struct snd_soc_ops cz_da7219_play_ops = {
>  	.startup = cz_da7219_play_startup,
>  	.shutdown = cz_da7219_shutdown,
> @@ -268,16 +281,19 @@ static const struct snd_soc_ops cz_da7219_cap_ops = {
>  static const struct snd_soc_ops cz_max_play_ops = {
>  	.startup = cz_max_startup,
>  	.shutdown = cz_max_shutdown,
> +	.hw_params = cz_da7219_hw_params,
>  };
>  
>  static const struct snd_soc_ops cz_dmic0_cap_ops = {
>  	.startup = cz_dmic0_startup,
>  	.shutdown = cz_dmic_shutdown,
> +	.hw_params = cz_da7219_hw_params,
>  };
>  
>  static const struct snd_soc_ops cz_dmic1_cap_ops = {
>  	.startup = cz_dmic1_startup,
>  	.shutdown = cz_dmic_shutdown,
> +	.hw_params = cz_da7219_hw_params,
>  };
>  
>  static struct snd_soc_dai_link cz_dai_7219_98357[] = {

      parent reply	other threads:[~2019-03-04 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15  7:06 [PATCH] ASoC: AMD: Configure master codec on all playback/capture cases Agrawal, Akshu
2019-02-15  9:58 ` Adam Thomson
2019-02-18 18:18 ` Mark Brown
2019-02-20  9:30   ` [alsa-devel] " Adam Thomson
2019-03-04 17:49 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190304174907.GA25016@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=Akshu.Agrawal@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).