1.\" $NetBSD: adb.4,v 1.5 2020/05/15 09:21:59 kamil Exp $ 2.\" 3.\" Copyright (c) 2003 Alex Zepeda <zipzippy@sonic.net> 4.\" Copyright (c) 1997 Colin Wood 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. All advertising materials mentioning features or use of this software 16.\" must display the following acknowledgement: 17.\" This product includes software developed by Alex Zepeda, and 18.\" Colin Wood for the NetBSD Project. 19.\" 4. The name of the author may not be used to endorse or promote products 20.\" derived from this software without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 23.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 24.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 27.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32.\" 33.Dd August 31, 2018 34.Dt ADB 4 35.Os 36.Sh NAME 37.Nm adb 38.Nd Apple Desktop Bus driver 39.Sh SYNOPSIS 40.Cd "adb* at obio?" 41.Pp 42.Cd "options MRG_ADB" 43.Pp 44.In machine/adbsys.h 45.Sh DESCRIPTION 46The Apple Desktop Bus 47.Pq Tn ADB 48is the single-master, multiple-slave, low-speed serial bus 49interface used by Macintosh computers to connect input devices 50such as keyboards, mice, trackpads, trackballs, and graphics tablets 51to the machine. 52.Nx 53provides support for the Apple Desktop Bus as found on all supported 54mac68k models, as well as macppc models with on-board 55.Tn ADB 56(PowerBooks and 57.Dq Old World 58models). 59.Pp 60The 61.Nm 62driver accesses the 63.Tn ADB 64controller using the so-called 65.Dq HWDIRECT 66method. 67This method of access bypasses the Macintosh ROM and uses only 68.Nx 69routines for ADB access. 70This is the only method supported on macppc and is the default for 71mac68k systems. 72.Pp 73On mac68k systems there is an alternate method of accessing the 74.Tn ADB 75controller. 76With the Macintosh ROM Glue 77.Pq Tn MRG 78method, the routines written for MacOS are used. 79To enable this method of 80.Tn ADB 81access, uncomment the line: 82.Pp 83.Cd options MRG_ADB 84.Pp 85in your kernel configuration file. 86.Pp 87The 88.Xr ioctl 2 89call is used to control the 90.Tn ADB 91event device. 92The following is a list of available 93.Xr ioctl 2 94commands: 95.Bl -tag -width ADBIOC_GETREPEAT 96.It Dv ADBIOC_DEVSINFO 97Get 98.Tn ADB 99Device Info 100.Pp 101The 102.Nm 103event device will return an array of information containing an entry 104for each device connected to the bus. 105Each entry contains the current address, default address, and 106handler ID for the corresponding 107.Tn ADB 108device. 109.It Dv ADBIOC_GETREPEAT 110Get Keyboard Repeat Info 111.Pp 112Returns a structure containing the current keyboard repeat delay 113and keyboard repeat interval. 114.It Dv ADBIOC_SETREPEAT 115Set Keyboard Repeat Rate 116.Pp 117Sets the keyboard repeat delay and interval to the values specified 118by 119.Ar argp . 120.It Dv ADBIOC_RESET 121.Tn ADB 122Reset 123.Pp 124Perform a reset of the 125.Tn ADB 126which will reinitialize all of the devices attached to the bus. 127.It Dv ADBIOC_LISTENCMD 128ADB Listen Command 129.Pp 130Send data to the register of the 131.Tn ADB 132device specified by 133.Ar argp . 134This command is not fully implemented at this time. 135.El 136.Sh SUPPORTED DEVICES 137.Nx 138includes support for the following 139.Tn ADB 140devices, sorted by driver name: 141.Bl -tag -width akbd -offset indent 142.It abtn 143ADB mouse button? 144.It aed 145ADB event device 146.It akbd 147ADB keyboard 148.It ams 149ADB mouse 150.It apm 151APM emulation 152.El 153.Sh FILES 154.Bl -tag -width /dev/adb -compact 155.It Pa /dev/adb 156The 157.Tn ADB 158event device. 159.El 160.Sh DIAGNOSTICS 161.Bl -diag 162.It aed0 at adb0 addr 0: ADB Event device 163This is a normal autoconfiguration message noting the presence of the 164.Nm 165event device. 166.It adb0 at obio0 offset 0x16000 irq 18: 2 targets 167A standard autoconfiguration message indicating the initialization 168of the 169.Tn ADB 170subsystem. 171.It "adb: no devices found." 172No 173.Tn ADB 174devices were found to be connected to the bus during autoconfiguration. 175.It "adb: using %s series hardware support." 176Indicates the class of 177.Tn ADB 178hardware support the machine uses. 179.It "adb: hardware type unknown for this machine." 180The 181.Tn ADB 182hardware in this machine is currently unsupported. 183.It "adb: no ROM ADB driver in this kernel for this machine." 184The kernel lacks the necessary Macintosh ROM Glue 185.Pq Tn MRG 186support for accessing the 187.Tn ADB 188hardware on this machine. 189.It "adb: using serial console." 190A serial console will be used for user input rather than the 191.Tn ADB 192event device. 193.It "adb: %s at %d." 194An 195.Tn ADB 196device of the type specified by 197.Em %s 198has been found at location 199.Em %d . 200.El 201.Sh SEE ALSO 202.Xr aed 4 , 203.Xr akbd 4 , 204.Xr ams 4 , 205.Xr apm 4 206.Sh HISTORY 207The 208.Nm 209interface first appeared in 210.Nx 0.9 . 211It has been under development ever since. 212.Sh AUTHORS 213.An -nosplit 214.An "Bradley A. Grantham" 215wrote the original 216.Nm 217driver, including the 218.Tn MRG 219support. 220The hardware direct interface was written by 221.An "John P. Wittkowski" . 222The PowerManager interface was written by 223.An "Takashi Hamada" . 224.Sh BUGS 225.Bl -bullet 226.It 227Not every class of 228.Tn ADB 229hardware is supported yet. 230.It 231The talk command is currently unimplemented. 232.It 233The listen command is not implemented yet. 234.It 235Not all multi-button mice are currently supported. 236.It 237Only mapped and relative-position 238.Tn ADB 239devices 240.Pq i.e. keyboards and mice 241are supported. 242Thus absolute-position and other exotic devices will not work. 243.It 244Some of the diagnostic messages in this man page need to be updated. 245.El 246.Pp 247Some mac68k machines contain so-called dirty ROM. 248These machines are the: Mac SE/30, Mac II, Mac IIx, and Mac IIcx. 249Machines with dirty ROM may experience trouble booting if the MRG code 250is used, especially under the following conditions: 251.Bl -bullet -compact -offset indent 252.It 253Both a keyboard and a mouse are not attached to the computer. 254.It 255An extended keyboard is attached to the computer. 256.El 257.Pp 258On (some) machines with dirty ROM, the ROM indicates the presence of a 259.Dq ghost 260keyboard or mouse. 261When this nonexistent device is probed for, the result is an infinite 262loop. 263This is believed to be triggered by the 264.Nm 265driver probing for extended mice, and non-EMP Logitech mice. 266