public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Cc: krzysztof.kozlowski+dt@linaro.org, alsa-devel@alsa-project.org,
	perex@perex.cz, paul@crapouillou.net, robh+dt@kernel.org,
	broonie@kernel.org, tsbogend@alpha.franken.de,
	linux-mips@vger.kernel.org, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, tiwai@suse.com,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v1 1/3] dt-bindings: ingenic,aic: Remove unnecessary clocks from schema
Date: Mon, 31 Oct 2022 13:46:10 -0500	[thread overview]
Message-ID: <166724196894.3242676.3402578757445878857.robh@kernel.org> (raw)
In-Reply-To: <20221028103418.17578-2-aidanmacdonald.0x0@gmail.com>


On Fri, 28 Oct 2022 11:34:16 +0100, Aidan MacDonald wrote:
> The AIC needs only the first two clocks: "aic" is a gate that's used
> for gating the I2S controller when it's suspended, and "i2s" is the
> system clock, from which the bit and frame clocks are derived. Both
> clocks are therefore reasonably part of the AIC and should be passed
> to the OS.
> 
> But the "ext" and "pll half" clocks are a little more questionable.
> It appears these bindings were introduced when the schema was first
> converted to YAML, but weren't present in the original .txt binding.
> They are intended to be the possible parent clocks of "i2s".
> 
> The JZ4770 actually has three parents for its "i2s" clock, named
> "ext", "pll0", and "pll1" in the Linux driver. The JZ4780 has two
> parents but it doesn't have a "pll half" clock, instead it has an
> "i2s_pll" clock which behaves much differently to the actual
> "pll half" clock found on the JZ4740 & JZ4760. And there are other
> Ingenic SoCs that share the JZ4780's clock layout, eg, the X1000.
> 
> Therefore, the bindings aren't really adequate for the JZ4770 and
> a bit misleading for the JZ4780. Either we should fix the bindings,
> or remove them entirely.
> 
> This patch opts to remove the bindings. There is a good case to be
> made that "ext" and "pll half" don't belong here because they aren't
> directly used by the AIC. They are only used to set the parent of
> the "i2s" clock; they have no other effect on the AIC.
> 
> A good way to think of it is in terms of how the AIC constrains
> clocks. The AIC can only generate the bit & frame clocks from the
> system clock in certain ratios. Setting the sample rate effectively
> constrains the frame clock, which, because of the clock dividers
> controlled by the AIC, translates to constraints on the "i2s" clock.
> Nothing in the AIC imposes a direct constraint on the parents of
> the "i2s" clock, and the AIC does not need to enable or disable
> the parents directly, so in principle the AIC doesn't need to be
> aware of the parent clocks at all.
> 
> The choice of parent clock is still important, but the AIC doesn't
> have enough information to apply such constraints itself. The sound
> card does have that information because it knows how the AIC is
> connected to other components. We need to use other DT mechanisms
> to communicate those constraints at the sound card level, instead
> of passing the clocks through to the AIC, and inventing ad-hoc ways
> to plumb the constraints around behind the scenes.
> 
> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
> ---
>  .../devicetree/bindings/sound/ingenic,aic.yaml         | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

  parent reply	other threads:[~2022-10-31 18:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 10:34 [PATCH v1 0/3] ASoC: jz4740-i2s: Remove .set_sysclk() & friends Aidan MacDonald
2022-10-28 10:34 ` [PATCH v1 1/3] dt-bindings: ingenic,aic: Remove unnecessary clocks from schema Aidan MacDonald
2022-10-30 11:56   ` Paul Cercueil
2022-10-31 12:15   ` Mark Brown
2022-10-31 18:46   ` Rob Herring [this message]
2022-10-28 10:34 ` [PATCH v1 2/3] mips: dts: ingenic: Remove unnecessary AIC clocks Aidan MacDonald
2022-10-28 10:34 ` [PATCH v1 3/3] ASoC: jz4740-i2s: Remove .set_sysclk() Aidan MacDonald
2022-10-30 11:58   ` Paul Cercueil
2022-10-31 18:59 ` (subset) [PATCH v1 0/3] ASoC: jz4740-i2s: Remove .set_sysclk() & friends Mark Brown

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=166724196894.3242676.3402578757445878857.robh@kernel.org \
    --to=robh@kernel.org \
    --cc=aidanmacdonald.0x0@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.com \
    --cc=tsbogend@alpha.franken.de \
    /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