Commit 09cc358a authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by Vinod Koul

dt-bindings: phy: uniphier: Clean up clocks, resets, and their names using compatible string

Instead of "oneOf:" choices, use "allOf:" and "if:" to define clocks,
clock-names, resets, and reset-names that can be taken by the compatible
string.

The order of clock-names and reset-names doesn't change here.
Signed-off-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1648637715-19262-6-git-send-email-hayashi.kunihiko@socionext.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 45d1f841
...@@ -30,31 +30,77 @@ properties: ...@@ -30,31 +30,77 @@ properties:
minItems: 1 minItems: 1
maxItems: 2 maxItems: 2
clock-names: clock-names: true
oneOf:
- items: # for PXs2
- const: link
- items: # for Pro4
- const: link
- const: gio
- items: # for others
- const: link
- const: phy
resets: resets:
minItems: 2 minItems: 2
maxItems: 6 maxItems: 6
reset-names: true
allOf:
- if:
properties:
compatible:
contains:
const: socionext,uniphier-pro4-ahci-phy
then:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names:
items:
- const: link
- const: gio
resets:
minItems: 6
maxItems: 6
reset-names: reset-names:
oneOf: items:
- items: # for Pro4
- const: link - const: link
- const: gio - const: gio
- const: phy - const: phy
- const: pm - const: pm
- const: tx - const: tx
- const: rx - const: rx
- items: # for others - if:
properties:
compatible:
contains:
const: socionext,uniphier-pxs2-ahci-phy
then:
properties:
clocks:
maxItems: 1
clock-names:
const: link
resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: link
- const: phy
- if:
properties:
compatible:
contains:
const: socionext,uniphier-pxs3-ahci-phy
then:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names:
items:
- const: link
- const: phy
resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: link - const: link
- const: phy - const: phy
......
...@@ -31,28 +31,51 @@ properties: ...@@ -31,28 +31,51 @@ properties:
minItems: 1 minItems: 1
maxItems: 2 maxItems: 2
clock-names: clock-names: true
oneOf:
- items: # for Pro5
- const: gio
- const: link
- const: link # for others
resets: resets:
minItems: 1 minItems: 1
maxItems: 2 maxItems: 2
reset-names: reset-names: true
oneOf:
- items: # for Pro5
- const: gio
- const: link
- const: link # for others
socionext,syscon: socionext,syscon:
$ref: /schemas/types.yaml#/definitions/phandle $ref: /schemas/types.yaml#/definitions/phandle
description: A phandle to system control to set configurations for phy description: A phandle to system control to set configurations for phy
allOf:
- if:
properties:
compatible:
contains:
const: socionext,uniphier-pro5-pcie-phy
then:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names:
items:
- const: gio
- const: link
resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: gio
- const: link
else:
properties:
clocks:
maxItems: 1
clock-names:
const: link
resets:
maxItems: 1
reset-names:
const: link
required: required:
- compatible - compatible
- reg - reg
......
...@@ -34,30 +34,12 @@ properties: ...@@ -34,30 +34,12 @@ properties:
minItems: 2 minItems: 2
maxItems: 3 maxItems: 3
clock-names: clock-names: true
oneOf:
- items: # for Pro5
- const: gio
- const: link
- items: # for PXs3 with phy-ext
- const: link
- const: phy
- const: phy-ext
- items: # for others
- const: link
- const: phy
resets: resets:
maxItems: 2 maxItems: 2
reset-names: reset-names: true
oneOf:
- items: # for Pro5
- const: gio
- const: link
- items: # for others
- const: link
- const: phy
vbus-supply: vbus-supply:
description: A phandle to the regulator for USB VBUS description: A phandle to the regulator for USB VBUS
...@@ -80,6 +62,77 @@ properties: ...@@ -80,6 +62,77 @@ properties:
required for each port, if any one is omitted, the trimming data required for each port, if any one is omitted, the trimming data
of the port will not be set at all. of the port will not be set at all.
allOf:
- if:
properties:
compatible:
contains:
const: socionext,uniphier-pro5-usb3-hsphy
then:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names:
items:
- const: gio
- const: link
resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: gio
- const: link
- if:
properties:
compatible:
contains:
enum:
- socionext,uniphier-pxs2-usb3-hsphy
- socionext,uniphier-ld20-usb3-hsphy
then:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names:
items:
- const: link
- const: phy
resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: link
- const: phy
- if:
properties:
compatible:
contains:
enum:
- socionext,uniphier-pxs3-usb3-hsphy
- socionext,uniphier-nx1-usb3-hsphy
then:
properties:
clocks:
minItems: 2
maxItems: 3
clock-names:
minItems: 2
items:
- const: link
- const: phy
- const: phy-ext
resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: link
- const: phy
required: required:
- compatible - compatible
- reg - reg
......
...@@ -35,33 +35,88 @@ properties: ...@@ -35,33 +35,88 @@ properties:
minItems: 2 minItems: 2
maxItems: 3 maxItems: 3
clock-names: true
resets:
maxItems: 2
reset-names: true
vbus-supply:
description: A phandle to the regulator for USB VBUS, only for USB host
allOf:
- if:
properties:
compatible:
contains:
enum:
- socionext,uniphier-pro4-usb3-ssphy
- socionext,uniphier-pro5-usb3-ssphy
then:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names: clock-names:
oneOf: items:
- items: # for Pro4, Pro5
- const: gio - const: gio
- const: link - const: link
- items: # for PXs3 with phy-ext resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: gio
- const: link - const: link
- const: phy - if:
- const: phy-ext properties:
- items: # for others compatible:
contains:
enum:
- socionext,uniphier-pxs2-usb3-ssphy
- socionext,uniphier-ld20-usb3-ssphy
then:
properties:
clocks:
minItems: 2
maxItems: 2
clock-names:
items:
- const: link - const: link
- const: phy - const: phy
resets: resets:
minItems: 2
maxItems: 2 maxItems: 2
reset-names: reset-names:
oneOf: items:
- items: # for Pro4,Pro5
- const: gio
- const: link - const: link
- items: # for others - const: phy
- if:
properties:
compatible:
contains:
enum:
- socionext,uniphier-pxs3-usb3-ssphy
- socionext,uniphier-nx1-usb3-ssphy
then:
properties:
clocks:
minItems: 2
maxItems: 3
clock-names:
minItems: 2
items:
- const: link
- const: phy
- const: phy-ext
resets:
minItems: 2
maxItems: 2
reset-names:
items:
- const: link - const: link
- const: phy - const: phy
vbus-supply:
description: A phandle to the regulator for USB VBUS, only for USB host
required: required:
- compatible - compatible
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment