]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 2 Dec 2019 18:08:12 +0000 (10:08 -0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:25 +0000 (14:22 -0300)
commited20f1df18008c568532163c6a9d1bf1ee2a9753
tree57f78c803b1f4a99f896c4cefba2a1cd81d922d3
parent8b62bb4a2cb45fe30220ddbfee55334b9a425d2d
Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers

BugLink: https://bugs.launchpad.net/bugs/1857158
commit a284e11c371e446371675668d8c8120a27227339 upstream.

This increment of rmi_smbus in rmi_smb_read/write_block() causes
garbage to be read/written.

The first read of SMB_MAX_COUNT bytes is fine, but after that
it is nonsense. Trial-and-error showed that by dropping the
increment of rmiaddr everything is fine and the F54 function
properly works.

I tried a hack with rmi_smb_write_block() as well (writing to the
same F54 touchpad data area, then reading it back), and that
suggests that there too the rmiaddr increment has to be dropped.
It makes sense that if it has to be dropped for read, then it has
to be dropped for write as well.

It looks like the initial work with F54 was done using i2c, not smbus,
and it seems nobody ever tested F54 with smbus. The other functions
all read/write less than SMB_MAX_COUNT as far as I can tell, so this
issue was never noticed with non-F54 functions.

With this change I can read out the touchpad data correctly on my
Lenovo X1 Carbon 6th Gen laptop.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Link: https://lore.kernel.org/r/8dd22e21-4933-8e9c-a696-d281872c8de7@xs4all.nl
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/input/rmi4/rmi_smbus.c