xref: /netbsd/share/man/man4/adb.4 (revision 6550d01e)
1.\"	$NetBSD: adb.4,v 1.2 2003/12/14 18:08:43 wiz 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 Projet.
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 September 21, 2003
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
213Bradley A. Grantham wrote the original
214.Nm
215driver, including the
216.Tn MRG
217support.
218The hardware direct interface was written by
219John P. Wittkowski.
220The PowerManager interface was written by Takashi Hamada.
221.Sh BUGS
222.Bl -bullet
223.It
224Not every class of
225.Tn ADB
226hardware is supported yet.
227.It
228The talk command is currently unimplemented.
229.It
230The listen command is not implemented yet.
231.It
232Not all multi-button mice are currently supported.
233.It
234Only mapped and relative-position
235.Tn ADB
236devices
237.Pq i.e. keyboards and mice
238are supported.
239Thus absolute-position and other exotic devices will not work.
240.It
241Some of the diagnostic messages in this man page need to be updated.
242.El
243.Pp
244Some mac68k machines contain so-called dirty ROM.
245These machines are the: Mac SE/30, Mac II, Mac IIx, and Mac IIcx.
246Machines with dirty ROM may experience trouble booting if the MRG code
247is used, especially under the following conditions:
248.Bl -bullet -compact -offset indent
249.It
250Both a keyboard and a mouse are not attached to the computer.
251.It
252An extended keyboard is attached to the computer.
253.El
254.Pp
255On (some) machines with dirty ROM, the ROM indicates the presence of a
256.Dq ghost
257keyboard or mouse.
258When this non-existant device is probed for, the result is an infinite
259loop.
260This is believed to be triggered by the
261.Nm
262driver probing for extended mice, and non-EMP Logitech mice.
263