• Pratyush Yadav's avatar
    spi: dt-bindings: add schema listing peripheral-specific properties · 8762b07c
    Pratyush Yadav authored
    Many SPI controllers need to add properties to peripheral devices. This
    could be the delay in clock or data lines, etc. These properties are
    controller specific but need to be defined in the peripheral node
    because they are per-peripheral and there can be multiple peripherals
    attached to a controller.
    
    If these properties are not added to the peripheral binding, then the
    dtbs check emits a warning. But these properties do not make much sense
    in the peripheral binding because they are controller-specific and they
    will just pollute every peripheral binding. So this binding is added to
    collect all such properties from all such controllers. Peripheral
    bindings should simply refer to this binding and they should be rid of
    the warnings.
    
    There are some limitations with this approach. Firstly, there is no way
    to specify required properties. The schema contains properties for all
    controllers and there is no way to know which controller is being used.
    Secondly, there is no way to restrict additional properties. Since this
    schema will be used with an allOf operator, additionalProperties needs
    to be true. In addition, the peripheral schema will have to set
    unevaluatedProperties: false.
    
    Despite these limitations, this appears to be the best solution to this
    problem that doesn't involve modifying existing tools or schema specs.
    Signed-off-by: default avatarPratyush Yadav <p.yadav@ti.com>
    Reviewed-by: default avatarRob Herring <robh@kernel.org>
    Link: https://lore.kernel.org/r/20211109181911.2251-2-p.yadav@ti.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    8762b07c
spi-controller.yaml 3.75 KB