devicetree.vger.kernel.org archive mirror
 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,
	linux-i2c@vger.kernel.org, Wolfram Sang <wsa@kernel.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 3/3] dt-bindings:iio:gyro:invensense,mpu3050: txt to yaml format conversion.
Date: Mon, 2 Nov 2020 20:30:36 -0600	[thread overview]
Message-ID: <20201103023036.GC679426@bogus> (raw)
In-Reply-To: <20201031181801.742585-4-jic23@kernel.org>

On Sat, Oct 31, 2020 at 06:18:01PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Very similar to the mpu6050 binding.
> Only unusual element is the i2c-gate section.
> Example tweaked a little to include a real device behind the gate.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../iio/gyroscope/invensense,mpu3050.txt      | 45 ------------
>  .../iio/gyroscope/invensense,mpu3050.yaml     | 70 +++++++++++++++++++
>  2 files changed, 70 insertions(+), 45 deletions(-)

Reviewed-by: Rob Herring <robh@kernel.org>

> diff --git a/Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.txt b/Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.txt
> deleted file mode 100644
> index 233fe207aded..000000000000
> --- a/Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.txt
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -Invensense MPU-3050 Gyroscope device tree bindings
> -
> -Required properties:
> -  - compatible : should be "invensense,mpu3050"
> -  - reg : the I2C address of the sensor
> -
> -Optional properties:
> -  - interrupts : interrupt mapping for the trigger interrupt from the
> -    internal oscillator. The following IRQ modes are supported:
> -    IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_HIGH and
> -    IRQ_TYPE_LEVEL_LOW. The driver should detect and configure the hardware
> -    for the desired interrupt type.
> -  - vdd-supply : supply regulator for the main power voltage.
> -  - vlogic-supply : supply regulator for the signal voltage.
> -  - mount-matrix : see iio/mount-matrix.txt
> -
> -Optional subnodes:
> -  - The MPU-3050 will pass through and forward the I2C signals from the
> -    incoming I2C bus, alternatively drive traffic to a slave device (usually
> -    an accelerometer) on its own initiative. Therefore is supports a subnode
> -    i2c gate node. For details see: i2c/i2c-gate.txt
> -
> -Example:
> -
> -mpu3050@68 {
> -	compatible = "invensense,mpu3050";
> -	reg = <0x68>;
> -	interrupt-parent = <&foo>;
> -	interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
> -	vdd-supply = <&bar>;
> -	vlogic-supply = <&baz>;
> -
> -	/* External I2C interface */
> -	i2c-gate {
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		fnord@18 {
> -			compatible = "fnord";
> -			reg = <0x18>;
> -			interrupt-parent = <&foo>;
> -			interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
> -		};
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml b/Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml
> new file mode 100644
> index 000000000000..b0a476afb656
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/gyroscope/invensense,mpu3050.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Invensense MPU-3050 Gyroscope
> +
> +maintainers:
> +  - Linus Walleij <linus.walleij@linaro.org>
> +
> +properties:
> +  compatible:
> +    const: invensense,mpu3050
> +
> +  reg:
> +    maxItems: 1
> +
> +  vdd-supply: true
> +
> +  vlogic-supply: true
> +
> +  interrupts:
> +    minItems: 1
> +    description:
> +      Interrupt mapping for the trigger interrupt from the internal oscillator.
> +
> +  mount-matrix: true
> +
> +  i2c-gate:
> +    $ref: "../../i2c/i2c-gate.yaml"
> +    unevaluatedProperties: false
> +    description: |
> +      The MPU-3050 will pass through and forward the I2C signals from the
> +      incoming I2C bus, alternatively drive traffic to a slave device (usually
> +      an accelerometer) on its own initiative. Therefore is supports a subnode
> +      i2c gate node.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        gyroscope@68 {
> +            compatible = "invensense,mpu3050";
> +            reg = <0x68>;
> +            interrupt-parent = <&foo>;
> +            interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
> +            vdd-supply = <&bar>;
> +            vlogic-supply = <&baz>;
> +
> +            i2c-gate {
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +
> +                magnetometer@c {
> +                    compatible = "ak,ak8975";
> +                    reg = <0x0c>;
> +                };
> +            };
> +        };
> +    };
> +...
> -- 
> 2.28.0
> 

  reply	other threads:[~2020-11-03  2:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 18:17 [PATCH 0/3] dt-bindings: yaml conversion of i2c-gate and IIO users Jonathan Cameron
2020-10-31 18:17 ` [PATCH 1/3] dt-bindings:i2c:i2c-gate: txt to yaml conversion Jonathan Cameron
2020-11-03  2:25   ` Rob Herring
2020-10-31 18:18 ` [PATCH 2/3] dt-bindings:iio:imu:invensense,mpu6050: " Jonathan Cameron
2020-11-03  2:29   ` Rob Herring
2020-10-31 18:18 ` [PATCH 3/3] dt-bindings:iio:gyro:invensense,mpu3050: txt to yaml format conversion Jonathan Cameron
2020-11-03  2:30   ` Rob Herring [this message]
2020-11-03  9:55   ` Linus Walleij

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=20201103023036.GC679426@bogus \
    --to=robh@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=wsa@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).