Skip to contentSkip to conversation

dt-bindings: iio: accel: Convert lis302 binding to YAML schema

PATCH In review Md Shofiqul Islam 6 participants 11 messages Jun 10 – Jun 11

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: iio: accel: Convert lis302 binding to YAML schema

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

---
 .../devicetree/bindings/iio/accel/lis302.txt  | 119 ------
 .../bindings/iio/accel/st,lis302dl.yaml       | 343 ++++++++++++++++++
 2 files changed, 343 insertions(+), 119 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/lis302.txt
 create mode 100644 Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml
Documentation/devicetree/bindings/iio/accel/lis302.txt deleted +0 -119
deleted file mode 100644
index 457539647f36..000000000000
@@ -1,119 +0,0 @@
-LIS302 accelerometer devicetree bindings
-
-This device is matched via its bus drivers, and has a number of properties
-that apply in on the generic device (independent from the bus).
-
-
-Required properties for the SPI bindings:
- - compatible: 		should be set to "st,lis3lv02d-spi"
- - reg:			the chipselect index
- - spi-max-frequency:	maximal bus speed, should be set to 1000000 unless
-			constrained by external circuitry
- - interrupts:		the interrupt generated by the device
-
-Required properties for the I2C bindings:
- - compatible:		should be set to "st,lis3lv02d"
- - reg:			i2c slave address
- - Vdd-supply:		The input supply for Vdd
- - Vdd_IO-supply:	The input supply for Vdd_IO
-
-
-Optional properties for all bus drivers:
-
- - st,click-single-{x,y,z}:	if present, tells the device to issue an
-				interrupt on single click events on the
-				x/y/z axis.
- - st,click-double-{x,y,z}:	if present, tells the device to issue an
-				interrupt on double click events on the
-				x/y/z axis.
- - st,click-thresh-{x,y,z}:	set the x/y/z axis threshold
- - st,click-click-time-limit:	click time limit, from 0 to 127.5msec
-				with step of 0.5 msec
- - st,click-latency:		click latency, from 0 to 255 msec with
-				step of 1 msec.
- - st,click-window:		click window, from 0 to 255 msec with
-				step of 1 msec.
- - st,irq{1,2}-disable:		disable IRQ 1/2
- - st,irq{1,2}-ff-wu-1:		raise IRQ 1/2 on FF_WU_1 condition
- - st,irq{1,2}-ff-wu-2:		raise IRQ 1/2 on FF_WU_2 condition
- - st,irq{1,2}-data-ready:	raise IRQ 1/2 on data ready condition
- - st,irq{1,2}-click:		raise IRQ 1/2 on click condition
- - st,irq-open-drain:		consider IRQ lines open-drain
- - st,irq-active-low:		make IRQ lines active low
- - st,wu-duration-1:		duration register for Free-Fall/Wake-Up
-				interrupt 1
- - st,wu-duration-2:		duration register for Free-Fall/Wake-Up
-				interrupt 2
- - st,wakeup-{x,y,z}-{lo,hi}:	set wakeup condition on x/y/z axis for
-				upper/lower limit
- - st,wakeup-threshold:		set wakeup threshold
- - st,wakeup2-{x,y,z}-{lo,hi}:	set wakeup condition on x/y/z axis for
-				upper/lower limit for second wakeup
-				engine.
- - st,wakeup2-threshold:	set wakeup threshold for second wakeup
-				engine.
- - st,highpass-cutoff-hz=:	1, 2, 4 or 8 for 1Hz, 2Hz, 4Hz or 8Hz of
-				highpass cut-off frequency
- - st,hipass{1,2}-disable:	disable highpass 1/2.
- - st,default-rate=:		set the default rate
- - st,axis-{x,y,z}=:		set the axis to map to the three coordinates.
-				Negative values can be used for inverted axis.
- - st,{min,max}-limit-{x,y,z}	set the min/max limits for x/y/z axis
-				(used by self-test)
-
-
-Example for a SPI device node:
-
-	accelerometer@0 {
-		compatible = "st,lis302dl-spi";
-		reg = <0>;
-		spi-max-frequency = <1000000>;
-		interrupt-parent = <&gpio>;
-		interrupts = <104 0>;
-
-		st,click-single-x;
-		st,click-single-y;
-		st,click-single-z;
-		st,click-thresh-x = <10>;
-		st,click-thresh-y = <10>;
-		st,click-thresh-z = <10>;
-		st,irq1-click;
-		st,irq2-click;
-		st,wakeup-x-lo;
-		st,wakeup-x-hi;
-		st,wakeup-y-lo;
-		st,wakeup-y-hi;
-		st,wakeup-z-lo;
-		st,wakeup-z-hi;
-	};
-
-Example for a I2C device node:
-
-	lis331dlh: accelerometer@18 {
-		compatible = "st,lis331dlh", "st,lis3lv02d";
-		reg = <0x18>;
-		Vdd-supply = <&lis3_reg>;
-		Vdd_IO-supply = <&lis3_reg>;
-
-		st,click-single-x;
-		st,click-single-y;
-		st,click-single-z;
-		st,click-thresh-x = <10>;
-		st,click-thresh-y = <10>;
-		st,click-thresh-z = <10>;
-		st,irq1-click;
-		st,irq2-click;
-		st,wakeup-x-lo;
-		st,wakeup-x-hi;
-		st,wakeup-y-lo;
-		st,wakeup-y-hi;
-		st,wakeup-z-lo;
-		st,wakeup-z-hi;
-		st,min-limit-x = <120>;
-		st,min-limit-y = <120>;
-		st,min-limit-z = <140>;
-		st,max-limit-x = <550>;
-		st,max-limit-y = <550>;
-		st,max-limit-z = <750>;
-	};
-
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +343 -0

