Commit 303511ed authored by Finn Thain's avatar Finn Thain Committed by Michael Ellerman

macintosh/adb-iop: Adopt bus reset algorithm from via-macii driver

This algorithm is slightly shorter and avoids the surprising
adb_iop_start() call in adb_iop_poll().
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b63d56ecb6e75f11a0bf02231f3b2db656a528a3.1590880623.git.fthain@telegraphics.com.au
parent ff785e17
...@@ -238,24 +238,19 @@ int adb_iop_autopoll(int devs) ...@@ -238,24 +238,19 @@ int adb_iop_autopoll(int devs)
void adb_iop_poll(void) void adb_iop_poll(void)
{ {
if (adb_iop_state == idle)
adb_iop_start();
iop_ism_irq_poll(ADB_IOP); iop_ism_irq_poll(ADB_IOP);
} }
int adb_iop_reset_bus(void) int adb_iop_reset_bus(void)
{ {
struct adb_request req = { struct adb_request req;
.reply_expected = 0,
.nbytes = 2, /* Command = 0, Address = ignored */
.data = { ADB_PACKET, 0 }, adb_request(&req, NULL, ADBREQ_NOSEND, 1, ADB_BUSRESET);
}; adb_iop_send_request(&req, 1);
adb_iop_write(&req); /* Don't want any more requests during the Global Reset low time. */
while (!req.complete) { mdelay(3);
adb_iop_poll();
schedule();
}
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment