Skip to content

Commit

Permalink
media: dt-bindings: media: Use graph and video-interfaces schemas
Browse files Browse the repository at this point in the history
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: Rob Herring <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Rob Herring authored and Mauro Carvalho Chehab committed Jan 22, 2021
1 parent 41f42b6 commit 066a94e
Show file tree
Hide file tree
Showing 26 changed files with 244 additions and 583 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -83,20 +83,15 @@ properties:
data-active: true
hsync-active: true
pclk-sample: true
remote-endpoint: true
vsync-active: true

required:
- bus-width
- data-active
- hsync-active
- pclk-sample
- remote-endpoint
- vsync-active

required:
- endpoint

required:
- compatible
- reg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]

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

required:
- bus-width
- remote-endpoint

required:
- endpoint

additionalProperties: false

Expand Down
36 changes: 9 additions & 27 deletions Documentation/devicetree/bindings/media/i2c/adv7180.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

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
$ref: /schemas/graph.yaml#/properties/port

ports: true

additionalProperties: false

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
37 changes: 9 additions & 28 deletions Documentation/devicetree/bindings/media/i2c/adv7604.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 3 additions & 27 deletions Documentation/devicetree/bindings/media/i2c/imi,rdacm2x-gmsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,33 +86,9 @@ properties:
maxItems: 3

port:
type: object
additionalProperties: false
description: -|
Connection to the remote GMSL endpoint are modelled using the OF graph
bindings in accordance with the video interface bindings defined in
Documentation/devicetree/bindings/media/video-interfaces.txt.

The device node contains a single "port" child node with a single
"endpoint" sub-device.

properties:
endpoint:
type: object
additionalProperties: false

properties:
remote-endpoint:
description: -|
phandle to the remote GMSL endpoint sub-node in the remote node
port.
maxItems: 1

required:
- remote-endpoint

required:
- endpoint
$ref: /schemas/graph.yaml#/properties/port
description:
Connection to the remote GMSL endpoint.

required:
- compatible
Expand Down
21 changes: 8 additions & 13 deletions Documentation/devicetree/bindings/media/i2c/imx219.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ properties:
Reference to the GPIO connected to the xclr pin, if any.
Must be released (set high) after all supplies are applied.
# See ../video-interfaces.txt for more details
port:
type: object
$ref: /schemas/graph.yaml#/$defs/port-base
additionalProperties: false

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

properties:
data-lanes:
description: |-
Expand All @@ -60,16 +63,8 @@ properties:
- const: 1
- const: 2

clock-noncontinuous:
type: boolean
description: |-
MIPI CSI-2 clock is non-continuous if this property is present,
otherwise it's continuous.
link-frequencies:
$ref: /schemas/types.yaml#/definitions/uint64-array
description:
Allowed data bus frequencies.
clock-noncontinuous: true
link-frequencies: true

required:
- link-frequencies
Expand Down
Loading

0 comments on commit 066a94e

Please sign in to comment.