Subject: Re: Is sbdsp.c misusing bus_space_write_1?
To: John F. Woods <jfw@funhouse.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 07/03/1998 09:16:29
On Fri, 3 Jul 1998 08:05:51 -0400 (EDT) 
 "John F. Woods" <jfw@funhouse.com> wrote:

 > In studying the soundblaster driver (to figure out how to write a proper
 > ProAudio Spectrum driver), I noticed that sbdsp.c has the following
 > code:
 > 
 > 	if (bus_space_map(iot, JAZZ16_CONFIG_PORT, 1, 0, &ioh)) {
 >            ...
 > 	}
 > 	bus_space_write_1(iot, ioh, 0, JAZZ16_WAKEUP);
 > 	delay(10000);			/* delay 10 ms */
 > 	bus_space_write_1(iot, ioh, 0, JAZZ16_SETBASE);
 > 	bus_space_write_1(iot, ioh, 0, sc->sc_iobase & 0x70);
 > 
 > Now, does bus_space_map create a mapping which you apply local offsets
 > to, or does it simply validate certain regions of the given mapped
 > space which you still must supply correct offsets to?  (In other
 > words, should those 0s be JAZZ16_CONFIG_PORT?)

bus_space_map() creates a mapping which you apply local offsets to.
Those usages appear to be correct.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 650 940 5942