todds1337.h revision dd4eeefdb8e4583c47e28a7f315db6087931ef06
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _TODDS1337_H
#define _TODDS1337_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
extern char *v_rtc_addr_reg;
extern volatile uint8_t *v_rtc_data_reg;
#define DS1337_NODE_TYPE "ddi_i2c:tod"
struct rtc_t {
};
/*
* Register definitions for RTC driver (DS1337 chip)
*/
#define RTC_DYDT_MASK 0x40
/*
* Control register definitions
*/
#define RTC_CTL_RS2 0x10
#define RTC_CTL_RS1 0x08
#define RTC_CTL_INTCN 0x04
#define RTC_CTL_A2IE 0x02
#define RTC_CTL_A1IE 0x01
/*
* Status register definitions
*/
#define RTC_STATUS_OSF 0x80
#define RTC_STATUS_A2F 0x02
#define RTC_STATUS_A1F 0x01
/* per instance based */
typedef struct ds1337_state {
int instance;
#ifdef __cplusplus
}
#endif
#endif /* _TODDS1337_H */