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] [day] [month] [year] [list]
Message-ID: <20200501200652.GA13287@bogus>
Date:   Fri, 1 May 2020 15:06:52 -0500
From:   Rob Herring <robh@...nel.org>
To:     Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        devicetree@...r.kernel.org, alsa-devel@...a-project.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: dt-bindings: ak4613: switch to yaml base
 Documentation

On Tue, Apr 21, 2020 at 02:17:43PM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
> 
> This patch switches from .txt base to .yaml base Document.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
> ---
>  .../devicetree/bindings/sound/ak4613.txt      | 27 --------
>  .../devicetree/bindings/sound/ak4613.yaml     | 65 +++++++++++++++++++
>  2 files changed, 65 insertions(+), 27 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/sound/ak4613.txt
>  create mode 100644 Documentation/devicetree/bindings/sound/ak4613.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/ak4613.txt b/Documentation/devicetree/bindings/sound/ak4613.txt
> deleted file mode 100644
> index 49a2e74fd9cb..000000000000
> --- a/Documentation/devicetree/bindings/sound/ak4613.txt
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -AK4613 I2C transmitter
> -
> -This device supports I2C mode only.
> -
> -Required properties:
> -
> -- compatible : "asahi-kasei,ak4613"
> -- reg : The chip select number on the I2C bus
> -
> -Optional properties:
> -- asahi-kasei,in1-single-end	: Boolean. Indicate input / output pins are single-ended.
> -- asahi-kasei,in2-single-end	  rather than differential.
> -- asahi-kasei,out1-single-end
> -- asahi-kasei,out2-single-end
> -- asahi-kasei,out3-single-end
> -- asahi-kasei,out4-single-end
> -- asahi-kasei,out5-single-end
> -- asahi-kasei,out6-single-end
> -
> -Example:
> -
> -&i2c {
> -	ak4613: ak4613@10 {
> -		compatible = "asahi-kasei,ak4613";
> -		reg = <0x10>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/sound/ak4613.yaml b/Documentation/devicetree/bindings/sound/ak4613.yaml
> new file mode 100644
> index 000000000000..b5929239505e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/ak4613.yaml
> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/ak4613.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: AK4613 I2C transmitter Device Tree Bindings
> +
> +maintainers:
> +  - Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
> +
> +properties:
> +  compatible:
> +    const: asahi-kasei,ak4613
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  "#sound-dai-cells":
> +    const: 0
> +
> +  # for OF-graph
> +  port:
> +    $ref: "audio-graph-card.yaml#definitions/port"
> +  ports:
> +    $ref: "audio-graph-card.yaml#definitions/ports"

There was no indication any of this applied on the old binding.

I'd rather not get into these arbitrary custom definitions. I think the 
above file probably needs to be split between the card and codec 
schemas. Then in each codec you have just:

allOf:
  - $ref: audio-codec.yaml#

A codec binding should work whether the codec is part of a simple-card 
or graph-card.

> +
> +# use patternProperties to avoid naming "xxx,yyy" issue

What's the issue other than you need a 'description'?

We need to fix it rather than find holes in the meta-schema.

> +patternProperties:
> +  "^asahi-kasei,in1-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag
> +  "^asahi-kasei,in2-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag
> +  "^asahi-kasei,out1-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag
> +  "^asahi-kasei,out2-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag
> +  "^asahi-kasei,out3-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag
> +  "^asahi-kasei,out4-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag
> +  "^asahi-kasei,out5-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag
> +  "^asahi-kasei,out6-single-end$":
> +    $ref: /schemas/types.yaml#/definitions/flag

Though you could make these an actual pattern: in[1-2] and out[1-6]

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        ak4613: ak4613@10 {

audio-codec@10

> +            compatible = "asahi-kasei,ak4613";
> +            reg = <0x10>;
> +        };
> +    };
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