Re: [PATCH 5/7] ASoC: renesas: add MSIOF sound Documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux