macintosh/adb-iop: Send correct poll command
authorFinn Thain <fthain@telegraphics.com.au>
Fri, 20 Nov 2020 04:39:56 +0000 (15:39 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:39 +0000 (11:53 +0100)
commite7884eed1301792b79b18cf86036baceb3c7033d
treea3b22700bbeee3a1cb930814d554da65f3a41243
parentbbae91abbc27037e59326a9541c8912606665414
macintosh/adb-iop: Send correct poll command

[ Upstream commit 10199e90ee20e68859f8128331ec8d85b036d349 ]

The behaviour of the IOP firmware is not well documented but we do know
that IOP message reply data can be used to issue new ADB commands.
Use the message reply to better control autopoll behaviour by sending
a Talk Register 0 command after every ADB response, not unlike the
algorithm in the via-macii driver. This poll command is addressed to
that device which last received a Talk command (explicit or otherwise).

Cc: Joshua Thompson <funaho@jurai.org>
Fixes: 32226e817043 ("macintosh/adb-iop: Implement idle -> sending state transition")
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Link: https://lore.kernel.org/r/58bba4310da4c29b068345a4b36af8a531397ff7.1605847196.git.fthain@telegraphics.com.au
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/macintosh/adb-iop.c