Re: [PATCH v3 1/4] dt-bindings: i2c: imx-lpi2c: Add properties and use unevaluatedProperties

From: Rob Herring
Date: Tue Sep 15 2020 - 15:42:38 EST


On Thu, Sep 10, 2020 at 08:22:41PM +0200, Krzysztof Kozlowski wrote:
> Additional properties actually might appear (e.g. power-domains) so
> describe all typical properties, reference generic i2c schema and use
> unevaluatedProperties to fix dtbs_check warnings like:
>
> arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dt.yaml: i2c@5a800000:
> 'assigned-clock-rates', 'assigned-clocks', 'clock-names', 'power-domains' do not match any of the regexes: 'pinctrl-[0-9]+'
>
> arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dt.yaml: i2c@5a800000:
> 'touchscreen@2c' does not match any of the regexes: 'pinctrl-[0-9]+'
>
> Signed-off-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
>
> ---
>
> Changes since v2:
> 1. Add assigned-clock-parents
>
> Changes since v1:
> 1. Add more properties and include /schemas/i2c/i2c-controller.yaml#
> ---
> .../bindings/i2c/i2c-imx-lpi2c.yaml | 20 +++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml b/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml
> index ac0bc5dd64d6..918535b33384 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml
> +++ b/Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml
> @@ -9,6 +9,9 @@ title: Freescale Low Power Inter IC (LPI2C) for i.MX
> maintainers:
> - Anson Huang <Anson.Huang@xxxxxxx>
>
> +allOf:
> + - $ref: /schemas/i2c/i2c-controller.yaml#
> +
> properties:
> compatible:
> enum:
> @@ -16,29 +19,42 @@ properties:
> - fsl,imx8qxp-lpi2c
> - fsl,imx8qm-lpi2c
>
> + '#address-cells': true
> + '#size-cells': true

Can drop these as they are in i2c-controller.yaml.

> +
> reg:
> maxItems: 1
>
> interrupts:
> maxItems: 1
>
> + assigned-clock-parents: true
> + assigned-clock-rates: true
> + assigned-clocks: true
> + clock-frequency: true
> +
> + clock-names:
> + maxItems: 1
> +
> clocks:
> maxItems: 1
>
> + power-domains: true

How many?

> +
> required:
> - compatible
> - reg
> - interrupts
> - clocks
>
> -additionalProperties: false
> +unevaluatedProperties: false
>
> examples:
> - |
> #include <dt-bindings/clock/imx7ulp-clock.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
>
> - lpi2c7@40a50000 {
> + i2c@40a50000 {
> compatible = "fsl,imx7ulp-lpi2c";
> reg = <0x40A50000 0x10000>;
> interrupt-parent = <&intc>;
> --
> 2.17.1
>