343 lines not on this page · raw message

Signature · 1 line
2.51.1
#1 lore raw
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [Medium] DT Binding ABI Break (Validation Regression) due to missing legacy property names - [Medium] DT…

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [Medium] DT Binding ABI Break (Validation Regression) due to missing legacy property names
- [Medium] DT Schema Validation Regression for Compatible Strings (Array Format)
- [Medium] Architectural Conflict with Overlapping Bindings
- [Medium] Hardware Description Constraint Violation (interrupts property) --

commit 32ffb2a415040f6cd59db09f02686f031f4414c1
Author: Md Shofiqul Islam <[email protected]>

dt-bindings: iio: accel: Convert lis302 binding to YAML schema

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

Quoted 6 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +0 -0
new file mode 100644
index 0000000000000..befc419f7f397
@@ -0,0 +1,343 @@

[ ... ]

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 23

Quoted 5 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +5 -0
+properties:
+  compatible:
+    enum:
+      - st,lis302dl-spi
+      - st,lis3lv02d

[Severity: Medium]
Will this strict enum definition cause a schema validation regression by rejecting existing in-tree device trees that use a fallback list? Some boards use an array format like compatible = "st,lis331dlh", "st,lis3lv02d";. Could this be described using items and an enum instead so these arrays are allowed?

[Severity: Medium]
These compatible strings are already documented and matched in Documentation/devicetree/bindings/iio/st,st-sensors.yaml. Since st,st-sensors.yaml uses additionalProperties: false, won't any node using these compatibles fail dual-schema evaluation when properties like st,click-single-x or Vdd-supply are evaluated by the other schema?

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 29

Quoted 6 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +6 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1

[Severity: Medium]
The hardware has two physical interrupt pins, which is reflected in the routing properties defined below like st,irq1-click and st,irq2-click. Does enforcing maxItems: 1 here cause validation failures on existing valid boards that wire both interrupts?

[ ... ]

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 63

Quoted 7 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +7 -0
+  st,click-double-z:
+    type: boolean
+    description: Enable double-click detection on Z axis.
+
+  st,click-threshold-x:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click detection threshold for X axis.

[Severity: Medium]
Since unevaluatedProperties: false is set at the end of the schema, could defining strict new property names without supporting the legacy names (st,click-thresh-x and st,click-click-time-limit) cause a regression in dtbs_check validation for existing in-tree device trees that still use the older names?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#2 lore raw
In reply to Md Shofiqul Islam
Quoted 12 lines · On Wed, 10 Jun 2026 14:00:51 +0300 Md Shofiqul Islam <[email protected]>…

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Quoted 7 lines

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

Hi.

So the conundrum here is whether we want to keep carrying this binding as it dates to a previous era.

The driver never made it to IIO and is still in drivers/misc. The majority of what is the text document should never have been in DT in the first place. I'll guess this dates all the way back to the wild west days before we had regular binding review.

Quoted 6 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +0 -0
new file mode 100644
index 000000000000..befc419f7f39

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
@@ -0,0 +1,343 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/st,lis302dl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectronics LIS302DL/LIS3LV02D 3-Axis Accelerometer
+
+maintainers:
+  - Jonathan Cameron <[email protected]>

NACK for that. I'll only maintain bindings that are both in a good form and typically even then only ones I have written.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 22

Quoted 12 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +12 -0
+
+description: |
+  STMicroelectronics LIS302DL (SPI) and LIS3LV02D (I2C) 3-axis MEMS
+  accelerometers. Supports click detection, free-fall/wake-up interrupts,
+  high-pass filtering, axis remapping, and self-test functions.
+
+  Driver located at drivers/misc/lis3lv02d/.
+
+properties:
+  compatible:
+    enum:
+      - st,lis302dl-spi

That wants deprecating. We don't include the bus in a compatible as it can be trivially derived from where the device is declared.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 32

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+      - st,lis3lv02d
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  Vdd-supply:
+    description: Main power supply regulator (I2C variant).

That is very odd. Power supply that is only there when using one bus? If there was an alternative for SPI and some weird naming thing maybe but it seems that if not on I2C the device works fine without power :)

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 39

Quoted 7 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +7 -0
+
+  Vdd_IO-supply:
+    description: I/O power supply regulator (I2C variant).
+
+  st,click-single-x:
+    type: boolean
+    description: Enable single-click detection on X axis.

Everything from this one down to...

Quoted 34 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +34 -0
+
+  st,click-double-x:
+    type: boolean
+    description: Enable double-click detection on X axis.
+
+  st,click-single-y:
+    type: boolean
+    description: Enable single-click detection on Y axis.
+
+  st,click-double-y:
+    type: boolean
+    description: Enable double-click detection on Y axis.
+
+  st,click-single-z:
+    type: boolean
+    description: Enable single-click detection on Z axis.
+
+  st,click-double-z:
+    type: boolean
+    description: Enable double-click detection on Z axis.
+
+  st,click-threshold-x:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click detection threshold for X axis.
+
+  st,click-threshold-y:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click detection threshold for Y axis.
+
+  st,click-threshold-z:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click detection threshold for Z axis.
+
+  st,click-time-limit:

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 83

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click time limit, 0 to 127.5 ms in 0.5 ms steps.
+
+  st,click-latency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click latency, 0 to 255 ms in 1 ms steps.
+
+  st,click-window:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click window, 0 to 255 ms in 1 ms steps.

