dt-bindings: misc: convert lis302.txt to YAML
Subsystems (2)
PATCH 1/2 dt-bindings: misc: convert lis302.txt to YAML
Replace the old lis302.txt with a YAML binding covering all four compatibles (st,lis3lv02d, st,lis302dl-spi, st,lis331dlh, st,lis33de) and their ~35 DT properties.
The old txt documented st,click-thresh-* and st,click-click-time-limit but the code reads st,click-threshold-* and st,click-time-limit. Keep the old names as deprecated so existing DTBs don't break.
Add a select: so the misc schema only applies to nodes with misc-exclusive compatibles. Standalone st,lis3lv02d nodes that go to the IIO driver validate against the IIO schema instead.
Tested: dt_binding_check, dtbs_check against 7 omap/am335x DTBs (am335x-evm, am335x-evmsk, am335x-pepper, am437x-sk-evm, omap3-n900, omap3-n950, omap3-gta04a3). All clean.
--- .../devicetree/bindings/iio/accel/lis302.txt | 119 ------ .../bindings/misc/st,lis3lv02d.yaml | 396 ++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 397 insertions(+), 119 deletions(-) delete mode 100644 Documentation/devicetree/bindings/iio/accel/lis302.txt create mode 100644 Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml
Documentation/devicetree/bindings/iio/accel/lis302.txt deleted +0 -119
@@ -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/misc/st,lis3lv02d.yaml new file +396 -0
396 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -14858,6 +14858,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ LIS3LV02D ACCELEROMETER DRIVER M: Eric Piel <[email protected]> S: Maintained +F: Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml F: Documentation/misc-devices/lis3lv02d.rst F: drivers/misc/lis3lv02d/ F: drivers/platform/x86/hp/hp_accel.c
Signature · 1 line
2.54.0
PATCH 2/2 dt-bindings: iio: st-sensors: drop lis302dl-spi from deprecated list
st,lis302dl-spi is only used by the misc/lis3lv02d driver. Its binding is now in Documentation/devicetree/bindings/misc/.
Keep st,lis3lv02d in the deprecated list — the IIO i2c driver still matches it for LIS3LV02DL support.
Tested: dt_binding_check, dtbs_check.
--- Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 2 -- 1 file changed, 2 deletions(-)
Documentation/devicetree/bindings/iio/st,st-sensors.yaml +0 -2
@@ -90,10 +90,8 @@ properties: - st,lsm9ds0-imu - description: Deprecated bindings enum: - - st,lis302dl-spi - st,lis3lv02d deprecated: true - reg: maxItems: 1
Signature · 1 line
2.54.0
[email protected]
AI reviewRe: [PATCH 2/2] dt-bindings: iio: st-sensors: drop lis302dl-spi from deprecated list
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Incorrect Schema Removal / Broken Validation for st,lis302dl-spi --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Incorrect Schema Removal / Broken Validation for st,lis302dl-spi --
commit 23c740836661eab02e0a98566f673ed373f8b4d3
Author: Jad Keskes <[email protected]>
dt-bindings: iio: st-sensors: drop lis302dl-spi from deprecated list
This commit removes the st,lis302dl-spi compatible string from the deprecated list in the IIO st-sensors binding. It claims the compatible string is only used by the misc driver.
Quoted 2 lines
st,lis302dl-spi is only used by the misc/lis3lv02d driver. Its binding is now in
Documentation/devicetree/bindings/misc/.
[Severity: Medium]
Is this statement accurate? Looking at drivers/iio/accel/st_accel_spi.c, the IIO SPI driver still explicitly matches st,lis302dl-spi:
drivers/iio/accel/st_accel_spi.c:st_accel_of_match[] = {
{
/* An older compatible */
.compatible = "st,lis302dl-spi",
.data = LIS3LV02DL_ACCEL_DEV_NAME,
},Documentation/devicetree/bindings/iio/st,st-sensors.yaml properties: · line 93
Quoted 9 lines
Documentation/devicetree/bindings/iio/st,st-sensors.yaml +0
-1@@ -90,10 +90,8 @@ properties: - st,lsm9ds0-imu - description: Deprecated bindings enum: - - st,lis302dl-spi
[Severity: Medium]
If st,lis302dl-spi is removed from the IIO binding, won't dtbs_check fail for any valid device tree that pairs this compatible string with standard IIO properties (such as vdd-supply or mount-matrix)?
Since the misc binding (st,lis3lv02d.yaml) enforces additionalProperties: false, it would reject these IIO properties. It appears st,lis3lv02d was kept in the schema for the exact same reason that st,lis302dl-spi should be kept.
Quoted 5 lines
Documentation/devicetree/bindings/iio/st,st-sensors.yaml +0
-1- st,lis3lv02d deprecated: true - reg: maxItems: 1
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The `select` block incorrectly excludes standalone `st,lis3lv02d` nodes, breaking schema…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The select block incorrectly excludes standalone st,lis3lv02d nodes, breaking schema validation for in-tree boards and creating dead code. --
commit 4d572cc896007c912787ebc5396d56f2920edb3d
Author: Jad Keskes <[email protected]>
dt-bindings: misc: convert lis302.txt to YAML
This patch replaces the legacy lis302.txt binding with a YAML schema for the LIS3LV02D family of accelerometers. It introduces a select block intended to restrict the schema to misc-driver-exclusive compatibles, under the assumption that standalone st,lis3lv02d nodes belong to the IIO subsystem.
Quoted 6 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +0
-0@@ -0,0 +1,396 @@
[ ... ]
Quoted 6 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +6
-0+select: + anyOf: + - properties: + compatible: + contains: + const: st,lis302dl-spi
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml line 35
Quoted 10 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +10
-0+ - properties: + compatible: + contains: + const: st,lis331dlh + - properties: + compatible: + contains: + const: st,lis33de + required: + - compatible
[Severity: Medium]
The commit message claims standalone st,lis3lv02d nodes only go to the IIO driver, but could this select block incorrectly exclude valid standalone st,lis3lv02d nodes used by the misc driver?
For example, arch/arm/boot/dts/ti/omap/omap3-n950-n9.dtsi uses a standalone st,lis3lv02d compatible while relying heavily on misc-driver-specific properties like st,click-threshold-x and Vdd-supply.
Because this block explicitly omits st,lis3lv02d, that valid DT node bypasses the misc schema entirely. It instead falls back to the IIO schema (st,st-sensors.yaml), which specifies additionalProperties: false and does not recognize misc properties, leading to validation errors.
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml line 46
Quoted 11 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +11
-0+ +properties: + compatible: + oneOf: + - items: + - enum: + - st,lis331dlh + - st,lis33de + - const: st,lis3lv02d + - const: st,lis331dlh + - const: st,lis3lv02d
[Severity: Medium]
Is the standalone const: st,lis3lv02d option rendered unreachable dead code, since any node matching just st,lis3lv02d is excluded by the select block above?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v3 1/1 dt-bindings: misc: convert lis302.txt to YAML
In reply to Jad KeskesReplace the old lis302.txt with a YAML binding covering all four compatibles (st,lis3lv02d, st,lis302dl-spi, st,lis331dlh, st,lis33de) and their ~35 DT properties.
The old txt documented st,click-thresh-* and st,click-click-time-limit but the code reads st,click-threshold-* and st,click-time-limit. Keep the old names as deprecated so existing DTBs don't break.
Use a select block that matches only nodes with misc-driver compatibles (including standalone st,lis3lv02d for omap3-n950-n9 and similar), paired with the IIO schema which handles the IIO side. This avoids both schemas validating the same node.
Tested: dt_binding_check. dtbs_check against 7 omap/am335x DTBs (am335x-evm, am335x-evmsk, am335x-pepper, am437x-sk-evm, omap3-n900, omap3-n950, omap3-gta04a3) — no misc schema errors. Pre-existing IIO schema errors on paired compatible nodes unchanged.
---
v3:
- Add st,lis3lv02d to select block (fixes Sashiko review #1)
- Drop Patch 2 entirely (fixes Sashiko review #2 — IIO SPI driver still matches st,lis302dl-spi)
- Single patch, no IIO schema changes
v2:
- Rebase onto Linux 7.1-rc6
- Drop IIO changes, this is a single patch now
.../devicetree/bindings/iio/accel/lis302.txt | 119 ------ .../bindings/misc/st,lis3lv02d.yaml | 400 ++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 401 insertions(+), 119 deletions(-) delete mode 100644 Documentation/devicetree/bindings/iio/accel/lis302.txt create mode 100644 Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml
Documentation/devicetree/bindings/iio/accel/lis302.txt deleted +0 -119
@@ -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/misc/st,lis3lv02d.yaml new file +400 -0
400 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -14858,6 +14858,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ LIS3LV02D ACCELEROMETER DRIVER M: Eric Piel <[email protected]> S: Maintained +F: Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml F: Documentation/misc-devices/lis3lv02d.rst F: drivers/misc/lis3lv02d/ F: drivers/platform/x86/hp/hp_accel.c
Signature · 1 line
2.54.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Redundant 'select' block fails its stated purpose in the commit message --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Redundant 'select' block fails its stated purpose in the commit message --
commit 7b1f6ec4590fb8fea27ae6accf9a20a8de12ccd1
Author: Jad Keskes <[email protected]>
dt-bindings: misc: convert lis302.txt to YAML
Replace the old lis302.txt with a YAML binding covering four compatibles. The commit message states it includes a select block to avoid validating nodes against both the misc and IIO schemas.
Quoted 4 lines
Use a select block that matches only nodes with misc-driver compatibles (including standalone st,lis3lv02d for omap3-n950-n9 and similar), paired with the IIO schema which handles the IIO side. This avoids both schemas validating the same node.
[Severity: Medium]
Does this select block actually prevent the IIO schema from validating the node?
In the dt-schema architecture, schemas evaluate independently. A select block in this misc schema only determines if this specific schema applies; it has no effect on whether the IIO schema also matches the compatible string.
The testing note mentioning "Pre-existing IIO schema errors on paired compatible nodes unchanged" seems to confirm both schemas are still validating the node.
Quoted 5 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +0
-0
[ ... ]
Quoted 10 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +10
-0+select: + anyOf: + - properties: + compatible: + contains: + const: st,lis302dl-spi + - properties: + compatible: + contains: + const: st,lis331dlh
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml line 39
Quoted 10 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +10
-0+ - properties: + compatible: + contains: + const: st,lis33de + - properties: + compatible: + contains: + const: st,lis3lv02d + required: + - compatible
[Severity: Medium]
Is this explicit select block necessary?
Since this block exactly mirrors the default select block automatically generated by dt-schema from the compatible property definition below it, could this be removed entirely to simplify the binding?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v4 1/1 dt-bindings: misc: convert lis302.txt to YAML
In reply to Jad KeskesReplace the old lis302.txt with a YAML binding covering all four compatibles (st,lis3lv02d, st,lis302dl-spi, st,lis331dlh, st,lis33de) and their ~35 DT properties.
The old txt documented st,click-thresh-* and st,click-click-time-limit but the code reads st,click-threshold-* and st,click-time-limit. Keep the old names as deprecated so existing DTBs don't break.
Tested: dt_binding_check. dtbs_check against 7 omap/am335x DTBs (am335x-evm, am335x-evmsk, am335x-pepper, am437x-sk-evm, omap3-n900, omap3-n950, omap3-gta04a3) — no misc schema errors. Pre-existing IIO schema errors on paired compatible nodes unchanged.
---
v4:
- Drop explicit select block (redundant — dt-schema generates it from the compatible list automatically)
- Fix commit message: select block does not prevent IIO schema validation
v3:
- Add st,lis3lv02d to select block
- Drop Patch 2 entirely, single patch with no IIO changes
v2:
- Rebase onto Linux 7.1-rc6
- Drop IIO changes
.../devicetree/bindings/iio/accel/lis302.txt | 119 ------ .../bindings/misc/st,lis3lv02d.yaml | 400 ++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 401 insertions(+), 119 deletions(-) delete mode 100644 Documentation/devicetree/bindings/iio/accel/lis302.txt create mode 100644 Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml
Documentation/devicetree/bindings/iio/accel/lis302.txt deleted +0 -119
@@ -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/misc/st,lis3lv02d.yaml new file +400 -0
400 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -14858,6 +14858,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ LIS3LV02D ACCELEROMETER DRIVER M: Eric Piel <[email protected]> S: Maintained +F: Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml F: Documentation/misc-devices/lis3lv02d.rst F: drivers/misc/lis3lv02d/ F: drivers/platform/x86/hp/hp_accel.c
Signature · 1 line
2.54.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The YAML binding erroneously forbids `Vdd-supply` and `Vdd_IO-supply` for the SPI variant by…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The YAML binding erroneously forbids Vdd-supply and Vdd_IO-supply for the SPI variant by setting them to false. --
commit 286d4c20f34dbb3740102063ad8a21275e5828b2
Author: Jad Keskes <[email protected]>
dt-bindings: misc: convert lis302.txt to YAML
This commit converts the old LIS302 accelerometer plain text binding into a YAML schema. It covers both I2C and SPI variants and retains deprecated property names for backwards compatibility.
Quoted 5 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +0
-0
[ ... ]
Quoted 5 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +5
-0+allOf: + - if: + properties: + compatible: + not:
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml line 325
Quoted 10 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +10
-0+ contains: + const: st,lis302dl-spi + then: + required: + - Vdd-supply + - Vdd_IO-supply + else: + properties: + Vdd-supply: false + Vdd_IO-supply: false
[Severity: Medium]
Does forbidding these power supplies for the SPI variant prevent accurate hardware description?
The hardware physically requires Vdd and Vdd_IO power supplies to function, regardless of whether it is accessed via I2C or SPI. Setting these properties to false in the else branch explicitly forbids device tree writers from modeling the physical regulators powering the SPI device, which will cause valid hardware descriptions to fail dtbs_check schema validation.
Quoted 3 lines
Documentation/devicetree/bindings/misc/st,lis3lv02d.yaml new file +3
-0+ required: + - spi-max-frequency + - interrupts
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1