linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
To: Mark Brown <broonie@kernel.org>
Cc: devicetree <devicetree@vger.kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	alsa-devel <alsa-devel@alsa-project.org>,
	Xiubo Lee <Xiubo.Lee@gmail.com>,
	Fabio Estevam <festevam@gmail.com>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-sound <linux-sound@vger.kernel.org>,
	Jaroslav Kysela <perex@perex.cz>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	shengjiu wang <shengjiu.wang@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec
Date: Fri, 31 May 2024 10:48:12 -0400 (EDT)	[thread overview]
Message-ID: <1200863744.706237.1717166892907.JavaMail.zimbra@savoirfairelinux.com> (raw)
In-Reply-To: <826f6c22-d1f1-42ce-a8d1-2d5cb894a970@sirena.org.uk>

From: "Mark Brown" <broonie@kernel.org>
Sent: Friday, 31 May, 2024 15:05:28
> On Fri, May 31, 2024 at 08:46:55AM -0400, Elinor Montmasson wrote:
>> From: "Mark Brown" <broonie@kernel.org>
>> > On Fri, May 17, 2024 at 05:05:35AM -0400, Elinor Montmasson wrote:
>> >> From: "Mark Brown" <broonie@kernel.org>
>> >> > On Wed, May 15, 2024 at 03:54:09PM +0200, Elinor Montmasson wrote:
> 
>> >> >> +		struct clk *cpu_sysclk = clk_get(&pdev->dev, "cpu_sysclk");
>> >> >> +		if (!IS_ERR(cpu_sysclk)) {
>> >> >> +			priv->cpu_priv.sysclk_freq[TX] = clk_get_rate(cpu_sysclk);
>> >> >> +			priv->cpu_priv.sysclk_freq[RX] = priv->cpu_priv.sysclk_freq[TX];
>> >> >> +			clk_put(cpu_sysclk);
>> >> >> +		}
> 
>> >> > I don't really understand the goal here - this is just reading whatever
>> >> > frequency happens to be set in the hardware when the driver starts up
>> >> > which if nothing else seems rather fragile?
> 
>> >> The driver allow to set the sysclk frequency
>> >> of the CPU DAI through `priv->cpu_priv.sysclk_freq` when calling
>> >> `fsl_asoc_card_hw_params()`.
>> >> Currently it is hard-coded per use-case in the driver.
> 
>> >> My reasoning was that with a generic codec/compatible, there might
>> >> be use-cases needing to use this parameter, so I exposed it here via DT.
>> > 
>> >> Is it a bad idea to expose this parameter ? This is not a requirement for the
>> >> driver to work, most of the current compatibles do not use this parameter.
>> >> It is currently used only for `fsl,imx-audio-cs42888`.
>> >> In that case I can remove this commit.
> 
>> > I'm having a hard time connecting your reply here with my comment.  This
>> > isn't as far as I can see allowing the frequency to be explicitly
>> > configured, it's just using whatever value happens to be programmed in
>> > the clock when the driver starts.
> 
>> In v3 I used parameters `cpu-sysclk-freq-rx/tx` to explicitly
>> set the frequency.
>> In its review Rob Herring said that the clock bindings should
>> be used, so that's why I changed it to use this `cpu_sysclk` clock.
> 
> So you're trying to use this as the audio clock?  There's no code that
> enables the clock which seems worrying, and I'd expect that if the
> device is using it's own clock the device would be querying it directly
> via the clock API rather than this.  This all seems really confused.

It's not specifically the audio clock, I am merely using this
in the machine driver to let the user the possibility
to configure the CPU DAI sysclock frequency.
The CPU DAI and codec drivers already manage their
own clocks.

I agree it is confused, I am trying to expose a driver option
for this generic compatible without really knowing a use case where it
would be needed.
With the S/PDIF it isn't needed, so I should probably remove this commit.

  reply	other threads:[~2024-05-31 14:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 13:54 [PATCHv4 0/9] ASoC: fsl-asoc-card: compatibility integration of a generic codec use case for use with S/PDIF controller Elinor Montmasson
2024-05-15 13:54 ` [PATCHv4 1/9] ASoC: fsl-asoc-card: add support for dai links with multiple codecs Elinor Montmasson
2024-05-15 13:54 ` [PATCHv4 2/9] ASoC: fsl-asoc-card: add second dai link component for codecs Elinor Montmasson
2024-05-15 13:54 ` [PATCHv4 3/9] ASoC: fsl-asoc-card: add compatibility to use 2 codecs in dai-links Elinor Montmasson
2024-05-15 13:54 ` [PATCHv4 4/9] ASoC: fsl-asoc-card: add new compatible for a generic codec use case Elinor Montmasson
2024-05-15 13:54 ` [PATCHv4 5/9] ASoC: fsl-asoc-card: set generic codec as clock provider Elinor Montmasson
2024-05-15 13:54 ` [PATCHv4 6/9] ASoC: fsl-asoc-card: add use of devicetree TDM slot properties Elinor Montmasson
2024-05-15 13:54 ` [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec Elinor Montmasson
2024-05-16 12:13   ` Mark Brown
2024-05-17  9:05     ` Elinor Montmasson
2024-05-17 11:17       ` Mark Brown
2024-05-31 12:46         ` Elinor Montmasson
2024-05-31 13:05           ` Mark Brown
2024-05-31 14:48             ` Elinor Montmasson [this message]
2024-05-31 16:55               ` Mark Brown
2024-05-15 13:54 ` [PATCHv4 8/9] ASoC: fsl-asoc-card: add DT property "cpu-system-clock-direction-out" Elinor Montmasson
2024-05-16 12:18   ` Mark Brown
2024-05-17  9:05     ` Elinor Montmasson
2024-05-17 11:06       ` Mark Brown
2024-05-31 12:47         ` Elinor Montmasson
2024-05-31 13:09           ` Mark Brown
2024-05-15 13:54 ` [PATCHv4 9/9] ASoC: dt-bindings: fsl-asoc-card: add compatible for generic codec Elinor Montmasson
2024-05-16 12:11   ` Mark Brown
2024-05-17  9:05     ` Elinor Montmasson
2024-05-17 11:11       ` Mark Brown
2024-05-31 12:48         ` Elinor Montmasson
2024-05-31 13:14           ` Mark Brown
2024-05-31 14:48             ` Elinor Montmasson
2024-05-31 16:06               ` Mark Brown
2024-06-06 15:39                 ` Elinor Montmasson
2024-05-20 18:31   ` Rob Herring
2024-05-31 12:48     ` Elinor Montmasson

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=1200863744.706237.1717166892907.JavaMail.zimbra@savoirfairelinux.com \
    --to=elinor.montmasson@savoirfairelinux.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=shengjiu.wang@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).