This one are userspace decisions.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 87

Quoted 4 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +4 -0
+
+  st,irq1-disable:
+    type: boolean
+    description: Disable IRQ1 pin.

This one and the next lot

Quoted 27 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +27 -0
+
+  st,irq1-ff-wu-1:
+    type: boolean
+    description: Route free-fall/wake-up 1 event to IRQ1 pin.
+
+  st,irq1-ff-wu-2:
+    type: boolean
+    description: Route free-fall/wake-up 2 event to IRQ1 pin.
+
+  st,irq1-data-ready:
+    type: boolean
+    description: Route data-ready event to IRQ1 pin.
+
+  st,irq1-click:
+    type: boolean
+    description: Route click event to IRQ1 pin.
+
+  st,irq2-disable:
+    type: boolean
+    description: Disable IRQ2 pin.
+
+  st,irq2-ff-wu-1:
+    type: boolean
+    description: Route free-fall/wake-up 1 event to IRQ2 pin.
+
+  st,irq2-ff-wu-2:
+    type: boolean

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 124

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+    description: Route free-fall/wake-up 2 event to IRQ2 pin.
+
+  st,irq2-data-ready:
+    type: boolean
+    description: Route data-ready event to IRQ2 pin.
+
+  st,irq2-click:
+    type: boolean
+    description: Route click event to IRQ2 pin.
+

are driver internal decisions. The dt-binding should tell us which pins are wired, not make decisions on how the driver uses them.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 127

Quoted 3 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +3 -0
+  st,irq-open-drain:
+    type: boolean
+    description: Configure IRQ lines as open-drain.

This one is fine but there is a generic binding for it IIRC.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 131

Quoted 4 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +4 -0
+
+  st,irq-active-low:
+    type: boolean
+    description: Configure IRQ lines as active-low.

This one we normally do via the admittedly slightly dubious approach of assuming the IRQ flags tell us this one.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 135

Quoted 4 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +4 -0
+
+  st,wu-duration-1:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Duration register for free-fall/wake-up interrupt 1.

Back to stuff that should be userspace controlled.

Quoted 62 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +62 -0
+
+  st,wu-duration-2:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Duration register for free-fall/wake-up interrupt 2.
+
+  st,wakeup-x-lo:
+    type: boolean
+    description: Enable wake-up on X axis lower threshold crossing.
+
+  st,wakeup-x-hi:
+    type: boolean
+    description: Enable wake-up on X axis upper threshold crossing.
+
+  st,wakeup-y-lo:
+    type: boolean
+    description: Enable wake-up on Y axis lower threshold crossing.
+
+  st,wakeup-y-hi:
+    type: boolean
+    description: Enable wake-up on Y axis upper threshold crossing.
+
+  st,wakeup-z-lo:
+    type: boolean
+    description: Enable wake-up on Z axis lower threshold crossing.
+
+  st,wakeup-z-hi:
+    type: boolean
+    description: Enable wake-up on Z axis upper threshold crossing.
+
+  st,wakeup-threshold:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Threshold for wake-up engine 1.
+
+  st,wakeup2-x-lo:
+    type: boolean
+    description: Enable wake-up engine 2 on X axis lower threshold.
+
+  st,wakeup2-x-hi:
+    type: boolean
+    description: Enable wake-up engine 2 on X axis upper threshold.
+
+  st,wakeup2-y-lo:
+    type: boolean
+    description: Enable wake-up engine 2 on Y axis lower threshold.
+
+  st,wakeup2-y-hi:
+    type: boolean
+    description: Enable wake-up engine 2 on Y axis upper threshold.
+
+  st,wakeup2-z-lo:
+    type: boolean
+    description: Enable wake-up engine 2 on Z axis lower threshold.
+
+  st,wakeup2-z-hi:
+    type: boolean
+    description: Enable wake-up engine 2 on Z axis upper threshold.
+
+  st,wakeup2-threshold:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Threshold for wake-up engine 2.
+
+  st,highpass-cutoff-hz:

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 207

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+    enum: [1, 2, 4, 8]
+    description: High-pass filter cut-off frequency in Hz.
+
+  st,hipass1-disable:
+    type: boolean
+    description: Disable high-pass filter 1.
+
+  st,hipass2-disable:
+    type: boolean
+    description: Disable high-pass filter 2.

End of userspace stuff.

Quoted 8 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +8 -0
+
+  st,axis-x:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: |
+      Map physical X axis. Negative values invert the direction.
+      Valid range -3 to 3, excluding 0.
+
+  st,axis-y:

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 225

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: |
+      Map physical Y axis. Negative values invert the direction.
+      Valid range -3 to 3, excluding 0.
+
+  st,axis-z:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: |
+      Map physical Z axis. Negative values invert the direction.
+      Valid range -3 to 3, excluding 0.

The 3 are fine but should be deprecated and replaced with mount-matrix which makes it a userspace problem on the whole. There is little reason to ever have this stuff down in the driver.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 229

Quoted 5 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +4 -0
+
 
+  st,default-rate:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Default output data rate in Hz.

Nope. Driver should pick a value, then control from userspace. No reason to have a default in DT.

