All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Marek Vasut <marek.vasut+renesas@gmail.com>
Subject: Re: [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
Date: Tue, 3 Nov 2020 10:26:33 -0600	[thread overview]
Message-ID: <20201103162633.GD1754553@bogus> (raw)
In-Reply-To: <20201031184854.745828-31-jic23@kernel.org>

On Sat, Oct 31, 2020 at 06:48:38PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This is a somewhat unusual device, in that it effectively does
> spi offload.   That means that it doesn't act as a full SPI
> master, but supports some functionality.  As such it supports
> a subset of specific SPI ADCs.  There is potential for a future
> clash in bindings, but as these are simple devices hopefully that
> will not occur.
> 
> One addition to this from testing it against existing dts files
> was to add a resets property.
> This is specified in arch/arm/boot/dts/r8a7791.dtsi
> If it's the dtsi that is wrong and not the binding doc, then
> we can fix that instead.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
> ---
>  .../bindings/iio/adc/renesas,gyroadc.txt      |  98 ------------
>  .../iio/adc/renesas,rcar-gyroadc.yaml         | 141 ++++++++++++++++++
>  2 files changed, 141 insertions(+), 98 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt b/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
> deleted file mode 100644
> index df5b9f2ad8d8..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
> +++ /dev/null
> @@ -1,98 +0,0 @@
> -* Renesas R-Car GyroADC device driver
> -
> -The GyroADC block is a reduced SPI block with up to 8 chipselect lines,
> -which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs
> -are sampled by the GyroADC block in a round-robin fashion and the result
> -presented in the GyroADC registers.
> -
> -Required properties:
> -- compatible:	Should be "<soc-specific>", "renesas,rcar-gyroadc".
> -                The <soc-specific> should be one of:
> -		renesas,r8a7791-gyroadc - for the GyroADC block present
> -					  in r8a7791 SoC
> -		renesas,r8a7792-gyroadc - for the GyroADC with interrupt
> -					  block present in r8a7792 SoC
> -- reg:		Address and length of the register set for the device
> -- clocks:	References to all the clocks specified in the clock-names
> -		property as specified in
> -		Documentation/devicetree/bindings/clock/clock-bindings.txt.
> -- clock-names:	Shall contain "fck". The "fck" is the GyroADC block clock.
> -- power-domains: Must contain a reference to the PM domain, if available.
> -- #address-cells: Should be <1> (setting for the subnodes) for all ADCs
> -		except for "fujitsu,mb88101a". Should be <0> (setting for
> -		only subnode) for "fujitsu,mb88101a".
> -- #size-cells:	Should be <0> (setting for the subnodes)
> -
> -Sub-nodes:
> -You must define subnode(s) which select the connected ADC type and reference
> -voltage for the GyroADC channels.
> -
> -Required properties for subnodes:
> -- compatible:	Should be either of:
> -		"fujitsu,mb88101a"
> -			- Fujitsu MB88101A compatible mode,
> -			  12bit sampling, up to 4 channels can be sampled in
> -			  round-robin fashion. One Fujitsu chip supplies four
> -			  GyroADC channels with data as it contains four ADCs
> -			  on the chip and thus for 4-channel operation, single
> -			  MB88101A is required. The Cx chipselect lines of the
> -			  MB88101A connect directly to two CHS lines of the
> -			  GyroADC, no demuxer is required. The data out line
> -			  of each MB88101A connects to a shared input pin of
> -			  the GyroADC.
> -		"ti,adcs7476" or "ti,adc121" or "adi,ad7476"
> -			- TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode,
> -			  15bit sampling, up to 8 channels can be sampled in
> -			  round-robin fashion. One TI/ADI chip supplies single
> -			  ADC channel with data, thus for 8-channel operation,
> -			  8 chips are required. A 3:8 chipselect demuxer is
> -			  required to connect the nCS line of the TI/ADI chips
> -			  to the GyroADC, while MISO line of each TI/ADI ADC
> -			  connects to a shared input pin of the GyroADC.
> -		"maxim,max1162" or "maxim,max11100"
> -			- Maxim MAX1162 / Maxim MAX11100 compatible mode,
> -			  16bit sampling, up to 8 channels can be sampled in
> -			  round-robin fashion. One Maxim chip supplies single
> -			  ADC channel with data, thus for 8-channel operation,
> -			  8 chips are required. A 3:8 chipselect demuxer is
> -			  required to connect the nCS line of the MAX chips
> -			  to the GyroADC, while MISO line of each Maxim ADC
> -			  connects to a shared input pin of the GyroADC.
> -- reg:		Should be the number of the analog input. Should be present
> -		for all ADCs except "fujitsu,mb88101a".
> -- vref-supply:	Reference to the channel reference voltage regulator.
> -
> -Example:
> -	vref_max1162: regulator-vref-max1162 {
> -		compatible = "regulator-fixed";
> -
> -		regulator-name = "MAX1162 Vref";
> -		regulator-min-microvolt = <4096000>;
> -		regulator-max-microvolt = <4096000>;
> -	};
> -
> -	adc@e6e54000 {
> -		compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc";
> -		reg = <0 0xe6e54000 0 64>;
> -		clocks = <&mstp9_clks R8A7791_CLK_GYROADC>;
> -		clock-names = "fck";
> -		power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
> -
> -		pinctrl-0 = <&adc_pins>;
> -		pinctrl-names = "default";
> -
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		adc@0 {
> -			reg = <0>;
> -			compatible = "maxim,max1162";
> -			vref-supply = <&vref_max1162>;
> -		};
> -
> -		adc@1 {
> -			reg = <1>;
> -			compatible = "maxim,max1162";
> -			vref-supply = <&vref_max1162>;
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
> new file mode 100644
> index 000000000000..aeaa9d372450
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
> @@ -0,0 +1,141 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/renesas,rcar-gyroadc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas R-Car GyroADC
> +
> +maintainers:
> +  - Marek Vasut <marek.vasut+renesas@gmail.com>
> +
> +description: |
> +  The GyroADC block is a reduced SPI block with up to 8 chipselect lines,
> +  which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs
> +  are sampled by the GyroADC block in a round-robin fashion and the result
> +  presented in the GyroADC registers.
> +  The ADC bindings should match with that of the devices connected to a
> +  full featured SPI bus.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - renesas,r8a7791-gyroadc
> +          - renesas,r8a7792-gyroadc
> +      - const: renesas,rcar-gyroadc
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: fck
> +
> +  power-domains: true
> +
> +  resets: true
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +  - "#address-cells"
> +  - "#size-cells"
> +
> +patternProperties:
> +  "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$":

No reason to repeat this regex as all node names get checked. Just need 
to restrict the unit-address:

"@[0-7]$"

> +    type: object
> +    properties:
> +      compatible:
> +        description: |
> +          fujitsu,mb88101a
> +          - Fujitsu MB88101A compatible mode,
> +            12bit sampling, up to 4 channels can be sampled in round-robin
> +            fashion. One Fujitsu chip supplies four GyroADC channels with
> +            data as it contains four ADCs on the chip and thus for 4-channel
> +            operation, single MB88101A is required. The Cx chipselect lines
> +            of the MB88101A connect directly to two CHS lines of the GyroADC,
> +            no demuxer is required. The data out line of each MB88101A
> +            connects to a shared input pin of the GyroADC.
> +          ti,adcs7476 or ti,adc121 or adi,ad7476
> +          - TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode, 15bit
> +            sampling, up to 8 channels can be sampled in round-robin
> +            fashion. One TI/ADI chip supplies single ADC channel with data,
> +            thus for 8-channel operation, 8 chips are required.
> +            A 3:8 chipselect demuxer is  required to connect the nCS line
> +            of the TI/ADI chips to the GyroADC, while MISO line of each
> +            TI/ADI ADC connects to a shared input pin of the GyroADC.
> +          maxim,max1162 or maxim,max11100
> +          - Maxim MAX1162 / Maxim MAX11100 compatible mode,  16bit sampling,
> +            up to 8 channels can be sampled in round-robin fashion. One
> +            Maxim chip supplies single ADC channel with data, thus for
> +            8-channel operation, 8 chips are required.
> +            A 3:8 chipselect demuxer is required to connect the nCS line
> +            of the MAX chips to the GyroADC, while MISO line of each Maxim
> +            ADC connects to a shared input pin of the GyroADC.
> +        enum:
> +          - adi,7476
> +          - fujitsu,mb88101a
> +          - maxim,max1162
> +          - maxim,max11100
> +          - ti,adcs7476
> +          - ti,adc121
> +
> +      reg: true

minimum: 0
maximum: 7

> +
> +      vref-supply: true
> +
> +    additionalProperties: false
> +
> +    required:
> +      - compatible
> +      - reg
> +      - vref-supply
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/r8a7791-clock.h>
> +    #include <dt-bindings/power/r8a7791-sysc.h>
> +    soc {
> +        #address-cells = <2>;
> +        #size-cells = <2>;
> +
> +        adc@e6e54000 {
> +            compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc";
> +            reg = <0 0xe6e54000 0 64>;
> +            clocks = <&mstp9_clks R8A7791_CLK_GYROADC>;
> +            clock-names = "fck";
> +            power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
> +
> +            pinctrl-0 = <&adc_pins>;
> +            pinctrl-names = "default";
> +
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            adc@0 {
> +                reg = <0>;
> +                compatible = "maxim,max1162";
> +                vref-supply = <&vref_max1162>;
> +            };
> +
> +            adc@1 {
> +                reg = <1>;
> +                compatible = "maxim,max1162";
> +                vref-supply = <&vref_max1162>;
> +            };
> +        };
> +    };
> +...
> -- 
> 2.28.0
> 

  reply	other threads:[~2020-11-03 16:26 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
2020-10-31 18:48 ` [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml Jonathan Cameron
2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
2020-11-02  4:48   ` Phil Reid
2020-11-03 16:10   ` Rob Herring
2020-11-03 17:28     ` Jonathan Cameron
2020-11-04  0:39       ` Phil Reid
2020-11-04  3:12         ` Rob Herring
2020-11-04  4:53           ` Phil Reid
2020-11-09  2:56             ` Phil Reid
2020-11-22 16:35               ` Jonathan Cameron
2020-11-23 23:33                 ` Phil Reid
2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
2020-11-02 16:19   ` Slawomir Stepien
2020-11-03 16:11   ` Rob Herring
2020-10-31 18:48 ` [PATCH 04/46] dt-bindings:iio:potentiometer:microchip,mcp41010 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 05/46] dt-bindings:iio:impedance-analyzer:adi,ad5933 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: " Jonathan Cameron
2020-11-22 16:43   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding Jonathan Cameron
2020-11-22 17:32   ` Jonathan Cameron
2020-11-28 16:15     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
2020-11-28 16:24   ` Jonathan Cameron
2020-12-18 19:42   ` Rob Herring
2020-12-30 12:21     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: " Jonathan Cameron
2020-10-31 21:41   ` Matt Ranostay
2020-11-22 16:58     ` Jonathan Cameron
2020-11-22 17:24       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: " Jonathan Cameron
2020-10-31 21:38   ` Matt Ranostay
2020-11-22 17:29     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 11/46] dt-bindings:iio:imu:adi,adis16480: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 12/46] dt-bindings:iio:imu:st,lsm6dsx: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 13/46] dt-bindings:iio:light:avago,apds9300: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: " Jonathan Cameron
2020-10-31 21:33   ` Matt Ranostay
2020-10-31 21:35     ` Matt Ranostay
2020-11-01 14:57       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 15/46] dt-bindings:iio:light:capella,cm36651: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: " Jonathan Cameron
2020-11-22 17:42   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 17/46] dt-bindings:iio:light:maxim,max44009: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 18/46] dt-bindings:iio:light:ti,opt3001: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: " Jonathan Cameron
2020-11-03 16:18   ` Rob Herring
2020-10-31 18:48 ` [PATCH 20/46] dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor Jonathan Cameron
2020-10-31 18:48 ` [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion Jonathan Cameron
2020-11-22 17:52   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion Jonathan Cameron
2020-11-01 15:26   ` Manivannan Sadhasivam
2020-10-31 18:48 ` [PATCH 23/46] dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion Jonathan Cameron
2020-11-04 14:47   ` Linus Walleij
2020-11-08 15:55     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 25/46] dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 26/46] dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 27/46] dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: " Jonathan Cameron
2020-11-22 18:07   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt Jonathan Cameron
2020-11-13  9:22   ` Alexandre Belloni
2020-11-14 15:37     ` Jonathan Cameron
2020-11-22 18:09       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
2020-11-03 16:26   ` Rob Herring [this message]
2020-11-27  8:14   ` Geert Uytterhoeven
2020-10-31 18:48 ` [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: " Jonathan Cameron
2020-11-22 18:15   ` Jonathan Cameron
2020-11-23  3:02     ` Chen-Yu Tsai
2020-11-23 20:36       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 32/46] dt-bindings:iio:adc:brcm,iproc-static-adc: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 33/46] dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:20   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename Jonathan Cameron
2020-11-04 14:51   ` Linus Walleij
2020-10-31 18:48 ` [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:25   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: " Jonathan Cameron
2020-11-02 12:49   ` Dan Murphy
2020-11-08 16:59     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 38/46] dt-bindings:iio:dac:ad5592r: " Jonathan Cameron
2020-11-03 16:31   ` Rob Herring
2020-11-22 18:38     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 39/46] dt-bindings:iio:dac:ad5755: " Jonathan Cameron
2020-11-03 16:32   ` Rob Herring
2020-11-22 18:40     ` Jonathan Cameron
2021-02-21 16:33       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: " Jonathan Cameron
2020-11-22 18:44   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 41/46] dt-bindings:iio:accel:kionix,kxcjk1013: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion Jonathan Cameron
2020-11-03 16:34   ` Rob Herring
2020-11-22 18:50     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 43/46] dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion Jonathan Cameron
2020-11-02 16:16   ` Denis CIOCCA
2020-10-31 18:48 ` [PATCH 45/46] dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 46/46] dt-bindings:iio:temperature: Drop generic binding file Jonathan Cameron
2020-11-03 16:38 ` [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Rob Herring
2020-11-03 17:24   ` Jonathan Cameron
2020-11-22 18:59     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201103162633.GD1754553@bogus \
    --to=robh@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.