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

media: dt-bindings: media: Use graph and video-interfaces schemas



Now that we have graph and video-interfaces schemas, rework the media
related schemas to use them.

Cc: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 41f42b6e
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -67,14 +67,14 @@ properties:
  interconnect-names:
    const: dma-mem

  # See ./video-interfaces.txt for details
  port:
    type: object
    $ref: /schemas/graph.yaml#/$defs/port-base
    additionalProperties: false

    properties:
      endpoint:
        type: object
        $ref: video-interfaces.yaml#
        unevaluatedProperties: false

        properties:
          bus-width:
@@ -83,7 +83,6 @@ properties:
          data-active: true
          hsync-active: true
          pclk-sample: true
          remote-endpoint: true
          vsync-active: true

        required:
@@ -91,12 +90,8 @@ properties:
          - data-active
          - hsync-active
          - pclk-sample
          - remote-endpoint
          - vsync-active

    required:
      - endpoint

required:
  - compatible
  - reg
+3 −9
Original line number Diff line number Diff line
@@ -40,17 +40,15 @@ properties:
  resets:
    maxItems: 1

  # See ./video-interfaces.txt for details
  port:
    type: object
    $ref: /schemas/graph.yaml#/$defs/port-base

    properties:
      endpoint:
        type: object
        $ref: video-interfaces.yaml#
        unevaluatedProperties: false

        properties:
          remote-endpoint: true

          bus-width:
            enum: [ 8, 10, 12, 16 ]

@@ -60,10 +58,6 @@ properties:

        required:
          - bus-width
          - remote-endpoint

    required:
      - endpoint

    additionalProperties: false

+9 −27
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,25 +72,20 @@ allOf:
    then:
      properties:
        ports:
          $ref: /schemas/graph.yaml#/properties/ports
          properties:
            '#address-cells':
              const: 1
            '#size-cells':
              const: 0
            port@3:
              type: object
              $ref: /schemas/graph.yaml#/properties/port
              description: Output port

          patternProperties:
            "^port@[0-2]$":
              type: object
              $ref: /schemas/graph.yaml#/properties/port
              description: Input port

          required:
            - port@3

          additionalProperties: false

      required:
        - ports

@@ -110,25 +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
              $ref: /schemas/graph.yaml#/properties/port
              description: Output port

          patternProperties:
            "^port@[0-5]$":
              type: object
              $ref: /schemas/graph.yaml#/properties/port
              description: Input port

          required:
            - port@6

          additionalProperties: false

      required:
        - ports

+9 −28
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,26 +82,19 @@ allOf:
    then:
      properties:
        ports:
          $ref: /schemas/graph.yaml#/properties/ports
          properties:
            '#address-cells':
              const: 1
            '#size-cells':
              const: 0
            port@0:
              type: object
              $ref: /schemas/graph.yaml#/properties/port
              description: Input port

            port@1:
              type: object
              $ref: /schemas/graph.yaml#/properties/port
              description: Output port

          required:
            - port@1

          additionalProperties: false

      required:
        - ports

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

          patternProperties:
            "^port@[0-1]$":
              type: object
              $ref: /schemas/graph.yaml#/properties/port
              description: Input port

          required:
            - port@2

          additionalProperties: false

      required:
        - ports

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
+2 −2
Original line number Diff line number Diff line
@@ -41,9 +41,9 @@ properties:
    maxItems: 1

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

required:
  - compatible
Loading