Quoted 14 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +14 -0
+
+  st,min-limit-x:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: Minimum self-test limit for X axis.
+
+  st,min-limit-y:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: Minimum self-test limit for Y axis.
+
+  st,min-limit-z:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: Minimum self-test limit for Z axis.
+
+  st,max-limit-x:

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 253

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: Maximum self-test limit for X axis.
+
+  st,max-limit-y:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: Maximum self-test limit for Y axis.
+
+  st,max-limit-z:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: Maximum self-test limit for Z axis.

Those are actually plausible things to have in DT. Maybe... Depends a bit on what governs how they are set and whether there are always 'good enough' numbers we can hard code in the driver.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 257

Quoted 4 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +4 -0
+
+required:
+  - compatible
+  - reg

Supplies etc.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 269

Quoted 12 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +12 -0
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+  - if:
+      properties:
+        compatible:
+          enum:
+            - st,lis302dl-spi
+    then:
+      required:
+        - spi-max-frequency
+        - interrupts

Seems unlikely the other part doesn't have an interrupt or that the device is useless with out one. Note we don't care if the driver requires it - that has nothing to do with the binding.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 278

Quoted 9 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +9 -0
+  - if:
+      properties:
+        compatible:
+          enum:
+            - st,lis3lv02d
+    then:
+      required:
+        - Vdd-supply
+        - Vdd_IO-supply

as above. This smells like documenting the driver, not what the wiring is. I would be very surprised if the other part doesn't have power.

Quoted 65 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +65 -0
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        accelerometer@0 {
+            compatible = "st,lis302dl-spi";
+            reg = <0>;
+            spi-max-frequency = <1000000>;
+            interrupt-parent = <&gpio>;
+            interrupts = <104 IRQ_TYPE_EDGE_RISING>;
+            st,click-single-x;
+            st,click-single-y;
+            st,click-single-z;
+            st,click-threshold-x = <10>;
+            st,click-threshold-y = <10>;
+            st,click-threshold-z = <10>;
+            st,irq1-click;
+            st,irq2-click;
+            st,wakeup-x-lo;
+            st,wakeup-x-hi;
+            st,wakeup-y-lo;
+            st,wakeup-y-hi;
+            st,wakeup-z-lo;
+            st,wakeup-z-hi;
+        };
+    };
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        accelerometer@18 {
+            compatible = "st,lis3lv02d";
+            reg = <0x18>;
+            Vdd-supply = <&lis3_reg>;
+            Vdd_IO-supply = <&lis3_reg>;
+            st,click-single-x;
+            st,click-single-y;
+            st,click-single-z;
+            st,click-threshold-x = <10>;
+            st,click-threshold-y = <10>;
+            st,click-threshold-z = <10>;
+            st,irq1-click;
+            st,irq2-click;
+            st,wakeup-x-lo;
+            st,wakeup-x-hi;
+            st,wakeup-y-lo;
+            st,wakeup-y-hi;
+            st,wakeup-z-lo;
+            st,wakeup-z-hi;
+            st,min-limit-x = <120>;
+            st,min-limit-y = <120>;
+            st,min-limit-z = <140>;
+            st,max-limit-x = <550>;
+            st,max-limit-y = <550>;
+            st,max-limit-z = <750>;
+        };
+    };
+...
#3 lore raw
Quoted 25 lines · Jonathan Cameron
Quoted 12 lines · On Wed, 10 Jun 2026 14:00:51 +0300 Md Shofiqul Islam <[email protected]>…

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Quoted 7 lines

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

Hi.

Quoted 7 lines

So the conundrum here is whether we want to keep carrying this binding as it dates to a previous era.

The driver never made it to IIO and is still in drivers/misc. The majority of what is the text document should never have been in DT in the first place. I'll guess this dates all the way back to the wild west days before we had regular binding review.

I'd say this should be treated like a staging binding but for the fact that this has a user in arm. Problem of course is that it's probably impossible to get that board and so doing any rework is probably not realistic for this submitter?
Is there a general policy for iio devices in misc? Do they get reworked to be moved?

The user funnily enough has the binding's click-thresh properties:

		st,click-single-x;
		st,click-single-y;
		st,click-single-z;
		st,click-thresh-x = <10>;
		st,click-thresh-y = <10>;
		st,click-thresh-z = <10>;
		st,irq1-click;
		st,irq2-click;
		st,wakeup-x-lo;
		st,wakeup-x-hi;
		st,wakeup-y-lo;
		st,wakeup-y-hi;
		st,wakeup-z-lo;
		st,wakeup-z-hi;

Dunno what that ultimately means in terms of which should be used though.

maintainer
#4 lore raw
Quoted 34 lines · On Wed, 10 Jun 2026 17:40:04 +0100 Conor Dooley <[email protected]> wrote:
Quoted 25 lines · Jonathan Cameron
Quoted 12 lines · On Wed, 10 Jun 2026 14:00:51 +0300 Md Shofiqul Islam <[email protected]>…

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Quoted 7 lines

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

Hi.

Quoted 7 lines

So the conundrum here is whether we want to keep carrying this binding as it dates to a previous era.

The driver never made it to IIO and is still in drivers/misc. The majority of what is the text document should never have been in DT in the first place. I'll guess this dates all the way back to the wild west days before we had regular binding review.

Quoted 6 lines

I'd say this should be treated like a staging binding but for the fact that this has a user in arm. Problem of course is that it's probably impossible to get that board and so doing any rework is probably not realistic for this submitter?
Is there a general policy for iio devices in misc? Do they get reworked to be moved?

