Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings:iio:gyro:invensense,mpu3050: txt to yaml format conversion.

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201128173343.390165-4-jic23@kernel.org

+70 -45
-45
Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.txt
··· 1 - Invensense MPU-3050 Gyroscope device tree bindings 2 - 3 - Required properties: 4 - - compatible : should be "invensense,mpu3050" 5 - - reg : the I2C address of the sensor 6 - 7 - Optional properties: 8 - - interrupts : interrupt mapping for the trigger interrupt from the 9 - internal oscillator. The following IRQ modes are supported: 10 - IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_HIGH and 11 - IRQ_TYPE_LEVEL_LOW. The driver should detect and configure the hardware 12 - for the desired interrupt type. 13 - - vdd-supply : supply regulator for the main power voltage. 14 - - vlogic-supply : supply regulator for the signal voltage. 15 - - mount-matrix : see iio/mount-matrix.txt 16 - 17 - Optional subnodes: 18 - - The MPU-3050 will pass through and forward the I2C signals from the 19 - incoming I2C bus, alternatively drive traffic to a slave device (usually 20 - an accelerometer) on its own initiative. Therefore is supports a subnode 21 - i2c gate node. For details see: i2c/i2c-gate.txt 22 - 23 - Example: 24 - 25 - mpu3050@68 { 26 - compatible = "invensense,mpu3050"; 27 - reg = <0x68>; 28 - interrupt-parent = <&foo>; 29 - interrupts = <12 IRQ_TYPE_EDGE_FALLING>; 30 - vdd-supply = <&bar>; 31 - vlogic-supply = <&baz>; 32 - 33 - /* External I2C interface */ 34 - i2c-gate { 35 - #address-cells = <1>; 36 - #size-cells = <0>; 37 - 38 - fnord@18 { 39 - compatible = "fnord"; 40 - reg = <0x18>; 41 - interrupt-parent = <&foo>; 42 - interrupts = <13 IRQ_TYPE_EDGE_FALLING>; 43 - }; 44 - }; 45 - };
+70
Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/gyroscope/invensense,mpu3050.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Invensense MPU-3050 Gyroscope 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + properties: 13 + compatible: 14 + const: invensense,mpu3050 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + vdd-supply: true 20 + 21 + vlogic-supply: true 22 + 23 + interrupts: 24 + minItems: 1 25 + description: 26 + Interrupt mapping for the trigger interrupt from the internal oscillator. 27 + 28 + mount-matrix: true 29 + 30 + i2c-gate: 31 + $ref: /schemas/i2c/i2c-controller.yaml 32 + unevaluatedProperties: false 33 + description: | 34 + The MPU-3050 will pass through and forward the I2C signals from the 35 + incoming I2C bus, alternatively drive traffic to a slave device (usually 36 + an accelerometer) on its own initiative. Therefore is supports an 37 + i2c-gate subnode. 38 + 39 + required: 40 + - compatible 41 + - reg 42 + 43 + additionalProperties: false 44 + 45 + examples: 46 + - | 47 + #include <dt-bindings/interrupt-controller/irq.h> 48 + i2c { 49 + #address-cells = <1>; 50 + #size-cells = <0>; 51 + gyroscope@68 { 52 + compatible = "invensense,mpu3050"; 53 + reg = <0x68>; 54 + interrupt-parent = <&foo>; 55 + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; 56 + vdd-supply = <&bar>; 57 + vlogic-supply = <&baz>; 58 + 59 + i2c-gate { 60 + #address-cells = <1>; 61 + #size-cells = <0>; 62 + 63 + magnetometer@c { 64 + compatible = "ak,ak8975"; 65 + reg = <0x0c>; 66 + }; 67 + }; 68 + }; 69 + }; 70 + ...