Update man page to reflect API changes.

This commit is contained in:
tsutsui 2003-11-02 04:20:04 +00:00
parent 82097fd078
commit 440afd0bee
1 changed files with 55 additions and 22 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mk48txx.4,v 1.11 2003/06/27 18:36:20 wiz Exp $
.\" $NetBSD: mk48txx.4,v 1.12 2003/11/02 04:20:04 tsutsui Exp $
.\"
.\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd February 25, 2002
.Dd November 1, 2003
.Dt MK48TXX 4
.Os
.Sh NAME
@ -43,6 +43,7 @@
.Tn Mostek time-of-day clock driver
.Sh SYNOPSIS
.In dev/ic/mk48txxreg.h
.In dev/ic/mk48txxvar.h
.Cd "define mk48txx"
.Cd "file dev/ic/mk48txx.c mk48txx"
.Sh DESCRIPTION
@ -57,25 +58,46 @@ are provided through the
interface defined in
.Xr todr 9 .
.Pp
To tie in instance of this device to the system, use
.Bd -literal
typedef uint8_t (*mk48txx_nvrd_t)(bus_space_tag_t bus_tag,
bus_space_handle_t bus_handle, int off);
typedef void (*mk48txx_nvwr_t)(bus_space_tag_t bus_tag,
bus_space_handle_t bus_handle, int off, uint8_t datum);
.Ed
To tie in instance of this device to the system, use mk48txx_attach function
and mk48txx_softc structure defined as follows:
.Pp
.nr nS 1
.Ft "todr_chip_handle_t"
.Fn mk48txx_attach "bus_space_tag_t bus_tag" "bus_space_handle_t bus_handle" \
"const char *model" "int year0" \
"mk48txx_nvrd_t nvread" "mk48txx_nvwr_t nvwrite"
.Ft "void"
.Fn mk48txx_attach "struct mk48txx_softc"
.Pp
.Bd -literal
typedef uint8_t (*mk48txx_nvrd_t)(struct mk48txx_softc, int off);
typedef void (*mk48txx_nvwr_t)(struct mk48txx_softc, int off,
uint8_t datum);
.Ed
.Bd -literal
struct mk48txx_softc {
struct device sc_dev;
bus_space_tag_t sc_bst;
bus_space_handle_t sc_bsh;
struct todr_chip_handle sc_handle;
const char *sc_model;
bus_size_t sc_nvramsz;
bus_size_t sc_clkoffset;
u_int sc_year0;
u_int sc_flag;
mk48txx_nvrd_t sc_nvrd;
mk48txx_nvwr_t sc_nvwr;
};
.Ed
.Pp
.Bl -tag -width Dv -offset indent
.It Fa bus_tag
.It Fa bus_handle
.It Fa sc_bst
.It Fa sc_bsh
Specify bus space access to the chip's non-volatile memory
.Pq including the clock registers .
.It Fa model
.It Fa sc_handle
TODR handle passed to
.Fn todr_attach
function to register
.Xr todr 9
interface.
.It Fa sc_model
The chip model which this instance should serve.
Must be one of
.Dq mk48t02 ,
@ -83,7 +105,15 @@ Must be one of
.Dq mk48t18
or
.Dq mk48t59 .
.It Fa year0
.It Fa sc_nvramsz
Size of non-volatile RAM in the Mostek chip. This value is set by
.Fn mk48txx_attach
function.
.It Fa sc_clkoffset
Offset into the control registers of the Mosteck chip. This value is set by
.Fn mk48txx_attach
function.
.It Fa sc_year0
The actual year represented by the clock's
.Sq year
counter.
@ -91,8 +121,10 @@ This is generally dependent on the system configuration in which
the clock device is mounted.
For instance, on Sun Microsystems machines
the convention is to have clock's two-digit year represent the year 1968.
.It Fa nvread
.It Fa nvwrite
.It Fa sc_flag
This flag is used to specify machine dependent features.
.It Fa sc_nvread
.It Fa sc_nvwrite
Specify alternate access methods for reading resp. writing clock
device registers.
The default, when
@ -112,9 +144,10 @@ location to be read from or written to, respectively.
Note that if the resulting date retrieved with the todr_gettime() method
is earlier that January 1, 1970, the driver will assume that the chip's
year counter actually represents a year in the 21st century.
This behaviour can be overridden by setting the global variable
.Va mk48txx_auto_century_adjust
to zero.
This behaviour can be overridden by setting
.Va MK48TXX_NO_CENT_ADJUST
flag in
.Fa sc_flag .
.Sh HARDWARE
The following models are supported:
.Pp