It is tricky if we have upstream users because the ABI will change on them.

I'm not sure how easy this would be to add to the existing st sensors driver as these are very early parts. If we could maybe we'd do so and just deal with the mess of having to disable one or other driver.

My gut feeling here is ancient part, let it get dropped in a year or two and not worry about adding support to a standard IIO driver unless anyone actually has hardware and wants to do it.

Quoted 16 lines

The user funnily enough has the binding's click-thresh properties:

		st,click-single-x;
		st,click-single-y;
		st,click-single-z;
		st,click-thresh-x = <10>;
		st,click-thresh-y = <10>;
		st,click-thresh-z = <10>;
		st,irq1-click;
		st,irq2-click;
		st,wakeup-x-lo;
		st,wakeup-x-hi;
		st,wakeup-y-lo;
		st,wakeup-y-hi;
		st,wakeup-z-lo;
		st,wakeup-z-hi;
Quoted 2 lines

Dunno what that ultimately means in terms of which should be used though.

Set those as defaults in the driver if all upstream users have those values and then drop reading them from dt?

#5 lore raw
Quoted 72 lines · Jonathan Cameron
Quoted 34 lines · On Wed, 10 Jun 2026 17:40:04 +0100 Conor Dooley <[email protected]> wrote:
Quoted 25 lines · Jonathan Cameron
Quoted 12 lines · On Wed, 10 Jun 2026 14:00:51 +0300 Md Shofiqul Islam <[email protected]>…

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Quoted 7 lines

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

Hi.

Quoted 7 lines

So the conundrum here is whether we want to keep carrying this binding as it dates to a previous era.

The driver never made it to IIO and is still in drivers/misc. The majority of what is the text document should never have been in DT in the first place. I'll guess this dates all the way back to the wild west days before we had regular binding review.

Quoted 6 lines

I'd say this should be treated like a staging binding but for the fact that this has a user in arm. Problem of course is that it's probably impossible to get that board and so doing any rework is probably not realistic for this submitter?
Is there a general policy for iio devices in misc? Do they get reworked to be moved?

It is tricky if we have upstream users because the ABI will change on them.

I'm not sure how easy this would be to add to the existing st sensors driver as these are very early parts. If we could maybe we'd do so and just deal with the mess of having to disable one or other driver.

My gut feeling here is ancient part, let it get dropped in a year or two and not worry about adding support to a standard IIO driver unless anyone actually has hardware and wants to do it.

Quoted 16 lines

The user funnily enough has the binding's click-thresh properties:

		st,click-single-x;
		st,click-single-y;
		st,click-single-z;
		st,click-thresh-x = <10>;
		st,click-thresh-y = <10>;
		st,click-thresh-z = <10>;
		st,irq1-click;
		st,irq2-click;
		st,wakeup-x-lo;
		st,wakeup-x-hi;
		st,wakeup-y-lo;
		st,wakeup-y-hi;
		st,wakeup-z-lo;
		st,wakeup-z-hi;
Quoted 2 lines

Dunno what that ultimately means in terms of which should be used though.

Quoted 2 lines

Set those as defaults in the driver if all upstream users have those values and then drop reading them from dt?

Actually, there's more than one user in arm, but there's a mix of compatibles and properties used. Probably not really viable unless these are all unique compatible + property combinations. FWIW, there's more compatibles used than those documented, that fall back to the documented ones.

maintainer
#6 lore raw
Quoted 74 lines · Conor Dooley
Quoted 72 lines · Jonathan Cameron
Quoted 34 lines · On Wed, 10 Jun 2026 17:40:04 +0100 Conor Dooley <[email protected]> wrote:
Quoted 25 lines · Jonathan Cameron
Quoted 12 lines · On Wed, 10 Jun 2026 14:00:51 +0300 Md Shofiqul Islam <[email protected]>…

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Quoted 7 lines

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

Hi.

Quoted 7 lines

So the conundrum here is whether we want to keep carrying this binding as it dates to a previous era.

The driver never made it to IIO and is still in drivers/misc. The majority of what is the text document should never have been in DT in the first place. I'll guess this dates all the way back to the wild west days before we had regular binding review.

Quoted 6 lines

I'd say this should be treated like a staging binding but for the fact that this has a user in arm. Problem of course is that it's probably impossible to get that board and so doing any rework is probably not realistic for this submitter?
Is there a general policy for iio devices in misc? Do they get reworked to be moved?

It is tricky if we have upstream users because the ABI will change on them.

I'm not sure how easy this would be to add to the existing st sensors driver as these are very early parts. If we could maybe we'd do so and just deal with the mess of having to disable one or other driver.

My gut feeling here is ancient part, let it get dropped in a year or two and not worry about adding support to a standard IIO driver unless anyone actually has hardware and wants to do it.

Quoted 18 lines

The user funnily enough has the binding's click-thresh properties:

            st,click-single-x;
            st,click-single-y;
            st,click-single-z;
            st,click-thresh-x = <10>;
            st,click-thresh-y = <10>;
            st,click-thresh-z = <10>;
            st,irq1-click;
            st,irq2-click;
            st,wakeup-x-lo;
            st,wakeup-x-hi;
            st,wakeup-y-lo;
            st,wakeup-y-hi;
            st,wakeup-z-lo;
            st,wakeup-z-hi;

Dunno what that ultimately means in terms of which should be used though.

Quoted 8 lines
Quoted 2 lines

