Add bindings for spi-virtio based on virtio-device, allowing proper validation of SPI controller nodes declared as children of virtio transports (e.g.: virtio-mmio). Such nodes are not used to instantiate devices, which are registered by the virtio transport, but to define their properties and establish dependencies with other nodes.
The compatible follows what the virtio framework already searches for, "2d" being the hexadecimal representation of the SPI controller device ID defined by the virtio specification [1]. [1] https://docs.oasis-open.org/virtio/virtio/v1.4/virtio-v1.4.html Signed-off-by: Francesco Valla <[email protected]> --- .../devicetree/bindings/spi/spi-virtio.yaml | 46 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 47 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/spi-virtio.yaml b/Documentation/devicetree/bindings/spi/spi-virtio.yaml new file mode 100644 index 000000000000..5fc04a9c62cc --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-virtio.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/spi-virtio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Virtio SPI controller device + +maintainers: + - Francesco Valla <[email protected]> + +allOf: + - $ref: /schemas/spi/spi-controller.yaml# + - $ref: /schemas/virtio/virtio-device.yaml# + +properties: + compatible: + const: virtio,device2d + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + virtio@3000 { + compatible = "virtio,mmio"; + reg = <0x3000 0x100>; + interrupts = <41>; + + spi { + compatible = "virtio,device2d"; + + #address-cells = <1>; + #size-cells = <0>; + + sram@0 { + compatible = "microchip,mchp23k256"; + reg = <0>; + spi-max-frequency = <20000000>; + }; + }; + }; + +... diff --git a/MAINTAINERS b/MAINTAINERS index 03649f08c7c7..5724645bf703 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -29675,6 +29675,7 @@ VIRTIO SPI DRIVER M: Haixu Cui <[email protected]> L: [email protected] S: Maintained +F: Documentation/devicetree/bindings/spi/spi-virtio.yaml F: drivers/spi/spi-virtio.c F: include/uapi/linux/virtio_spi.h -- 2.56.0
