Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1648637715-19262-6-git-send-email-hayashi.kunihiko@socionext.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Kunihiko Hayashi and committed by
Vinod Koul
09cc358a 45d1f841

+251 -74
+68 -22
Documentation/devicetree/bindings/phy/socionext,uniphier-ahci-phy.yaml
··· 30 30 minItems: 1 31 31 maxItems: 2 32 32 33 - clock-names: 34 - oneOf: 35 - - items: # for PXs2 36 - - const: link 37 - - items: # for Pro4 38 - - const: link 39 - - const: gio 40 - - items: # for others 41 - - const: link 42 - - const: phy 33 + clock-names: true 43 34 44 35 resets: 45 36 minItems: 2 46 37 maxItems: 6 47 38 48 - reset-names: 49 - oneOf: 50 - - items: # for Pro4 51 - - const: link 52 - - const: gio 53 - - const: phy 54 - - const: pm 55 - - const: tx 56 - - const: rx 57 - - items: # for others 58 - - const: link 59 - - const: phy 39 + reset-names: true 40 + 41 + allOf: 42 + - if: 43 + properties: 44 + compatible: 45 + contains: 46 + const: socionext,uniphier-pro4-ahci-phy 47 + then: 48 + properties: 49 + clocks: 50 + minItems: 2 51 + maxItems: 2 52 + clock-names: 53 + items: 54 + - const: link 55 + - const: gio 56 + resets: 57 + minItems: 6 58 + maxItems: 6 59 + reset-names: 60 + items: 61 + - const: link 62 + - const: gio 63 + - const: phy 64 + - const: pm 65 + - const: tx 66 + - const: rx 67 + - if: 68 + properties: 69 + compatible: 70 + contains: 71 + const: socionext,uniphier-pxs2-ahci-phy 72 + then: 73 + properties: 74 + clocks: 75 + maxItems: 1 76 + clock-names: 77 + const: link 78 + resets: 79 + minItems: 2 80 + maxItems: 2 81 + reset-names: 82 + items: 83 + - const: link 84 + - const: phy 85 + - if: 86 + properties: 87 + compatible: 88 + contains: 89 + const: socionext,uniphier-pxs3-ahci-phy 90 + then: 91 + properties: 92 + clocks: 93 + minItems: 2 94 + maxItems: 2 95 + clock-names: 96 + items: 97 + - const: link 98 + - const: phy 99 + resets: 100 + minItems: 2 101 + maxItems: 2 102 + reset-names: 103 + items: 104 + - const: link 105 + - const: phy 60 106 61 107 required: 62 108 - compatible
+35 -12
Documentation/devicetree/bindings/phy/socionext,uniphier-pcie-phy.yaml
··· 31 31 minItems: 1 32 32 maxItems: 2 33 33 34 - clock-names: 35 - oneOf: 36 - - items: # for Pro5 37 - - const: gio 38 - - const: link 39 - - const: link # for others 34 + clock-names: true 40 35 41 36 resets: 42 37 minItems: 1 43 38 maxItems: 2 44 39 45 - reset-names: 46 - oneOf: 47 - - items: # for Pro5 48 - - const: gio 49 - - const: link 50 - - const: link # for others 40 + reset-names: true 51 41 52 42 socionext,syscon: 53 43 $ref: /schemas/types.yaml#/definitions/phandle 54 44 description: A phandle to system control to set configurations for phy 45 + 46 + allOf: 47 + - if: 48 + properties: 49 + compatible: 50 + contains: 51 + const: socionext,uniphier-pro5-pcie-phy 52 + then: 53 + properties: 54 + clocks: 55 + minItems: 2 56 + maxItems: 2 57 + clock-names: 58 + items: 59 + - const: gio 60 + - const: link 61 + resets: 62 + minItems: 2 63 + maxItems: 2 64 + reset-names: 65 + items: 66 + - const: gio 67 + - const: link 68 + else: 69 + properties: 70 + clocks: 71 + maxItems: 1 72 + clock-names: 73 + const: link 74 + resets: 75 + maxItems: 1 76 + reset-names: 77 + const: link 55 78 56 79 required: 57 80 - compatible
+73 -20
Documentation/devicetree/bindings/phy/socionext,uniphier-usb3hs-phy.yaml
··· 34 34 minItems: 2 35 35 maxItems: 3 36 36 37 - clock-names: 38 - oneOf: 39 - - items: # for Pro5 40 - - const: gio 41 - - const: link 42 - - items: # for PXs3 with phy-ext 43 - - const: link 44 - - const: phy 45 - - const: phy-ext 46 - - items: # for others 47 - - const: link 48 - - const: phy 37 + clock-names: true 49 38 50 39 resets: 51 40 maxItems: 2 52 41 53 - reset-names: 54 - oneOf: 55 - - items: # for Pro5 56 - - const: gio 57 - - const: link 58 - - items: # for others 59 - - const: link 60 - - const: phy 42 + reset-names: true 61 43 62 44 vbus-supply: 63 45 description: A phandle to the regulator for USB VBUS ··· 61 79 All of the 3 parameters associated with the above names are 62 80 required for each port, if any one is omitted, the trimming data 63 81 of the port will not be set at all. 82 + 83 + allOf: 84 + - if: 85 + properties: 86 + compatible: 87 + contains: 88 + const: socionext,uniphier-pro5-usb3-hsphy 89 + then: 90 + properties: 91 + clocks: 92 + minItems: 2 93 + maxItems: 2 94 + clock-names: 95 + items: 96 + - const: gio 97 + - const: link 98 + resets: 99 + minItems: 2 100 + maxItems: 2 101 + reset-names: 102 + items: 103 + - const: gio 104 + - const: link 105 + - if: 106 + properties: 107 + compatible: 108 + contains: 109 + enum: 110 + - socionext,uniphier-pxs2-usb3-hsphy 111 + - socionext,uniphier-ld20-usb3-hsphy 112 + then: 113 + properties: 114 + clocks: 115 + minItems: 2 116 + maxItems: 2 117 + clock-names: 118 + items: 119 + - const: link 120 + - const: phy 121 + resets: 122 + minItems: 2 123 + maxItems: 2 124 + reset-names: 125 + items: 126 + - const: link 127 + - const: phy 128 + - if: 129 + properties: 130 + compatible: 131 + contains: 132 + enum: 133 + - socionext,uniphier-pxs3-usb3-hsphy 134 + - socionext,uniphier-nx1-usb3-hsphy 135 + then: 136 + properties: 137 + clocks: 138 + minItems: 2 139 + maxItems: 3 140 + clock-names: 141 + minItems: 2 142 + items: 143 + - const: link 144 + - const: phy 145 + - const: phy-ext 146 + resets: 147 + minItems: 2 148 + maxItems: 2 149 + reset-names: 150 + items: 151 + - const: link 152 + - const: phy 64 153 65 154 required: 66 155 - compatible
+75 -20
Documentation/devicetree/bindings/phy/socionext,uniphier-usb3ss-phy.yaml
··· 35 35 minItems: 2 36 36 maxItems: 3 37 37 38 - clock-names: 39 - oneOf: 40 - - items: # for Pro4, Pro5 41 - - const: gio 42 - - const: link 43 - - items: # for PXs3 with phy-ext 44 - - const: link 45 - - const: phy 46 - - const: phy-ext 47 - - items: # for others 48 - - const: link 49 - - const: phy 38 + clock-names: true 50 39 51 40 resets: 52 41 maxItems: 2 53 42 54 - reset-names: 55 - oneOf: 56 - - items: # for Pro4,Pro5 57 - - const: gio 58 - - const: link 59 - - items: # for others 60 - - const: link 61 - - const: phy 43 + reset-names: true 62 44 63 45 vbus-supply: 64 46 description: A phandle to the regulator for USB VBUS, only for USB host 47 + 48 + allOf: 49 + - if: 50 + properties: 51 + compatible: 52 + contains: 53 + enum: 54 + - socionext,uniphier-pro4-usb3-ssphy 55 + - socionext,uniphier-pro5-usb3-ssphy 56 + then: 57 + properties: 58 + clocks: 59 + minItems: 2 60 + maxItems: 2 61 + clock-names: 62 + items: 63 + - const: gio 64 + - const: link 65 + resets: 66 + minItems: 2 67 + maxItems: 2 68 + reset-names: 69 + items: 70 + - const: gio 71 + - const: link 72 + - if: 73 + properties: 74 + compatible: 75 + contains: 76 + enum: 77 + - socionext,uniphier-pxs2-usb3-ssphy 78 + - socionext,uniphier-ld20-usb3-ssphy 79 + then: 80 + properties: 81 + clocks: 82 + minItems: 2 83 + maxItems: 2 84 + clock-names: 85 + items: 86 + - const: link 87 + - const: phy 88 + resets: 89 + minItems: 2 90 + maxItems: 2 91 + reset-names: 92 + items: 93 + - const: link 94 + - const: phy 95 + - if: 96 + properties: 97 + compatible: 98 + contains: 99 + enum: 100 + - socionext,uniphier-pxs3-usb3-ssphy 101 + - socionext,uniphier-nx1-usb3-ssphy 102 + then: 103 + properties: 104 + clocks: 105 + minItems: 2 106 + maxItems: 3 107 + clock-names: 108 + minItems: 2 109 + items: 110 + - const: link 111 + - const: phy 112 + - const: phy-ext 113 + resets: 114 + minItems: 2 115 + maxItems: 2 116 + reset-names: 117 + items: 118 + - const: link 119 + - const: phy 65 120 66 121 required: 67 122 - compatible