• André Draszik's avatar
    dt-bindings: serial: samsung: avoid duplicating permitted clock-names · 9da89fe1
    André Draszik authored
    This binding currently duplicates the permitted clock-names in various
    places, and when adding more compatibles, clock-names will have to be
    duplicated even more.
    
    The reason is:
    1) subschemas (-if: ...), still have to match the top-level:
           pattern: '^clk_uart_baud[0-3]$'
    2) there is one compatible that doesn't follow sequential numbering for
       the clock names (samsung,s3c6400-uart)
    3) when limiting the number of clock-names, we also want to enforce
       sequential names
    Because of 1) and 2), the patterns can not simply be changed to
    constant strings, and later overridden in a different subschema (for
    samsung,s3c6400-uart only).
    
    Since we can't populate the top-level clock-names based on the
    compatible, and because when limiting the number of items we generally
    want sequential numbers and not a pattern, move the permitted strings
    into a subschema of its own and populate it based on the compatible:
        * 'uart clk_uart_baud2 clk_uart_baud3' for the one outlier
        * 'uart clk_uart_baud0..3' for everything else
    
    This way we can avoid having to duplicate the permitted names
    everywhere.
    
    While at it, add blank lines as per the universal style, which is to
    have blank lines between properties, except where they are booleans.
    
    Also add another example using a compatible that uses the default
    clock-names scheme, as opposed to the existing example that uses
    samsung,s3c6400-uart's non-default clock-names. This allows testing
    both versions of the clock-names property when running
    dt_binding_check.
    Reviewed-by: default avatarRob Herring (Arm) <robh@kernel.org>
    Signed-off-by: default avatarAndré Draszik <andre.draszik@linaro.org>
    Link: https://lore.kernel.org/r/20240725-gs101-uart-binding-v5-1-e237be8253a9@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    9da89fe1
samsung_uart.yaml 4.66 KB