[PATCH v2 1/3] misc: lis3lv02d: set default click detection thresholds

From: Md Shofiqul Islam

Date: Thu Jun 11 2026 - 11:44:11 EST


Several upstream board DTS files use st,click-thresh-x/y/z (the name
documented in the old lis302.txt binding), but the driver reads
st,click-threshold-x/y/z. As a result those boards have had click
detection silently broken since the DT properties were added.

Set a default threshold of 10 for all three axes immediately after
the platform data allocation so those boards get working click
detection without requiring a DT change.

The DT reads for st,click-threshold-x/y/z are unchanged so boards
using the correct name can still override the default.

Fixes: 6a7740c7f5b2 ("lis3lv02d: add device-tree support")

Signed-off-by: Md Shofiqul Islam <shofiqtest@xxxxxxxxx>
---
drivers/misc/lis3lv02d/lis3lv02d.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index 21e8ad0a7444..6a028c1bf866 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -956,6 +956,14 @@ int lis3lv02d_init_dt(struct lis3lv02d *lis3)
if (!pdata)
return -ENOMEM;

+ /* Set sensible click threshold defaults. Several upstream board DTS
+ * files use the misspelled property "st,click-thresh-*" which the
+ * driver never reads, leaving these at zero. Default to 10 so those
+ * boards get working click detection without a DT change. */
+ pdata->click_thresh_x = 10;
+ pdata->click_thresh_y = 10;
+ pdata->click_thresh_z = 10;
+
if (of_property_read_bool(np, "st,click-single-x"))
pdata->click_flags |= LIS3_CLICK_SINGLE_X;
if (of_property_read_bool(np, "st,click-double-x"))
--
2.51.1