Skip to content

Commit

Permalink
dt-bindings: net: marvell,orion-mdio: Fix examples
Browse files Browse the repository at this point in the history
As stated in marvell-orion-mdio.txt deleted in commit 0781434
("dt-bindings: net: orion-mdio: Convert to JSON schema") if
'interrupts' property is present, width of 'reg' should be 0x84.
Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and add
constraints checking whether 'interrupts' property is present
and validate it against fixed values in reg.

Signed-off-by: Michał Grzelak <mig@semihalf.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
semihalf-grzelak-michal authored and davem330 committed Jan 1, 2023
1 parent a3542b0 commit 91e2286
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ description: |
8k has a second unit which provides an interface with the xMDIO bus. This
driver handles these interfaces.
allOf:
- $ref: "mdio.yaml#"

properties:
compatible:
enum:
Expand All @@ -39,13 +36,38 @@ required:
- compatible
- reg

allOf:
- $ref: mdio.yaml#

- if:
required:
- interrupts

then:
properties:
reg:
items:
- items:
- $ref: /schemas/types.yaml#/definitions/cell
- const: 0x84

else:
properties:
reg:
items:
- items:
- $ref: /schemas/types.yaml#/definitions/cell
- enum:
- 0x4
- 0x10

unevaluatedProperties: false

examples:
- |
mdio@d0072004 {
compatible = "marvell,orion-mdio";
reg = <0xd0072004 0x4>;
reg = <0xd0072004 0x84>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <30>;
Expand Down

0 comments on commit 91e2286

Please sign in to comment.