Convert adi,adv7511.txt DT bindings to yaml
Subsystems (7)
v4 cover Convert adi,adv7511.txt DT bindings to yaml
Hi all,
I'm rescuing and resending this patch series again, as it got reviewed but parts of it didn't make it to mainline. The previous version can be found in
https://lore.kernel.org/linux-devicetree/[email protected]/
This series convert the adi,adv7511.txt DT bindings to json-schema. As a result of the conversion some dts files needed to be updated.
The changes to the dts files are of three types:
- Reordering of the I2C slave addresses list of the ADV75xx node. The addresses in the 'reg' property and the matching names in 'reg-names' for an I2C slave don't need to be in any particular order, but the DT schema defines these properties as a cell array and a string array respectively, which are ordered, so the definitions in the dts files must match the order in the binding.
- Filling the minimum binding requirements. Most of the time this means creating a 'ports' node in the boards that don't define them. Note, however, that the purpose of this is simply to make the definition compliant with the binding. I didn't define any endpoints for the ports.
- Removing unneeded properties.
About the binding conversion:
- The original binding covered five different devices: ADV7511, ADV7511W, ADV7513, ADV7533 and ADV7535. They all share a common set of properties but ADV7533 and ADV7535 have enough differences from the rest to warrant their own binding file. In v1 I modelled all the properties constraints for all five devices in a single file but it turned out a bit too complex. Splitting the binding into one for ADV7511/11W/13 and another for ADV7533/35 makes them much easier to read and maintain.
Patches 1/4 to 3/4 contain the dts changes. Patch 4/4 contains the binding conversion.
NOTE: the bindings have been tested with:
make dt_binding_check ARCH=<arch> DT_SCHEMA_FILES=<...adi,adv7511.yaml> make dt_binding_check ARCH=<arch> DT_SCHEMA_FILES=<...adi,adv7533.yaml> make dtbs_check ARCH=<arch> DT_SCHEMA_FILES=<...adi,adv7511.yaml> make dtbs_check ARCH=<arch> DT_SCHEMA_FILES=<...adi,adv7533.yaml>
for <arch> = arm and arm64. dts changes haven't been tested in hardware.
Some existing DTs are expected to fail after this conversion.
Changes in v4:
- Removed from the patch series (already in mainline):
- arm64: dts: hisilicon: hikey: fixes to comply with adi,adv7533 DT binding.
- Update binding examples to comply with the current schema checks.
- Update the license in the binding files.
Ricardo Cañuelo (3):
ARM: dts: zynq: add port definitions to hdmi-tx@39
ARM: dts: stm32: make hdmi-transmitter node compliant with DT bindings
dt-bindings: drm: bridge: adi,adv7511.txt: convert to yaml
.../bindings/display/bridge/adi,adv7511.txt | 143 ----------- .../bindings/display/bridge/adi,adv7511.yaml | 241 ++++++++++++++++++ .../bindings/display/bridge/adi,adv7533.yaml | 184 +++++++++++++ .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 6 +- arch/arm/boot/dts/zynq-zc702.dts | 10 + arch/arm/boot/dts/zynq-zc706.dts | 10 + 6 files changed, 447 insertions(+), 147 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml
Signature · 1 line
2.25.1
PATCH RESEND v4 1/3 ARM: dts: zynq: add port definitions to hdmi-tx@39
Define a 'ports' node for 'adv7511: hdmi-tx@39' to make it compliant with the adi,adv7511 DT binding.
This fills the minimum requirements to meet the binding requirements, remote endpoints are not defined.
---
Michal, this was already reviewed and acked a long time ago but it never made it into mainline. Can you take a look at it? Thanks.
arch/arm/boot/dts/zynq-zc702.dts | 10 ++++++++++ arch/arm/boot/dts/zynq-zc706.dts | 10 ++++++++++ 2 files changed, 20 insertions(+)
arch/arm/boot/dts/zynq-zc702.dts +10 -0
@@ -141,6 +141,16 @@ adv7511: hdmi-tx@39 { adi,input-clock = "1x"; adi,input-style = <3>; adi,input-justification = "right"; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + }; + port@1 { + reg = <1>; + }; + }; }; };
arch/arm/boot/dts/zynq-zc706.dts +10 -0
@@ -93,6 +93,16 @@ adv7511: hdmi-tx@39 { adi,input-clock = "1x"; adi,input-style = <3>; adi,input-justification = "evenly"; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + }; + port@1 { + reg = <1>; + }; + }; }; };
Signature · 1 line
2.25.1
PATCH RESEND v4 2/3 ARM: dts: stm32: make hdmi-transmitter node compliant with DT bindings
In reply to Ricardo CañueloReorder the I2C slave addresses of the hdmi-transmitter node and remove the adi,input-style and adi,input-justification properties to meet the adi,adv7513 binding requirements.
--- arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi +2 -4
@@ -220,8 +220,8 @@ &i2c2 { /* X6 I2C2 */ &i2c4 { hdmi-transmitter@3d { compatible = "adi,adv7513"; - reg = <0x3d>, <0x2d>, <0x4d>, <0x5d>; - reg-names = "main", "cec", "edid", "packet"; + reg = <0x3d>, <0x4d>, <0x2d> , <0x5d>; + reg-names = "main", "edid", "cec", "packet"; clocks = <&cec_clock>; clock-names = "cec";
@@ -239,8 +239,6 @@ hdmi-transmitter@3d { adi,input-depth = <8>; adi,input-colorspace = "rgb"; adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; ports { #address-cells = <1>;
Signature · 1 line
2.25.1
PATCH RESEND v4 3/3 dt-bindings: drm: bridge: adi, adv7511.txt: convert to yaml
In reply to Ricardo CañueloConvert the ADV7511/11w/13/33/35 DT bindings to json-schema. The original binding has been split into two files: adi,adv7511.yaml for ADV7511/11W/13 and adi,adv7533.yaml for ADV7533/35.
--- .../bindings/display/bridge/adi,adv7511.txt | 143 ----------- .../bindings/display/bridge/adi,adv7511.yaml | 241 ++++++++++++++++++ .../bindings/display/bridge/adi,adv7533.yaml | 184 +++++++++++++ 3 files changed, 425 insertions(+), 143 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml
Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt deleted +0 -143
@@ -1,143 +0,0 @@ -Analog Devices ADV7511(W)/13/33/35 HDMI Encoders ------------------------------------------------- - -The ADV7511, ADV7511W, ADV7513, ADV7533 and ADV7535 are HDMI audio and video -transmitters compatible with HDMI 1.4 and DVI 1.0. They support color space -conversion, S/PDIF, CEC and HDCP. ADV7533/5 supports the DSI interface for input -pixels, while the others support RGB interface. - -Required properties: - -- compatible: Should be one of: - "adi,adv7511" - "adi,adv7511w" - "adi,adv7513" - "adi,adv7533" - "adi,adv7535" - -- reg: I2C slave addresses - The ADV7511 internal registers are split into four pages exposed through - different I2C addresses, creating four register maps. Each map has it own - I2C address and acts as a standard slave device on the I2C bus. The main - address is mandatory, others are optional and revert to defaults if not - specified. - - -The ADV7511 supports a large number of input data formats that differ by their -color depth, color format, clock mode, bit justification and random -arrangement of components on the data bus. The combination of the following -properties describe the input and map directly to the video input tables of the -ADV7511 datasheet that document all the supported combinations. - -- adi,input-depth: Number of bits per color component at the input (8, 10 or - 12). -- adi,input-colorspace: The input color space, one of "rgb", "yuv422" or - "yuv444". -- adi,input-clock: The input clock type, one of "1x" (one clock cycle per - pixel), "2x" (two clock cycles per pixel), "ddr" (one clock cycle per pixel, - data driven on both edges). - -The following input format properties are required except in "rgb 1x" and -"yuv444 1x" modes, in which case they must not be specified. - -- adi,input-style: The input components arrangement variant (1, 2 or 3), as - listed in the input format tables in the datasheet. -- adi,input-justification: The input bit justification ("left", "evenly", - "right"). - -- avdd-supply: A 1.8V supply that powers up the AVDD pin on the chip. -- dvdd-supply: A 1.8V supply that powers up the DVDD pin on the chip. -- pvdd-supply: A 1.8V supply that powers up the PVDD pin on the chip. -- dvdd-3v-supply: A 3.3V supply that powers up the pin called DVDD_3V - on the chip. -- bgvdd-supply: A 1.8V supply that powers up the BGVDD pin. This is - needed only for ADV7511. - -The following properties are required for ADV7533 and ADV7535: - -- adi,dsi-lanes: Number of DSI data lanes connected to the DSI host. It should - be one of 1, 2, 3 or 4. -- a2vdd-supply: 1.8V supply that powers up the A2VDD pin on the chip. -- v3p3-supply: A 3.3V supply that powers up the V3P3 pin on the chip. -- v1p2-supply: A supply that powers up the V1P2 pin on the chip. It can be - either 1.2V or 1.8V for ADV7533 but only 1.8V for ADV7535. - -Optional properties: - -- interrupts: Specifier for the ADV7511 interrupt -- pd-gpios: Specifier for the GPIO connected to the power down signal - -- adi,clock-delay: Video data clock delay relative to the pixel clock, in ps - (-1200 ps .. 1600 ps). Defaults to no delay. -- adi,embedded-sync: The input uses synchronization signals embedded in the - data stream (similar to BT.656). Defaults to separate H/V synchronization - signals. -- adi,disable-timing-generator: Only for ADV7533 and ADV7535. Disables the - internal timing generator. The chip will rely on the sync signals in the - DSI data lanes, rather than generate its own timings for HDMI output. -- clocks: from common clock binding: reference to the CEC clock. -- clock-names: from common clock binding: must be "cec". -- reg-names : Names of maps with programmable addresses. - It can contain any map needing a non-default address. - Possible maps names are : "main", "edid", "cec", "packet" - -Required nodes: - -The ADV7511 has two video ports. Their connections are modelled using the OF -graph bindings specified in Documentation/devicetree/bindings/graph.txt. - -- Video port 0 for the RGB, YUV or DSI input. In the case of ADV7533/5, the - remote endpoint phandle should be a reference to a valid mipi_dsi_host device - node. -- Video port 1 for the HDMI output -- Audio port 2 for the HDMI audio input - - -Example -------- - - adv7511w: hdmi@39 { - compatible = "adi,adv7511w"; - /* - * The EDID page will be accessible on address 0x66 on the I2C - * bus. All other maps continue to use their default addresses. - */ - reg = <0x39>, <0x66>; - reg-names = "main", "edid"; - interrupt-parent = <&gpio3>; - interrupts = <29 IRQ_TYPE_EDGE_FALLING>; - clocks = <&cec_clock>; - clock-names = "cec"; - - adi,input-depth = <8>; - adi,input-colorspace = "rgb"; - adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - adv7511w_in: endpoint { - remote-endpoint = <&dpi_out>; - }; - }; - - port@1 { - reg = <1>; - adv7511_out: endpoint { - remote-endpoint = <&hdmi_connector_in>; - }; - }; - - port@2 { - reg = <2>; - codec_endpoint: endpoint { - remote-endpoint = <&i2s0_cpu_endpoint>; - }; - }; - }; - };
Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml new file +241 -0
241 lines not on this page · raw message
Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml new file +184 -0
184 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [RESEND PATCH v4 3/3] dt-bindings: drm: bridge: adi, adv7511.txt: convert to yaml
Quoted 7 lines · Ricardo Cañuelo
Convert the ADV7511/11w/13/33/35 DT bindings to json-schema. The original binding has been split into two files: adi,adv7511.yaml for ADV7511/11W/13 and adi,adv7533.yaml for ADV7533/35.
Signed-off-by Ricardo Cañuelo <[email protected]>Reviewed-by Rob Herring <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>
Quoted 9 lines
--- .../bindings/display/bridge/adi,adv7511.txt | 143 ----------- .../bindings/display/bridge/adi,adv7511.yaml | 241 ++++++++++++++++++ .../bindings/display/bridge/adi,adv7533.yaml | 184 +++++++++++++ 3 files changed, 425 insertions(+), 143 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml create mode 100644 Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml
Applied, thanks!
Re: [RESEND PATCH v4 3/3] dt-bindings: drm: bridge: adi, adv7511.txt: convert to yaml
In reply to Ricardo CañueloHi Ricardo,
Quoted 7 lines · Ricardo Cañuelo
Convert the ADV7511/11w/13/33/35 DT bindings to json-schema. The original binding has been split into two files: adi,adv7511.yaml for ADV7511/11W/13 and adi,adv7533.yaml for ADV7533/35.
Signed-off-by Ricardo Cañuelo <[email protected]>Reviewed-by Rob Herring <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>
Thanks for your patch, which is now commit cfe34bb7a770c5d8 ("dt-bindings: drm: bridge: adi,adv7511.txt: convert to yaml") in robh/for-next.
Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml new file +2
-0+required: + - compatible
Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml line 175
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml new file +10
-0+ - reg + - ports + - adi,input-depth + - adi,input-colorspace + - adi,input-clock + - avdd-supply + - dvdd-supply + - pvdd-supply + - dvdd-3v-supply + - bgvdd-supply
This causes lots of failures like:
arm/boot/dts/r8a7743-iwg20d-q7-dbcm-ca.dt.yaml: hdmi@39:
'avdd-supply' is a required property
Should all supplies be required?
Looking at the driver, missing supplies are automatically replaced by dummy regulators by the regulator framework.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Laurent Pinchart
reviewerRe: [RESEND PATCH v4 3/3] dt-bindings: drm: bridge: adi, adv7511.txt: convert to yaml
Hi Geert,
Quoted 29 lines · Geert Uytterhoeven
Quoted 7 lines · Ricardo Cañuelo
Convert the ADV7511/11w/13/33/35 DT bindings to json-schema. The original binding has been split into two files: adi,adv7511.yaml for ADV7511/11W/13 and adi,adv7533.yaml for ADV7533/35.
Signed-off-by Ricardo Cañuelo <[email protected]>Reviewed-by Rob Herring <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Thanks for your patch, which is now commit
cfe34bb7a770c5d8("dt-bindings: drm: bridge: adi,adv7511.txt: convert to yaml") in robh/for-next.Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml new file +2
-0+required: + - compatibleDocumentation/devicetree/bindings/display/bridge/adi,adv7511.yaml line 175
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/adi,adv7511.yaml new file +10
-0+ - reg + - ports + - adi,input-depth + - adi,input-colorspace + - adi,input-clock + - avdd-supply + - dvdd-supply + - pvdd-supply + - dvdd-3v-supply + - bgvdd-supply
Quoted 8 lines
This causes lots of failures like:
arm/boot/dts/r8a7743-iwg20d-q7-dbcm-ca.dt.yaml: hdmi@39:'avdd-supply' is a required property
Should all supplies be required?
Looking at the driver, missing supplies are automatically replaced by dummy regulators by the regulator framework.
Generally speaking, I like DT bindings to be descriptive of the hardware, and thus require power supplies that are needed for the device to function, even if they are fixed supplies.
This being said, I think there's also room to group some power supplies together in the bindings, when they are not meant by the device to be controlled separately. In this specific case, we also need to take into account that the adv7511 and adv7533 have different supplies.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [RESEND PATCH v4 3/3] dt-bindings: drm: bridge: adi,adv7511.txt: convert to yaml
Hi,
Quoted 10 lines · Geert Uytterhoeven
Quoted 8 lines
This causes lots of failures like:
arm/boot/dts/r8a7743-iwg20d-q7-dbcm-ca.dt.yaml: hdmi@39:'avdd-supply' is a required property
Should all supplies be required?
Looking at the driver, missing supplies are automatically replaced by dummy regulators by the regulator framework.
Quoted 8 lines
Generally speaking, I like DT bindings to be descriptive of the hardware, and thus require power supplies that are needed for the device to function, even if they are fixed supplies.
This being said, I think there's also room to group some power supplies together in the bindings, when they are not meant by the device to be controlled separately. In this specific case, we also need to take into account that the adv7511 and adv7533 have different supplies.
Thanks for the review, guys. Yes, there were some dtbs check warnings to be expected, the consensus in a previous version of the patch was that that shouldn't be a blocker for a binding conversion and that the *.dts definitions should eventually be fixed to comply with the binding, which is, IMO, a more reasonable process to keep the binding conversion effort progressing.
Cheers,
Ricardo