Skip to content

Commit 2eacc84

Browse files
khayash1broonie
authored andcommitted
regulator: uniphier: Clean up clocks, resets, and their names using compatible string
Instead of "oneOf:" choices, use "allOf:" and "if:" to define clocks, resets, and their names that can be taken by the compatible string. The order of clock-names and reset-names doesn't change here. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/1649145303-30221-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 266d57d commit 2eacc84

1 file changed

Lines changed: 38 additions & 17 deletions

File tree

Documentation/devicetree/bindings/regulator/socionext,uniphier-regulator.yaml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ description: |
1414
maintainers:
1515
- Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
1616

17-
allOf:
18-
- $ref: "regulator.yaml#"
19-
2017
# USB3 Controller
2118

2219
properties:
@@ -36,25 +33,49 @@ properties:
3633
minItems: 1
3734
maxItems: 2
3835

39-
clock-names:
40-
oneOf:
41-
- items: # for Pro4, Pro5
42-
- const: gio
43-
- const: link
44-
- items: # for others
45-
- const: link
36+
clock-names: true
4637

4738
resets:
4839
minItems: 1
4940
maxItems: 2
5041

51-
reset-names:
52-
oneOf:
53-
- items: # for Pro4, Pro5
54-
- const: gio
55-
- const: link
56-
- items:
57-
- const: link
42+
reset-names: true
43+
44+
allOf:
45+
- $ref: "regulator.yaml#"
46+
- if:
47+
properties:
48+
compatible:
49+
contains:
50+
enum:
51+
- socionext,uniphier-pro4-usb3-regulator
52+
- socionext,uniphier-pro5-usb3-regulator
53+
then:
54+
properties:
55+
clocks:
56+
minItems: 2
57+
maxItems: 2
58+
clock-names:
59+
items:
60+
- const: gio
61+
- const: link
62+
resets:
63+
minItems: 2
64+
maxItems: 2
65+
reset-names:
66+
items:
67+
- const: gio
68+
- const: link
69+
else:
70+
properties:
71+
clocks:
72+
maxItems: 1
73+
clock-names:
74+
const: link
75+
resets:
76+
maxItems: 1
77+
reset-names:
78+
const: link
5879

5980
additionalProperties: false
6081

0 commit comments

Comments
 (0)