Set those as defaults in the driver if all upstream users have those values and then drop reading them from dt?

Actually, there's more than one user in arm, but there's a mix of compatibles and properties used. Probably not really viable unless these are all unique compatible + property combinations. FWIW, there's more compatibles used than those documented, that fall back to the documented ones.

There's only 1 for SPI. For I2C, I guess it is a question of which driver is used:

drivers/iio/accel/st_accel_i2c.c: .compatible = "st,lis3lv02d",
drivers/misc/lis3lv02d/lis3lv02d_i2c.c: { .compatible = "st,lis3lv02d" },

Rob

maintainer
#7 lore raw
In reply to Jonathan Cameron
Quoted 25 lines · Jonathan Cameron
Quoted 12 lines · On Wed, 10 Jun 2026 14:00:51 +0300 Md Shofiqul Islam <[email protected]>…

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Quoted 7 lines

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

Hi.

Quoted 7 lines

So the conundrum here is whether we want to keep carrying this binding as it dates to a previous era.

The driver never made it to IIO and is still in drivers/misc. The majority of what is the text document should never have been in DT in the first place. I'll guess this dates all the way back to the wild west days before we had regular binding review.

Where the driver is doesn't matter for the binding. Unless the 1 apparent user is will to change things, we should just document what is in use (and nothing more). Some of this looks like it can be droppped.

Rob

maintainer
#8 lore raw
Quoted 29 lines · On Wed, 10 Jun 2026 14:23:38 -0500 Rob Herring <[email protected]> wrote:
Quoted 28 lines · Jonathan Cameron
Quoted 12 lines · On Wed, 10 Jun 2026 14:00:51 +0300 Md Shofiqul Islam <[email protected]>…

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Quoted 7 lines

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

Hi.

So the conundrum here is whether we want to keep carrying this binding as it dates to a previous era.

Quoted 8 lines
Quoted 4 lines

The driver never made it to IIO and is still in drivers/misc. The majority of what is the text document should never have been in DT in the first place. I'll guess this dates all the way back to the wild west days before we had regular binding review.

Where the driver is doesn't matter for the binding. Unless the 1 apparent user is will to change things, we should just document what is in use (and nothing more). Some of this looks like it can be droppped.

I don't mind documenting it, but with a big warning at the top to make sure no one copies it for a newer part!

Jonathan

Quoted 2 lines

Rob

maintainer
#9 lore raw
In reply to Md Shofiqul Islam
Quoted 164 lines · Md Shofiqul Islam

Convert the STMicroelectronics LIS302DL/LIS3LV02D accelerometer device tree binding from plain text format to YAML schema format.

The binding covers two variants matched via their respective bus drivers:
- SPI: st,lis302dl-spi (drivers/misc/lis3lv02d/lis3lv02d_spi.c)
- I2C: st,lis3lv02d (drivers/misc/lis3lv02d/lis3lv02d_i2c.c)

Document all vendor-specific properties read by the driver via of_property_read_*(), including click detection, IRQ routing, free-fall/ wake-up engines, high-pass filtering, axis remapping, output data rate, and self-test limits.

Also correct the click threshold property names: the driver reads "st,click-threshold-{x,y,z}" but the old .txt documented them as "st,click-thresh-{x,y,z}".

Validated with: make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml

---
 .../devicetree/bindings/iio/accel/lis302.txt  | 119 ------
 .../bindings/iio/accel/st,lis302dl.yaml       | 343 ++++++++++++++++++
 2 files changed, 343 insertions(+), 119 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/lis302.txt
 create mode 100644 Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml
