mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Cc: Andrejs Cainikovs <andrejs.cainikovs@gmail.com>,
	<patches@opensource.cirrus.com>, <linux-sound@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Subject: Re: [RFC PATCH v1] ASoC: wm8904: enable fll with fixed mclk
Date: Tue, 12 Mar 2024 13:51:02 +0000	[thread overview]
Message-ID: <ZfBdxrzX3EnPuGOn@ediswmail9.ad.cirrus.com> (raw)
In-Reply-To: <ZfBG9IMFEjjIdgdi@toradex.com>

On Tue, Mar 12, 2024 at 01:13:40PM +0100, Andrejs Cainikovs wrote:
> On Mon, Mar 11, 2024 at 11:35:53AM +0000, Charles Keepax wrote:
> > On Fri, Mar 08, 2024 at 04:58:31PM +0100, Andrejs Cainikovs wrote:
> > > From: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
> With or without mclk-fs wm8904_set_sysclk() is called always during probe,
> with following parameters:
> 
> clk_id = 0
> dir = 0
> freq = 25000000
> mclk_freq = 25000000
> 
> When mclk-fs is set, wm8904_set_sysclk() is also called before each
> playback [1]. In case of 44.1kHz:
> 
> clk_id = 0
> dir = 0
> freq = 11289600
> mclk_freq = 11235955
> 
> In both scenarios, clk_id is always WM8904_CLK_AUTO.

Ah, ok I see what I was missing here. simple_card_utils calls
clk_set_rate if you specify mclk_fs. Which you don't want in this
case. My gut reaction is that really the problem here is the machine
driver doesn't support the clocking setup you have.

Having a quick look through the simple card stuff can you remove:

	clocks = <&audio_refclk1>;

From the machine driver DT stuff, and add mclk-fs. I think that
should cause the simple card to call the codec dai_set_sysclk
but without ever touching the audio_refclk. A small change in
simple_util_parse_clk might also be needed to allow it to return
without finding a clock. Which feels like a much simpler and less
scary change.

My only slight reservation is the automatic clocking thing only
really exists as a hack to support simple card anyway. But overal
I think it might be better to try to move the direction of travel
more to adding support for the clocking systems that exist into
simple-card rather than tweaking the codec driver to work around
it.

Thanks,
Charles

  reply	other threads:[~2024-03-12 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 15:58 Andrejs Cainikovs
2024-03-11 11:35 ` Charles Keepax
2024-03-12 12:13   ` Andrejs Cainikovs
2024-03-12 13:51     ` Charles Keepax [this message]
2024-03-15 10:32       ` Andrejs Cainikovs

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=ZfBdxrzX3EnPuGOn@ediswmail9.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=andrejs.cainikovs@gmail.com \
    --cc=andrejs.cainikovs@toradex.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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

all inboxes | Powered by JetHome®