From patchwork Sat Nov 28 17:33:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 334146 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp3426875ilb; Sat, 28 Nov 2020 14:09:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVoTSh4L8DHWKxIJgoCeAdnDL7S4H0jfXE5VaE4nQ3d7znjePhlw8xzgy2nK/OqT4uhR6E X-Received: by 2002:a17:906:614:: with SMTP id s20mr13845105ejb.202.1606601392630; Sat, 28 Nov 2020 14:09:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606601392; cv=none; d=google.com; s=arc-20160816; b=p8zCeKKsewPfk6+5CB+zAXojU7j2h6MKwcj2va5K1zrE/hJr32ZySIalYr2DvNGpDu I5RWBFXhqwJ1xrjWC/HQwzEJCxPnI2kwW7FdZUaBxFJl25jSA235M/nbSomWYUr1RE9D cWN2z3lPHtKg2uUQr6XtMXt3iSqWfLMA+XLzpV5xqiONd4RFvWMnNMSAcWty7orsOe21 XAcOftpNcNzs1Erjm02nydfm+yV54CCVKGiWEygxcVoaMlzCyAW4K0koWbBlWH1jF8eU 4/rbc6N1aAtqgWQxE1oxmvHk21zvPCkktsJIYYYuZOEOzQyOUvKKQWOlUzl5B8YpKrpR Y4Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IIxpIl+qkKI5ZYcCvkPKaQZICR9KYJ/TRpKhV5sgftY=; b=FRGN0Zddhv0m+xihl2rxQu5cEYST0vQa4kbTsedRGyzAdysl/+4FWBY39NXnaDCIa1 A0mXWbt6e46Taj6DX4068Nd6XdHZJOT5ZMWtv/60+La71z2L2ETKevecnecaNW/id4UN UN+/UinwU9NHYA1BTeWrlkz5wkGK+cmUDABT3TqElheNljE/hOwG/exdObsB3wEJ+og5 1xfe5p7y5aE7+IzxaFnjiAxOmJrNY9+DH3tsFZomZ3Q9lie+XxPJlGwLwTlpOUvKVKVc TSP2gyBtlbSbMWDQpQjJLOCzh/0WN330qoWn7eZAinW5fsscfoZnUpZzJrKXjqsu7Scz ii+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NgXLvdP9; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si7548039ejg.233.2020.11.28.14.09.52; Sat, 28 Nov 2020 14:09:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NgXLvdP9; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730883AbgK1VuI (ORCPT + 2 others); Sat, 28 Nov 2020 16:50:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:45768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733189AbgK1SL4 (ORCPT ); Sat, 28 Nov 2020 13:11:56 -0500 Received: from localhost.localdomain (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E83BD246D4; Sat, 28 Nov 2020 17:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606584949; bh=QhRj1M5XcWGqykhdQbuDQTyYKfBpV6BiehQdm55EpYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NgXLvdP9hQsAygC60erbFKdh3q1fLabcxnyrUZiExsMm+yU2KKMN+B3u7qx9NuEV0 4gA9xVq1jeD50SDUHAss2LZnHSgrixivxeZLe0PEtsXqP6onMgN3An4xg0c2gp7uIs 4P15f1ZTk3NpzrvD7GeM53eB+SVO06uhoyuRgB3U= From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org Cc: Rob Herring , Wolfram Sang , Peter Rosin , Jonathan Cameron , Wolfram Sang Subject: [PATCH v2 1/3] dt-bindings:i2c:i2c-gate: txt to yaml conversion Date: Sat, 28 Nov 2020 17:33:41 +0000 Message-Id: <20201128173343.390165-2-jic23@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201128173343.390165-1-jic23@kernel.org> References: <20201128173343.390165-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Jonathan Cameron This file provides very little in the way of actual schema but does provide a convenient intro to what an i2c-gate node actually represents. Signed-off-by: Jonathan Cameron Cc: Peter Rosin Cc: Wolfram Sang Link: https://lore.kernel.org/r/20201031181801.742585-2-jic23@kernel.org --- .../devicetree/bindings/i2c/i2c-gate.txt | 41 ------------------- .../devicetree/bindings/i2c/i2c-gate.yaml | 39 ++++++++++++++++++ 2 files changed, 39 insertions(+), 41 deletions(-) -- 2.29.2 diff --git a/Documentation/devicetree/bindings/i2c/i2c-gate.txt b/Documentation/devicetree/bindings/i2c/i2c-gate.txt deleted file mode 100644 index 1846d236e656..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-gate.txt +++ /dev/null @@ -1,41 +0,0 @@ -An i2c gate is useful to e.g. reduce the digital noise for RF tuners connected -to the i2c bus. Gates are similar to arbitrators in that you need to perform -some kind of operation to access the i2c bus past the arbitrator/gate, but -there are no competing masters to consider for gates and therefore there is -no arbitration happening for gates. - -Common i2c gate properties. - -- i2c-gate child node - -Required properties for the i2c-gate child node: -- #address-cells = <1>; -- #size-cells = <0>; - -Optional properties for i2c-gate child node: -- Child nodes conforming to i2c bus binding - - -Example : - - /* - An Invensense mpu9150 at address 0x68 featuring an on-chip Asahi - Kasei ak8975 compass behind a gate. - */ - - mpu9150@68 { - compatible = "invensense,mpu9150"; - reg = <0x68>; - interrupt-parent = <&gpio1>; - interrupts = <18 1>; - - i2c-gate { - #address-cells = <1>; - #size-cells = <0>; - - ax8975@c { - compatible = "ak,ak8975"; - reg = <0x0c>; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/i2c/i2c-gate.yaml b/Documentation/devicetree/bindings/i2c/i2c-gate.yaml new file mode 100644 index 000000000000..66472f12a7e2 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-gate.yaml @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/i2c-gate.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common i2c gate properties + +maintainers: + - Peter Rosin + +description: | + An i2c gate is useful to e.g. reduce the digital noise for RF tuners connected + to the i2c bus. Gates are similar to arbitrators in that you need to perform + some kind of operation to access the i2c bus past the arbitrator/gate, but + there are no competing masters to consider for gates and therefore there is + no arbitration happening for gates. + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml + +properties: + $nodename: + const: i2c-gate + +additionalProperties: true + +examples: + - | + i2c-gate { + #address-cells = <1>; + #size-cells = <0>; + ak8975@c { + compatible = "ak,ak8975"; + reg = <0x0c>; + }; + }; +... + From patchwork Sat Nov 28 17:33:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 334145 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp3426864ilb; Sat, 28 Nov 2020 14:09:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6AA6zf+gAzsWY62UZxXcMnI6at8lXB4sEyNhdjAbu2Jsh0mfmBSufjWydXmmXASewB/sy X-Received: by 2002:a50:a40f:: with SMTP id u15mr14875786edb.307.1606601391301; Sat, 28 Nov 2020 14:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606601391; cv=none; d=google.com; s=arc-20160816; b=tNSaoZPdNatoDp0B3VObmn5HEaEyIQyinWSC1yY14FXAt8v71zKepEcACxa85nRgiM wL+gV5SEV5F4DIrT/irW900qJT0lVa4l7fInSrGhZi1jB8LTpajCfcjS5uZFm/vjltSM EMrDTpJGg0NOKbHmCY8MUw/70K/NRVNCQJHVX/HhnjlxH3/9xwtkJXcTKy1Fc4g1KWN9 Q/asPP96qymqJn7HahyBaOkADviZkQdulKQ0OJF6SKCFmXxSyAwoDC3R5ALjeplCxrRB iDhfg9yM+LRih45M1IKIkuIx9EJogCT/AjMLZWLbSpvuYe4YDH1yej+/guDeyMWVpXIF ZXrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qoKaNdF6LtM9TCQf4tHUeOSpYldKwzjOHUmz2j1B+g8=; b=elJotKGLtix72Z8zXUPk3nit4Z6diO25g4On3+2eeZwPZg60CkeJe246T2bmuIxA2a Aihv1l7CWfgg5gv5LMKg/GQtIioR91xsinUK1oq5T6nB7heqGff8rtwYJjcDnLNLe65C LZDDsHrPvUzQ4UUE5UCasKqdZ6UT7puYopgqVfieYj64UILcnSTgByFHbpTyU311gd/J drXYI7qZfZ64660QVXyPIVRlFT8t43VKj41wiz0J0YBYx9+dnLhuKikcockfnuv7lXBT m01Q/bJpgFelB4CN+DGbCBKInD8THAiTRUtOqv1yUYWF/WL+zhwHdJJGNQAAeB45rDP4 aocQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fRbd+QL5; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si7548039ejg.233.2020.11.28.14.09.51; Sat, 28 Nov 2020 14:09:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fRbd+QL5; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733189AbgK1VuJ (ORCPT + 2 others); Sat, 28 Nov 2020 16:50:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:45758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733178AbgK1SL4 (ORCPT ); Sat, 28 Nov 2020 13:11:56 -0500 Received: from localhost.localdomain (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D090C246DC; Sat, 28 Nov 2020 17:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606584951; bh=9BQlSLMXU7WdE/+S3iVfiYVyMzHTfy7TaP9dxoF6nXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRbd+QL5mVVzD0mfqm5tQa6u3F4IhPx1HnjVILbZzWMHVD/9cNQc3BXzG2zEpeeRd eGCGO5rhUh9oI3xjVmAE1bcrgOScWYzq0/U8RI52FeK9odPQOoMMtKm27+wwuq4Anh A3OZKBlauFexuvI3hXdZrabpbUzMxyqpwurHEilY= From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org Cc: Rob Herring , Wolfram Sang , Peter Rosin , Jonathan Cameron , Rob Herring , Jean-Baptiste Maneyrol , Wolfram Sang Subject: [PATCH v2 2/3] dt-bindings:iio:imu:invensense, mpu6050: txt to yaml conversion Date: Sat, 28 Nov 2020 17:33:42 +0000 Message-Id: <20201128173343.390165-3-jic23@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201128173343.390165-1-jic23@kernel.org> References: <20201128173343.390165-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Jonathan Cameron As Rob Herring suggested, this no long requires the explicit i2c-gate binding, but instead just used i2c-controller.yaml directly. 2 prior examples combinded into one as a single example can show all of the binding elements as long as the right part is selected. Signed-off-by: Jonathan Cameron Reviewed-by: Rob Herring Cc: Jean-Baptiste Maneyrol Cc: Wolfram Sang Cc: Peter Rosin Link: https://lore.kernel.org/r/20201031181801.742585-3-jic23@kernel.org --- .../bindings/iio/imu/inv_mpu6050.txt | 67 ------------ .../bindings/iio/imu/invensense,mpu6050.yaml | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 67 deletions(-) -- 2.29.2 diff --git a/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt b/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt deleted file mode 100644 index f2f64749e818..000000000000 --- a/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt +++ /dev/null @@ -1,67 +0,0 @@ -InvenSense MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS MotionTracking Device - -http://www.invensense.com/mems/gyro/mpu6050.html - -Required properties: - - compatible : should be one of - "invensense,mpu6000" - "invensense,mpu6050" - "invensense,mpu6500" - "invensense,mpu6515" - "invensense,mpu9150" - "invensense,mpu9250" - "invensense,mpu9255" - "invensense,icm20608" - "invensense,icm20609" - "invensense,icm20689" - "invensense,icm20602" - "invensense,icm20690" - "invensense,iam20680" - - reg : the I2C address of the sensor - - interrupts: interrupt mapping for IRQ. It should be configured with flags - IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or - IRQ_TYPE_EDGE_FALLING. - - Refer to interrupt-controller/interrupts.txt for generic interrupt client node - bindings. - -Optional properties: - - vdd-supply: regulator phandle for VDD supply - - vddio-supply: regulator phandle for VDDIO supply - - mount-matrix: an optional 3x3 mounting rotation matrix - - i2c-gate node. These devices also support an auxiliary i2c bus. This is - simple enough to be described using the i2c-gate binding. See - i2c/i2c-gate.txt for more details. - -Example: - mpu6050@68 { - compatible = "invensense,mpu6050"; - reg = <0x68>; - interrupt-parent = <&gpio1>; - interrupts = <18 IRQ_TYPE_EDGE_RISING>; - mount-matrix = "-0.984807753012208", /* x0 */ - "0", /* y0 */ - "-0.173648177666930", /* z0 */ - "0", /* x1 */ - "-1", /* y1 */ - "0", /* z1 */ - "-0.173648177666930", /* x2 */ - "0", /* y2 */ - "0.984807753012208"; /* z2 */ - }; - - - mpu9250@68 { - compatible = "invensense,mpu9250"; - reg = <0x68>; - interrupt-parent = <&gpio3>; - interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; - i2c-gate { - #address-cells = <1>; - #size-cells = <0>; - ax8975@c { - compatible = "ak,ak8975"; - reg = <0x0c>; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml new file mode 100644 index 000000000000..9268b6ca2afe --- /dev/null +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml @@ -0,0 +1,103 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/imu/invensense,mpu6050.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: InvenSense MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS MotionTracking Device + +maintainers: + - Jean-Baptiste Maneyrol + +description: | + These devices support both I2C and SPI bus interfaces. + +properties: + compatible: + enum: + - invensense,iam20680 + - invensense,icm20608 + - invensense,icm20609 + - invensense,icm20689 + - invensense,icm20602 + - invensense,icm20690 + - invensense,mpu6000 + - invensense,mpu6050 + - invensense,mpu6500 + - invensense,mpu6515 + - invensense,mpu9150 + - invensense,mpu9250 + - invensense,mpu9255 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + spi-max-frequency: true + + vdd-supply: true + vddio-supply: true + + mount-matrix: true + + i2c-gate: + $ref: /schemas/i2c/i2c-controller.yaml + unevaluatedProperties: false + description: | + These devices also support an auxiliary i2c bus via an i2c-gate. + +allOf: + - if: + not: + properties: + compatible: + contains: + enum: + - invensense,mpu9150 + - invensense,mpu9250 + - invensense,mpu9255 + then: + properties: + i2c-gate: false + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + imu@68 { + compatible = "invensense,mpu9250"; + reg = <0x68>; + interrupt-parent = <&gpio3>; + interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; + mount-matrix = "-0.984807753012208", /* x0 */ + "0", /* y0 */ + "-0.173648177666930", /* z0 */ + "0", /* x1 */ + "-1", /* y1 */ + "0", /* z1 */ + "-0.173648177666930", /* x2 */ + "0", /* y2 */ + "0.984807753012208"; /* z2 */ + i2c-gate { + #address-cells = <1>; + #size-cells = <0>; + magnetometer@c { + compatible = "ak,ak8975"; + reg = <0x0c>; + }; + }; + }; + }; +... From patchwork Sat Nov 28 17:33:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 334147 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp3426880ilb; Sat, 28 Nov 2020 14:09:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJywBrsFz43FjCb/kZESOifW/hIJAjI3lKbeVwrbDNFi3kTsx+IZxOQHI+EpwTWUP51IWnkf X-Received: by 2002:a17:906:31cb:: with SMTP id f11mr14517125ejf.142.1606601393043; Sat, 28 Nov 2020 14:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606601393; cv=none; d=google.com; s=arc-20160816; b=NSNLNraWRyNAoxQlBXQILN7riJMfJKAhC3TVzEwgEfn9OY/g6SKyOdiE+kIj8sJ2+z lknzFzpojBGDyTUZYztlkNxLTsPCFk6Dd0p2TM/JWY9pR2FPWua95AzYL1EFyltSmFCX VSCBFz4+a1BlpVcK7OX5Av5xWnyNTsvZFZpqeJTTPSh/5Png/sIXj9430XGiitsdPl8P ICD9p8cfOLsjFvogHkhwMASzjnJVscu3Eg2XXfWYG99NGICbYzPuZZF1nF/2ph2TF4Bf FL5W9ICyDD2ERYUQgKYZRIvJyAsYSZx2vl//hm4q4gZi2irGzSwyr3XUN12wc33kY8gP tsDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZYyU0S5Rp5aT9sL+rmdoBY/nNBaVqgmYC84h+/e5hj4=; b=qsZaBrbgDvTcW2k9tVxlJzZynlnFBhZxki5UKYhoFRbR19LzU/98UB+FRAFp5ac1L2 1E61Qo5CvVfNNRoPD0UFIdFyqP2qE+5rHpLaGaVhz6Ispjbc8XNKDBXkAGkf60LUUeWO g8xgWmZv/1cBPcfoiKI8AH2+qPb/kDaCIr5a2UIt6SwO18LHnRnVBJwzGemeSXrEe27V A/tTy5EyzAQwCSDw8cYhwZAAlfUzQO5y8/57we2HyylmAnmgIO4XC7HCoRUJIh1hoiui R8zrayVb/UG9CJUJTJYPvSAVhMLM4fOwrDlsXvB+WOC8+IWut3JCvYcp+AFS8U/YBJzJ CwVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vzSZqtyx; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si7548039ejg.233.2020.11.28.14.09.52; Sat, 28 Nov 2020 14:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vzSZqtyx; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733170AbgK1VuI (ORCPT + 2 others); Sat, 28 Nov 2020 16:50:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:45766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730883AbgK1SL4 (ORCPT ); Sat, 28 Nov 2020 13:11:56 -0500 Received: from localhost.localdomain (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0A524246DE; Sat, 28 Nov 2020 17:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606584953; bh=6qNyZ1RtQGHuKLMWge17BBB6zo62SDUtn3lfhDZJZAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vzSZqtyxwLzk+3Q2GF6+3WfEP7KYzBpUefXHLTXmRq7FjIZMG/k3GDDgGEF7z3xPr 90LXvcn6jVEwivGKxPbedMN4v/bqddMc8wgorcrUfUpROlWTd2PmGbfxlMKTjIMR1b TfIljwhhINop5T409hmlhkkuFb96kut70UOtsPIs= From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org Cc: Rob Herring , Wolfram Sang , Peter Rosin , Jonathan Cameron , Linus Walleij , Rob Herring Subject: [PATCH v2 3/3] dt-bindings:iio:gyro:invensense, mpu3050: txt to yaml format conversion. Date: Sat, 28 Nov 2020 17:33:43 +0000 Message-Id: <20201128173343.390165-4-jic23@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201128173343.390165-1-jic23@kernel.org> References: <20201128173343.390165-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Jonathan Cameron 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. As Rob Herring suggested, dropped use of explicit i2c-gate yaml binding in favour of just using the i2c-controller.yaml binding directly. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20201031181801.742585-4-jic23@kernel.org --- .../iio/gyroscope/invensense,mpu3050.txt | 45 ------------ .../iio/gyroscope/invensense,mpu3050.yaml | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 45 deletions(-) -- 2.29.2 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..7e2accc3d5ce --- /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 + +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: /schemas/i2c/i2c-controller.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 an + i2c-gate subnode. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + 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>; + }; + }; + }; + }; +...