Thread (1 message) 1 message, 1 author, 2021-07-14

Re: [PATCH 1/5] dt-bindings: virtio: mmio: Add support for device subnode

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2021-07-14 02:28:44
Also in: linux-devicetree, lkml

On 13-07-21, 14:32, Arnd Bergmann wrote:
On Tue, Jul 13, 2021 at 12:51 PM Viresh Kumar [off-list ref] wrote:
quoted
+
+    virtio@3200 {
+        compatible = "virtio,mmio";
+        reg = <0x3200 0x100>;
+        interrupts = <43>;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        i2c-virtio@0 {
+            reg = <VIRTIO_ID_I2C_ADAPTER>;
+        };
+    };
This works, but it seems oddly inconsistent with the way we do the same thing
for PCI, USB and MMC devices that normally don't need device tree properties but
can optionally have those.

All of the above use the "compatible" property to identify the device,
rather than
using the "reg" property. Neither of them is actually great here,
since we already
know what the device is and how to talk to it, but I'd still prefer doing this
with

       compatible = "virtio,34";

or similar, where 34 is the numerical value of VIRTIO_ID_I2C_ADAPTER.
This would then be required in the virtio-i2c binding.
I think you can skip the #address-cells/#size-cells then.
That works, sure.

I think I misunderstood it when you said it earlier and thought that
you are asking to add compatible in the parent node itself and so did
it this way.

Though that may be the way we will end up doing it now :)

-- 
viresh
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help