devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Cc: broonie@kernel.org, lgirdwood@gmail.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org,
	kuninori.morimoto.gx@renesas.com, perex@perex.cz, tiwai@suse.com,
	alsa-devel@alsa-project.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] dt-bindings: ASoC: simple-card: Add system-clock-id property
Date: Mon, 24 Oct 2022 20:00:31 -0400	[thread overview]
Message-ID: <66c1a100-922e-4a33-e80c-fc80866acf03@linaro.org> (raw)
In-Reply-To: <hXRpArckbrXUelDdaJ3Y2SErmKiuycXt@localhost>

On 24/10/2022 19:38, Aidan MacDonald wrote:
> 
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> writes:
> 
>> On 23/10/2022 09:47, Aidan MacDonald wrote:
>>>
>>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> writes:
>>>
>>>> On 22/10/2022 12:27, Aidan MacDonald wrote:
>>>>> This is a new per-DAI property used to specify the clock ID argument
>>>>> to snd_soc_dai_set_sysclk().
>>>>
>>>> You did no show the use of this property and here you refer to some
>>>> specific Linux driver implementation, so in total this does no look like
>>>>  a hardware property.
>>>>
>>>> You also did not explain why do you need it (the most important piece of
>>>> commit msg).
>>>>
>>>>>
>>>>> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
>>>>> ---
>>>>>  Documentation/devicetree/bindings/sound/simple-card.yaml | 8 ++++++++
>>>>>  1 file changed, 8 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/sound/simple-card.yaml b/Documentation/devicetree/bindings/sound/simple-card.yaml
>>>>> index ed19899bc94b..cb7774e235d0 100644
>>>>> --- a/Documentation/devicetree/bindings/sound/simple-card.yaml
>>>>> +++ b/Documentation/devicetree/bindings/sound/simple-card.yaml
>>>>> @@ -57,6 +57,12 @@ definitions:
>>>>>        single fixed sampling rate.
>>>>>      $ref: /schemas/types.yaml#/definitions/flag
>>>>>
>>>>> +  system-clock-id:
>>>>> +    description: |
>>>>> +      Specify the clock ID used for setting the DAI system clock.
>>>>
>>>>
>>>> With lack of explanation above, I would say - use common clock framework
>>>> to choose a clock...
>>>>
>>>>
>>>> Best regards,
>>>> Krzysztof
>>>
>>> Sorry, I didn't explain things very well. The system clock ID is indeed
>>> a property of the DAI hardware. The ID is not specific to Linux in any
>>> way, and really it's an enumeration that requires a dt-binding.
>>>
>>> A DAI may support multiple system clock inputs or outputs identified by
>>> the clock ID. In the case of outputs, these could be distinct clocks
>>> that have their own I/O pins, or the clock ID could select the internal
>>> source clock used for a clock generator. For inputs, the system clock ID
>>> may inform the DAI how or where the system clock is being provided so
>>> hardware registers can be configured appropriately.
>>>
>>> Really the details do not matter, except that in a particular DAI link
>>> configuration a specific clock ID must be used. This is determined by
>>> the actual hardware connection between the DAIs; if the wrong clock is
>>> used, the DAI may not function correctly.
>>>
>>> Currently the device tree is ambiguous as to which system clock should
>>> be used when the DAI supports more than one, because there is no way to
>>> specify which clock was intended. Linux just treats the ID as zero, but
>>> that's currently a Linux-specific numbering so there's guarantee that
>>> another OS would choose the same clock as Linux.
>>>
>>> The system-clock-id property is therefore necessary to fully describe
>>> the hardware connection between DAIs in a DAI link when a DAI offers
>>> more than one choice of system clock.
>>>
>>> I will resend the patch with the above in the commit message.
>>
>> For example if you want to define which input pin to use (so you have
>> internal mux), it's quite unspecific to give them some indexes. What is
>> 0? What is 1? Number of pin? Number of pin counting from where?
>>
>> Since this is unanswered, the IDs are also driver and implementation
>> dependent, thus you still have the same problem - another OS can choose
>> different clock. That's not then a hardware description, but software
>> configuration.
>>
>> Best regards,
>> Krzysztof
> 
> I answered this already. The enumeration is arbitrary. Create some
> dt-bindings and voila, it becomes standardized and OS-independent.

Hm, then I missed something. Can you point me to DTS and bindings
(patches or in-tree) which show this standardized indices of clock inputs?

Best regards,
Krzysztof


  reply	other threads:[~2022-10-25  1:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22 16:27 [PATCH v1 1/2] ASoC: simple-card: Support custom DAI system clock IDs Aidan MacDonald
2022-10-22 16:27 ` [PATCH v1 2/2] dt-bindings: ASoC: simple-card: Add system-clock-id property Aidan MacDonald
2022-10-23 13:08   ` Krzysztof Kozlowski
2022-10-23 13:47     ` Aidan MacDonald
2022-10-24 20:46       ` Krzysztof Kozlowski
2022-10-24 23:38         ` Aidan MacDonald
2022-10-25  0:00           ` Krzysztof Kozlowski [this message]
2022-10-25  9:14             ` Aidan MacDonald
2022-10-25 12:19               ` Krzysztof Kozlowski
2022-10-26 14:48                 ` Aidan MacDonald
2022-10-26 15:03                   ` Krzysztof Kozlowski
2022-10-26 19:27                     ` Aidan MacDonald
2022-10-26 15:05   ` Krzysztof Kozlowski
2022-10-23 23:54 ` [PATCH v1 1/2] ASoC: simple-card: Support custom DAI system clock IDs Kuninori Morimoto
2022-10-24  9:18   ` Aidan MacDonald
2022-10-24 11:49 ` Mark Brown
2022-10-24 23:17   ` Aidan MacDonald
2022-10-25 11:03     ` Mark Brown
2022-10-26 14:42       ` Aidan MacDonald
2022-10-26 15:11         ` Mark Brown
2022-10-26 19:22           ` Aidan MacDonald

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=66c1a100-922e-4a33-e80c-fc80866acf03@linaro.org \
    --to=krzysztof.kozlowski@linaro.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=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --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).