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

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

On Fri, Feb 15, 2019 at 07:06:15AM +0000, Agrawal, Akshu wrote:

> +static static int cz_da7219_hw_params(struct snd_pcm_substream *substream,
> +				    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;
> +}

No, this is a bad idea - you shouldn't be callings ops in drivers
outside of the framework, something is going to break on you there.
Either the drivers or the frameworks are going to get surprised by
things getting called out of sequence, for example I'd not rely on the
fact that the CODEC would be outputing a clock without active audio.
This probably means that you're going to have to extend the framework in
some way, or refactor things so that the BCLK is exported as a clock by
the CODEC and reflect the relationships via the clock API.  I need to
think a bit more but I think the clock API is going to be the the best
solution.

I also suspect that some work is needed to propagate constraints between
the various DAIs in the system.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2019-02-18 18:18 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 [this message]
2019-02-20  9:30   ` [alsa-devel] " Adam Thomson
2019-03-04 17:49 ` Guenter Roeck

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=20190218181807.GF10794@sirena.org.uk \
    --to=broonie@kernel.org \
    --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=djkurtz@chromium.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --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).