<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/input/mouse, branch v6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-12-01T23:36:18Z</updated>
<entry>
<title>Input: amimouse - convert to platform remove callback returning void</title>
<updated>2023-12-01T23:36:18Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-12-01T13:37:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=42b8ff47720258d1f6a4412e780a480c139773a0'/>
<id>urn:sha1:42b8ff47720258d1f6a4412e780a480c139773a0</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20231201133747.1099286-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: psmouse - enable Synaptics InterTouch for ThinkPad L14 G1</title>
<updated>2023-11-15T16:52:02Z</updated>
<author>
<name>José Pekkarinen</name>
<email>jose.pekkarinen@foxhound.fi</email>
</author>
<published>2023-11-15T16:50:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c1f342f35f820b33390571293498c3e2e9bc77ec'/>
<id>urn:sha1:c1f342f35f820b33390571293498c3e2e9bc77ec</id>
<content type='text'>
Observed on dmesg of my laptop I see the following
output:

[   19.898700] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]
[   19.936057] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]
[   19.936076] psmouse serio1: synaptics: Your touchpad (PNP: LEN0411 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.
[   20.008901] psmouse serio1: synaptics: Touchpad model: 1, fw: 10.32, id: 0x1e2a1, caps: 0xf014a3/0x940300/0x12e800/0x500000, board id: 3471, fw id: 2909640
[   20.008925] psmouse serio1: synaptics: serio: Synaptics pass-through port at isa0060/serio1/input0
[   20.053344] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input7
[   20.397608] mousedev: PS/2 mouse device common for all mice

This patch will add its pnp id to the smbus list to
produce the setup of intertouch for the device.

Signed-off-by: José Pekkarinen &lt;jose.pekkarinen@foxhound.fi&gt;
Link: https://lore.kernel.org/r/20231114063607.71772-1-jose.pekkarinen@foxhound.fi
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next' into for-linus</title>
<updated>2023-11-06T23:42:08Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2023-11-06T23:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdd5b5a9761fd66d17586e4f4ba6588c70e640ea'/>
<id>urn:sha1:cdd5b5a9761fd66d17586e4f4ba6588c70e640ea</id>
<content type='text'>
Prepare input updates for 6.7 merge window.
</content>
</entry>
<entry>
<title>Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport</title>
<updated>2023-10-14T00:59:19Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2023-10-14T00:29:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5030b2fe6aab37fe42d14f31842ea38be7c55c57'/>
<id>urn:sha1:5030b2fe6aab37fe42d14f31842ea38be7c55c57</id>
<content type='text'>
Touch controllers need some time after receiving reset command for the
firmware to finish re-initializing and be ready to respond to commands
from the host. The driver already had handling for the post-reset delay
for I2C and SPI transports, this change adds the handling to
SMBus-connected devices.

SMBus devices are peculiar because they implement legacy PS/2
compatibility mode, so reset is actually issued by psmouse driver on the
associated serio port, after which the control is passed to the RMI4
driver with SMBus companion device.

Note that originally the delay was added to psmouse driver in
92e24e0e57f7 ("Input: psmouse - add delay when deactivating for SMBus
mode"), but that resulted in an unwanted delay in "fast" reconnect
handler for the serio port, so it was decided to revert the patch and
have the delay being handled in the RMI4 driver, similar to the other
transports.

Tested-by: Jeffery Miller &lt;jefferymiller@google.com&gt;
Link: https://lore.kernel.org/r/ZR1yUFJ8a9Zt606N@penguin
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: psmouse - fix fast_reconnect function for PS/2 mode</title>
<updated>2023-10-14T00:59:18Z</updated>
<author>
<name>Jeffery Miller</name>
<email>jefferymiller@google.com</email>
</author>
<published>2023-10-13T22:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2cb5cc822b6c9ee72c56ce1d81671b22c05406a'/>
<id>urn:sha1:e2cb5cc822b6c9ee72c56ce1d81671b22c05406a</id>
<content type='text'>
When the SMBus connection is attempted psmouse_smbus_init() sets
the fast_reconnect pointer to psmouse_smbus_reconnecti(). If SMBus
initialization fails, elantech_setup_ps2() and synaptics_init_ps2() will
fallback to PS/2 mode, replacing the psmouse private data. This can cause
issues on resume, since psmouse_smbus_reconnect() expects to find an
instance of struct psmouse_smbus_dev in psmouse-&gt;private.

The issue was uncovered when in 92e24e0e57f7 ("Input: psmouse - add
delay when deactivating for SMBus mode") psmouse_smbus_reconnect()
started attempting to use more of the data structure. The commit was
since reverted, not because it was at fault, but because there was found
a better way of doing what it was attempting to do.

Fix the problem by resetting the fast_reconnect pointer in psmouse
structure in elantech_setup_ps2() and synaptics_init_ps2() when the PS/2
mode is used.

Reported-by: Thorsten Leemhuis &lt;linux@leemhuis.info&gt;
Tested-by: Thorsten Leemhuis &lt;linux@leemhuis.info&gt;
Signed-off-by: Jeffery Miller &lt;jefferymiller@google.com&gt;
Fixes: bf232e460a35 ("Input: psmouse-smbus - allow to control psmouse_deactivate")
Link: https://lore.kernel.org/r/20231005002249.554877-1-jefferymiller@google.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Revert "Input: psmouse - add delay when deactivating for SMBus mode"</title>
<updated>2023-10-12T23:01:36Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2023-10-12T22:54:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b35726396390eb445668cecdbcd41d0285dbefdf'/>
<id>urn:sha1:b35726396390eb445668cecdbcd41d0285dbefdf</id>
<content type='text'>
This reverts commit 92e24e0e57f72e06c2df87116557331fd2d4dda2.

While the patch itself is correct, it uncovered an issue with fallback
to PS/2 mode, where we were leaving psmouse-&gt;fast_reconnect handler set
to psmouse_smbus_reconnect(), which caused crashes.

While discussing various approaches to fix the issue it was noted that
this patch ass undesired delay in the "fast" resume path of PS/2 device,
and it would be better to actually use "reset_delay" option defined in
struct rmi_device_platform_data and have RMI code handle it for SMBus
transport as well. So this patch is being reverted to deal with crashes
and a better solution will be merged shortly.

Reported-by: Thorsten Leemhuis &lt;linux@leemhuis.info&gt;
Closes: https://lore.kernel.org/all/ca0109fa-c64b-43c1-a651-75b294d750a1@leemhuis.info/
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: navpoint - convert to platform remove callback returning void</title>
<updated>2023-09-24T02:16:45Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-09-20T12:58:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=37a432c2278967cc678a4a1c4a1ee751582636e0'/>
<id>urn:sha1:37a432c2278967cc678a4a1c4a1ee751582636e0</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20230920125829.1478827-29-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: cyapa - use device core to create driver-specific device attributes</title>
<updated>2023-09-06T21:23:46Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2023-07-29T00:51:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4cd121c19a30bd3f5f84612313e94828edf6a91b'/>
<id>urn:sha1:4cd121c19a30bd3f5f84612313e94828edf6a91b</id>
<content type='text'>
Instead of creating driver-specific device attributes with
devm_device_add_group() have device core do this by setting up dev_groups
pointer in the driver structure.

Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20230729005133.1095051-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: psmouse - add delay when deactivating for SMBus mode</title>
<updated>2023-07-26T05:07:42Z</updated>
<author>
<name>Jeffery Miller</name>
<email>jefferymiller@google.com</email>
</author>
<published>2023-07-26T02:52:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92e24e0e57f72e06c2df87116557331fd2d4dda2'/>
<id>urn:sha1:92e24e0e57f72e06c2df87116557331fd2d4dda2</id>
<content type='text'>
There is a period of time between the psmouse deactivate and the
ability to communicate with the SMBus companion. Insert a
sleep after the deactivate to account for the delay and ensure
the SMBus companion is responsive.

Attempting to read from the SMBus companion too quickly was causing
the touchpad on machines with an i801_smbus companion to stop working
after a sleep/resume cycle.

On resume the rmi4_smbus would fail with errors reading the SMBus version
number:
```
[5454] i2c_i801:i801_check_post:414: i801_smbus 0000:00:1f.3: No response
smbus_result: i2c-0 a=02c f=0000 c=fd BYTE_DATA rd res=-6
rmi4_smbus 0-002c: failed to get SMBus version number!
...
rmi4_f01 rmi4-00.fn01: Failed to restore normal operation: -6.
rmi4_f01 rmi4-00.fn01: Resume failed with code -6.
rmi4_physical rmi4-00: Failed to suspend functions: -6
rmi4_smbus 0-002c: Failed to resume device: -6
```
In this case the rmi_smb_get_version fails with -ENXIO if it happens too
soon after the preceding serio_resume -&gt; psmouse_deactivate call.

On boot this issue could cause the touchpad to stay in the limited PS/2
mode. This only reproduced in 1 in 10 boots on the Lenovo T440p.
Failures in the log on boot would show up as:
```
psmouse serio1: synaptics: Trying to set up SMBus access
[122] i2c_i801:i801_check_post:437: i801_smbus 0000:00:1f.3: No response
psmouse serio1: synaptics: SMbus companion is not ready yet
```

Experimentation on the Lenovo T440p showed that a delay of 7-12ms on
resume allowed the companion to respond.

The 30ms delay in this patch was chosen based on the linux-input message:
Link: https://lore.kernel.org/all/BYAPR03MB47572F2C65E52ED673238D41B2439@BYAPR03MB4757.namprd03.prod.outlook.com/

Signed-off-by: Jeffery Miller &lt;jefferymiller@google.com&gt;
Link: https://lore.kernel.org/r/20230726025256.81174-1-jefferymiller@google.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v6.4' into next</title>
<updated>2023-07-17T16:20:46Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2023-07-17T16:20:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=50501936288d6a29d7ef78f25d00e33240fad45f'/>
<id>urn:sha1:50501936288d6a29d7ef78f25d00e33240fad45f</id>
<content type='text'>
Sync up with mainline to bring in updates to shared infrastructure.
</content>
</entry>
</feed>
