Re: [PATCH v2 09/11] dt-bindings: net: sun8i-emac: Convert the binding to a schemas

From
Maxime Ripard <hidden>
Date
2019-06-11 11:31:08
Also in
linux-arm-kernel, netdev
Reply to
Rob Herring, 2019-06-10
Hi,

On Mon, Jun 10, 2019 at 01:22:00PM -0600, Rob Herring wrote:
On Mon, Jun 10, 2019 at 3:26 AM Maxime Ripard [off-list ref] wrote:
quoted
+    then:
+      properties:
+        allwinner,tx-delay-ps:
+          allOf:
+            - $ref: /schemas/types.yaml#definitions/uint32
Can drop this as anything with unit prefix has its type defined
already.
Not for picoseconds though. I'll send a PR to dt-schema if you prefer
to define it there.
quoted
+            - enum: [0, 100, 200, 300, 400, 500, 600, 700]
+              default: 0
+          description:
+            External RGMII PHY TX clock delay chain value in ps.
+
+        allwinner,rx-delay-ps:
+          allOf:
+            - $ref: /schemas/types.yaml#definitions/uint32
+            - enum:
+                - 0
+                - 100
+                - 200
+                - 300
+                - 400
+                - 500
+                - 600
+                - 700
+                - 800
+                - 900
+                - 1000
+                - 1100
+                - 1200
+                - 1300
+                - 1400
+                - 1500
+                - 1600
+                - 1700
+                - 1800
+                - 1900
+                - 2000
+                - 2100
+                - 2200
+                - 2300
+                - 2400
+                - 2500
+                - 2600
+                - 2700
+                - 2800
+                - 2900
+                - 3000
+                - 3100
I think you can do

enum: [1, 2, 3,
  4,  5, 6]

Or you can do:

minimum: 0
maximum: 3100
multipleOf: 100

IIRC that multipleOf is a json-schema key.
I really like that second syntax, thanks!

Maxime
Thread (35 messages) 35 messages, 5 authors, last reply 2019-06-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help