Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: serial: add common properties schema for UART children

Properties should be defined in only one place, thus add new
serial-peripheral-props.yaml schema with definition of common properties
for UART-connected devices (children of UART controller): current-speed
and max-speed. The schema can be referenced by individual devices using
these properties.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240811-dt-bindings-serial-peripheral-props-v1-2-1dba258b7492@linaro.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Rob Herring (Arm)
89b96e32 02929075

+42 -22
+41
Documentation/devicetree/bindings/serial/serial-peripheral-props.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/serial/serial-peripheral-props.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Common Properties for Serial-attached Devices 8 + 9 + maintainers: 10 + - Rob Herring <robh@kernel.org> 11 + - Greg Kroah-Hartman <gregkh@linuxfoundation.org> 12 + 13 + description: 14 + Devices connected over serial/UART, expressed as children of a serial 15 + controller, might need similar properties, e.g. for configuring the baud 16 + rate. 17 + 18 + properties: 19 + max-speed: 20 + $ref: /schemas/types.yaml#/definitions/uint32 21 + description: 22 + The maximum baud rate the device operates at. 23 + This should only be present if the maximum is less than the slave 24 + device can support. For example, a particular board has some 25 + signal quality issue or the host processor can't support higher 26 + baud rates. 27 + 28 + current-speed: 29 + $ref: /schemas/types.yaml#/definitions/uint32 30 + description: | 31 + The current baud rate the device operates at. 32 + This should only be present in case a driver has no chance to know 33 + the baud rate of the slave device. 34 + Examples: 35 + * device supports auto-baud 36 + * the rate is setup by a bootloader and there is no way to reset 37 + the device 38 + * device baud rate is configured by its firmware but there is no 39 + way to request the actual settings 40 + 41 + additionalProperties: true
+1 -22
Documentation/devicetree/bindings/serial/serial.yaml
··· 93 93 type: object 94 94 then: 95 95 additionalProperties: true 96 + $ref: serial-peripheral-props.yaml# 96 97 description: 97 98 Serial attached devices shall be a child node of the host UART device 98 99 the slave device is attached to. It is expected that the attached ··· 104 103 compatible: 105 104 description: 106 105 Compatible of the device connected to the serial port. 107 - 108 - max-speed: 109 - $ref: /schemas/types.yaml#/definitions/uint32 110 - description: 111 - The maximum baud rate the device operates at. 112 - This should only be present if the maximum is less than the slave 113 - device can support. For example, a particular board has some 114 - signal quality issue or the host processor can't support higher 115 - baud rates. 116 - 117 - current-speed: 118 - $ref: /schemas/types.yaml#/definitions/uint32 119 - description: | 120 - The current baud rate the device operates at. 121 - This should only be present in case a driver has no chance to know 122 - the baud rate of the slave device. 123 - Examples: 124 - * device supports auto-baud 125 - * the rate is setup by a bootloader and there is no way to reset 126 - the device 127 - * device baud rate is configured by its firmware but there is no 128 - way to request the actual settings 129 106 130 107 required: 131 108 - compatible