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
Showing 26 changed files with 244 additions and 583 deletions.
Original file line number Diff line number Diff line change
@@ -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,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
Original file line number Diff line number Diff line change
@@ -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

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

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

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

0 comments on commit 066a94e

Please sign in to comment.