Documentation/devicetree/bindings/iio/accel/lis302.txt deleted +0 -119
deleted file mode 100644
index 457539647f36..000000000000
@@ -1,119 +0,0 @@
-LIS302 accelerometer devicetree bindings
-
-This device is matched via its bus drivers, and has a number of properties
-that apply in on the generic device (independent from the bus).
-
-
-Required properties for the SPI bindings:
- - compatible: 		should be set to "st,lis3lv02d-spi"
- - reg:			the chipselect index
- - spi-max-frequency:	maximal bus speed, should be set to 1000000 unless
-			constrained by external circuitry
- - interrupts:		the interrupt generated by the device
-
-Required properties for the I2C bindings:
- - compatible:		should be set to "st,lis3lv02d"
- - reg:			i2c slave address
- - Vdd-supply:		The input supply for Vdd
- - Vdd_IO-supply:	The input supply for Vdd_IO
-
-
-Optional properties for all bus drivers:
-
- - st,click-single-{x,y,z}:	if present, tells the device to issue an
-				interrupt on single click events on the
-				x/y/z axis.
- - st,click-double-{x,y,z}:	if present, tells the device to issue an
-				interrupt on double click events on the
-				x/y/z axis.
- - st,click-thresh-{x,y,z}:	set the x/y/z axis threshold
- - st,click-click-time-limit:	click time limit, from 0 to 127.5msec
-				with step of 0.5 msec
- - st,click-latency:		click latency, from 0 to 255 msec with
-				step of 1 msec.
- - st,click-window:		click window, from 0 to 255 msec with
-				step of 1 msec.
- - st,irq{1,2}-disable:		disable IRQ 1/2
- - st,irq{1,2}-ff-wu-1:		raise IRQ 1/2 on FF_WU_1 condition
- - st,irq{1,2}-ff-wu-2:		raise IRQ 1/2 on FF_WU_2 condition
- - st,irq{1,2}-data-ready:	raise IRQ 1/2 on data ready condition
- - st,irq{1,2}-click:		raise IRQ 1/2 on click condition
- - st,irq-open-drain:		consider IRQ lines open-drain
- - st,irq-active-low:		make IRQ lines active low
- - st,wu-duration-1:		duration register for Free-Fall/Wake-Up
-				interrupt 1
- - st,wu-duration-2:		duration register for Free-Fall/Wake-Up
-				interrupt 2
- - st,wakeup-{x,y,z}-{lo,hi}:	set wakeup condition on x/y/z axis for
-				upper/lower limit
- - st,wakeup-threshold:		set wakeup threshold
- - st,wakeup2-{x,y,z}-{lo,hi}:	set wakeup condition on x/y/z axis for
-				upper/lower limit for second wakeup
-				engine.
- - st,wakeup2-threshold:	set wakeup threshold for second wakeup
-				engine.
- - st,highpass-cutoff-hz=:	1, 2, 4 or 8 for 1Hz, 2Hz, 4Hz or 8Hz of
-				highpass cut-off frequency
- - st,hipass{1,2}-disable:	disable highpass 1/2.
- - st,default-rate=:		set the default rate
- - st,axis-{x,y,z}=:		set the axis to map to the three coordinates.
-				Negative values can be used for inverted axis.
- - st,{min,max}-limit-{x,y,z}	set the min/max limits for x/y/z axis
-				(used by self-test)
-
-
-Example for a SPI device node:
-
-	accelerometer@0 {
-		compatible = "st,lis302dl-spi";
-		reg = <0>;
-		spi-max-frequency = <1000000>;
-		interrupt-parent = <&gpio>;
-		interrupts = <104 0>;
-
-		st,click-single-x;
-		st,click-single-y;
-		st,click-single-z;
-		st,click-thresh-x = <10>;
-		st,click-thresh-y = <10>;
-		st,click-thresh-z = <10>;
-		st,irq1-click;
-		st,irq2-click;
-		st,wakeup-x-lo;
-		st,wakeup-x-hi;
-		st,wakeup-y-lo;
-		st,wakeup-y-hi;
-		st,wakeup-z-lo;
-		st,wakeup-z-hi;
-	};
-
-Example for a I2C device node:
-
-	lis331dlh: accelerometer@18 {
-		compatible = "st,lis331dlh", "st,lis3lv02d";
-		reg = <0x18>;
-		Vdd-supply = <&lis3_reg>;
-		Vdd_IO-supply = <&lis3_reg>;
-
-		st,click-single-x;
-		st,click-single-y;
-		st,click-single-z;
-		st,click-thresh-x = <10>;
-		st,click-thresh-y = <10>;
-		st,click-thresh-z = <10>;
-		st,irq1-click;
-		st,irq2-click;
-		st,wakeup-x-lo;
-		st,wakeup-x-hi;
-		st,wakeup-y-lo;
-		st,wakeup-y-hi;
-		st,wakeup-z-lo;
-		st,wakeup-z-hi;
-		st,min-limit-x = <120>;
-		st,min-limit-y = <120>;
-		st,min-limit-z = <140>;
-		st,max-limit-x = <550>;
-		st,max-limit-y = <550>;
-		st,max-limit-z = <750>;
-	};
-
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +7 -0
new file mode 100644
index 000000000000..befc419f7f39
@@ -0,0 +1,343 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/st,lis302dl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectronics LIS302DL/LIS3LV02D 3-Axis Accelerometer

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 17

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+
+maintainers:
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  STMicroelectronics LIS302DL (SPI) and LIS3LV02D (I2C) 3-axis MEMS
+  accelerometers. Supports click detection, free-fall/wake-up interrupts,
+  high-pass filtering, axis remapping, and self-test functions.
+
+  Driver located at drivers/misc/lis3lv02d/.

Bindings are independent from a driver, so drop this.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 23

Quoted 6 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - st,lis302dl-spi
+      - st,lis3lv02d

These compatibles are already present in st,st-sensors.yaml. The long list of properties are not. Probably need to drop them from st,st-sensors.yaml.

I would suggest you remove anything here (compatibles and properties) that is not used on the 1 platform using this binding. If there's no platform using I2C interface, then that could be removed from the driver too.

