public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* Re: [PATCH 5/7] dt-bindings: trivial-devices: Add IOT2050 Arduino SPI connector
       [not found] ` <7838d99a1795337c73f480fafcbf698fc17d16dd.1698413678.git.jan.kiszka@siemens.com>
@ 2023-10-30 16:43   ` Rob Herring
  2023-10-30 17:35     ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2023-10-30 16:43 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Krzysztof Kozlowski, linux-arm-kernel, linux-kernel, devicetree,
	Bao Cheng Su, Benedikt Niedermayr

On Fri, Oct 27, 2023 at 03:34:36PM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> On the Siemens IOT2050 devices, the SPI controller wired to the Arduino
> connector is normally driven by userspace. Introduce a binding for use
> by spidev.

What's spidev? Not a h/w device...


> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> index 430a814f64a5..01b9f36afcd5 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -349,6 +349,8 @@ properties:
>            - silabs,si3210
>              # Relative Humidity and Temperature Sensors
>            - silabs,si7020
> +            # Siemens IOT2050: SPI interface on Arduino connector
> +          - siemens,iot2050-arduino-spi

How is this specific to your board? Presumably, an 'Arduino connector' 
is a somewhat standard interface, right? If every board with an Arduino 
connector adds a compatible, this doesn't scale.

A connector is what you should be describing, but I imagine it is not 
just SPI. Here's some past discussions[1][2] on the need for connector 
bindings.

Rob


[1] https://lore.kernel.org/all/20220421094421.288672-1-michael@walle.cc/
[2] https://lore.kernel.org/all/CAL_JsqK2DKPbaFvUPSU2E7oh1_pryrRXPMg8OASmK722jmznwA@mail.gmail.com/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 5/7] dt-bindings: trivial-devices: Add IOT2050 Arduino SPI connector
  2023-10-30 16:43   ` [PATCH 5/7] dt-bindings: trivial-devices: Add IOT2050 Arduino SPI connector Rob Herring
@ 2023-10-30 17:35     ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2023-10-30 17:35 UTC (permalink / raw)
  To: Rob Herring
  Cc: Nishanth Menon, Vignesh Raghavendra, Tero Kristo,
	Krzysztof Kozlowski, linux-arm-kernel, linux-kernel, devicetree,
	Bao Cheng Su, Benedikt Niedermayr

On 30.10.23 17:43, Rob Herring wrote:
> On Fri, Oct 27, 2023 at 03:34:36PM +0200, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> On the Siemens IOT2050 devices, the SPI controller wired to the Arduino
>> connector is normally driven by userspace. Introduce a binding for use
>> by spidev.
> 
> What's spidev? Not a h/w device...
> 
> 
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>  Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
>> index 430a814f64a5..01b9f36afcd5 100644
>> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
>> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
>> @@ -349,6 +349,8 @@ properties:
>>            - silabs,si3210
>>              # Relative Humidity and Temperature Sensors
>>            - silabs,si7020
>> +            # Siemens IOT2050: SPI interface on Arduino connector
>> +          - siemens,iot2050-arduino-spi
> 
> How is this specific to your board? Presumably, an 'Arduino connector' 
> is a somewhat standard interface, right? If every board with an Arduino 
> connector adds a compatible, this doesn't scale.
> 
> A connector is what you should be describing, but I imagine it is not 
> just SPI. Here's some past discussions[1][2] on the need for connector 
> bindings.

Right, we are not alone with this modelling problem on our board. The
code talking to the SPI devices is inside applications, the kernel just
needs to pave the way to the interface. However, you can't define that
path without bending of the DT. This is specific to at least SPI, maybe
some other buses without probing as well.

If this were a PCI device, no problem: tell vfio-pci or uio_pci_generic
to be responsible as well (add IDs on the fly), bind bind any of them
and then let userspace handle things. Same why to go back to an
in-kernel driver. No bothering of the DT regarding how the final device
is driven.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-30 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1698413678.git.jan.kiszka@siemens.com>
     [not found] ` <7838d99a1795337c73f480fafcbf698fc17d16dd.1698413678.git.jan.kiszka@siemens.com>
2023-10-30 16:43   ` [PATCH 5/7] dt-bindings: trivial-devices: Add IOT2050 Arduino SPI connector Rob Herring
2023-10-30 17:35     ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox