Commit f61eb7bc authored by Rob Herring's avatar Rob Herring Committed by Mauro Carvalho Chehab
Browse files

media: dt-bindings: media: Use OF graph schema



Now that we have a graph schema, rework the media related schemas to
use it. Mostly this is adding a reference to graph.yaml and dropping
duplicate parts from schemas.

Cc: Maxime Ripard <mripard@kernel.org>
Cc: Jacopo Mondi <jacopo@jmondi.org>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 7fe1d445
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ properties:
  # See ./video-interfaces.txt for details
  port:
    type: object
    $ref: /schemas/graph.yaml#/properties/port
    additionalProperties: false

    properties:
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ properties:
  # See ./video-interfaces.txt for details
  port:
    type: object
    $ref: /schemas/graph.yaml#/properties/port

    properties:
      endpoint:
+7 −24
Original line number Diff line number Diff line
@@ -36,17 +36,9 @@ properties:
    maxItems: 1

  port:
    type: object
    description:
      A node containing a single endpoint as doucmented in
      Documentation/devicetree/bindings/media/video-interfaces.txt
    $ref: /schemas/graph.yaml#/properties/port

  ports:
    type: object
    description:
      A node containing input and output port nodes with endpoint definitions
      as documented in
      Documentation/devicetree/bindings/media/video-interfaces.txt
  ports: true

additionalProperties: false

@@ -80,24 +72,19 @@ allOf:
    then:
      properties:
        ports:
          $ref: /schemas/graph.yaml#/properties/ports
          properties:
            '#address-cells':
              const: 1
            '#size-cells':
              const: 0
            port@3:
              type: object
              description: Output port

          patternProperties:
            "^port@[0-2]$":
              type: object
              description: Input port

          required:
            - port@3

          additionalProperties: false
          unevaluatedProperties: false

      required:
        - ports
@@ -110,24 +97,20 @@ allOf:
    then:
      properties:
        ports:
          $ref: /schemas/graph.yaml#/properties/ports
          properties:
            '#address-cells':
              const: 1
            '#size-cells':
              const: 0
            port@6:
              type: object
              description: Output port

          patternProperties:
            "^port@[0-5]$":
              type: object
              description: Input port

          required:
            - port@6

          additionalProperties: false
          unevaluatedProperties: false

      required:
        - ports
+6 −26
Original line number Diff line number Diff line
@@ -64,16 +64,12 @@ properties:
    description:
      Select which input is selected after reset.

  ports:
    type: object
    description:
      A node containing input and output port nodes with endpoint definitions
      as documented in
      Documentation/devicetree/bindings/media/video-interfaces.txt
  ports: true

required:
  - compatible
  - reg
  - ports

additionalProperties: false

@@ -86,25 +82,17 @@ allOf:
    then:
      properties:
        ports:
          $ref: /schemas/graph.yaml#/properties/ports
          properties:
            '#address-cells':
              const: 1
            '#size-cells':
              const: 0
            port@0:
              type: object
              description: Input port
            port@1:
              type: object
              description: Output port

          required:
            - port@1

          additionalProperties: false

      required:
        - ports
          unevaluatedProperties: false

  - if:
      properties:
@@ -114,27 +102,19 @@ allOf:
    then:
      properties:
        ports:
          $ref: /schemas/graph.yaml#/properties/ports
          properties:
            '#address-cells':
              const: 1
            '#size-cells':
              const: 0
            port@2:
              type: object
              description: Output port

          patternProperties:
            "^port@[0-1]$":
              type: object
              description: Input port

          required:
            - port@2

          additionalProperties: false

      required:
        - ports
          unevaluatedProperties: false

examples:
  - |
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ properties:
    maxItems: 1

  port:
    type: object
    $ref: /schemas/graph.yaml#/properties/port
    description: |
      Output video port. See ../video-interfaces.txt.

Loading