From: Dmitry Mikushin <dmitry@kernelgen.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Dmitry Mikushin <dmitry@kernelgen.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] Input: synaptics-rmi4 - f12: read only the object data on attention
Date: Mon, 26 Oct 2026 10:31:17 +0100 [thread overview]
Message-ID: <20261026093118.2312302-2-dmitry@kernelgen.org> (raw)
In-Reply-To: <20261026093118.2312302-1-dmitry@kernelgen.org>
When F12 data is not supplied by the transport as attention data, the
attention handler reads the whole F12 data packet on every interrupt,
although only Data1 (the object reports) is consumed. The remaining
data registers are never used.
On SMBus this transfer is the dominant per-frame cost. On a ThinkPad
P14s Gen 2i with a Synaptics TM3471-030 (i801 SMBus) the F12 data
packet is 79 bytes, of which Data1 is the first 32. Reading 79 bytes
takes about 17.4 ms and reading 32 bytes about 7.3 ms. With the full
read the touchpad reports at about 43 Hz (median 23.0 ms between
frames), and fast swipes yield only a handful of frames, so they are
mostly lost to pointer acceleration and smoothing.
Reading only Data1 raises the report rate to about 65 Hz (median
15.3 ms between frames), measured with a finger on the same machine.
Compute the size of the leading registers up to and including Data1 at
probe time and read only that much. The attention data path (hid-rmi)
is unchanged.
Signed-off-by: Dmitry Mikushin <dmitry@kernelgen.org>
---
drivers/input/rmi4/rmi_f12.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
index 841884d967..ad210464b2 100644
--- a/drivers/input/rmi4/rmi_f12.c
+++ b/drivers/input/rmi4/rmi_f12.c
@@ -58,6 +58,8 @@ struct f12_data {
const struct rmi_register_desc_item *data15;
u16 data15_offset;
+ u32 read_size;
+
unsigned long irq_mask[];
};
@@ -269,8 +271,9 @@ static irqreturn_t rmi_f12_attention(int irq, void *ctx)
drvdata->attn_data.data += valid_bytes;
drvdata->attn_data.size -= valid_bytes;
} else {
+ valid_bytes = f12->read_size;
retval = rmi_read_block(rmi_dev, f12->data_addr,
- sensor->data_pkt, sensor->pkt_size);
+ sensor->data_pkt, valid_bytes);
if (retval < 0) {
dev_err(&fn->dev, "Failed to read object data. Code: %d.\n",
retval);
@@ -529,6 +532,17 @@ static int rmi_f12_probe(struct rmi_function *fn)
data_offset += item->reg_size;
}
+ /*
+ * Only Data1 (object reports) is consumed when the data registers
+ * are read from the device, so do not read the remaining registers
+ * on every attention. On SMBus this transfer dominates the per-frame
+ * cost and therefore limits the report rate.
+ */
+ f12->read_size = sensor->pkt_size;
+ if (f12->data1)
+ f12->read_size = min_t(u32, sensor->pkt_size,
+ f12->data1_offset + f12->data1->reg_size);
+
/* allocate the in-kernel tracking buffers */
sensor->tracking_pos = devm_kcalloc(&fn->dev, sensor->nbr_fingers,
sizeof(*sensor->tracking_pos),
--
2.56.0
next prev parent reply other threads:[~2026-10-26 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 9:31 [PATCH 0/2] Input: synaptics - enable SMBus for ThinkPad P14s Gen 2i (LEN2072) Dmitry Mikushin
2026-10-26 9:31 ` Dmitry Mikushin [this message]
2026-10-26 9:31 ` [PATCH 2/2] Input: synaptics - add LEN2072 to smbus_pnp_ids for ThinkPad P14s Gen 2i Dmitry Mikushin
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=20261026093118.2312302-2-dmitry@kernelgen.org \
--to=dmitry@kernelgen.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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 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®