mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Verbovoy via B4 Relay <devnull+ivanverbovoy.gmail.com@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	 Support Opensource <support.opensource@diasemi.com>
Cc: Roy Im <roy.im.opensource@diasemi.com>,
	linux-input@vger.kernel.org,  linux-kernel@vger.kernel.org,
	stable@vger.kernel.org,  Ivan Verbovoy <ivanverbovoy@gmail.com>
Subject: [PATCH] Input: da7280 - do not advertise FF_GAIN
Date: Mon, 09 Nov 2026 19:15:55 +0200	[thread overview]
Message-ID: <20261109-da7280-fixes-v1-1-09cc3650261c@gmail.com> (raw)

From: Ivan Verbovoy <ivanverbovoy@gmail.com>

The driver sets FF_GAIN in the device's force feedback capabilities but
provides no set_gain() callback. input_ff_event() checks the capability
bit, not the callback, before calling ff->set_gain(), so an EV_FF/FF_GAIN
event written to the event node by any process with write access to it
calls through a NULL pointer.

The driver has no global gain to set: a constant effect carries its own
level, and a periodic effect plays a pattern from the device's waveform
memory. Drop FF_GAIN from the capabilities, so that input_ff_event()
ignores such an event.

Fixes: cd3f609823a5 ("Input: new da7280 haptic driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ivan Verbovoy <ivanverbovoy@gmail.com>
---
A NULL set_gain() call on an FF_GAIN write, seen on a Surface Duo
(sm8150).
---
 drivers/input/misc/da7280.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
index 995d3f7af41a..4c60fd4fb932 100644
--- a/drivers/input/misc/da7280.c
+++ b/drivers/input/misc/da7280.c
@@ -1226,7 +1226,6 @@ static int da7280_probe(struct i2c_client *client)
 	input_set_capability(haptics->input_dev, EV_FF, FF_PERIODIC);
 	input_set_capability(haptics->input_dev, EV_FF, FF_CUSTOM);
 	input_set_capability(haptics->input_dev, EV_FF, FF_CONSTANT);
-	input_set_capability(haptics->input_dev, EV_FF, FF_GAIN);
 
 	error = input_ff_create(haptics->input_dev,
 				DA7280_FF_EFFECT_COUNT_MAX);

---
base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
change-id: 20261103-da7280-fixes-bc3662da833d

Best regards,
--  
Ivan Verbovoy <ivanverbovoy@gmail.com>



                 reply	other threads:[~2026-11-09 17:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261109-da7280-fixes-v1-1-09cc3650261c@gmail.com \
    --to=devnull+ivanverbovoy.gmail.com@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ivanverbovoy@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roy.im.opensource@diasemi.com \
    --cc=stable@vger.kernel.org \
    --cc=support.opensource@diasemi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®