Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Takashi Iwai <tiwai@suse.com>,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-sound@vger.kernel.org, linux-spi@vger.kernel.org
Subject: Re: [PATCH 5/7] ASoC: renesas: add MSIOF sound Documentation
Date: Wed, 9 Apr 2025 14:08:56 +0200	[thread overview]
Message-ID: <41954d00-0abe-40ea-8d8a-2201e6e75743@kernel.org> (raw)
In-Reply-To: <CAMuHMdWto+2Kyecc5B+PvcF6+fXkmLf-skpX+rmRb3O68bbeAQ@mail.gmail.com>

On 09/04/2025 10:09, Geert Uytterhoeven wrote:
>>>>
>>>> If you have duplicated compatibles then:
>>>> 1. It rarely makes sense because you claim that two different devices
>>>> are using the same compatible. Different device, different compatible.
>>>> 2. Or if this is really same device, then only one schema.
>>>
>>> This the same device, but it can be used in two (actually more)
>>> different modes: SPI and I2S.  Hence it has two separate DT binding
>>> documents.  If this needs to be merged (the result is gonna be ugly):
>>
>> ... then next time don't post incomplete bindings. I know we do not have
> 
> :-)
> 
>> time machine, but any mess is on contributors who posted some limited
>> scope/view of the hardware entirely ignoring the rest of interfaces.
> 
> This is the first time someone implemented I2S using MSIOF on a system
> intended to run Linux.  Note that MSIOF is not even limited to SPI and
> I2S.  It can be used as a generic synchronous serial interface, too. So

So like a serial engine for UART/I2C/SPI? I think all or most of new
SoCs since few years switched to these.

> far no one did under Linux, so it is not reflected yet in the bindings.
> MSIOF is also used to provide a clock signal to a PMIC on some older
> R-Car boards.  As that PMIC has no upstream Linux driver, no one ever
> implemented support for this mode in Linux.  So I guess I should be
> pro-active, and add #clock-cells to the unified MSIOF DT bindings, too?

Yes, probably. Although missing cells is easy to change but missing
protocol, like this patchset here, is quite more challenging.


> 
> Note that there are other devices to consider, too. E.g. SCIF can
> not only be used as a UART, but also as a USART, SPI, or even I2C
> controller... (currently Linux with DT supports the UART personality only,
> but drivers/spi/spi-sh-sci.c does exist for SH).

Just like all serial engines for all other SoCs and there are no
problems with them... Why is this somehow different?

> 
>>> where to fit it in the DT binding doc hierarchy?
>>
>> Does not matter, whatever fits better in overal picture/purpose of this
>> device.
> 
> OK, hence the existing SPI bindings....
> 
>>>>> +  dmas:
>>>>> +    minItems: 2
>>>>> +    maxItems: 4
>>>>
>>>> Why flexible?
>>>>
>>>>> +
>>>>> +  dma-names:
>>>>> +    minItems: 2
>>>>> +    maxItems: 4
>>>>> +    items:
>>>>> +      enum: [ tx, rx ]
>>>>
>>>> How would that work? tx rx tx rx? And then driver requests 'tx' (by
>>>> name) and what is supposed to be returned?
>>>
>>> The module may be connected to one or more DMA controllers (see below).
>>
>> Yes, but how the implementation would work?
>>
>> Anyway, this needs to be strictly ordered, not random rx rx tx tx or rx
>> rx rx rx.
> 
> Why?

Because that's the standard DT rule, so unless, you come with a need to
bypass the rule, standard applies. Why? Because implementations can use
one of two ABIs - name or index - and binding should allow it. The names
are for cases where entries are optional in the middle, so you cannot
use index. Only for that. You cannot use that exception and make a
standard case "now I want flexibility everywhere". No. Flexibility is
only for special cases.

> 
>>>>> +
>>>>> +    msiof1: serial@e6ea0000 {
>>>>
>>>> serial means UART controller. You need name matching the class of the
>>>> device.
>>>> Node names should be generic. See also an explanation and list of
>>>> examples (not exhaustive) in DT specification:
>>>> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
>>>
>>> What is the recommend generic node name for a flexible serial device
>>> that can operate as (a.o.) either SPI or I2S controller?
>>
>> i2s
>> or even not so generic msiof, but definitely not serial because that is
>> reserved for UART.
> 
> The MSIOF device node lives in the SoC-specific .dtsi file.  Its use
> case is not known in that file, and specified only in the board
> .dts file.

sure, so call it serial-engine. or msiof.

Not serial. Why? well, I said twice - it is reserved by dtschema for serial.


Best regards,
Krzysztof

  reply	other threads:[~2025-04-09 12:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  1:04 [PATCH 0/7] ASoC: add Renesas MSIOF sound driver Kuninori Morimoto
2025-03-18  2:06 ` [PATCH 1/7] spi: renesas,sh-msiof: Living separately from MSIOF I2S Sound Kuninori Morimoto
2025-04-09  6:31   ` Krzysztof Kozlowski
2025-04-09 23:19     ` Kuninori Morimoto
2025-04-10  5:48       ` Krzysztof Kozlowski
2025-04-09  1:05 ` [PATCH 2/7] spi: sh-msiof: ignore driver probing if it was MSIOF Sound Kuninori Morimoto
2025-04-09  7:09   ` Geert Uytterhoeven
2025-04-09 23:31     ` Kuninori Morimoto
2025-04-09  1:05 ` [PATCH 3/7] ASoC: rsnd: allow to use ADG only Kuninori Morimoto
2025-04-09  1:05 ` [PATCH 4/7] ASoC: rsnd: enable to use "adg" clock Kuninori Morimoto
2025-04-09  1:05 ` [PATCH 5/7] ASoC: renesas: add MSIOF sound Documentation Kuninori Morimoto
2025-04-09  6:37   ` Krzysztof Kozlowski
2025-04-09  7:01     ` Geert Uytterhoeven
2025-04-09  7:52       ` Krzysztof Kozlowski
2025-04-09  8:09         ` Geert Uytterhoeven
2025-04-09 12:08           ` Krzysztof Kozlowski [this message]
2025-04-09  7:41     ` Krzysztof Kozlowski
2025-04-10  0:49       ` Kuninori Morimoto
2025-04-10  5:46         ` Krzysztof Kozlowski
2025-04-10  7:02           ` Kuninori Morimoto
2025-04-09  1:05 ` [PATCH 6/7] ASoC: renesas: add MSIOF sound support Kuninori Morimoto
2025-04-09  6:38   ` Krzysztof Kozlowski
2025-04-09 23:25     ` Kuninori Morimoto
2025-04-10  5:45       ` Krzysztof Kozlowski
2025-04-10  6:29         ` Kuninori Morimoto
2025-04-10  6:33           ` Krzysztof Kozlowski
2025-04-09  7:28   ` Geert Uytterhoeven
2025-04-09 23:45     ` Kuninori Morimoto
2025-04-10  2:37       ` Kuninori Morimoto
2025-04-10  7:39         ` Geert Uytterhoeven
2025-04-10 23:04           ` Kuninori Morimoto
2025-04-10  7:47       ` Geert Uytterhoeven
2025-04-10 23:08         ` Kuninori Morimoto
2025-04-09  1:05 ` [PATCH 7/7] arm64: dts: renesas: sparrow hawk: Add MSIOF Sound support Kuninori Morimoto

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=41954d00-0abe-40ea-8d8a-2201e6e75743@kernel.org \
    --to=krzk@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@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