All of lore.kernel.org
 help / color / mirror / Atom feed
From: Md Shofiqul Islam <shofiqtest@gmail.com>
To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org
Cc: jic23@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, linusw@kernel.org,
	linux-kernel@vger.kernel.org,
	Md Shofiqul Islam <shofiqtest@gmail.com>
Subject: [PATCH v2 1/3] misc: lis3lv02d: set default click detection thresholds
Date: Thu, 11 Jun 2026 18:41:03 +0300	[thread overview]
Message-ID: <20260611154105.3727-2-shofiqtest@gmail.com> (raw)
In-Reply-To: <20260611154105.3727-1-shofiqtest@gmail.com>

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@gmail.com>
---
 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


  reply	other threads:[~2026-06-11 15:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 15:41 [PATCH v2 0/3] lis302dl/lis3lv02d: fix click thresholds and add legacy YAML binding Md Shofiqul Islam
2026-06-11 15:41 ` Md Shofiqul Islam [this message]
2026-06-11 15:52   ` [PATCH v2 1/3] misc: lis3lv02d: set default click detection thresholds sashiko-bot
2026-06-12 14:21   ` Linus Walleij
2026-06-12 17:35     ` Jonathan Cameron
2026-06-11 15:41 ` [PATCH v2 2/3] dt-bindings: iio: st,st-sensors: remove lis302dl and lis3lv02d from deprecated list Md Shofiqul Islam
2026-06-12  9:07   ` Krzysztof Kozlowski
2026-06-11 15:41 ` [PATCH v2 3/3] dt-bindings: iio: accel: convert lis302 binding to YAML schema (v2) Md Shofiqul Islam
2026-06-11 15:52   ` sashiko-bot
2026-06-11 17:10   ` Conor Dooley
2026-06-12  9:10   ` Krzysztof Kozlowski
2026-06-12 14:16   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260611154105.3727-2-shofiqtest@gmail.com \
    --to=shofiqtest@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.