Skip to content

Commit 89b96e3

Browse files
krzkrobherring
authored andcommitted
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 <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/20240811-dt-bindings-serial-peripheral-props-v1-2-1dba258b7492@linaro.org Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 0292907 commit 89b96e3

File tree

2 files changed

+42
-22
lines changed

2 files changed

+42
-22
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 <[email protected]>
11+
- Greg Kroah-Hartman <[email protected]>
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

Documentation/devicetree/bindings/serial/serial.yaml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ patternProperties:
9393
type: object
9494
then:
9595
additionalProperties: true
96+
$ref: serial-peripheral-props.yaml#
9697
description:
9798
Serial attached devices shall be a child node of the host UART device
9899
the slave device is attached to. It is expected that the attached
@@ -104,28 +105,6 @@ patternProperties:
104105
description:
105106
Compatible of the device connected to the serial port.
106107

107-
max-speed:
108-
$ref: /schemas/types.yaml#/definitions/uint32
109-
description:
110-
The maximum baud rate the device operates at.
111-
This should only be present if the maximum is less than the slave
112-
device can support. For example, a particular board has some
113-
signal quality issue or the host processor can't support higher
114-
baud rates.
115-
116-
current-speed:
117-
$ref: /schemas/types.yaml#/definitions/uint32
118-
description: |
119-
The current baud rate the device operates at.
120-
This should only be present in case a driver has no chance to know
121-
the baud rate of the slave device.
122-
Examples:
123-
* device supports auto-baud
124-
* the rate is setup by a bootloader and there is no way to reset
125-
the device
126-
* device baud rate is configured by its firmware but there is no
127-
way to request the actual settings
128-
129108
required:
130109
- compatible
131110

0 commit comments

Comments
 (0)