Skip to content

Commit 8fa8380

Browse files
krzkWim Van Sebroeck
authored andcommitted
dt-bindings: watchdog: samsung-wdt: Split if:then: and constrain more
Binding defined two if:then: blocks covering different conditions but not fully constraining the properties per each variant: 1. "if:" to require samsung,syscon-phandle, 2. "if:" with "else:" to narrow number of clocks and require or disallow samsung,cluster-index. This still did not cover following cases: 1. Disallow samsung,syscon-phandle when not applicable, 2. Narrow samsung,cluster-index to [0, 1], for SoCs with only two clusters. Solving this in current format would lead to spaghetti code, so re-write entire "if:then:" approach into mutually exclusive cases so each SoC appears only in one "if:" block. This allows to forbid samsung,syscon-phandle for S3C6410, and narrow samsung,cluster-index to [0, 1]. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 6a11dbf commit 8fa8380

1 file changed

Lines changed: 43 additions & 9 deletions

File tree

Documentation/devicetree/bindings/watchdog/samsung-wdt.yaml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,31 @@ allOf:
7474
contains:
7575
enum:
7676
- google,gs101-wdt
77-
- samsung,exynos5250-wdt
78-
- samsung,exynos5420-wdt
79-
- samsung,exynos7-wdt
8077
- samsung,exynos850-wdt
81-
- samsung,exynos990-wdt
8278
- samsung,exynosautov9-wdt
8379
- samsung,exynosautov920-wdt
8480
then:
81+
properties:
82+
clocks:
83+
items:
84+
- description: Bus clock, used for register interface
85+
- description: Source clock (driving watchdog counter)
86+
clock-names:
87+
items:
88+
- const: watchdog
89+
- const: watchdog_src
90+
samsung,cluster-index:
91+
enum: [0, 1]
8592
required:
93+
- samsung,cluster-index
8694
- samsung,syscon-phandle
95+
8796
- if:
8897
properties:
8998
compatible:
9099
contains:
91100
enum:
92-
- google,gs101-wdt
93-
- samsung,exynos850-wdt
94101
- samsung,exynos990-wdt
95-
- samsung,exynosautov9-wdt
96-
- samsung,exynosautov920-wdt
97102
then:
98103
properties:
99104
clocks:
@@ -106,7 +111,35 @@ allOf:
106111
- const: watchdog_src
107112
required:
108113
- samsung,cluster-index
109-
else:
114+
- samsung,syscon-phandle
115+
116+
- if:
117+
properties:
118+
compatible:
119+
contains:
120+
enum:
121+
- samsung,exynos5250-wdt
122+
- samsung,exynos5420-wdt
123+
- samsung,exynos7-wdt
124+
then:
125+
properties:
126+
clocks:
127+
items:
128+
- description: Bus clock, which is also a source clock
129+
clock-names:
130+
items:
131+
- const: watchdog
132+
samsung,cluster-index: false
133+
required:
134+
- samsung,syscon-phandle
135+
136+
- if:
137+
properties:
138+
compatible:
139+
contains:
140+
enum:
141+
- samsung,s3c6410-wdt
142+
then:
110143
properties:
111144
clocks:
112145
items:
@@ -115,6 +148,7 @@ allOf:
115148
items:
116149
- const: watchdog
117150
samsung,cluster-index: false
151+
samsung,syscon-phandle: false
118152

119153
unevaluatedProperties: false
120154

0 commit comments

Comments
 (0)