Quoted 178 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +178 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  Vdd-supply:
+    description: Main power supply regulator (I2C variant).
+
+  Vdd_IO-supply:
+    description: I/O power supply regulator (I2C variant).
+
+  st,click-single-x:
+    type: boolean
+    description: Enable single-click detection on X axis.
+
+  st,click-double-x:
+    type: boolean
+    description: Enable double-click detection on X axis.
+
+  st,click-single-y:
+    type: boolean
+    description: Enable single-click detection on Y axis.
+
+  st,click-double-y:
+    type: boolean
+    description: Enable double-click detection on Y axis.
+
+  st,click-single-z:
+    type: boolean
+    description: Enable single-click detection on Z axis.
+
+  st,click-double-z:
+    type: boolean
+    description: Enable double-click detection on Z axis.
+
+  st,click-threshold-x:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click detection threshold for X axis.
+
+  st,click-threshold-y:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click detection threshold for Y axis.
+
+  st,click-threshold-z:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click detection threshold for Z axis.
+
+  st,click-time-limit:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click time limit, 0 to 127.5 ms in 0.5 ms steps.
+
+  st,click-latency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click latency, 0 to 255 ms in 1 ms steps.
+
+  st,click-window:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Click window, 0 to 255 ms in 1 ms steps.
+
+  st,irq1-disable:
+    type: boolean
+    description: Disable IRQ1 pin.
+
+  st,irq1-ff-wu-1:
+    type: boolean
+    description: Route free-fall/wake-up 1 event to IRQ1 pin.
+
+  st,irq1-ff-wu-2:
+    type: boolean
+    description: Route free-fall/wake-up 2 event to IRQ1 pin.
+
+  st,irq1-data-ready:
+    type: boolean
+    description: Route data-ready event to IRQ1 pin.
+
+  st,irq1-click:
+    type: boolean
+    description: Route click event to IRQ1 pin.
+
+  st,irq2-disable:
+    type: boolean
+    description: Disable IRQ2 pin.
+
+  st,irq2-ff-wu-1:
+    type: boolean
+    description: Route free-fall/wake-up 1 event to IRQ2 pin.
+
+  st,irq2-ff-wu-2:
+    type: boolean
+    description: Route free-fall/wake-up 2 event to IRQ2 pin.
+
+  st,irq2-data-ready:
+    type: boolean
+    description: Route data-ready event to IRQ2 pin.
+
+  st,irq2-click:
+    type: boolean
+    description: Route click event to IRQ2 pin.
+
+  st,irq-open-drain:
+    type: boolean
+    description: Configure IRQ lines as open-drain.
+
+  st,irq-active-low:
+    type: boolean
+    description: Configure IRQ lines as active-low.
+
+  st,wu-duration-1:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Duration register for free-fall/wake-up interrupt 1.
+
+  st,wu-duration-2:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Duration register for free-fall/wake-up interrupt 2.
+
+  st,wakeup-x-lo:
+    type: boolean
+    description: Enable wake-up on X axis lower threshold crossing.
+
+  st,wakeup-x-hi:
+    type: boolean
+    description: Enable wake-up on X axis upper threshold crossing.
+
+  st,wakeup-y-lo:
+    type: boolean
+    description: Enable wake-up on Y axis lower threshold crossing.
+
+  st,wakeup-y-hi:
+    type: boolean
+    description: Enable wake-up on Y axis upper threshold crossing.
+
+  st,wakeup-z-lo:
+    type: boolean
+    description: Enable wake-up on Z axis lower threshold crossing.
+
+  st,wakeup-z-hi:
+    type: boolean
+    description: Enable wake-up on Z axis upper threshold crossing.
+
+  st,wakeup-threshold:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Threshold for wake-up engine 1.
+
+  st,wakeup2-x-lo:
+    type: boolean
+    description: Enable wake-up engine 2 on X axis lower threshold.
+
+  st,wakeup2-x-hi:
+    type: boolean
+    description: Enable wake-up engine 2 on X axis upper threshold.
+
+  st,wakeup2-y-lo:
+    type: boolean
+    description: Enable wake-up engine 2 on Y axis lower threshold.
+
+  st,wakeup2-y-hi:
+    type: boolean
+    description: Enable wake-up engine 2 on Y axis upper threshold.
+
+  st,wakeup2-z-lo:
+    type: boolean
+    description: Enable wake-up engine 2 on Z axis lower threshold.
+
+  st,wakeup2-z-hi:
+    type: boolean
+    description: Enable wake-up engine 2 on Z axis upper threshold.
+
+  st,wakeup2-threshold:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Threshold for wake-up engine 2.
+
+  st,highpass-cutoff-hz:
+    enum: [1, 2, 4, 8]
+    description: High-pass filter cut-off frequency in Hz.
+
+  st,hipass1-disable:

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 211

Quoted 10 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +10 -0
+    type: boolean
+    description: Disable high-pass filter 1.
+
+  st,hipass2-disable:
+    type: boolean
+    description: Disable high-pass filter 2.
+
+  st,axis-x:
+    $ref: /schemas/types.yaml#/definitions/int32
+    description: |

Don't need '|'.

Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml line 213

Quoted 2 lines
Documentation/devicetree/bindings/iio/accel/st,lis302dl.yaml new file +2 -0
+      Map physical X axis. Negative values invert the direction.
+      Valid range -3 to 3, excluding 0.

Define the range with schema, not free form text.

Rob

#10 lore raw
In reply to Md Shofiqul Islam
kernel test robot noticed the following build warnings:

Hi Md,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v7.1-rc7 next-20260610] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Md-Shofiqul-Islam/dt-bindings-iio-accel-Convert-lis302-binding-to-YAML-schema/20260610-191419
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20260610110051.1228-1-shofiqtest%40gmail.com
patch subject: [PATCH] dt-bindings: iio: accel: Convert lis302 binding to YAML schema
config: microblaze-randconfig-2052-20260610 (https://download.01.org/0day-ci/archive/20260611/[email protected]/config)
compiler: microblaze-linux-gcc (GCC) 15.2.0
dtschema: 2026.5.dev10+g5d839523d
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260611/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> Warning: Duplicate compatible "st,lis302dl-spi" found in schemas matching "$id":
   	http://devicetree.org/schemas/iio/accel/st,lis302dl.yaml
   	http://devicetree.org/schemas/iio/st,st-sensors.yaml#
>> Warning: Duplicate compatible "st,lis3lv02d" found in schemas matching "$id":

http://devicetree.org/schemas/iio/accel/st,lis302dl.yaml
http://devicetree.org/schemas/iio/st,st-sensors.yaml#

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki