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: <20250430-folic-skittle-06b0ccbedf35@spud>
Date: Wed, 30 Apr 2025 16:42:57 +0100
From: Conor Dooley <conor@...nel.org>
To: Rodrigo Gobbi <rodrigo.gobbi.7@...il.com>
Cc: jic23@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
	conor+dt@...nel.org, ~lkcamp/patches@...ts.sr.ht,
	linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] dt-bindings:iio:adc:st,spear600-adc: txt to yaml
 format conversion.

Hey,

On Tue, Apr 29, 2025 at 10:50:01PM -0300, Rodrigo Gobbi wrote:
> Straight forward conversion from spear-adc.txt into yaml format.
> 
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@...il.com>
> ---
> Some constraints were extracted from the driver (spear_adc.c) and the public datasheet
> referenced at the yaml.
> 
> Changelog:
> v2: add constraints over properties and remove a ref at MAINTAINERS file.
> v1: https://lore.kernel.org/linux-devicetree/20250423022956.31218-1-rodrigo.gobbi.7@gmail.com/
> ---
>  .../bindings/iio/adc/st,spear600-adc.yaml     | 69 +++++++++++++++++++
>  .../bindings/staging/iio/adc/spear-adc.txt    | 24 -------
>  MAINTAINERS                                   |  2 +-
>  3 files changed, 70 insertions(+), 25 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/st,spear600-adc.yaml
>  delete mode 100644 Documentation/devicetree/bindings/staging/iio/adc/spear-adc.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/st,spear600-adc.yaml b/Documentation/devicetree/bindings/iio/adc/st,spear600-adc.yaml
> new file mode 100644
> index 000000000000..afce10eab1c1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/st,spear600-adc.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/st,spear600-adc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ST SPEAr ADC device driver
> +
> +maintainers:
> +  - Jonathan Cameron <jic23@...nel.org>
> +
> +description: |
> +  Integrated ADC inside the ST SPEAr SoC, SPEAr600, supporting
> +  10-bit resolution. Datasheet can be found here:
> +  https://www.st.com/resource/en/datasheet/spear600.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - st,spear600-adc
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  sampling-frequency:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 2500000
> +    maximum: 20000000
> +    description:
> +      Default sampling frequency of the ADC

I think you should note that this is in Hz, while you're at it.

> +  vref-external:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 1000
> +    maximum: 2800
> +    description:
> +      External voltage reference in milli-volts. If omitted
> +      the internal voltage reference will be used.
> +
> +  average-samples:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 1
> +    maximum: 128
> +    default: 0

Is 0 the default here or 1? "Single data conversion" sounds more like 1
sample than 0, and the default of 0 is below the minimum of 1. What's
going on there?


> +    description:
> +      Number of samples to generate an average value. If
> +      omitted, single data conversion will be used.
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - sampling-frequency
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    adc: adc@...00000 {

The "adc:" label here can be removed, it's not doing anything!

> +        compatible = "st,spear600-adc";
> +        reg = <0xd8200000 0x1000>;
> +        interrupt-parent = <&vic1>;
> +        interrupts = <6>;
> +        sampling-frequency = <5000000>;
> +        vref-external = <2500>;	/* 2.5V VRef */
> +    };
> diff --git a/Documentation/devicetree/bindings/staging/iio/adc/spear-adc.txt b/Documentation/devicetree/bindings/staging/iio/adc/spear-adc.txt
> deleted file mode 100644
> index 88bc94fe1f6d..000000000000
> --- a/Documentation/devicetree/bindings/staging/iio/adc/spear-adc.txt
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -* ST SPEAr ADC device driver
> -
> -Required properties:
> -- compatible: Should be "st,spear600-adc"
> -- reg: Address and length of the register set for the device
> -- interrupts: Should contain the ADC interrupt
> -- sampling-frequency: Default sampling frequency
> -
> -Optional properties:
> -- vref-external: External voltage reference in milli-volts. If omitted
> -  the internal voltage reference will be used.
> -- average-samples: Number of samples to generate an average value. If
> -  omitted, single data conversion will be used.
> -
> -Examples:
> -
> -	adc: adc@...00000 {
> -		compatible = "st,spear600-adc";
> -		reg = <0xd8200000 0x1000>;
> -		interrupt-parent = <&vic1>;
> -		interrupts = <6>;
> -		sampling-frequency = <5000000>;
> -		vref-external = <2500>;	/* 2.5V VRef */
> -	};
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 906881b6c5cb..e923becb0633 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -23213,7 +23213,7 @@ STAGING - INDUSTRIAL IO
>  M:	Jonathan Cameron <jic23@...nel.org>
>  L:	linux-iio@...r.kernel.org
>  S:	Odd Fixes
> -F:	Documentation/devicetree/bindings/staging/iio/
> +F:	Documentation/devicetree/bindings/iio/

This change seems unneeded? The main iio entry already covers this
directory. I think you can probably just drop the line from the staging
entry?

Cheers,
Conor.

>  F:	drivers/staging/iio/
>  
>  STAGING - NVIDIA COMPLIANT EMBEDDED CONTROLLER INTERFACE (nvec)
> -- 
> 2.47.0
> 

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