Subject: New experimental ADB subsystem committed
To: netbsd-macppc macppc <port-macppc@netbsd.org>
From: Michael Lorenz <macallan@netbsd.org>
List: port-macppc
Date: 01/17/2007 19:59:16
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

so I gave up trying to fix the old ADB subsystem and wrote my own ( 
recycling what could be recycled ).

Benefits:
- - separate drivers for CUDA and PMU
- - ADB is separate from CUDA and PMU
- - improved ADB device drivers (see below)
- - better granularity and much smaller code size
- - support for CUDA's I2C bus and the beige G3's external mixer so audio 
on those boxes works now

What's not done yet:
- - battery monitoring, APM emulation etc.
- - there's no equivalent to abtn so far
- - man pages ;)

In detail:
CUDA and PMU may look similar but the protocol they use is totally 
different so they have separate drivers. Besides that it allows you to 
save a few bytes kernel size since - as far as I know no Mac has both 
;)
CUDA:
- - attaches ADB
- - I2C
- - real time clock
- - power off and reset
PMU:
- - can attach ADB when present
- - supports various buttons found on PowerBooks, like PCMCIA eject, 
brightness etc.
- - real time clock
- - power off and reset

ADB device discovery and initialization has been moved into its own 
driver, nadb. All it does is to find ADB devices and attach the 
appropriate drivers. Unlike with the old driver any number of keyboards 
and pointing devices can be present ( well, as long as there are enough 
free ADB bus addresses )
On New World Macs just leave out nadb, most *Books have ADB keyboards 
and trackpads though.

adbkbd vs. akbd:
- - adbkbd can attach more than one instance
- - adbkbd attaches a wsmouse device for button emulation, which keys are 
translated can be controlled via sysctl
- - adbkbd can twinkle LEDs on external keyboards

adbms behaves pretty much the same as ams

To get audio to work on a beige G3 you need:
cuda* at obio?
iic0 at cuda0
sgsmix0 at iic0 addr 0x8a
awacs* at obio?

The awacs driver will use sgsmix when necessary, additionally it 
exposes bass and treble controls.

All these devices have been added to GENERIC in commented out form and 
labeled experimental.
You can have both ADB subsystems in a kernel which makes sense when you 
want adb at obio for PMUs and cuda for Old World PowerMacs but if you 
have both pmu and cuda they will always beat adb at obio so it will 
never actually be used.

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iQEVAwUBRa7GZMpnzkX8Yg2nAQKnvAf8DFneGb0KXVgTTnAbmIDYTKpxpuSy1Yhs
sJtvrpV3gQ7oAOxSnqOmocR1B/Jgu6LIclJygmKyx7IqotPltTa0v53E2Jg1uFqw
Pi5VFYdHANBS7pHjixY2SkVmvQIFZ3+i9xfKPReSXObzCgfT0y7Dm+EFyAmjQ39N
STYCQSRrgbzaHK2dOXDA8yjNICbDGTkkLHJfXB2+SZ33DX3b8hW+oIcawz1vLFfv
0L4EaEeE4i0YMwFe+0+W7X85yy4zbFM6e5sYWagnFIjih6xubArBIXYl7WYg7D9q
mSsCLXGpJU+CtJm3Y0LqrCg75mkb69I2yHr7ECBHIHNFx4F5JSA39g==
=xJwn
-----END PGP SIGNATURE-----