mac_via: rework ADB state machine to be compatible with both MacOS and Linux
commit975fcedd3194b486916a4b13afbf8308edf5b1a1
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tue, 23 Jun 2020 20:49:33 +0000 (23 21:49 +0100)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fri, 26 Jun 2020 09:13:52 +0000 (26 10:13 +0100)
tree195590d6cd76b64e915b492477064c18fb580013
parent378a50347931e71b15aaec44c4dc0f9adfa346bf
mac_via: rework ADB state machine to be compatible with both MacOS and Linux

The existing ADB state machine is designed to work with Linux which has a different
interpretation of the state machine detailed in "Guide to the Macintosh Family
Hardware". In particular the current Linux implementation includes an extra change
to IDLE state when switching the VIA between send and receive modes which does not
occur in MacOS, and omitting this transition causes the current mac_via ADB state
machine to fail.

Rework the ADB state machine accordingly so that it can enumerate and autopoll the
ADB under both Linux and MacOS, including the addition of the new adb_autopoll_block()
and adb_autopoll_unblock() functions.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200623204936.24064-20-mark.cave-ayland@ilande.co.uk>
hw/misc/mac_via.c
hw/misc/trace-events
include/hw/misc/mac_via.h