2008-07-06 17:29:50 +04:00
|
|
|
/* $NetBSD: mm58167var.h,v 1.6 2008/07/06 13:29:50 tsutsui Exp $ */
|
2001-04-10 16:46:26 +04:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Matthew Fredette.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MM58167VAR_H
|
|
|
|
#define _MM58167VAR_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Driver support for the National Semiconductor MM58167
|
|
|
|
* time-of-day chip. See
|
|
|
|
* http://www.national.com/ds/MM/MM58167B.pdf for data sheets.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct mm58167_softc {
|
2008-07-06 17:29:50 +04:00
|
|
|
device_t mm58167_dev;
|
2001-04-10 16:46:26 +04:00
|
|
|
|
|
|
|
/* Pointers to bus_space */
|
|
|
|
bus_space_tag_t mm58167_regt;
|
|
|
|
bus_space_handle_t mm58167_regh;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pointers to MM58167 registers. All of these values are in
|
2005-02-27 03:26:58 +03:00
|
|
|
* BCD.
|
2001-04-10 16:46:26 +04:00
|
|
|
*/
|
2005-02-27 03:26:58 +03:00
|
|
|
|
2001-04-10 16:46:26 +04:00
|
|
|
/*
|
|
|
|
* The most significant digit of this first value is the
|
2005-02-27 03:26:58 +03:00
|
|
|
* milliseconds unit; least significant digit is undefined:
|
2001-04-10 16:46:26 +04:00
|
|
|
*/
|
|
|
|
bus_size_t mm58167_msec_xxx;
|
|
|
|
/* both digits of this value make up centiseconds: */
|
|
|
|
bus_size_t mm58167_csec;
|
|
|
|
bus_size_t mm58167_sec;
|
|
|
|
bus_size_t mm58167_min;
|
|
|
|
bus_size_t mm58167_hour;
|
|
|
|
bus_size_t mm58167_wday;
|
|
|
|
bus_size_t mm58167_day;
|
|
|
|
bus_size_t mm58167_mon;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The MM58167 has compare latches that line up with the
|
|
|
|
* above, interrupt registers, etc., but we don't use them, so
|
2005-02-27 03:26:58 +03:00
|
|
|
* we don't mention them here.
|
2001-04-10 16:46:26 +04:00
|
|
|
*/
|
|
|
|
bus_size_t mm58167_status; /* bad counter read status */
|
|
|
|
bus_size_t mm58167_go; /* GO - start at integral seconds */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We keep a TODR handle in the softc to save
|
|
|
|
* us from having to allocate it ourselves.
|
|
|
|
* However, only mm58167.c should know this.
|
|
|
|
*/
|
|
|
|
struct todr_chip_handle _mm58167_todr_handle;
|
|
|
|
};
|
|
|
|
|
2005-02-04 05:10:35 +03:00
|
|
|
todr_chip_handle_t mm58167_attach(struct mm58167_softc *);
|
2001-04-10 16:46:26 +04:00
|
|
|
|
|
|
|
#endif /* _MM58167VAR_H */
|