mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
iio: st-sensors: Update ST Sensor bindings
This adjusts the ST Sensor bindings with the more fine-grained syntax checks that were proposed late in the last kernel cycle and colliding with parallel work. Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210412122331.1631643-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
8bad605065
commit
0cd7114580
1 changed files with 182 additions and 77 deletions
|
@ -6,7 +6,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||||
|
|
||||||
title: STMicroelectronics MEMS sensors
|
title: STMicroelectronics MEMS sensors
|
||||||
|
|
||||||
description: |
|
description: The STMicroelectronics sensor devices are pretty straight-forward
|
||||||
|
I2C or SPI devices, all sharing the same device tree descriptions no matter
|
||||||
|
what type of sensor it is.
|
||||||
Note that whilst this covers many STMicro MEMs sensors, some more complex
|
Note that whilst this covers many STMicro MEMs sensors, some more complex
|
||||||
IMUs need their own bindings.
|
IMUs need their own bindings.
|
||||||
The STMicroelectronics sensor devices are pretty straight-forward I2C or
|
The STMicroelectronics sensor devices are pretty straight-forward I2C or
|
||||||
|
@ -15,90 +17,178 @@ description: |
|
||||||
|
|
||||||
maintainers:
|
maintainers:
|
||||||
- Denis Ciocca <denis.ciocca@st.com>
|
- Denis Ciocca <denis.ciocca@st.com>
|
||||||
|
- Linus Walleij <linus.walleij@linaro.org>
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
compatible:
|
compatible:
|
||||||
description: |
|
oneOf:
|
||||||
Some values are deprecated.
|
- description: STMicroelectronics Accelerometers
|
||||||
st,lis3lv02d (deprecated, use st,lis3lv02dl-accel)
|
enum:
|
||||||
st,lis302dl-spi (deprecated, use st,lis3lv02dl-accel)
|
- st,h3lis331dl-accel
|
||||||
enum:
|
- st,lis2de12
|
||||||
# Accelerometers
|
- st,lis2dw12
|
||||||
- st,lis3lv02d
|
- st,lis2hh12
|
||||||
- st,lis302dl-spi
|
- st,lis2dh12-accel
|
||||||
- st,lis3lv02dl-accel
|
- st,lis331dl-accel
|
||||||
- st,lsm303dlh-accel
|
- st,lis331dlh-accel
|
||||||
- st,lsm303dlhc-accel
|
- st,lis3de
|
||||||
- st,lis3dh-accel
|
- st,lis3dh-accel
|
||||||
- st,lsm330d-accel
|
- st,lis3dhh
|
||||||
- st,lsm330dl-accel
|
- st,lis3l02dq
|
||||||
- st,lsm330dlc-accel
|
- st,lis3lv02dl-accel
|
||||||
- st,lis331dl-accel
|
- st,lng2dm-accel
|
||||||
- st,lis331dlh-accel
|
- st,lsm303agr-accel
|
||||||
- st,lsm303dl-accel
|
- st,lsm303dl-accel
|
||||||
- st,lsm303dlm-accel
|
- st,lsm303dlh-accel
|
||||||
- st,lsm330-accel
|
- st,lsm303dlhc-accel
|
||||||
- st,lsm303agr-accel
|
- st,lsm303dlm-accel
|
||||||
- st,lis2dh12-accel
|
- st,lsm330-accel
|
||||||
- st,h3lis331dl-accel
|
- st,lsm330d-accel
|
||||||
- st,lng2dm-accel
|
- st,lsm330dl-accel
|
||||||
- st,lis3l02dq
|
- st,lsm330dlc-accel
|
||||||
- st,lis2dw12
|
- description: STMicroelectronics Gyroscopes
|
||||||
- st,lis3dhh
|
enum:
|
||||||
- st,lis3de
|
- st,l3g4200d-gyro
|
||||||
- st,lis2de12
|
- st,l3g4is-gyro
|
||||||
- st,lis2hh12
|
- st,l3gd20-gyro
|
||||||
# Gyroscopes
|
- st,l3gd20h-gyro
|
||||||
- st,l3g4200d-gyro
|
- st,lsm330-gyro
|
||||||
- st,lsm330d-gyro
|
- st,lsm330d-gyro
|
||||||
- st,lsm330dl-gyro
|
- st,lsm330dl-gyro
|
||||||
- st,lsm330dlc-gyro
|
- st,lsm330dlc-gyro
|
||||||
- st,l3gd20-gyro
|
- st,lsm9ds0-gyro
|
||||||
- st,l3gd20h-gyro
|
- description: STMicroelectronics Magnetometers
|
||||||
- st,l3g4is-gyro
|
enum:
|
||||||
- st,lsm330-gyro
|
- st,lis2mdl
|
||||||
- st,lsm9ds0-gyro
|
- st,lis3mdl-magn
|
||||||
# Magnetometers
|
- st,lsm303agr-magn
|
||||||
- st,lsm303agr-magn
|
- st,lsm303dlh-magn
|
||||||
- st,lsm303dlh-magn
|
- st,lsm303dlhc-magn
|
||||||
- st,lsm303dlhc-magn
|
- st,lsm303dlm-magn
|
||||||
- st,lsm303dlm-magn
|
- st,lsm9ds1-magn
|
||||||
- st,lis3mdl-magn
|
- description: STMicroelectronics Pressure Sensors
|
||||||
- st,lis2mdl
|
enum:
|
||||||
- st,lsm9ds1-magn
|
- st,lps001wp-press
|
||||||
- st,iis2mdc
|
- st,lps22hb-press
|
||||||
# Pressure sensors
|
- st,lps22hh
|
||||||
- st,lps001wp-press
|
- st,lps25h-press
|
||||||
- st,lps25h-press
|
- st,lps331ap-press
|
||||||
- st,lps331ap-press
|
- st,lps33hw
|
||||||
- st,lps22hb-press
|
- st,lps35hw
|
||||||
- st,lps33hw
|
- description: Deprecated bindings
|
||||||
- st,lps35hw
|
enum:
|
||||||
- st,lps22hh
|
- st,lis302dl-spi
|
||||||
|
- st,lis3lv02d
|
||||||
|
deprecated: true
|
||||||
|
|
||||||
reg:
|
reg:
|
||||||
maxItems: 1
|
maxItems: 1
|
||||||
|
|
||||||
interrupts:
|
interrupts:
|
||||||
|
description: interrupt line(s) connected to the DRDY line(s) and/or the
|
||||||
|
Intertial interrupt lines INT1 and INT2 if these exist. This means up to
|
||||||
|
three interrupts, and the DRDY must be the first one if it exists on
|
||||||
|
the package. The trigger edge of the interrupts is sometimes software
|
||||||
|
configurable in the hardware so the operating system should parse this
|
||||||
|
flag and set up the trigger edge as indicated in the device tree.
|
||||||
minItems: 1
|
minItems: 1
|
||||||
|
maxItems: 2
|
||||||
|
|
||||||
vdd-supply: true
|
vdd-supply: true
|
||||||
vddio-supply: true
|
vddio-supply: true
|
||||||
|
|
||||||
st,drdy-int-pin:
|
st,drdy-int-pin:
|
||||||
|
description: the pin on the package that will be used to signal
|
||||||
|
"data ready" (valid values 1 or 2). This property is not configurable
|
||||||
|
on all sensors.
|
||||||
$ref: /schemas/types.yaml#/definitions/uint32
|
$ref: /schemas/types.yaml#/definitions/uint32
|
||||||
description:
|
enum: [1, 2]
|
||||||
Some sensors have multiple possible pins via which they can provide
|
|
||||||
a data ready interrupt. This selects which one.
|
|
||||||
enum:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
|
|
||||||
drive-open-drain:
|
drive-open-drain:
|
||||||
$ref: /schemas/types.yaml#/definitions/flag
|
$ref: /schemas/types.yaml#/definitions/flag
|
||||||
description: |
|
description: the interrupt/data ready line will be configured
|
||||||
The interrupt/data ready line will be configured as open drain, which
|
as open drain, which is useful if several sensors share the same
|
||||||
is useful if several sensors share the same interrupt line.
|
interrupt line. (This binding is taken from pinctrl.)
|
||||||
|
|
||||||
|
mount-matrix:
|
||||||
|
description: an optional 3x3 mounting rotation matrix.
|
||||||
|
|
||||||
|
allOf:
|
||||||
|
- if:
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
enum:
|
||||||
|
# These have no interrupts
|
||||||
|
- st,lps001wp
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
interrupts: false
|
||||||
|
st,drdy-int-pin: false
|
||||||
|
drive-open-drain: false
|
||||||
|
|
||||||
|
- if:
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
enum:
|
||||||
|
# These have only DRDY
|
||||||
|
- st,lis2mdl
|
||||||
|
- st,lis3l02dq
|
||||||
|
- st,lis3lv02dl-accel
|
||||||
|
- st,lps22hb-press
|
||||||
|
- st,lps22hh
|
||||||
|
- st,lps25h-press
|
||||||
|
- st,lps33hw
|
||||||
|
- st,lps35hw
|
||||||
|
- st,lsm303agr-magn
|
||||||
|
- st,lsm303dlh-magn
|
||||||
|
- st,lsm303dlhc-magn
|
||||||
|
- st,lsm303dlm-magn
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
interrupts:
|
||||||
|
maxItems: 1
|
||||||
|
st,drdy-int-pin: false
|
||||||
|
|
||||||
|
- if:
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
enum:
|
||||||
|
# Two intertial interrupts i.e. accelerometer/gyro interrupts
|
||||||
|
- st,h3lis331dl-accel
|
||||||
|
- st,l3g4200d-gyro
|
||||||
|
- st,l3g4is-gyro
|
||||||
|
- st,l3gd20-gyro
|
||||||
|
- st,l3gd20h-gyro
|
||||||
|
- st,lis2de12
|
||||||
|
- st,lis2dw12
|
||||||
|
- st,lis2hh12
|
||||||
|
- st,lis2dh12-accel
|
||||||
|
- st,lis331dl-accel
|
||||||
|
- st,lis331dlh-accel
|
||||||
|
- st,lis3de
|
||||||
|
- st,lis3dh-accel
|
||||||
|
- st,lis3dhh
|
||||||
|
- st,lis3mdl-magn
|
||||||
|
- st,lng2dm-accel
|
||||||
|
- st,lps331ap-press
|
||||||
|
- st,lsm303agr-accel
|
||||||
|
- st,lsm303dlh-accel
|
||||||
|
- st,lsm303dlhc-accel
|
||||||
|
- st,lsm303dlm-accel
|
||||||
|
- st,lsm330-accel
|
||||||
|
- st,lsm330-gyro
|
||||||
|
- st,lsm330d-accel
|
||||||
|
- st,lsm330d-gyro
|
||||||
|
- st,lsm330dl-accel
|
||||||
|
- st,lsm330dl-gyro
|
||||||
|
- st,lsm330dlc-accel
|
||||||
|
- st,lsm330dlc-gyro
|
||||||
|
- st,lsm9ds0-gyro
|
||||||
|
- st,lsm9ds1-magn
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
interrupts:
|
||||||
|
maxItems: 2
|
||||||
|
|
||||||
required:
|
required:
|
||||||
- compatible
|
- compatible
|
||||||
|
@ -110,15 +200,30 @@ examples:
|
||||||
- |
|
- |
|
||||||
#include <dt-bindings/interrupt-controller/irq.h>
|
#include <dt-bindings/interrupt-controller/irq.h>
|
||||||
i2c {
|
i2c {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
accelerometer@1d {
|
|
||||||
compatible = "st,lis3lv02dl-accel";
|
accelerometer@1c {
|
||||||
reg = <0x1d>;
|
compatible = "st,lis331dl-accel";
|
||||||
interrupt-parent = <&gpio2>;
|
reg = <0x1c>;
|
||||||
interrupts = <18 IRQ_TYPE_EDGE_RISING>;
|
st,drdy-int-pin = <1>;
|
||||||
pinctrl-0 = <&lis3lv02dl_nhk_mode>;
|
vdd-supply = <&ldo1>;
|
||||||
pinctrl-names = "default";
|
vddio-supply = <&ldo2>;
|
||||||
};
|
interrupt-parent = <&gpio>;
|
||||||
|
interrupts = <18 IRQ_TYPE_EDGE_RISING>, <19 IRQ_TYPE_EDGE_RISING>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
spi {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
num-cs = <1>;
|
||||||
|
|
||||||
|
l3g4200d: gyroscope@0 {
|
||||||
|
compatible = "st,l3g4200d-gyro";
|
||||||
|
st,drdy-int-pin = <2>;
|
||||||
|
reg = <0>;
|
||||||
|
vdd-supply = <&vcc_io>;
|
||||||
|
vddio-supply = <&vcc_io>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
...
|
...
|
||||||
|
|
Loading…
Reference in a new issue