xref: /netbsd-src/share/man/man4/intersil7170.4 (revision 11a6dbe72840351315e0652b2fc6663628c84cad)
1.\"	$NetBSD: intersil7170.4,v 1.12 2008/04/30 13:10:54 martin Exp $
2.\"
3.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Paul Kranenburg.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd October 1, 2006
31.Dt INTERSIL7170 4
32.Os
33.Sh NAME
34.Nm intersil7170
35.Nd
36.Tn Intersil ICM7170 time-of-day clock driver
37.Sh SYNOPSIS
38.In dev/ic/intersil7170reg.h
39.In dev/ic/intersil7170var.h
40.Cd "define intersil7170"
41.Cd "file   dev/ic/intersil7170.c    intersil7170"
42.Sh DESCRIPTION
43The
44.Nm
45driver provides access to the
46.Tn Intersil ICM7170
47time-of-day clock chip.
48Access methods to retrieve and set date and time
49are provided through the
50.Em TODR
51interface defined in
52.Xr todr 9 .
53.Pp
54To tie an instance of this device to the system, use the
55.Fn intersil7170_attach
56function and the
57.Fa intersil7170_softc
58structure defined as follows:
59.Pp
60.Ft "void"
61.Fn intersil7170_attach "struct intersil7170_softc *"
62.Pp
63.Bd -literal
64struct intersil7170_softc {
65	struct device	sc_dev;
66	bus_space_tag_t	sc_bst;
67	bus_space_handle_t sc_bsh;
68	struct todr_chip_handle sc_handle;
69	u_int		sc_year0;
70	u_int		sc_flag;
71};
72.Ed
73.Pp
74.Bl -tag -width Dv -offset indent
75.It Fa bus_tag
76.It Fa bus_handle
77Specify bus space access to the chip's non-volatile memory
78.Pq including the clock registers .
79.It Fa sc_handle
80TODR handle passed to the
81.Fn todr_attach
82function to register
83.Xr todr 9
84interface.
85.It Fa sc_year0
86The actual year represented by the clock's
87.Sq year
88counter.
89This is generally dependent on the system configuration in which
90the clock device is mounted.
91For instance, on Sun Microsystems machines
92the convention is to have clock's two-digit year represent the year 1968.
93.It Fa sc_flag
94This flag is used to specify machine-dependent features.
95.El
96.Pp
97Note that if the resulting date retrieved with the todr_gettime() method
98is earlier that January 1, 1970, the driver will assume that the chip's
99year counter actually represents a year in the 21st century.
100This behaviour can be overridden by setting the
101.Va INTERSIL7170_NO_CENT_ADJUST
102flag in
103.Fa sc_flag .
104.Sh SEE ALSO
105.Xr intro 4 ,
106.Xr todr 9
107.Sh HISTORY
108The
109.Nm
110driver first appeared in
111.Nx 1.5 .
112.Sh AUTHORS
113The
114.Nm
115driver was written by
116.An Paul Kranenburg
117.Aq pk@NetBSD.org .
118