Skip to content

Commit b0ef97a

Browse files
robherringbroonie
authored andcommitted
spi: dt-bindings: arm,pl022: Move child node properties to separate schema
In order to validate SPI peripherals, SPI controller-specific child node properties need to be in a separate schema, spi-peripheral-props.yaml, which SPI peripheral schemas reference. Move the arm,pl022 child properties to their own schema file and add a $ref in spi-peripheral-props.yaml. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent fd811b6 commit b0ef97a

File tree

3 files changed

+62
-51
lines changed

3 files changed

+62
-51
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/spi/arm,pl022-peripheral-props.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Peripheral-specific properties for Arm PL022 SPI controller
8+
9+
maintainers:
10+
- Linus Walleij <[email protected]>
11+
12+
select: false
13+
14+
properties:
15+
pl022,interface:
16+
description: SPI interface type
17+
$ref: /schemas/types.yaml#/definitions/uint32
18+
enum:
19+
- 0 # SPI
20+
- 1 # Texas Instruments Synchronous Serial Frame Format
21+
- 2 # Microwire (Half Duplex)
22+
23+
pl022,com-mode:
24+
description: Specifies the transfer mode
25+
$ref: /schemas/types.yaml#/definitions/uint32
26+
enum:
27+
- 0 # interrupt mode
28+
- 1 # polling mode
29+
- 2 # DMA mode
30+
default: 1
31+
32+
pl022,rx-level-trig:
33+
description: Rx FIFO watermark level
34+
$ref: /schemas/types.yaml#/definitions/uint32
35+
minimum: 0
36+
maximum: 4
37+
38+
pl022,tx-level-trig:
39+
description: Tx FIFO watermark level
40+
$ref: /schemas/types.yaml#/definitions/uint32
41+
minimum: 0
42+
maximum: 4
43+
44+
pl022,ctrl-len:
45+
description: Microwire interface - Control length
46+
$ref: /schemas/types.yaml#/definitions/uint32
47+
minimum: 0x03
48+
maximum: 0x1f
49+
50+
pl022,wait-state:
51+
description: Microwire interface - Wait state
52+
$ref: /schemas/types.yaml#/definitions/uint32
53+
enum: [0, 1]
54+
55+
pl022,duplex:
56+
description: Microwire interface - Full/Half duplex
57+
$ref: /schemas/types.yaml#/definitions/uint32
58+
enum: [0, 1]
59+
60+
additionalProperties: true
61+
...

Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ properties:
115115

116116
# The controller specific properties go here.
117117
allOf:
118+
- $ref: arm,pl022-peripheral-props.yaml#
118119
- $ref: cdns,qspi-nor-peripheral-props.yaml#
119120
- $ref: samsung,spi-peripheral-props.yaml#
120121
- $ref: nvidia,tegra210-quad-peripheral-props.yaml#

Documentation/devicetree/bindings/spi/spi-pl022.yaml

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -74,57 +74,6 @@ properties:
7474
resets:
7575
maxItems: 1
7676

77-
patternProperties:
78-
"^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-f]+$":
79-
type: object
80-
# SPI slave nodes must be children of the SPI master node and can
81-
# contain the following properties.
82-
properties:
83-
pl022,interface:
84-
description: SPI interface type
85-
$ref: /schemas/types.yaml#/definitions/uint32
86-
enum:
87-
- 0 # SPI
88-
- 1 # Texas Instruments Synchronous Serial Frame Format
89-
- 2 # Microwire (Half Duplex)
90-
91-
pl022,com-mode:
92-
description: Specifies the transfer mode
93-
$ref: /schemas/types.yaml#/definitions/uint32
94-
enum:
95-
- 0 # interrupt mode
96-
- 1 # polling mode
97-
- 2 # DMA mode
98-
default: 1
99-
100-
pl022,rx-level-trig:
101-
description: Rx FIFO watermark level
102-
$ref: /schemas/types.yaml#/definitions/uint32
103-
minimum: 0
104-
maximum: 4
105-
106-
pl022,tx-level-trig:
107-
description: Tx FIFO watermark level
108-
$ref: /schemas/types.yaml#/definitions/uint32
109-
minimum: 0
110-
maximum: 4
111-
112-
pl022,ctrl-len:
113-
description: Microwire interface - Control length
114-
$ref: /schemas/types.yaml#/definitions/uint32
115-
minimum: 0x03
116-
maximum: 0x1f
117-
118-
pl022,wait-state:
119-
description: Microwire interface - Wait state
120-
$ref: /schemas/types.yaml#/definitions/uint32
121-
enum: [0, 1]
122-
123-
pl022,duplex:
124-
description: Microwire interface - Full/Half duplex
125-
$ref: /schemas/types.yaml#/definitions/uint32
126-
enum: [0, 1]
127-
12877
required:
12978
- compatible
13079
- reg

0 commit comments

Comments
 (0)