yaml schema and sub-nodes with vendor prefixes

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

 



Hi,

I'm trying to convert Xilinx XADC devicetree bindings[1] description to yaml format. And I'm running into issue with describing a sub-node with a vendor prefix.

A typical devicetree entry for the XADC looks like

    xadc@43200000 {
        compatible = "xlnx,axi-xadc-1.00.a";

        xlnx,channels {
            #address-cells = <1>;
            #size-cells = <0>;
            channel@0 {
                reg = <0>;
                xlnx,bipolar;
            };
        };
    };

So there is the 'xlnx,channels' sub-node which contains a set of other nodes which represent the individual channels.

The way I'm trying to describe it in the yaml file is like

 xlnx,channels:
    description: Node containing all the channel nodes
    type: object
    properties:
      '#address-cells':
         const: 1
      '#size-cells':
         const: 0

    patternProperties:
      "^channel@([0-9]|1[0-6])$":
        type: object
        properties:
          reg:
            description: ...
          xlnx,bipolar:
            description: If set the channel is used in bipolar mode.
            type: boolean
        required:
          - reg
        additionalProperties: false

    required:
      - '#address-cells'
      - '#size-cells'
    additionalProperties: false

This now fails validation, presumably because there is no match in meta-schemas/vendor-props.yaml. If I drop the vendor prefix from the property name validation passes. I can also make validation pass by adding an arbitrary $ref property, but there is no 'node' type in types.yaml.

What's the best way to describe a node with a vendor prefix?

Thanks,

- Lars

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux