lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Nov 2019 18:44:34 +0100
From:   Maxime Ripard <mripard@...nel.org>
To:     Vasily Khoruzhick <anarsoul@...il.com>
Cc:     Yangtao Li <tiny.windzz@...il.com>,
        Zhang Rui <rui.zhang@...el.com>,
        Eduardo Valentin <edubezval@...il.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amit.kucheria@...durent.com>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Chen-Yu Tsai <wens@...e.org>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        Ondřej Jirman <megous@...ous.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 2/7] dt-bindings: thermal: add YAML schema for
 sun8i-thermal driver bindings

Hi,

On Tue, Nov 26, 2019 at 09:29:30PM -0800, Vasily Khoruzhick wrote:
> From: Yangtao Li <tiny.windzz@...il.com>
>
> sun8i-thermal driver supports thermal sensor in wide range of Allwinner
> SoCs. Add YAML schema for its bindings.
>
> Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
> Signed-off-by: Vasily Khoruzhick <anarsoul@...il.com>
> ---
>  .../thermal/allwinner,sun8i-a83t-ths.yaml     | 103 ++++++++++++++++++
>  1 file changed, 103 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml
>
> diff --git a/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml
> new file mode 100644
> index 000000000000..e622f0a4be90
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml
> @@ -0,0 +1,103 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/thermal/allwinner,sun8i-a83t-ths.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Allwinner SUN8I Thermal Controller Device Tree Bindings
> +
> +maintainers:
> +  - Yangtao Li <tiny.windzz@...il.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: allwinner,sun8i-a83t-ths
> +      - const: allwinner,sun8i-h3-ths
> +      - const: allwinner,sun8i-r40-ths
> +      - const: allwinner,sun50i-a64-ths
> +      - const: allwinner,sun50i-h5-ths
> +      - const: allwinner,sun50i-h6-ths
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  resets:
> +    maxItems: 1
> +
> +  clocks:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clock-names:
> +    anyOf:
> +      - items:
> +        - const: bus
> +        - const: mod
> +      - items:
> +        - const: bus

This can be:

clock-names:
  minItems: 1
  maxItems: 2
  items:
    - const: bus
    - const: mod

And the length should be checked based on the compatible value, with
something like

if:
  properties:
    compatible:
      contains:
        const: allwinner,sun50i-h6-ths

then:
  properties:
    clocks:
      maxItems: 1

    clock-names:
      maxItems: 1

else:
  properties:
    clocks:
      maxItems: 2

    clock-names:
      maxItems: 2

> +
> +  '#thermal-sensor-cells':
> +    enum: [ 0, 1 ]
> +    description: |
> +      Definition depends on soc version:
> +
> +      For "allwinner,sun8i-h3-ths",
> +      value must be 0.
> +      For all other compatibles
> +      value must be 1.

This should be checked using an if as well.

> +
> +  nvmem-cells:
> +    maxItems: 1
> +    items:
> +      - description: Calibration data for thermal sensors

You can drop the items and just move the description up one level,
under nvmem-cells

> +
> +  nvmem-cell-names:
> +    items:
> +      - const: calibration

Ditto for the const

> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - '#thermal-sensor-cells'

Whether clocks, clock-names and resets are thereshould be check using
an if statement as well.

> +
> +examples:
> +  - |
> +    ths_a83t: ths@...4000 {

You don't need the label at all, and the node name should be
temperature-sensor according to the DT spec, not ths. This applies to
all you examples.

> +         compatible = "allwinner,sun8i-a83t-ths";
> +         reg = <0x01f04000 0x100>;
> +         interrupts = <0 31 0>;
> +         nvmem-cells = <&ths_calibration>;
> +         nvmem-cell-names = "calibration";
> +         #thermal-sensor-cells = <1>;
> +    };

New line.

Thanks!
Maxime

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