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

dt-bindings: pinctrl: nvidia,tegra234-pinmux: Restructure common schema

The structure of the NVIDIA Tegra234 common pinmux schema doesn't work
for restricting properties because a child node schema can't be extended
with additional properties from another schema defining the same child
node. The 2 child node schemas are evaluated independently as the
schemas are not recursively combined in any way.

As the common schema is almost all the child node schema anyways, just
remove the parent node from the common schema. Then add 'reg' and adjust
the $ref's in the users of the common schema.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20240202223454.1667383-1-robh@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Rob Herring and committed by
Linus Walleij
7ac57288 e15ab05a

+44 -52
+5 -2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra234-pinmux-aon.yaml
··· 10 10 - Thierry Reding <thierry.reding@gmail.com> 11 11 - Jon Hunter <jonathanh@nvidia.com> 12 12 13 - $ref: nvidia,tegra234-pinmux-common.yaml 14 - 15 13 properties: 16 14 compatible: 17 15 const: nvidia,tegra234-pinmux-aon 16 + 17 + reg: 18 + maxItems: 1 18 19 19 20 patternProperties: 20 21 "^pinmux(-[a-z0-9-]+)?$": ··· 23 22 24 23 # pin groups 25 24 additionalProperties: 25 + $ref: nvidia,tegra234-pinmux-common.yaml 26 + 26 27 properties: 27 28 nvidia,pins: 28 29 items:
+34 -48
Documentation/devicetree/bindings/pinctrl/nvidia,tegra234-pinmux-common.yaml
··· 10 10 - Thierry Reding <thierry.reding@gmail.com> 11 11 - Jon Hunter <jonathanh@nvidia.com> 12 12 13 + $ref: nvidia,tegra-pinmux-common.yaml 14 + 13 15 properties: 14 - reg: 15 - items: 16 - - description: pinmux registers 16 + nvidia,function: 17 + enum: [ gp, uartc, i2c8, spi2, i2c2, can1, can0, rsvd0, eth0, eth2, 18 + eth1, dp, eth3, i2c4, i2c7, i2c9, eqos, pe2, pe1, pe0, pe3, 19 + pe4, pe5, pe6, pe7, pe8, pe9, pe10, qspi0, qspi1, qpsi, 20 + sdmmc1, sce, soc, gpio, hdmi, ufs0, spi3, spi1, uartb, uarte, 21 + usb, extperiph2, extperiph1, i2c3, vi0, i2c5, uarta, uartd, 22 + i2c1, i2s4, i2s6, aud, spi5, touch, uartj, rsvd1, wdt, tsc, 23 + dmic3, led, vi0_alt, i2s5, nv, extperiph3, extperiph4, spi4, 24 + ccla, i2s1, i2s2, i2s3, i2s8, rsvd2, dmic5, dca, displayb, 25 + displaya, vi1, dcb, dmic1, dmic4, i2s7, dmic2, dspk0, rsvd3, 26 + tsc_alt, istctrl, vi1_alt, dspk1, igpu ] 17 27 18 - patternProperties: 19 - "^pinmux(-[a-z0-9-]+)?$": 20 - type: object 21 - 22 - # pin groups 23 - additionalProperties: 24 - $ref: nvidia,tegra-pinmux-common.yaml 25 - # We would typically use unevaluatedProperties here but that has the 26 - # downside that all the properties in the common bindings become valid 27 - # for all chip generations. In this case, however, we want the per-SoC 28 - # bindings to be able to override which of the common properties are 29 - # allowed, since not all pinmux generations support the same sets of 30 - # properties. This way, the common bindings define the format of the 31 - # properties but the per-SoC bindings define which of them apply to a 32 - # given chip. 33 - additionalProperties: false 34 - properties: 35 - nvidia,function: 36 - enum: [ gp, uartc, i2c8, spi2, i2c2, can1, can0, rsvd0, eth0, eth2, 37 - eth1, dp, eth3, i2c4, i2c7, i2c9, eqos, pe2, pe1, pe0, pe3, 38 - pe4, pe5, pe6, pe7, pe8, pe9, pe10, qspi0, qspi1, qpsi, 39 - sdmmc1, sce, soc, gpio, hdmi, ufs0, spi3, spi1, uartb, uarte, 40 - usb, extperiph2, extperiph1, i2c3, vi0, i2c5, uarta, uartd, 41 - i2c1, i2s4, i2s6, aud, spi5, touch, uartj, rsvd1, wdt, tsc, 42 - dmic3, led, vi0_alt, i2s5, nv, extperiph3, extperiph4, spi4, 43 - ccla, i2s1, i2s2, i2s3, i2s8, rsvd2, dmic5, dca, displayb, 44 - displaya, vi1, dcb, dmic1, dmic4, i2s7, dmic2, dspk0, rsvd3, 45 - tsc_alt, istctrl, vi1_alt, dspk1, igpu ] 46 - 47 - # out of the common properties, only these are allowed for Tegra234 48 - nvidia,pins: true 49 - nvidia,pull: true 50 - nvidia,tristate: true 51 - nvidia,schmitt: true 52 - nvidia,enable-input: true 53 - nvidia,open-drain: true 54 - nvidia,lock: true 55 - nvidia,drive-type: true 56 - nvidia,io-hv: true 57 - 58 - required: 59 - - nvidia,pins 28 + # out of the common properties, only these are allowed for Tegra234 29 + nvidia,pins: true 30 + nvidia,pull: true 31 + nvidia,tristate: true 32 + nvidia,schmitt: true 33 + nvidia,enable-input: true 34 + nvidia,open-drain: true 35 + nvidia,lock: true 36 + nvidia,drive-type: true 37 + nvidia,io-hv: true 60 38 61 39 required: 62 - - compatible 63 - - reg 40 + - nvidia,pins 64 41 65 - additionalProperties: true 42 + # We would typically use unevaluatedProperties here but that has the 43 + # downside that all the properties in the common bindings become valid 44 + # for all chip generations. In this case, however, we want the per-SoC 45 + # bindings to be able to override which of the common properties are 46 + # allowed, since not all pinmux generations support the same sets of 47 + # properties. This way, the common bindings define the format of the 48 + # properties but the per-SoC bindings define which of them apply to a 49 + # given chip. 50 + additionalProperties: false 51 + 66 52 ...
+5 -2
Documentation/devicetree/bindings/pinctrl/nvidia,tegra234-pinmux.yaml
··· 10 10 - Thierry Reding <thierry.reding@gmail.com> 11 11 - Jon Hunter <jonathanh@nvidia.com> 12 12 13 - $ref: nvidia,tegra234-pinmux-common.yaml 14 - 15 13 properties: 16 14 compatible: 17 15 const: nvidia,tegra234-pinmux 16 + 17 + reg: 18 + maxItems: 1 18 19 19 20 patternProperties: 20 21 "^pinmux(-[a-z0-9-]+)?$": ··· 23 22 24 23 # pin groups 25 24 additionalProperties: 25 + $ref: nvidia,tegra234-pinmux-common.yaml 26 + 26 27 properties: 27 28 nvidia,pins: 28 29 items: